/* ==========================================================================
   Dottie Clothing OMS — design system
   ========================================================================== */

:root {
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', var(--font);

    --pink: #ff6b9d;
    --orchid: #c058f3;
    --violet: #7b5cff;
    --grad: linear-gradient(135deg, #ff6b9d 0%, #c058f3 55%, #7b5cff 100%);
    --grad-soft: linear-gradient(135deg, rgba(255, 107, 157, .16), rgba(123, 92, 255, .16));

    --success: #34d399;
    --warn: #fbbf24;
    --danger: #fb7185;
    --info: #60a5fa;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --sidebar-w: 264px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d0a14;
    --bg-glow-1: rgba(192, 88, 243, .16);
    --bg-glow-2: rgba(255, 107, 157, .10);
    --surface: rgba(255, 255, 255, .035);
    --surface-solid: #17121f;
    --surface-2: rgba(255, 255, 255, .06);
    --surface-hover: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);
    --text: #f4eff9;
    --muted: #a69db8;
    --faint: #6e6680;
    --input-bg: rgba(255, 255, 255, .04);
    --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75);
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f3fa;
    --bg-glow-1: rgba(192, 88, 243, .10);
    --bg-glow-2: rgba(255, 107, 157, .08);
    --surface: rgba(255, 255, 255, .75);
    --surface-solid: #ffffff;
    --surface-2: rgba(40, 20, 70, .04);
    --surface-hover: rgba(40, 20, 70, .06);
    --border: rgba(40, 20, 70, .09);
    --border-strong: rgba(40, 20, 70, .18);
    --text: #1d1729;
    --muted: #675f7a;
    --faint: #9a93aa;
    --input-bg: #fff;
    --shadow: 0 10px 30px -14px rgba(60, 30, 100, .25);
    --shadow-lg: 0 30px 70px -20px rgba(60, 30, 100, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(900px 600px at 0% -10%, var(--bg-glow-1), transparent 60%),
        radial-gradient(800px 500px at 100% 0%, var(--bg-glow-2), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code { font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
button { font: inherit; color: inherit; }
::selection { background: rgba(255, 107, 157, .35); }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: 15px; height: 15px; }
.i--lg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[hidden] { display: none !important; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    display: flex; flex-direction: column; gap: 18px;
    padding: 22px 16px;
    background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    z-index: 40;
    transition: transform .35s var(--ease);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand img { border-radius: 12px; box-shadow: 0 8px 24px -6px rgba(192, 88, 243, .6); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text strong { font-family: var(--font-display); font-size: 17px; }
.brand__text small { color: var(--muted); font-size: 12px; }
.sidebar__cta { margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 11px;
    color: var(--muted); font-weight: 500;
    transition: background .2s, color .2s;
}
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a.active { background: var(--grad-soft); color: var(--text); }
.nav a.active::before {
    content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 4px 4px 0; background: var(--grad);
}
.nav a.active .i { color: var(--pink); }
.nav__badge {
    margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px;
    background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}
.nav__badge--warn { background: rgba(251, 191, 36, .18); color: var(--warn); }

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.fardar-pill {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
    font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted);
}
.fardar-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); animation: pulse 2s infinite; }
.fardar-pill.is-test .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 36, .18); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.avatar {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--grad); color: #fff; font-weight: 700; flex: none;
}
.user-chip__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.user-chip__text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__text small { color: var(--muted); font-size: 11px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.search {
    flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px;
    padding: 0 12px; height: 40px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: rgba(255, 107, 157, .5); box-shadow: 0 0 0 4px rgba(255, 107, 157, .12); }
.search .i { color: var(--faint); }
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--text); font: inherit; min-width: 0; }
.search kbd { font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--faint); }
#btn-theme { margin-left: auto; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

.view { padding: 28px; outline: none; animation: viewIn .35s var(--ease); }
.view.is-loading { opacity: .6; }
.sidebar-scrim { display: none; }

/* ------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.breadcrumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.breadcrumb:hover { color: var(--text); }

/* ------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 11px;
    border: 1px solid var(--border); background: var(--surface-2);
    font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
    transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary {
    border: 0; color: #fff; background: var(--grad); background-size: 140% 140%;
    box-shadow: 0 8px 24px -8px rgba(192, 88, 243, .7);
}
.btn--primary:hover { background: var(--grad); background-position: 100% 50%; box-shadow: 0 10px 30px -8px rgba(255, 107, 157, .75); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .35); }
.btn--success { color: #fff; border: 0; background: linear-gradient(135deg, #10b981, #34d399); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.order-status-select {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: 40px;
    padding: 0 36px 0 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background-color: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    font-size: 13.5px;
    line-height: 38px;
    cursor: pointer;
    white-space: nowrap;
    background-position: right 12px center;
    transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.order-status-select:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-strong);
}
.order-status-select:focus {
    border-color: rgba(255, 107, 157, .6);
    box-shadow: 0 0 0 4px rgba(255, 107, 157, .12);
}

.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn--danger:hover { color: var(--danger); background: rgba(251, 113, 133, .12); }

/* ------------------------------------------------------------- cards */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card__head h2, .card__head h3 { font-size: 16px; font-weight: 600; }
.card__body { padding: 18px 20px 20px; }
.card--flush .card__body { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: 1.6fr 1fr; }
.grid--2-even { grid-template-columns: 1fr 1fr; }

.stat { position: relative; overflow: hidden; padding: 18px 20px; }
.stat__icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
    background: var(--grad-soft); color: var(--pink);
}
.stat__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat__value { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; }
.stat__sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat::after {
    content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(192, 88, 243, .18), transparent 70%);
}
.stat--warn .stat__icon { background: rgba(251, 191, 36, .14); color: var(--warn); }
.stat--success .stat__icon { background: rgba(52, 211, 153, .14); color: var(--success); }
.stat--info .stat__icon { background: rgba(96, 165, 250, .14); color: var(--info); }
a.stat { transition: transform .25s var(--ease), border-color .25s; }
a.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }

