/* ==========================================================================
   Warehouse / Storage Subdomain — Mobile-first dark theme
   ========================================================================== */

:root {
    --bg: #0b0e14;
    --bg-soft: #11141d;
    --bg-card: #161a25;
    --bg-card-hover: #1c2030;
    --border: #2a2f40;
    --border-soft: #1e2230;
    --text: #e6e8ee;
    --text-muted: #9ba0b3;
    --text-dim: #6a6f80;
    --accent: #ff7e29;
    --accent-soft: rgba(255, 126, 41, 0.15);
    --accent-hover: #ff8d40;
    --success: #2ec27e;
    --success-soft: rgba(46, 194, 126, 0.15);
    --danger: #ff5b6d;
    --danger-soft: rgba(255, 91, 109, 0.15);
    --warning: #ffc04d;
    --warning-soft: rgba(255, 192, 77, 0.15);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.25);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

/* The [hidden] attribute must always win — author rules like
   `.form-field { display:flex }` have equal specificity and would
   otherwise override it, leaving JS-toggled fields stuck visible. */
[hidden] {
    display: none !important;
}

/* Flex/grid items default to min-content; let them shrink inside their parent */
.wh-app, .wh-main, .wh-card, .wh-list__item, .wh-list__body,
.wh-subcat-block, .wh-subcat-block__head, .wh-subcat-block__title,
.wh-mc, .wh-mc__head, .wh-mc__color,
.wh-product-picker, .wh-product-picker__toolbar,
.wh-pp-group, .wh-pp-group__head, .wh-pp-card, .wh-pp-card__body {
    min-width: 0;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Lock horizontal page scroll — only vertical panning */
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    /* Disable iOS Safari rubber-band horizontal drag */
    overscroll-behavior-x: none;
    /* Tell touch-screen browsers we only handle vertical gestures */
    touch-action: pan-y;
}

html {
    /* Belt-and-suspenders: nothing in <html> may overflow horizontally */
    overflow-x: clip;
}

body {
    position: relative;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ============= Layout ============= */

.wh-app {
    min-height: 100vh;
    padding-bottom: 80px; /* room for bottom nav */
    display: flex;
    flex-direction: column;
    /* Belt-and-suspenders horizontal lock — anything overflowing must scroll internally */
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

.wh-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
    background: rgba(11, 14, 20, 0.85);
    border-bottom: 1px solid var(--border-soft);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wh-header__brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    text-decoration: none;
    line-height: 1;
}

.wh-header__brand:hover {
    color: var(--text);
}

.wh-brand-mark {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--accent) 0%, #ffad6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wh-brand-sub {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wh-auth__accent {
    color: var(--accent);
    font-weight: 500;
}

.wh-header__title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
}

.wh-header__actions {
    display: flex;
    gap: 8px;
}

/* ============= Header burger + left drawer ============= */

.wh-burger {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wh-burger:hover,
.wh-burger:active {
    background: var(--accent-soft);
    border-color: var(--border-soft);
}

.wh-burger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

body.wh-drawer-open .wh-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.wh-drawer-open .wh-burger span:nth-child(2) { opacity: 0; }
body.wh-drawer-open .wh-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.wh-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.wh-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.wh-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    background: var(--bg-soft);
    border-right: 1px solid var(--border);
    z-index: 71;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    display: flex;
    flex-direction: column;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
}

.wh-drawer.open { transform: translateX(0); }

.wh-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 10px;
}

.wh-drawer__brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
}

.wh-drawer__close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wh-drawer__close:hover { color: var(--text); background: var(--bg-card); }

.wh-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.wh-drawer__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.wh-drawer__link:hover,
.wh-drawer__link:active {
    background: var(--bg-card);
    color: var(--accent);
}

.wh-drawer__link:active { transform: scale(0.985); }

.wh-drawer__link svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.wh-drawer__link--danger { color: var(--danger); }
.wh-drawer__link--danger:hover,
.wh-drawer__link--danger:active {
    color: var(--danger);
    background: var(--danger-soft);
}