/* ------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
    font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--pending    { color: #fbbf24; background: rgba(251, 191, 36, .13); }
.badge--confirmed  { color: #60a5fa; background: rgba(96, 165, 250, .13); }
.badge--dispatched { color: #c084fc; background: rgba(192, 132, 252, .14); }
.badge--delivered  { color: #34d399; background: rgba(52, 211, 153, .13); }
.badge--returned   { color: #fb923c; background: rgba(251, 146, 60, .13); }
.badge--cancelled  { color: #a1a1aa; background: rgba(161, 161, 170, .13); }
.badge--synced     { color: #34d399; background: rgba(52, 211, 153, .13); }
.badge--failed     { color: #fb7185; background: rgba(251, 113, 133, .14); }
.badge--not_sent   { color: var(--muted); background: var(--surface-2); }
.badge--test       { color: #fbbf24; background: rgba(251, 191, 36, .13); }

/* ------------------------------------------------------------- forms */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.field--full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field > span em { font-style: normal; color: var(--pink); }
.field small { color: var(--faint); font-size: 12px; }
input, select, textarea {
    width: 100%; font: inherit; color: var(--text);
    background: var(--input-bg); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 10px 12px; outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--pink); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a69db8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select option { background: var(--surface-solid); color: var(--text); }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: rgba(255, 107, 157, .6); box-shadow: 0 0 0 4px rgba(255, 107, 157, .12); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input.is-invalid { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); font-weight: 500; }
.input-group { display: flex; align-items: stretch; }
.input-group > span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); background: var(--surface-2); font-size: 13px; }
.input-group > input { border-radius: 0 10px 10px 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-hover); border: 1px solid var(--border-strong); position: relative; transition: background .25s; flex: none; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch input:checked + .switch__track { background: var(--grad); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 4px rgba(255, 107, 157, .2); }
.switch__text strong { display: block; font-size: 13.5px; }
.switch__text small { color: var(--muted); font-size: 12px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button, .segmented label { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button.active, .segmented input:checked + span { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.segmented label { padding: 0; }
.segmented label span { padding: 6px 14px; border-radius: 8px; display: inline-block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------- toolbar & tabs */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { max-width: 340px; height: 38px; }
.toolbar select, .toolbar input[type="date"] { width: auto; height: 38px; padding-top: 0; padding-bottom: 0; }
.toolbar__spacer { flex: 1; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
    border: 1px solid transparent; background: none; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background .2s, color .2s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--text); background: var(--surface); border-color: var(--border); }
.tab__count { font-size: 11px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tab.active .tab__count { background: var(--grad); color: #fff; }
.tab--alert .tab__count { background: rgba(251, 113, 133, .18); color: var(--danger); }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--faint); padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: rgba(255, 107, 157, .07); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .row-link { cursor: pointer; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.th-check, .td-check { width: 36px; padding-left: 12px !important; padding-right: 0 !important; }

.bulkbar {
    position: sticky; bottom: 18px; z-index: 20; margin-top: 16px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px 10px 18px; border-radius: 14px;
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg); backdrop-filter: blur(16px);
    animation: slideUp .3s var(--ease);
}
.bulkbar strong { margin-right: auto; }
.bulk-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bulk-select-icon {
    position: absolute;
    left: 11px;
    pointer-events: none;
    color: var(--muted);
    z-index: 2;
    width: 14px;
    height: 14px;
}
.bulk-status-select {
    height: 32px !important;
    padding: 0 28px 0 32px !important;
    border-radius: 9px !important;
    border: 1px solid var(--border) !important;
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 30px !important;
    cursor: pointer;
    white-space: nowrap;
    width: auto !important;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a69db8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 14px !important;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.bulk-status-select:hover {
    background-color: var(--surface-hover) !important;
    border-color: var(--border-strong) !important;
}
.bulk-status-select:focus {
    border-color: rgba(255, 107, 157, .6) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, .12) !important;
}

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.pager__btns { display: flex; gap: 6px; }

/* ------------------------------------------------------------- thumbnails & images */
.thumb {
    position: relative; flex: none; width: 44px; height: 54px; border-radius: 9px; overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--faint);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.thumb--sm { width: 32px; height: 40px; border-radius: 7px; }
.thumb--lg { width: 64px; height: 80px; border-radius: 12px; }
.thumb[data-preview] { cursor: zoom-in; }
.thumb[data-preview]:hover img { transform: scale(1.08); }
.thumb-stack { display: flex; align-items: center; }
.thumb-stack .thumb { margin-left: -12px; box-shadow: 0 0 0 2px var(--bg); }
.thumb-stack .thumb:first-child { margin-left: 0; }
.thumb-more { display: grid; place-items: center; width: 32px; height: 40px; margin-left: -12px; border-radius: 7px; background: var(--surface-solid); border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--muted); box-shadow: 0 0 0 2px var(--bg); }

.hover-preview {
    position: fixed; z-index: 200; width: 240px; aspect-ratio: 3 / 4; pointer-events: none;
    border-radius: 16px; overflow: hidden; background: var(--surface-solid);
    border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
    animation: popIn .18s var(--ease);
}
.hover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; animation: fadeUp .4s var(--ease) both; }
.product-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.product-card__media { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .3s; }
.product-card:hover .product-card__media img { transform: scale(1.06); }
.product-card__media .img-alt { position: absolute; inset: 0; opacity: 0; }
.product-card:hover .product-card__media .img-alt { opacity: 1; }
.product-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); gap: 6px; text-align: center; font-size: 12px; cursor: pointer; }
.product-card__badges { position: absolute; top: 10px; left: 44px; right: 10px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.product-card__chk-label {
    position: absolute; top: 10px; left: 10px; z-index: 10;
    width: 26px; height: 26px; border-radius: 8px;
    background: rgba(15, 10, 25, .65); backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .25);
    display: grid; place-items: center; cursor: pointer;
    transition: background .2s, border-color .2s;
}
.product-card__chk-label:hover { background: rgba(255, 107, 157, .3); border-color: var(--pink); }
.product-card__chk-label input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; margin: 0; }
.product-card.is-selected { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(255, 107, 157, .4); }
.chip-glass { padding: 4px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(15, 10, 25, .55); backdrop-filter: blur(8px); display: inline-flex; align-items: center; gap: 5px; }
.chip-glass--warn { background: rgba(217, 119, 6, .85); }
.chip-glass--danger { background: rgba(225, 29, 72, .85); }
.product-card__zoom { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: rgba(15, 10, 25, .55); backdrop-filter: blur(8px); opacity: 0; transform: translateY(6px); transition: .25s var(--ease); }
.product-card:hover .product-card__zoom { opacity: 1; transform: none; }
.product-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-card__title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.product-card__title h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.product-card__title .price { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.product-card__meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.product-card__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 4px; }

/* Size chips */
.sizes { display: flex; flex-wrap: wrap; gap: 5px; }
.size-chip {
    display: inline-flex; flex-direction: column; align-items: center; min-width: 38px; padding: 4px 6px 3px;
    border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.15;
}
.size-chip b { font-size: 11px; font-weight: 700; }
.size-chip small { font-size: 10.5px; color: var(--success); font-weight: 600; }
.size-chip.is-low small { color: var(--warn); }
.size-chip.is-out { opacity: .55; }
.size-chip.is-out small { color: var(--danger); }

/* Size editor in product form */
.size-editor { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); gap: 10px; }
.size-cell {
    position: relative; border-radius: 14px; border: 1.5px dashed var(--border-strong); padding: 12px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; transition: .2s var(--ease); cursor: pointer;
}
.size-cell__label { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--faint); }
.size-cell input[type="number"] { text-align: center; padding: 6px; font-weight: 600; }
.size-cell input[type="number"]:disabled { opacity: .3; }
.size-cell.is-on { border-style: solid; border-color: rgba(255, 107, 157, .55); background: var(--grad-soft); }
.size-cell.is-on .size-cell__label { color: var(--text); }
.size-cell__toggle { position: absolute; top: 8px; right: 8px; }
.size-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Image manager */
.dropzone {
    position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 26px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted);
    cursor: pointer; transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--pink); background: rgba(255, 107, 157, .06); color: var(--text); }
.dropzone .i { width: 30px; height: 30px; color: var(--pink); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { color: var(--text); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 14px; }
.gallery__item {
    position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-2);
    border: 1px solid var(--border); cursor: grab; animation: popIn .25s var(--ease);
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item.is-dragging { opacity: .4; }
.gallery__item.is-drop-target { outline: 2px solid var(--pink); outline-offset: 2px; }
.gallery__item.is-uploading img { filter: blur(2px) brightness(.7); }
.gallery__item .progress { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.gallery__item .progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.gallery__cover { position: absolute; top: 8px; left: 8px; }
.gallery__actions { position: absolute; inset: auto 6px 6px 6px; display: flex; justify-content: flex-end; gap: 4px; opacity: 0; transform: translateY(6px); transition: .2s var(--ease); }
.gallery__item:hover .gallery__actions { opacity: 1; transform: none; }
.gallery__actions button { width: 30px; height: 30px; border: 0; border-radius: 8px; display: grid; place-items: center; color: #fff; background: rgba(15, 10, 25, .65); backdrop-filter: blur(6px); cursor: pointer; }
.gallery__actions button:hover { background: rgba(15, 10, 25, .9); }
.gallery__actions button.danger:hover { background: rgba(225, 29, 72, .9); }

/* Product preview card (form sidebar) */
.preview-hero { aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--surface-2); position: relative; cursor: zoom-in; }
.preview-hero img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.preview-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 9px; background: none; cursor: pointer; flex: none; }
.preview-thumbs button.active { border-color: var(--pink); }
.preview-thumbs img { width: 46px; height: 56px; object-fit: cover; border-radius: 7px; }

/* ------------------------------------------------------------- lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column;
    background: rgba(6, 4, 12, .94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    animation: fadeIn .2s ease; user-select: none;
}
.lightbox__top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(13, 10, 20, .6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    z-index: 20; flex-shrink: 0;
}
.lightbox__top-left {
    display: flex; align-items: center; gap: 14px; min-width: 0;
}
.lightbox__top h3 {
    font-size: 15px; font-weight: 600; color: #fff; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw;
    letter-spacing: -0.01em;
}
.lightbox__badges {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.lb-badge {
    display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 500; background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8);
}
.lb-badge--accent {
    background: rgba(255, 107, 157, .15); border-color: rgba(255, 107, 157, .3); color: #ff9ec0;
}
.lb-hint {
    font-size: 12px; color: rgba(255, 255, 255, .45); margin-left: 6px;
}
@media (max-width: 768px) {
    .lb-hint { display: none; }
}
.lightbox__top-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.lightbox .icon-btn {
    color: rgba(255, 255, 255, .85); border-radius: 10px; width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
    transition: all .15s ease;
}
.lightbox .icon-btn:hover {
    color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
}
.lightbox .icon-btn:active {
    transform: translateY(0);
}
.lightbox .icon-btn--close {
    background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .25); color: #fb7185;
}
.lightbox .icon-btn--close:hover {
    background: #fb7185; color: #fff; border-color: #fb7185;
}

/* Stage & Image Canvas */
.lightbox__stage {
    flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
    overflow: hidden; min-height: 0; padding: 24px 20px 84px; touch-action: none;
    cursor: default;
}
.lightbox__stage.has-strip {
    padding-bottom: 130px;
}
.lightbox__viewport {
    position: relative; display: flex; align-items: center; justify-content: center;
    max-width: 100%; max-height: 100%; pointer-events: none;
}
.lightbox__img {
    max-width: min(88vw, 1200px); max-height: min(78vh, 850px);
    object-fit: contain; border-radius: 14px;
    box-shadow: 0 30px 90px -15px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .08);
    cursor: zoom-in; pointer-events: auto; will-change: transform;
    transform-origin: center center; opacity: 1;
    transition: opacity .2s ease;
}
.lightbox__img.is-loading {
    opacity: 0;
}
.lightbox__img.is-zoomed {
    cursor: grab;
}
.lightbox__img.is-dragging {
    cursor: grabbing;
}