.wh-drawer__divider {
    height: 1px;
    background: var(--border-soft);
    margin: 8px 4px;
}

body.wh-drawer-open { overflow: hidden; }

.wh-main {
    flex: 1;
    padding: 16px;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    /* Prevent inline content (long words / pre / urls) from pushing past viewport */
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (min-width: 920px) {
    .wh-main {
        max-width: 1100px;
        padding: 24px;
    }
}

/* ============= Cards ============= */

.wh-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
    /* Card never extends past parent — children must scroll internally if needed */
    max-width: 100%;
    min-width: 0;
}

/* <pre>/<code> blocks must scroll internally and never bust the layout */
.wh-app pre {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: pre;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

.wh-app code {
    overflow-wrap: anywhere;
    word-break: break-all;
    max-width: 100%;
}

.wh-app pre code {
    /* Keep formatting inside <pre>; do not break */
    word-break: normal;
    overflow-wrap: normal;
}

/* Images: never overflow */
.wh-app img {
    max-width: 100%;
    height: auto;
}

.wh-card--accent {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
}

.wh-card__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 8px;
    font-weight: 600;
}

.wh-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    margin: 0;
}

.wh-card__value--accent {
    color: var(--accent);
}

.wh-card__hint {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 6px;
}

.wh-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

.wh-card__row:last-child {
    border-bottom: none;
}

/* ============= Grid ============= */

.wh-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

@media (min-width: 540px) {
    .wh-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .wh-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============= Buttons ============= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 44px;
}

.btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.btn--primary {
    background: var(--accent);
    color: #0b0e14;
    border-color: var(--accent);
    font-weight: 600;
}

.btn--primary:hover {
    background: var(--accent-hover);
    color: #0b0e14;
}

.btn--ghost {
    background: transparent;
    border-color: var(--border);
}

.btn--danger {
    background: var(--danger);
    color: #0b0e14;
    border-color: var(--danger);
    font-weight: 600;
}

.btn--success {
    background: var(--success);
    color: #0b0e14;
    border-color: var(--success);
    font-weight: 600;
}

.btn--small {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.btn--danger-ghost {
    border-color: var(--border);
    color: var(--text-muted);
}

.btn--danger-ghost:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

.btn--block {
    width: 100%;
}

.btn--icon {
    width: 44px;
    padding: 0;
}

/* ============= Forms ============= */

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    /* Critical for nested flex/grid: allow shrinking below intrinsic width */
    min-width: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.form-field label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="search"],
select,
textarea {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    min-height: 44px;
    outline: none;
    transition: border-color 0.15s ease;
    /* Critical: prevent select/textarea from growing wider than their parent
       when a long <option> is present (iPhone SE 320px) */
    max-width: 100%;
    width: 100%;
}

/* Selects with long options should not expand the parent container */
select {
    text-overflow: ellipsis;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    color: var(--text-dim);
    font-size: 12px;
}

/* ============= Tables / Matrix ============= */

/* Generic table cards (history / today / finance / dashboard) — horizontal scroll */
.wh-card:has(> .wh-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Allow horizontal pan inside (overrides body pan-y) */
    touch-action: pan-x pan-y;
}

.wh-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.wh-table th,
.wh-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
}

.wh-table th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wh-table tr:last-child td {
    border-bottom: none;
}

.wh-table tr:hover td {
    background: var(--bg-card-hover);
}

.wh-matrix-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    /* Allow horizontal pan inside even though body locks it to pan-y */
    touch-action: pan-x pan-y;
    /* Scroll-shadow: gradient on right edge to hint "scroll here" */
    background-image:
        linear-gradient(to right, var(--bg-card), var(--bg-card)),
        linear-gradient(to right, var(--bg-card), var(--bg-card)),
        linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0)),
        linear-gradient(to left, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-size: 30px 100%, 30px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
    -webkit-overflow-scrolling: touch;
}

.wh-matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: max-content;
}