/* Spinner */
.lightbox__spinner {
    position: absolute; width: 44px; height: 44px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .1); border-top-color: var(--pink);
    border-right-color: var(--orchid); animation: spin .8s linear infinite;
    pointer-events: none; z-index: 5;
}

/* Floating Dock Controls */
.lightbox__dock {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 4px; padding: 5px 8px;
    background: rgba(18, 13, 28, .85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px;
    box-shadow: 0 16px 45px -10px rgba(0, 0, 0, .7), 0 0 25px rgba(192, 88, 243, .12);
    z-index: 25; pointer-events: auto; animation: popIn .25s var(--ease);
}
.lightbox__stage.has-strip .lightbox__dock {
    bottom: 96px;
}
.lightbox__dock-btn {
    width: 34px; height: 34px; border-radius: 999px; border: none; background: transparent;
    color: rgba(255, 255, 255, .8); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .15s ease; padding: 0;
}
.lightbox__dock-btn:hover {
    color: #fff; background: rgba(255, 255, 255, .12); transform: scale(1.08);
}
.lightbox__dock-btn:active {
    transform: scale(0.96);
}
.lightbox__dock-btn.active {
    color: var(--pink); background: rgba(255, 107, 157, .16);
}
.lightbox__dock-zoom-val {
    padding: 0 10px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .9);
    min-width: 54px; text-align: center; border: none; background: transparent;
    cursor: pointer; border-radius: 999px; height: 34px; display: inline-flex;
    align-items: center; justify-content: center; transition: all .15s ease;
}
.lightbox__dock-zoom-val:hover {
    color: #fff; background: rgba(255, 255, 255, .12);
}
.lightbox__dock-sep {
    width: 1px; height: 18px; background: rgba(255, 255, 255, .12); margin: 0 2px;
}

/* Nav Arrows */
.lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px;
    border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(20, 15, 30, .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #fff; display: grid; place-items: center; cursor: pointer;
    transition: all .2s ease; z-index: 15;
}
.lightbox__nav:hover {
    background: rgba(255, 107, 157, .2); border-color: rgba(255, 107, 157, .4);
    transform: translateY(-50%) scale(1.06); color: #fff; box-shadow: 0 8px 25px rgba(255, 107, 157, .25);
}
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }

/* Thumbnail Strip */
.lightbox__strip {
    position: absolute; bottom: 12px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 8px; padding: 10px 20px;
    overflow-x: auto; z-index: 20; background: linear-gradient(to top, rgba(6, 4, 12, .8) 0%, transparent 100%);
}
.lightbox__strip button {
    padding: 0; border: 2px solid transparent; border-radius: 10px; background: none;
    cursor: pointer; opacity: .55; transition: all .2s ease; flex: none; overflow: hidden;
}
.lightbox__strip button:hover {
    opacity: .85; transform: translateY(-2px);
}
.lightbox__strip button.active {
    border-color: var(--pink); opacity: 1; transform: scale(1.08);
    box-shadow: 0 0 18px rgba(255, 107, 157, .45);
}
.lightbox__strip img {
    width: 52px; height: 64px; object-fit: cover; display: block; border-radius: 8px;
}

/* ------------------------------------------------------------- modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px;
    background: rgba(8, 5, 14, .6); backdrop-filter: blur(6px); animation: fadeIn .2s ease;
}
.modal {
    width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); animation: popIn .25s var(--ease);
}
.modal--lg { width: min(860px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 18px; }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 400; display: flex; flex-direction: column; gap: 10px; max-width: min(400px, calc(100vw - 40px)); }
.toast {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
    animation: toastIn .35s var(--ease); white-space: pre-line;
}
.toast.is-leaving { animation: toastOut .25s ease forwards; }
.toast__icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast--success .toast__icon { background: rgba(52, 211, 153, .15); color: var(--success); }
.toast--error .toast__icon { background: rgba(251, 113, 133, .15); color: var(--danger); }
.toast--info .toast__icon { background: rgba(96, 165, 250, .15); color: var(--info); }
.toast__body { flex: 1; font-size: 13.5px; }
.toast__body strong { display: block; margin-bottom: 2px; }

/* ------------------------------------------------------------- alerts */
.alert { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.alert--error { background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .3); color: var(--danger); }
.alert--success { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); color: var(--success); }
.alert--info { background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .3); color: var(--info); }
.alert--warn { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .3); color: var(--warn); }
.alert .i { margin-top: 1px; }
.alert a { text-decoration: underline; font-weight: 600; }

/* ------------------------------------------------------------- empty & skeleton */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--grad-soft); color: var(--pink); }
.empty__icon .i { width: 28px; height: 28px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hover) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

/* ------------------------------------------------------------- dashboard */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 10px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; position: relative; }
.chart__bar {
    width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--grad); min-height: 3px;
    transform-origin: bottom; animation: growUp .7s var(--ease) both; opacity: .9; transition: opacity .2s, filter .2s;
}
.chart__bar.is-zero { background: var(--surface-hover); }
.chart__col:hover .chart__bar { opacity: 1; filter: brightness(1.15); }
.chart__label { font-size: 11px; color: var(--faint); }
.chart__tip {
    position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translate(-50%, 4px); padding: 6px 10px; border-radius: 9px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12px;
    white-space: nowrap; opacity: 0; pointer-events: none; transition: .2s var(--ease); z-index: 2;
}
.chart__col:hover .chart__tip { opacity: 1; transform: translate(-50%, 0); }
.mini-list { display: flex; flex-direction: column; }
.mini-list__item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-list__item:last-child { border-bottom: 0; }
.mini-list__main { flex: 1; min-width: 0; }
.mini-list__main strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list__main small { color: var(--muted); font-size: 12px; }
.size-bars { display: flex; flex-direction: column; gap: 10px; }
.size-bar { display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; align-items: center; font-size: 12.5px; }
.size-bar__track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.size-bar__fill { height: 100%; border-radius: 99px; background: var(--grad); animation: growX .8s var(--ease) both; transform-origin: left; }

/* Sri Lankan Cities in Demand */
.city-demand-list { display: flex; flex-direction: column; gap: 8px; }
.city-demand-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    text-decoration: none; color: inherit; transition: all .2s var(--ease);
}
.city-demand-item:hover {
    background: var(--surface-hover); border-color: var(--border-strong);
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.city-rank-badge {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
    font-size: 11px; font-weight: 700; flex-shrink: 0; font-family: var(--font-display);
}
.city-rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,.35); }
.city-rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.city-rank-3 { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }
.city-rank-other { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.city-demand-info { min-width: 110px; max-width: 160px; display: flex; flex-direction: column; flex-shrink: 0; }
.city-demand-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-demand-sub { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.city-demand-villages { color: var(--pink); font-size: 10px; background: rgba(255, 107, 157, .12); padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(255, 107, 157, .25); font-weight: 500; display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-demand-bar-wrap { flex: 1; min-width: 50px; display: flex; flex-direction: column; gap: 2px; }
.city-demand-track { height: 7px; border-radius: 99px; background: var(--surface); overflow: hidden; border: 1px solid rgba(255,255,255,.05); }
.city-demand-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff6b9d, #7b5cff); transform-origin: left; animation: growX .8s var(--ease) both; }
.city-demand-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; text-align: right; min-width: 85px; }
.city-demand-rev { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text); }
.city-demand-pill { font-size: 10.5px; color: var(--muted); background: var(--surface); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); }
.city-hub-indicator {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px;
    color: var(--muted); background: var(--surface-2); padding: 5px 12px; border-radius: 8px;
    border: 1px solid var(--border); animation: fadeIn .2s var(--ease); flex-wrap: wrap;
}
.city-hub-indicator b { color: var(--pink); font-weight: 600; }
.city-dist-badge {
    font-size: 10.5px; color: var(--muted); background: rgba(255, 255, 255, 0.05);
    padding: 1px 7px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.08);
}
.city-zone-badge {
    font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px;
}
.city-zone-badge--1-to-15 { background: rgba(56, 189, 248, 0.16); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.city-zone-badge--suburb { background: rgba(52, 211, 153, 0.16); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.city-zone-badge--oustation { background: rgba(251, 191, 36, 0.16); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.city-zone-badge--remote { background: rgba(192, 132, 252, 0.16); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }

/* Interactive City / Destination Autocomplete Dropdown */
.card:has(.city-suggestions-dropdown),
.card.has-open-dropdown {
    position: relative;
    z-index: 60 !important;
}
.order-layout .form-stack > .card:nth-of-type(1),
.order-layout .form-stack > .card:nth-of-type(2) {
    position: relative;
    z-index: 30;
}
.order-layout .form-stack > .card:nth-of-type(3),
.order-layout .form-stack > .card:nth-of-type(4) {
    position: relative;
    z-index: 10;
}
.field--city { position: relative; z-index: 70; }
.city-input-wrap {
    position: relative;
    width: 100%;
    z-index: 80;
}
.city-input-wrap input {
    padding-right: 36px;
}
.city-clear-btn {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    transition: all .15s ease;
    z-index: 2;
}
.city-clear-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.city-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    z-index: 9999;
    max-height: 310px;
    background: #191424;
    border: 1px solid rgba(255, 107, 157, 0.45);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn .15s var(--ease);
}
[data-theme="light"] .city-suggestions-dropdown {
    background: #ffffff;
    border-color: rgba(192, 88, 243, 0.35);
    box-shadow: 0 16px 36px rgba(40, 20, 70, 0.18), 0 0 0 1px rgba(40, 20, 70, 0.08);
}
[data-theme="light"] .city-suggestions-header {
    background: #f8f6fc;
    border-bottom-color: rgba(40, 20, 70, 0.09);
    color: #675f7a;
}
[data-theme="light"] .city-suggestion-item {
    border-bottom-color: rgba(40, 20, 70, 0.06);
}
[data-theme="light"] .city-suggestion-item:hover,
[data-theme="light"] .city-suggestion-item.is-active {
    background: rgba(192, 88, 243, 0.12);
}
[data-theme="light"] .city-suggestion-name {
    color: #1d1729;
}
[data-theme="light"] .city-suggestion-hub b {
    color: #1d1729;
}
.city-suggestions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.city-suggestions-count {
    font-size: 10.5px;
    color: var(--pink);
    font-weight: 700;
}
.city-suggestions-list {
    overflow-y: auto;
    max-height: 265px;
    overscroll-behavior: contain;
}
.city-suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s ease;
}
.city-suggestion-item:last-child {
    border-bottom: none;
}
.city-suggestion-item:hover,
.city-suggestion-item.is-active {
    background: rgba(255, 107, 157, 0.16);
}
.city-suggestion-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.city-suggestion-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.city-suggestion-name mark {
    background: rgba(255, 107, 157, 0.38);
    color: #fff;
    padding: 0 3px;
    border-radius: 4px;
    font-weight: 700;
}
.city-suggestion-dist {
    font-size: 11.5px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.city-suggestion-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.city-suggestion-hub {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}
.city-suggestion-hub b {
    color: var(--text);
    font-weight: 600;
}
.city-zone-pill {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2.5px 7px;
    border-radius: 6px;
    white-space: nowrap;
}
.city-zone-pill--1-to-15 {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.city-zone-pill--suburb {
    background: rgba(52, 211, 153, 0.18);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}
.city-zone-pill--oustation {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}
.city-zone-pill--remote {
    background: rgba(192, 132, 252, 0.18);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.35);
}
.city-suggestion-empty {
    padding: 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

.hero-banner {
    position: relative; overflow: hidden; padding: 22px 24px; margin-bottom: 18px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 107, 157, .18), rgba(123, 92, 255, .18)); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.hero-banner h2 { font-size: 22px; }
.hero-banner p { margin: 4px 0 0; color: var(--muted); }
.hero-banner::before, .hero-banner::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); pointer-events: none; }
.hero-banner::before { width: 160px; height: 160px; right: 120px; top: -80px; }
.hero-banner::after { width: 90px; height: 90px; right: 40px; bottom: -40px; }