.wh-matrix th,
.wh-matrix td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    min-width: 56px;
    white-space: nowrap;
}

.wh-matrix tbody tr:last-child td {
    border-bottom: none;
}

.wh-matrix th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Sticky first column (color) */
.wh-matrix th.size-col,
.wh-matrix td.size-col {
    background: var(--bg-soft);
    font-weight: 600;
    text-align: left;
    min-width: 130px;
    max-width: 180px;
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 4px 0 6px -3px rgba(0, 0, 0, 0.35);
}

.wh-matrix th.size-col { z-index: 4; }

.wh-matrix .wh-color-name {
    display: inline-block;
    vertical-align: middle;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-matrix .qty-cell {
    cursor: pointer;
    transition: background 0.1s ease;
    font-weight: 600;
    color: var(--text);
}

.wh-matrix .qty-cell:hover,
.wh-matrix .qty-cell:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.wh-matrix .qty-zero {
    color: var(--text-dim);
    font-weight: 400;
}

.wh-matrix .qty-positive {
    color: var(--success);
}

.wh-matrix .qty-low {
    color: var(--warning);
}

.wh-matrix__total-row td {
    background: var(--bg-soft);
}

/* ============= Mobile matrix cards (per-color) ============= */
.wh-matrix-cards { display: none; }

.wh-mc {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.wh-mc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.wh-mc__color {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.wh-mc__swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.wh-mc__name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wh-mc__total {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.wh-mc__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
}

.wh-mc__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    min-height: 56px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: inherit;
}

.wh-mc__cell:active {
    transform: scale(0.97);
    background: var(--accent-soft);
}

.wh-mc__cell.qty-zero {
    opacity: 0.55;
}

.wh-mc__size {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.wh-mc__qty {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.wh-mc__cell.qty-positive .wh-mc__qty { color: var(--success); }
.wh-mc__cell.qty-low .wh-mc__qty { color: var(--warning); }
.wh-mc__cell.qty-zero .wh-mc__qty { color: var(--text-dim); }

/* ============= Price-shift flags (batch cost drifted) ============= */

/* Small triangle badge shown on a stock cell when the latest purchase
   price differs from the weighted-average cost. ▲ = подорожчало,
   ▼ = подешевшало. Keeps the matrix readable — just a tiny corner mark. */
.wh-price-flag {
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
}

/* Table cell: position flag top-right of the number */
.wh-matrix .qty-cell.has-price-shift {
    position: relative;
}

.wh-matrix .qty-cell .wh-price-flag {
    position: absolute;
    top: 3px;
    right: 4px;
}

/* Mobile card cell */
.wh-mc__cell.has-price-shift {
    position: relative;
}

.wh-mc__cell .wh-price-flag {
    position: absolute;
    top: 4px;
    right: 5px;
}

.wh-price-flag--up { color: var(--danger); }
.wh-price-flag--down { color: var(--success); }

/* Slightly tint the whole cell background so a price shift is noticeable
   without reading the tiny triangle. */
.qty-cell.has-price-shift.price-up { background: linear-gradient(180deg, transparent 60%, var(--danger-soft) 100%); }
.qty-cell.has-price-shift.price-down { background: linear-gradient(180deg, transparent 60%, var(--success-soft) 100%); }

/* Toggle: show cards on mobile, table on tablet+ */
@media (max-width: 599px) {
    .wh-matrix-wrap { display: none; }
    .wh-matrix-cards { display: block; }
}

/* ============= Color indicator ============= */

.wh-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    vertical-align: middle;
    margin-right: 6px;
}

.wh-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-soft);
    border-radius: 99px;
    font-size: 13px;
    border: 1px solid var(--border-soft);
}

/* Color multi-select grid (settings + bulk_add) */
.wh-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}

.wh-color-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    min-height: 40px;
}