/* ------------------------------------------------------------- order form & detail */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 88px; }
.line-items { display: flex; flex-direction: column; gap: 10px; }
.line-item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) 90px 110px 100px auto; gap: 12px; align-items: center;
    padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); animation: fadeUp .25s var(--ease);
}
.line-item__name strong { display: block; font-size: 13.5px; }
.line-item__name small { color: var(--muted); font-size: 12px; }
.line-item input { padding: 8px 10px; }
.line-item__total { font-weight: 700; text-align: right; font-family: var(--font-display); }
.qty { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.qty button { width: 28px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.qty button:hover { color: var(--text); background: var(--surface-hover); }
.qty input { border: 0; border-radius: 0; text-align: center; padding: 0; height: 36px; width: 34px; background: none; box-shadow: none !important; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.add-item { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--border-strong); color: var(--muted); background: none; cursor: pointer; font-weight: 600; width: 100%; transition: .2s; }
.add-item:hover { border-color: var(--pink); color: var(--text); background: rgba(255, 107, 157, .05); }

.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; color: var(--muted); }
.summary-row strong { color: var(--text); }
.summary-row input { width: 120px; text-align: right; padding: 6px 10px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 6px; margin-top: 8px; border-top: 1px dashed var(--border-strong); }
.summary-total span { font-weight: 600; }
.summary-total strong { font-family: var(--font-display); font-size: 26px; }

/* Customer Intelligence & Order History */
.customer-hint, .customer-intel-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fadeUp .25s var(--ease);
    margin: 4px 0 10px;
}
.customer-intel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.customer-intel__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--pink);
    flex: none;
}
.customer-intel__meta {
    flex: 1;
    min-width: 180px;
}
.customer-intel__title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}
.customer-intel__sub {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.customer-intel__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.customer-intel__candidates {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.candidate-pill {
    padding: 3px 10px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 11.5px;
    cursor: pointer;
    transition: .15s;
}
.candidate-pill:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
.candidate-pill.active {
    background: var(--grad);
    color: #fff;
    border-color: transparent;
}
.customer-intel__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stat-pill {
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stat-pill small {
    font-size: 10.5px;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.stat-pill b {
    font-size: 14px;
    font-weight: 700;
}
.customer-intel__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
}
.customer-intel__alert svg {
    flex: none;
    margin-top: 2px;
}
.customer-intel__alert--danger {
    background: rgba(251, 113, 133, 0.12);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}
.customer-intel__alert--danger strong { color: var(--danger); }
.customer-intel__alert--success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #a7f3d0;
}
.customer-intel__alert--success strong { color: var(--success); }
.customer-intel__alert--info {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #bfdbfe;
}
.customer-intel__alert--info strong { color: var(--info); }
.customer-intel__history {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.customer-intel__history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 2px 0;
}
.customer-intel__history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 2px;
}
.customer-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: background .15s, border-color .15s;
}
.customer-history-row:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}
.chr-main {
    flex: 1;
    min-width: 0;
}
.chr-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
}
.chr-date {
    font-size: 11px;
}
.chr-item-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11px;
    margin: 2px 4px 2px 0;
}
.chr-total {
    flex: none;
    text-align: right;
}

/* Product picker */
.picker-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 55vh; overflow-y: auto; }
.picker-item { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.picker-item__main { flex: 1; min-width: 0; }
.picker-item__main strong { display: block; }
.picker-item__main small { color: var(--muted); }
.picker-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.picker-size {
    min-width: 48px; padding: 5px 8px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-solid);
    cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.15; transition: .15s var(--ease);
}
.picker-size b { font-size: 12px; }
.picker-size small { font-size: 10.5px; color: var(--muted); }
.picker-size:hover:not(:disabled) { border-color: var(--pink); background: rgba(255, 107, 157, .1); transform: translateY(-1px); }
.picker-size:disabled { opacity: .35; cursor: not-allowed; }
.picker-size.is-added { border-color: var(--success); background: rgba(52, 211, 153, .12); }