.wh-color-pill:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.wh-color-pill input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.wh-color-pill:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.wh-color-pill__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.wh-color-pill__label {
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Subcategory color section in category_detail (grouped view) */
.wh-subcat-block {
    margin-bottom: 24px;
}

.wh-subcat-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.wh-subcat-block__title {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    flex-wrap: wrap;
    min-width: 0;
}

.wh-subcat-block__total {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 2px 10px;
    border-radius: 99px;
}

.wh-subcat-block__colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.wh-subcat-color-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 99px;
    font-size: 12px;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-subcat-color-pill__swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* ============= Product picker (print → products linkage) ============= */

.wh-product-picker {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
}

.wh-product-picker__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wh-product-picker__search {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.wh-product-picker__search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.wh-product-picker__counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 6px 12px;
    border-radius: 99px;
    white-space: nowrap;
    border: 1px solid var(--border-soft);
}

.wh-product-picker__counter.is-selected {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.wh-product-picker__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.wh-product-picker__actions .btn.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

.wh-product-picker__groups {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.wh-product-picker__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 8px;
    font-size: 13px;
}

.wh-pp-group {
    margin-bottom: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.wh-pp-group[open] .wh-pp-group__head::after {
    transform: rotate(90deg);
}

.wh-pp-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.wh-pp-group__head::-webkit-details-marker { display: none; }

.wh-pp-group__head::after {
    content: '›';
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    transition: transform 0.15s ease;
    margin-left: 8px;
}

.wh-pp-group__title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wh-pp-group__count {
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid var(--border-soft);
}

.wh-pp-group__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    padding: 8px;
}

.wh-pp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s ease;
    min-height: 0;
}

.wh-pp-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.wh-pp-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

.wh-pp-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 2px 8px rgba(255, 126, 41, 0.18);
}

.wh-pp-card__thumb {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-soft);
    overflow: hidden;
    display: block;
}

.wh-pp-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wh-pp-card__no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 28px;
}

.wh-pp-card__check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.15s ease;
}

.wh-pp-card:has(input:checked) .wh-pp-card__check {
    background: var(--accent);
    color: #0b0e14;
    border-color: var(--accent);
}

.wh-pp-card__body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.wh-pp-card__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-pp-card__meta {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: auto;
}

.wh-pp-card:has(input:checked) .wh-pp-card__title {
    color: var(--text);
    font-weight: 600;
}

/* Mobile tweaks for product picker */
@media (max-width: 540px) {
    .wh-pp-group__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 6px;
        padding: 6px;
    }
    .wh-pp-card__check {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }
    .wh-product-picker__groups {
        max-height: 60vh;
    }
}

@media (max-width: 380px) {
    .wh-pp-group__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============= Bottom navigation ============= */

.wh-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 40;
    padding: 6px 4px env(safe-area-inset-bottom, 6px);
}

.wh-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    min-height: 56px;
    border-radius: 8px;
    transition: color 0.15s ease;
}

.wh-bottom-nav__item.active,
.wh-bottom-nav__item:hover {
    color: var(--accent);
}

/* Active pill highlight under the icon */
.wh-bottom-nav__item.active .wh-bottom-nav__icon {
    background: var(--accent-soft);
    border-radius: 10px;
}

.wh-bottom-nav__icon {
    width: 30px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.wh-bottom-nav__icon svg {
    width: 22px;
    height: 22px;
}

/* Center FAB ("+") — raised circular action button */
.wh-bottom-nav--ctx { align-items: flex-end; }

.wh-bottom-nav__fab {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    margin: 0 6px;
    transform: translateY(-14px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #ff9d52 100%);
    color: #0b0e14;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(255, 126, 41, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--bg-soft);
    text-decoration: none;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
}

.wh-bottom-nav__fab svg { width: 26px; height: 26px; }

.wh-bottom-nav__fab:hover {
    color: #0b0e14;
    transform: translateY(-16px) scale(1.04);
    box-shadow: 0 10px 26px rgba(255, 126, 41, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.wh-bottom-nav__fab:active {
    transform: translateY(-12px) scale(0.96);
}

/* ============= Messages ============= */

.wh-messages {
    position: fixed;
    top: 70px;
    left: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.wh-message {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    animation: msgIn 0.25s ease-out;
}

.wh-message--success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--success-soft) 100%);
}

.wh-message--error {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--danger-soft) 100%);
}

.wh-message--warning {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--warning-soft) 100%);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============= Bottom sheet ============= */

.wh-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.wh-sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.wh-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 18px 18px calc(env(safe-area-inset-bottom, 18px) + 18px);
    z-index: 61;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    max-height: 92vh;
    overflow-y: auto;
}

.wh-sheet.open {
    transform: translateY(0);
}

.wh-sheet__grip {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 14px;
}

.wh-sheet__title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
}

/* Adjust summary card (current → preview) */
.wh-adjust-summary {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wh-adjust-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.wh-adjust-summary__label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.wh-adjust-summary__value {
    color: var(--text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wh-adjust-summary__value--preview {
    color: var(--accent);
}

.wh-adjust-summary__delta {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 700;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
}

.wh-adjust-summary__delta.is-positive {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}

.wh-adjust-summary__delta.is-negative {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

/* Tabs (delta / set) */
.wh-adjust-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 12px;
}

.wh-adjust-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.12s ease;
}

.wh-adjust-tab:hover { color: var(--text); }

.wh-adjust-tab.is-active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Centered + delta controls */
.qty-controls--centered {
    justify-content: center;
    width: 100%;
}

/* ============= Chips (filter pills) ============= */

.wh-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 14px;
}

.wh-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.wh-chip:hover {
    color: var(--text);
    border-color: var(--border);
}

.wh-chip.is-active {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
    font-weight: 600;
}

.wh-chip__count {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.wh-chip:not(.is-active) .wh-chip__count {
    background: var(--bg-card);
    color: var(--text-muted);
}

/* ============= Print groups ============= */

.wh-print-group {
    margin-bottom: 24px;
}

/* Prints grid: always 2 per row (more compact for grading), wider on tablet+ */
.wh-print-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (min-width: 720px) {
    .wh-print-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1000px) {
    .wh-print-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Compact print cards on small screens so 2-up stays readable */
@media (max-width: 380px) {
    .wh-print-grid { gap: 8px; }
    .wh-print-card { padding: 10px; }
    .wh-print-card__title { font-size: 13px; }
}

.wh-print-group__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wh-print-group__icon {
    font-size: 18px;
    text-transform: none;
}

.wh-print-group__count {
    margin-left: auto;
    font-size: 12px;
    background: var(--bg-soft);
    border-radius: 99px;
    padding: 2px 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.wh-print-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease;
}

.wh-print-card:hover { transform: translateY(-2px); }

.wh-print-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    /* Neutral checker-ish background so transparent prints read clearly
       and the whole design стays visible (no destructive crop). */
    background-color: var(--bg-soft);
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.03) 75%),
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.03) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    padding: 6px;
}

.wh-print-card__no-img {
    aspect-ratio: 1;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-size: 13px;
}

.wh-print-card__title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.wh-print-card__meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

/* ---- Print card v2: media wrapper + placement badge + color chips ---- */
.wh-print-card__media {
    position: relative;
    margin-bottom: 8px;
}

.wh-print-card__placement {
    position: absolute;
    left: 6px;
    bottom: 6px;
    background: rgba(11, 14, 20, 0.78);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
    letter-spacing: 0.02em;
}

.wh-print-card__media .wh-print-card__img,
.wh-print-card__media .wh-print-card__no-img {
    margin-bottom: 0;
}

.wh-print-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.wh-pc-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    border-radius: 99px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.wh-pc-chip--mix {
    background: linear-gradient(90deg, #ff5b6d, #ffc04d, #2ec27e, #4d9bff);
    color: #0b0e14;
    border-color: transparent;
}

.wh-pc-chip--std {
    background: var(--bg-card-hover);
}

.wh-pc-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.wh-print-card__fit {
    font-weight: 600;
}
.wh-print-card__fit--dark { color: var(--text); }
.wh-print-card__fit--light { color: var(--warning); }
.wh-print-card__fit--specific { color: var(--accent); }

/* ---- Print detail meta + swatch ---- */
.wh-print-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 4px;
}