/* Detail */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--pink); }
.timeline li:first-child::after { background: var(--grad); border-color: transparent; box-shadow: 0 0 0 4px rgba(255, 107, 157, .18); }
.timeline strong { font-size: 13px; }
.timeline p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.timeline small { color: var(--faint); font-size: 11.5px; }

.waybill-card {
    position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius-lg);
    background: var(--grad); color: #fff; box-shadow: 0 16px 40px -14px rgba(192, 88, 243, .7);
}
.waybill-card small { opacity: .8; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.waybill-card .num { font-family: ui-monospace, Consolas, monospace; font-size: 24px; font-weight: 700; letter-spacing: .06em; margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.waybill-card .num button { border: 0; background: rgba(255, 255, 255, .2); color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.waybill-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.waybill-card--pending { background: var(--surface-2); color: var(--text); border: 1px dashed var(--border-strong); box-shadow: none; }
.waybill-card--failed { background: rgba(251, 113, 133, .1); color: var(--text); border: 1px solid rgba(251, 113, 133, .35); box-shadow: none; }
.waybill-card--pending::after, .waybill-card--failed::after { display: none; }

.log { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.log summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 13px; list-style: none; }
.log summary::-webkit-details-marker { display: none; }
.log pre { margin: 0; padding: 12px; font-size: 12px; background: var(--surface-2); overflow-x: auto; white-space: pre-wrap; word-break: break-all; border-top: 1px solid var(--border); }

/* Sync results */
.sync-results { display: flex; flex-direction: column; gap: 8px; }
.sync-result { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.sync-result .i { margin-top: 1px; }
.sync-result.ok .i { color: var(--success); }
.sync-result.bad .i { color: var(--danger); }

/* Settings */
.settings-layout { display: flex; flex-direction: column; gap: 18px; max-width: 960px; }
.settings-section + .settings-section { margin-top: 18px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { position: relative; padding: 16px; border-radius: 14px; border: 1.5px solid var(--border-strong); cursor: pointer; transition: .2s var(--ease); }
.mode-card input { position: absolute; opacity: 0; }
.mode-card strong { display: block; margin-bottom: 4px; }
.mode-card small { color: var(--muted); font-size: 12.5px; }
.mode-card:has(input:checked) { border-color: var(--pink); background: var(--grad-soft); }
.mode-card:has(input:checked)::after { content: '✓'; position: absolute; top: 12px; right: 14px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; }
.health { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.health li { display: flex; justify-content: space-between; gap: 10px; }
.health .ok { color: var(--success); font-weight: 600; }
.health .bad { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------- auth pages */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; overflow-x: hidden; }
.auth-bg span { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: -1; animation: float 14s ease-in-out infinite; }
.auth-bg span:nth-child(1) { width: 420px; height: 420px; background: #ff6b9d; top: -120px; left: -100px; }
.auth-bg span:nth-child(2) { width: 380px; height: 380px; background: #7b5cff; bottom: -120px; right: -80px; animation-delay: -5s; }
.auth-bg span:nth-child(3) { width: 260px; height: 260px; background: #c058f3; top: 40%; left: 55%; animation-delay: -9s; opacity: .35; }
.auth-card {
    width: min(420px, 100%); padding: 32px; border-radius: 24px;
    background: color-mix(in srgb, var(--surface-solid) 78%, transparent); border: 1px solid var(--border-strong);
    backdrop-filter: blur(24px); box-shadow: var(--shadow-lg); animation: popIn .5s var(--ease);
}
.auth-card--wide { width: min(640px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-brand img { border-radius: 14px; box-shadow: 0 10px 30px -8px rgba(192, 88, 243, .7); }
.auth-brand h1 { font-size: 22px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-foot { text-align: center; color: var(--faint); font-size: 12px; margin: 20px 0 0; }
.check-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.check-list li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.check-list span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.check-list .ok span { background: rgba(52, 211, 153, .18); color: var(--success); }
.check-list .bad span { background: rgba(251, 113, 133, .18); color: var(--danger); }
body.auth-page:not([data-theme]) { color-scheme: dark; }
html:not([data-theme]) .auth-page { /* default to dark tokens on auth pages */ }

/* ------------------------------------------------------------- animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes growUp { from { transform: scaleY(0); } }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes float { 50% { transform: translate(30px, -30px) scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
    .order-layout, .settings-layout { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .size-editor { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
    .grid--2, .grid--2-even { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .5); }
    .main { margin-left: 0; }
    .topbar { padding: 12px 16px; }
    .topbar__menu { display: inline-grid; }
    .search kbd { display: none; }
    .view { padding: 18px 16px; }
    .form-grid, .form-grid--3, .mode-cards, .check-list { grid-template-columns: 1fr; }
    .line-item { grid-template-columns: auto 1fr auto; }
    .line-item > :nth-child(3), .line-item > :nth-child(4) { grid-column: 2; }
    .line-item__total { grid-column: 3; }
    .page-head h1 { font-size: 23px; }
    .kv { grid-template-columns: 110px 1fr; }
    .lightbox__nav { width: 40px; height: 40px; }
    .lightbox__nav--prev { left: 8px; }
    .lightbox__nav--next { right: 8px; }
    .lightbox__top { padding: 10px 14px; }
    .lightbox__dock { padding: 4px 6px; bottom: 14px; gap: 2px; }
    .lightbox__stage.has-strip .lightbox__dock { bottom: 82px; }
    .lightbox__dock-btn { width: 32px; height: 32px; }
    .lightbox__dock-zoom-val { min-width: 46px; font-size: 11.5px; padding: 0 6px; }
}
@media (max-width: 560px) {
    .size-editor { grid-template-columns: repeat(3, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card__body { padding: 10px 12px 12px; }
    .table .hide-sm { display: none; }
}

/* ------------------------------------------------------------- Social Media Chat Parser */
.chat-parser-card {
    position: relative;
    border: 1.5px solid rgba(255, 107, 157, 0.35);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(123, 92, 255, 0.07));
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 10px 30px -15px rgba(255, 107, 157, 0.3);
}
.chat-parser__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.chat-parser__title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-parser__title h2 { font-size: 16px; font-weight: 700; }
.chat-parser__samples {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.chat-parser__samples span { font-size: 12px; color: var(--muted); }
.sample-btn {
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    cursor: pointer;
    color: var(--text);
    transition: .15s;
}
.sample-btn:hover { background: var(--surface-hover); border-color: var(--pink); }

.chat-parser__body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}
@media (max-width: 900px) {
    .chat-parser__body { grid-template-columns: 1fr; }
}
.chat-parser__input {
    width: 100%;
    min-height: 140px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px;
    resize: vertical;
}
.chat-parser__preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.chat-parser__preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12.5px;
}
.chat-parser__preview-item {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.chat-parser__preview-item.full { grid-column: 1 / -1; }
.chat-parser__preview-item small { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 600; }
.chat-parser__preview-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.chat-parser__preview-item.is-empty strong { color: var(--faint); font-weight: 400; font-style: italic; }
.chat-parser__items-detected {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}
.detected-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    font-size: 12px;
}
.detected-pill b { color: var(--success); }

/* ------------------------------------------------------------- Reports */
.date-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}
.date-preset-btn {
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: .15s;
}
.date-preset-btn:hover { color: var(--text); border-color: var(--border-strong); }
.date-preset-btn.active { background: var(--grad); color: #fff; border-color: transparent; }

.report-filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 18px;
}
.report-filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}
.report-filter-bar input[type="date"], .report-filter-bar select {
    height: 38px;
    font-size: 13px;
    width: auto;
    min-width: 140px;
}
.report-filter-bar input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.report-filter-bar input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.report-kpi {
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.report-kpi small { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.report-kpi strong { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-top: 4px; }
.report-kpi .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.channel-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}
.channel-track {
    height: 8px;
    border-radius: 99px;
    background: var(--surface-2);
    overflow: hidden;
}
.channel-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--grad);
}

.reorder-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--warn);
    margin-bottom: 18px;
    font-size: 13.5px;
}
.reorder-banner strong { color: var(--text); }
.reorder-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(251, 113, 133, 0.2);
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
    margin: 2px 4px 2px 0;
}

/* Customer Intelligence & Order History (New Order form live lookup) */
.customer-intel-card {
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 8px 0 16px 0;
    backdrop-filter: blur(12px);
    animation: fadeInSlideDown 0.22s ease-out;
}

[data-theme="dark"] .customer-intel-card {
    background: linear-gradient(135deg, rgba(28, 20, 38, 0.95) 0%, rgba(17, 13, 24, 0.98) 100%);
    border-color: rgba(255, 107, 157, 0.35);
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 107, 157, 0.12);
}

[data-theme="light"] .customer-intel-card {
    background: linear-gradient(135deg, #ffffff 0%, #faf8fc 100%);
    border-color: rgba(255, 107, 157, 0.35);
    box-shadow: 0 10px 30px -8px rgba(40, 20, 70, 0.12), 0 0 15px rgba(255, 107, 157, 0.08);
}

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

.customer-intel__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.customer-intel__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--orchid));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.35);
}