.wh-badge--dark { background: #1a1d27; color: #cfd3e0; border-color: var(--border); }
.wh-badge--light { background: #f4f5f8; color: #1a1d27; border-color: transparent; }

.wh-print-swatch {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 18px;
    flex-wrap: wrap;
    padding: 6px;
}

.wh-print-swatch .wh-pc-dot { width: 14px; height: 14px; }

/* ---- Sub chip row (placement filter) ---- */
.wh-chip-row--sub {
    margin-top: -4px;
    align-items: center;
}

.wh-chip-row__lbl {
    font-size: 12px;
    color: var(--text-dim);
    margin-right: 2px;
}

.wh-chip--sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ---- Segmented control (single choice) ---- */
.wh-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.wh-seg__btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.wh-seg__btn:hover { color: var(--text); }

.wh-seg__btn.is-active {
    background: var(--accent);
    color: #0b0e14;
    box-shadow: 0 1px 4px rgba(255, 126, 41, 0.35);
}

.wh-seg--modes .wh-seg__btn {
    flex: 1 1 40%;
}

/* ---- Variant row (print form) ---- */
.variant-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.variant-row__label {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.variant-remove {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.14s ease;
}

.variant-remove:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
}

.variant-colors-picker {
    margin: 10px 0;
}

/* Labelled sub-section inside a variant card (Тип / Колір) */
.variant-field {
    margin: 12px 0;
}

.variant-field__label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.wh-color-grid--compact {
    max-height: 180px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.wh-seg--modes { margin-bottom: 4px; }

.wh-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wh-check-row input { width: auto; min-height: auto; }

.wh-sheet__row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

/* ============= Quick adjust controls ============= */

.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--accent);
    color: #0b0e14;
    border-color: var(--accent);
}

.qty-value {
    min-width: 48px;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

/* ============= Login page ============= */

.wh-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.wh-auth__card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

.wh-auth__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    text-align: center;
}

.wh-auth__sub {
    color: var(--text-muted);
    margin: 0 0 24px;
    text-align: center;
    font-size: 14px;
}

/* ============= Lists ============= */

.wh-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wh-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: 1px solid var(--border-soft);
}

.wh-list__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.wh-list__body {
    flex: 1;
    min-width: 0;
}

.wh-list__title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.wh-list__meta {
    color: var(--text-muted);
    font-size: 13px;
}

.wh-list__action {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Clickable list rows + low-stock highlight (consumables) */
a.wh-list__item { text-decoration: none; transition: border-color 0.15s ease, transform 0.1s ease; }
a.wh-list__item:hover { border-color: var(--border); }
a.wh-list__item:active { transform: scale(0.992); }

.wh-list__item--warn {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--danger-soft) 160%);
}

.wh-list__qty {
    flex-shrink: 0;
    text-align: right;
    line-height: 1.15;
}
.wh-list__qty b { font-size: 16px; color: var(--text); }
.wh-list__qty.is-low b { color: var(--danger); }
.wh-list__qty span { display: block; font-size: 11px; color: var(--text-dim); }

/* ============= Section title ============= */

.wh-section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 22px 0 10px;
    font-weight: 600;
}

.wh-section-title:first-child {
    margin-top: 4px;
}

/* ============= Badges ============= */

.wh-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
}

.wh-badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.wh-badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.wh-badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.wh-badge--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ============= Utility ============= */

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-small { font-size: 13px; }
.text-tiny { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.text-bold { font-weight: 600; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap-8 { display: flex; gap: 8px; }
.flex-gap-12 { display: flex; gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

@media (max-width: 540px) {
    .wh-header__title { display: none; }
}

/* ============= Notification settings UI ============= */

.wh-switch-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wh-switch-card__body { flex: 1; min-width: 0; }

/* iOS-style toggle */
.wh-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.wh-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wh-switch__track {
    width: 52px;
    height: 30px;
    border-radius: 99px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: background 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    padding: 2px;
}

.wh-switch__thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

.wh-switch input:checked + .wh-switch__track {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.wh-switch input:checked + .wh-switch__track .wh-switch__thumb {
    transform: translateX(22px);
    background: var(--accent);
}

/* Disabled options block */
#notif-options.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.3);
    transition: opacity 0.2s ease;
}

/* Radio cards (frequency) */
.wh-radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.wh-radio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: var(--bg-card);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.wh-radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.wh-radio-card.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.wh-radio-card__icon { font-size: 22px; }
.wh-radio-card__title { font-weight: 600; color: var(--text); }
.wh-radio-card__desc { font-size: 12px; color: var(--text-muted); }

/* Check tiles (content selection) */
.wh-check-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 540px) {
    .wh-check-grid { grid-template-columns: 1fr 1fr; }
}

.wh-check-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.wh-check-tile input { position: absolute; opacity: 0; pointer-events: none; }

.wh-check-tile__check {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 7px;
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.15s ease;
}

.wh-check-tile.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.wh-check-tile.is-active .wh-check-tile__check {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0e14;
}

.wh-check-tile__label { font-size: 14px; color: var(--text); font-weight: 500; }

/* ============= Write-off page ============= */

.wh-wo-client__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wh-wo-client__badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}

.wh-wo-item {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

.wh-wo-item__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 12px;
}

.wh-wo-item__thumb {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.wh-wo-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.wh-wo-item__info { flex: 1; min-width: 0; }
.wh-wo-item__title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.wh-wo-item__meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.wh-wo-item__qty {
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.wh-wo-section { margin-top: 14px; }
.wh-wo-section--empty { padding: 10px 0 2px; }

.wh-wo-section__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

/* Stepper */
.wh-wo-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.wh-wo-stepper__label { font-size: 13px; color: var(--text-muted); }

.wh-wo-stepper__controls { display: inline-flex; align-items: center; gap: 6px; }

.wh-wo-stepper input[type="number"] {
    width: 64px;
    text-align: center;
    padding: 8px 6px;
    min-height: 40px;
    font-weight: 700;
}

.wh-wo-stepper__btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.wh-wo-stepper__btn:hover { background: var(--accent); color: #0b0e14; border-color: var(--accent); }
.wh-wo-stepper__btn:active { transform: scale(0.92); }

.wh-wo-stepper--sm .wh-wo-stepper__btn { width: 34px; height: 34px; font-size: 17px; }
.wh-wo-stepper--sm input[type="number"] { width: 52px; min-height: 34px; }

/* Print rows */
.wh-wo-prints { display: flex; flex-direction: column; gap: 8px; }

.wh-wo-print {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--bg-soft);
    padding: 8px;
    transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    opacity: 0.6;
}

.wh-wo-print.is-on {
    opacity: 1;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-soft) 0%, var(--accent-soft) 220%);
}

.wh-wo-print__main {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.wh-wo-print__main input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }

.wh-wo-print__thumb {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.wh-wo-print__thumb img { width: 100%; height: 100%; object-fit: cover; }

.wh-wo-print__body { flex: 1; min-width: 0; }
.wh-wo-print__name { display: block; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

.wh-wo-print__tags { display: inline-flex; gap: 4px; margin-top: 2px; }

.wh-wo-print__placement {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
}

.wh-wo-print__check {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: 700;
    transition: all 0.15s ease;
}

.wh-wo-print.is-on .wh-wo-print__check {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0e14;
}

.wh-wo-print__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-soft);
}

.wh-wo-print__variant { flex: 1; min-width: 0; min-height: 38px; padding: 6px 10px; }
.wh-wo-print__single { font-size: 13px; color: var(--text-muted); }

.wh-wo-print__controls .wh-wo-stepper { margin-top: 0; flex-shrink: 0; }

/* Sticky submit bar */
.wh-wo-bar {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    margin-top: 16px;
    z-index: 20;
}