.customer-intel__avatar svg {
    width: 18px;
    height: 18px;
}

.customer-intel__meta {
    flex: 1;
    min-width: 0;
}

.customer-intel__title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.customer-intel__title strong {
    color: var(--text);
    font-weight: 700;
}

.customer-intel__sub {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.customer-intel__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.customer-intel__candidates {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 7px 10px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.candidate-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11.5px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.candidate-pill:hover {
    border-color: var(--pink);
    color: var(--pink);
}

.candidate-pill.active {
    background: rgba(236, 72, 153, 0.16);
    border-color: var(--pink);
    color: var(--pink);
    font-weight: 600;
}

.customer-intel__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.stat-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-pill:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.stat-pill small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}

.stat-pill b {
    font-size: 14.5px;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    color: var(--text);
}

.customer-intel__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.customer-intel__alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

[data-theme="dark"] .customer-intel__alert--danger {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

[data-theme="light"] .customer-intel__alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.customer-intel__alert--danger svg {
    color: var(--danger);
}

[data-theme="dark"] .customer-intel__alert--success {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #86efac;
}

[data-theme="light"] .customer-intel__alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.customer-intel__alert--success svg {
    color: var(--success);
}

[data-theme="dark"] .customer-intel__alert--info {
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

[data-theme="light"] .customer-intel__alert--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.customer-intel__alert--info svg {
    color: var(--info);
}

.customer-intel__history {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.customer-intel__history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text);
    margin-bottom: 8px;
}

.customer-intel__history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.customer-intel__history-list::-webkit-scrollbar {
    width: 5px;
}

.customer-intel__history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.customer-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.customer-history-row:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.chr-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.chr-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chr-date {
    font-size: 11px;
}

.chr-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.chr-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--text);
}

.chr-item-tag b {
    color: var(--pink);
    font-size: 10px;
}

.chr-total {
    text-align: right;
    flex-shrink: 0;
}

@media print {
    .sidebar, .topbar, .page-head__actions, .toolbar, .report-filter-bar, .date-presets, #toasts, .bulkbar {
        display: none !important;
    }
    .main { margin-left: 0 !important; width: 100% !important; }
    body { background: #fff !important; color: #000 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; background: #fff !important; }
    .table th, .table td { border-color: #ddd !important; color: #111 !important; }
    .report-kpi { border: 1px solid #ddd !important; background: #fafafa !important; }
}
