/* =====================================================================
   VisionPoint Online Order System - Design System
   Owner: UX Designer / Frontend Developer 2   (see docs/04-ux-design-system.md)
   No build step. Tokens first, then base, then components, then layouts.
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
    /* brand */
    --brand-50:  #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-contrast: #ffffff;

    /* accent - used for optical / prescription context */
    --accent-50:  #ecfeff;
    --accent-500: #06b6d4;
    --accent-600: #0891b2;
    --accent-700: #0e7490;

    /* status */
    --success-50:  #f0fdf4;  --success-500: #22c55e;  --success-600: #16a34a;  --success-700: #15803d;
    --warning-50:  #fffbeb;  --warning-500: #f59e0b;  --warning-600: #d97706;  --warning-700: #b45309;
    --danger-50:   #fef2f2;  --danger-500:  #ef4444;  --danger-600:  #dc2626;  --danger-700:  #b91c1c;
    --info-50:     #f0f9ff;  --info-500:    #0ea5e9;  --info-600:    #0284c7;  --info-700:    #0369a1;

    /* surfaces */
    --bg:          #f1f5f9;
    --surface:     #ffffff;
    --surface-2:   #f8fafc;
    --surface-3:   #f1f5f9;
    --border:      #e2e8f0;
    --border-strong: #cbd5e1;

    /* text */
    --text:        #0f172a;
    --text-muted:  #475569;
    --text-subtle: #94a3b8;
    --text-inverse:#ffffff;

    /* radius */
    --r-sm: 6px;
    --r:    10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 999px;

    /* shadow */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow:    0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12), 0 4px 8px rgba(15, 23, 42, .06);

    /* spacing scale (4px) */
    --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
    --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;

    /* type */
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px;
    --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 25px; --fs-3xl: 31px;

    --sidebar-w: 248px;
    --topbar-h: 62px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:          #0b1120;
        --surface:     #111a2e;
        --surface-2:   #16213a;
        --surface-3:   #1c2942;
        --border:      #22304d;
        --border-strong: #33415c;
        --text:        #e8eefc;
        --text-muted:  #a3b2cc;
        --text-subtle: #6b7c9c;
        --brand-50:    #17233f;
        --brand-100:   #1c2c4f;
        --success-50:  #0d2418;
        --warning-50:  #2a1e08;
        --danger-50:   #2a1113;
        --info-50:     #0a1f2e;
        --accent-50:   #0a2028;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
        --shadow:    0 1px 3px rgba(0, 0, 0, .4);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    }
}

:root[data-theme="dark"] {
    --bg:          #0b1120;
    --surface:     #111a2e;
    --surface-2:   #16213a;
    --surface-3:   #1c2942;
    --border:      #22304d;
    --border-strong: #33415c;
    --text:        #e8eefc;
    --text-muted:  #a3b2cc;
    --text-subtle: #6b7c9c;
    --brand-50:    #17233f;
    --brand-100:   #1c2c4f;
    --success-50:  #0d2418;
    --warning-50:  #2a1e08;
    --danger-50:   #2a1113;
    --info-50:     #0a1f2e;
    --accent-50:   #0a2028;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow:    0 1px 3px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0 0 var(--s3); line-height: 1.25; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p  { margin: 0 0 var(--s3); }

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }

small { font-size: var(--fs-xs); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }

:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

img { max-width: 100%; height: auto; display: block; }

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

/* utility */
.muted   { color: var(--text-muted); }
.subtle  { color: var(--text-subtle); }
.tnum    { font-variant-numeric: tabular-nums; }
.mono    { font-family: var(--mono); font-size: .93em; }
.nowrap  { white-space: nowrap; }
.right   { text-align: right; }
.center  { text-align: center; }
.strong  { font-weight: 650; }
.up      { text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-xs); }
.hide    { display: none !important; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt2 { margin-top: var(--s2); } .mt3 { margin-top: var(--s3); } .mt4 { margin-top: var(--s4); }
.mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); }
.mb2 { margin-bottom: var(--s2); } .mb3 { margin-bottom: var(--s3); } .mb4 { margin-bottom: var(--s4); }
.mb5 { margin-bottom: var(--s5); } .mb6 { margin-bottom: var(--s6); }
.gap2 { gap: var(--s2); } .gap3 { gap: var(--s3); } .gap4 { gap: var(--s4); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.flex-center { display: flex; align-items: center; gap: var(--s2); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--brand-600); color: #fff; padding: var(--s3) var(--s4); border-radius: 0 0 var(--r) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font: inherit; font-weight: 560; font-size: var(--fs-base);
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--brand-600); color: var(--brand-contrast); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); color: #fff; }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-success { background: var(--success-600); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success-700); color: #fff; }

.btn-danger { background: var(--danger-600); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-700); color: #fff; }

.btn-outline-danger { background: transparent; color: var(--danger-600); border-color: var(--danger-500); }
.btn-outline-danger:hover:not(:disabled) { background: var(--danger-50); color: var(--danger-700); }

.btn-sm { padding: 6px 11px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { padding: 12px 22px; font-size: var(--fs-md); border-radius: var(--r); }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

.btn-group { display: inline-flex; gap: var(--s2); flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--s5); }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-md); }
.card-body { padding: var(--s5); }
.card-body.tight { padding: var(--s4); }
.card-body.flush { padding: 0; }
.card-foot {
    padding: var(--s4) var(--s5);
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card-accent { border-top: 3px solid var(--brand-600); }

/* ------------------------------------------------------------ stat tiles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--s4);
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s4) var(--s5);
    box-shadow: var(--shadow-sm);
    display: block;
    position: relative;
    overflow: hidden;
    transition: box-shadow .15s, transform .1s, border-color .15s;
}
a.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; border-color: var(--border-strong); }
.stat-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); font-weight: 600; }
.stat-value { font-size: var(--fs-2xl); font-weight: 680; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-value.sm { font-size: var(--fs-xl); }
.stat-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.stat-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-600); }
.stat-bar.warning { background: var(--warning-500); }
.stat-bar.danger  { background: var(--danger-500); }
.stat-bar.success { background: var(--success-500); }
.stat-bar.accent  { background: var(--accent-500); }

/* ---------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs); font-weight: 620; line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-neutral { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.badge-brand   { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }
.badge-info    { background: var(--info-50); color: var(--info-700); border-color: color-mix(in srgb, var(--info-500) 30%, transparent); }
.badge-accent  { background: var(--accent-50); color: var(--accent-700); border-color: color-mix(in srgb, var(--accent-500) 30%, transparent); }
.badge-success { background: var(--success-50); color: var(--success-700); border-color: color-mix(in srgb, var(--success-500) 30%, transparent); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); border-color: color-mix(in srgb, var(--warning-500) 32%, transparent); }
.badge-danger  { background: var(--danger-50); color: var(--danger-700); border-color: color-mix(in srgb, var(--danger-500) 30%, transparent); }
.badge-danger-soft { background: transparent; color: var(--danger-600); border-color: var(--danger-500); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-lg { padding: 5px 12px; font-size: var(--fs-sm); }

.pill-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: var(--r-full);
    background: var(--danger-600); color: #fff;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pill-count.quiet { background: var(--surface-3); color: var(--text-muted); }

/* ----------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s4); }
.col-12 { grid-column: span 12; } .col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }   .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }   .col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

.field { display: block; margin-bottom: var(--s4); }
.field:last-child { margin-bottom: 0; }
.field > label, .label {
    display: block; margin-bottom: 6px;
    font-size: var(--fs-sm); font-weight: 580; color: var(--text);
}
.field .req { color: var(--danger-600); margin-left: 2px; }
.field-hint { display: block; margin-top: 5px; font-size: var(--fs-xs); color: var(--text-subtle); }
.field-error { display: block; margin-top: 5px; font-size: var(--fs-xs); color: var(--danger-600); font-weight: 550; }

.input, .select, .textarea {
    width: 100%;
    padding: 9px 12px;
    font: inherit; font-size: var(--fs-base);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    appearance: none;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 18%, transparent);
}
.input:disabled, .select:disabled, .textarea:disabled,
.input[readonly] { background: var(--surface-3); color: var(--text-muted); cursor: not-allowed; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger-500); }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }

.select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 34px;
}

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r) 0 0 var(--r); }
.input-group .addon {
    display: flex; align-items: center; padding: 0 12px;
    background: var(--surface-3); border: 1px solid var(--border-strong); border-left: 0;
    border-radius: 0 var(--r) var(--r) 0;
    font-size: var(--fs-sm); color: var(--text-muted); font-weight: 560;
}
.input-group.prefix .addon { border-left: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r) 0 0 var(--r); }
.input-group.prefix .input { border-radius: 0 var(--r) var(--r) 0; }

.check {
    display: flex; align-items: flex-start; gap: var(--s2);
    font-size: var(--fs-base); cursor: pointer; user-select: none;
}
.check input[type="checkbox"], .check input[type="radio"] {
    width: 17px; height: 17px; margin: 2px 0 0; flex-shrink: 0;
    accent-color: var(--brand-600); cursor: pointer;
}
.check-card {
    border: 1px solid var(--border-strong); border-radius: var(--r);
    padding: var(--s3) var(--s4); background: var(--surface);
    transition: border-color .15s, background-color .15s;
}
.check-card:hover { border-color: var(--brand-500); }
.check-card:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }

.file-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
    padding: var(--s6) var(--s4);
    border: 2px dashed var(--border-strong);
    border-radius: var(--r);
    background: var(--surface-2);
    text-align: center; cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--brand-600); background: var(--brand-50); }
.file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop .file-name { font-weight: 600; color: var(--brand-700); word-break: break-all; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-base);
}
.table th, .table td { padding: 11px var(--s4); text-align: left; vertical-align: middle; }
.table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--surface-2);
    font-size: var(--fs-xs); font-weight: 640; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-subtle);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-flagged { background: var(--danger-50); }
.table tbody tr.is-flagged:hover { background: color-mix(in srgb, var(--danger-50) 70%, var(--surface)); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .cell-main { font-weight: 580; color: var(--text); }
.table .cell-sub { display: block; font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 1px; }
.table-compact th, .table-compact td { padding: 8px var(--s3); }
.table tfoot td { padding: 11px var(--s4); border-top: 2px solid var(--border-strong); font-weight: 620; }

/* Responsive card-stack for narrow screens */
@media (max-width: 720px) {
    .table.responsive thead { display: none; }
    .table.responsive tbody tr {
        display: block; padding: var(--s3) 0;
        border-bottom: 1px solid var(--border);
    }
    .table.responsive tbody td {
        display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3);
        padding: 5px var(--s4); text-align: right;
    }
    .table.responsive tbody td::before {
        content: attr(data-label);
        font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
        color: var(--text-subtle); font-weight: 620; text-align: left; flex-shrink: 0;
    }
    .table.responsive tbody td:empty { display: none; }
}

/* ----------------------------------------------------------------- alert */
.alert {
    display: flex; align-items: flex-start; gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-radius: var(--r);
    border: 1px solid transparent;
    font-size: var(--fs-base);
    margin-bottom: var(--s4);
}
.alert:last-child { margin-bottom: 0; }
.alert-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.alert-body { flex: 1; min-width: 0; }
.alert strong { display: block; margin-bottom: 2px; }
.alert-success { background: var(--success-50); color: var(--success-700); border-color: color-mix(in srgb, var(--success-500) 30%, transparent); }
.alert-error, .alert-danger { background: var(--danger-50); color: var(--danger-700); border-color: color-mix(in srgb, var(--danger-500) 30%, transparent); }
.alert-warning { background: var(--warning-50); color: var(--warning-700); border-color: color-mix(in srgb, var(--warning-500) 32%, transparent); }
.alert-info { background: var(--info-50); color: var(--info-700); border-color: color-mix(in srgb, var(--info-500) 30%, transparent); }

/* --------------------------------------------------------------- toasts */
.toast-stack {
    position: fixed; top: var(--s4); right: var(--s4); z-index: 120;
    display: flex; flex-direction: column; gap: var(--s2);
    max-width: min(400px, calc(100vw - 32px));
}
.toast {
    display: flex; align-items: flex-start; gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-600);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease-out;
}
.toast.success { border-left-color: var(--success-600); }
.toast.error   { border-left-color: var(--danger-600); }
.toast.warning { border-left-color: var(--warning-600); }
.toast.info    { border-left-color: var(--info-600); }
.toast-close {
    background: none; border: 0; cursor: pointer; padding: 0 2px;
    color: var(--text-subtle); font-size: 18px; line-height: 1;
}
.toast-close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 var(--s5); position: relative; }
.timeline::before {
    content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
    width: 2px; background: var(--border);
}
.timeline li { position: relative; padding: 0 0 var(--s5) var(--s4); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -22px; top: 5px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--border-strong);
}
.timeline li.done::before   { border-color: var(--success-600); background: var(--success-600); }
.timeline li.current::before{ border-color: var(--brand-600); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-600) 18%, transparent); }
.timeline li.alert::before  { border-color: var(--danger-600); background: var(--danger-600); }
.timeline-title { font-weight: 600; font-size: var(--fs-base); }
.timeline-meta  { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 1px; }
.timeline-note  { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 5px; }

/* Horizontal tracking stepper */
.tracker { display: flex; gap: 0; margin: var(--s4) 0 var(--s6); overflow-x: auto; padding-bottom: var(--s2); }
.tracker-step { flex: 1 0 auto; min-width: 108px; text-align: center; position: relative; padding-top: 30px; }
.tracker-step::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 16px; height: 16px;
    margin-left: -8px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--border-strong); z-index: 1;
}
.tracker-step::after {
    content: ""; position: absolute; top: 15px; left: 50%; right: -50%; height: 2px;
    background: var(--border);
}
.tracker-step:last-child::after { display: none; }
.tracker-step.done::before { background: var(--success-600); border-color: var(--success-600); }
.tracker-step.done::after  { background: var(--success-600); }
.tracker-step.current::before { border-color: var(--brand-600); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-600) 20%, transparent); }
.tracker-step.cancelled::before { background: var(--danger-600); border-color: var(--danger-600); }
.tracker-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-subtle); padding: 0 4px; }
.tracker-step.done .tracker-label, .tracker-step.current .tracker-label { color: var(--text); }
.tracker-date { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

/* --------------------------------------------------------- credit meter */
.credit-meter { margin-top: var(--s3); }
.meter {
    height: 8px; border-radius: var(--r-full);
    background: var(--surface-3); overflow: hidden;
}
.meter > span {
    display: block; height: 100%; border-radius: var(--r-full);
    background: var(--success-600);
    transition: width .4s ease;
}
.meter.warn > span   { background: var(--warning-500); }
.meter.danger > span { background: var(--danger-600); }
.meter-legend {
    display: flex; justify-content: space-between; gap: var(--s3);
    font-size: var(--fs-xs); color: var(--text-muted); margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.credit-chip {
    display: inline-flex; align-items: center; gap: var(--s2);
    padding: 5px 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.credit-chip .amount { font-weight: 650; color: var(--success-700); }
.credit-chip.low .amount { color: var(--warning-700); }
.credit-chip.over .amount { color: var(--danger-600); }

/* ---------------------------------------------------------------- modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 130;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: var(--s6) var(--s4);
    overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 540px;
    margin: auto;
    animation: modal-in .2s ease-out;
}
.modal.wide { max-width: 820px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: var(--fs-md); }
.modal-body { padding: var(--s5); }
.modal-foot {
    display: flex; justify-content: flex-end; gap: var(--s2);
    padding: var(--s4) var(--s5); border-top: 1px solid var(--border);
    background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-subtle); padding: 0 4px; }
.modal-close:hover { color: var(--text); }

/* ---------------------------------------------------------- empty state */
.empty {
    text-align: center;
    padding: var(--s8) var(--s5);
    color: var(--text-muted);
}
.empty-icon {
    width: 52px; height: 52px; margin: 0 auto var(--s4);
    border-radius: var(--r-lg);
    background: var(--surface-3);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-subtle);
}
.empty h3 { margin-bottom: var(--s2); color: var(--text); font-size: var(--fs-md); }
.empty p { margin-bottom: var(--s4); font-size: var(--fs-sm); }

/* ---------------------------------------------------------- pagination */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s3); flex-wrap: wrap;
    padding: var(--s4) var(--s5);
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm); color: var(--text-muted);
}
.pagination .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span.page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 9px;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--surface); color: var(--text-muted);
    font-size: var(--fs-sm); font-weight: 560; text-decoration: none;
}
.pagination a:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.pagination .current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .disabled { opacity: .45; pointer-events: none; }
.pagination .ellipsis { border: 0; background: none; }

/* -------------------------------------------------------------- filters */
.filter-bar {
    display: flex; gap: var(--s3); flex-wrap: wrap; align-items: flex-end;
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.filter-bar .field { margin: 0; min-width: 150px; flex: 0 1 auto; }
.filter-bar .field.grow { flex: 1 1 220px; }
.filter-bar label { font-size: var(--fs-xs); color: var(--text-subtle); }

.chip-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: var(--r-full);
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: var(--fs-sm); font-weight: 550; color: var(--text-muted);
    text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); text-decoration: none; background: var(--brand-50); }
.chip.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.chip.active:hover { background: var(--brand-700); color: #fff; }

/* ------------------------------------------------------------- products */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--s4);
}
.product-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: box-shadow .15s, transform .1s, border-color .15s;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.product-thumb {
    aspect-ratio: 4 / 3;
    background: var(--surface-3);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-subtle);
    overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; flex: 1; gap: 4px; }
.product-name {
    font-weight: 600; font-size: var(--fs-base); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-name a { color: var(--text); }
.product-name a:hover { color: var(--brand-600); }
.product-attrs { font-size: var(--fs-xs); color: var(--text-subtle); line-height: 1.4; }
.product-price { margin-top: auto; padding-top: var(--s2); display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.product-price .now { font-size: var(--fs-lg); font-weight: 680; font-variant-numeric: tabular-nums; }
.product-price .was { font-size: var(--fs-xs); color: var(--text-subtle); text-decoration: line-through; }
.product-price .unit { font-size: var(--fs-xs); color: var(--text-subtle); }
.stock-ok   { color: var(--success-700); font-size: var(--fs-xs); font-weight: 560; }
.stock-low  { color: var(--warning-700); font-size: var(--fs-xs); font-weight: 560; }
.stock-out  { color: var(--danger-600); font-size: var(--fs-xs); font-weight: 560; }

/* -------------------------------------------------------------- RX group */
.rx-group {
    border: 1px solid var(--accent-500);
    background: var(--accent-50);
    border-radius: var(--r);
    padding: var(--s4);
}
.rx-group legend, .rx-title {
    font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--accent-700); padding: 0 6px;
}
.rx-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: var(--s3); }
.rx-fields .field { margin: 0; }
.rx-fields label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-700); }
.rx-fields .input, .rx-fields .select { padding: 7px 9px; font-size: var(--fs-sm); text-align: center; font-variant-numeric: tabular-nums; }
.rx-summary {
    display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
    font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
    color: var(--accent-700); background: var(--accent-50);
    border: 1px solid color-mix(in srgb, var(--accent-500) 30%, transparent);
    border-radius: var(--r-sm); padding: 2px 8px; margin-top: 4px;
}

/* --------------------------------------------------------- qty stepper */
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.qty button {
    width: 32px; border: 0; background: var(--surface-2); color: var(--text-muted);
    font-size: 16px; line-height: 1; cursor: pointer; font-weight: 600;
}
.qty button:hover { background: var(--surface-3); color: var(--text); }
.qty input {
    width: 52px; border: 0; text-align: center; font: inherit; font-variant-numeric: tabular-nums;
    background: var(--surface); color: var(--text); padding: 7px 2px;
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.qty input:focus { outline: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-600) 30%, transparent); }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input[type=number] { -moz-appearance: textfield; }

/* ------------------------------------------------------- summary blocks */
.summary-row {
    display: flex; justify-content: space-between; gap: var(--s3);
    padding: 7px 0; font-size: var(--fs-base);
}
.summary-row .label { color: var(--text-muted); }
.summary-row .value { font-variant-numeric: tabular-nums; font-weight: 560; }
.summary-row.total {
    border-top: 2px solid var(--border-strong); margin-top: var(--s2); padding-top: var(--s3);
    font-size: var(--fs-lg); font-weight: 680;
}
.summary-row.total .value { font-weight: 700; }
.summary-row.balance .value { color: var(--danger-600); font-weight: 680; }
.summary-row.paid .value { color: var(--success-700); }
.summary-row.pending .value { color: var(--text-subtle); font-style: italic; font-weight: 500; }

.kv { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 7px var(--s4); font-size: var(--fs-sm); }
.kv dt { color: var(--text-subtle); }
.kv dd { margin: 0; color: var(--text); font-weight: 550; }

/* ------------------------------------------------------------ auth page */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--bg);
}
.auth-visual {
    display: none;
    background: linear-gradient(150deg, var(--brand-700), var(--brand-600) 45%, var(--accent-600));
    color: #fff;
    padding: var(--s8);
    flex-direction: column; justify-content: space-between;
}
.auth-visual h2 { color: #fff; font-size: var(--fs-3xl); max-width: 15ch; }
.auth-visual p { color: rgba(255,255,255,.85); max-width: 42ch; }
.auth-feature { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
.auth-feature-icon {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--r);
    background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center;
}
.auth-panel {
    display: flex; align-items: center; justify-content: center;
    padding: var(--s6) var(--s4);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s6); }
.auth-logo .mark {
    width: 42px; height: 42px; border-radius: var(--r);
    background: var(--brand-600); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.auth-logo .name { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.02em; }
.auth-logo .sub { font-size: var(--fs-xs); color: var(--text-subtle); }
.auth-switch { text-align: center; margin-top: var(--s5); font-size: var(--fs-sm); color: var(--text-muted); }

@media (min-width: 900px) {
    .auth-wrap { grid-template-columns: 1.05fr 1fr; }
    .auth-visual { display: flex; }
}

/* ------------------------------------------------------ customer layout */
.topbar {
    position: sticky; top: 0; z-index: 60;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
}
.topbar-inner {
    width: 100%; max-width: 1240px; margin: 0 auto;
    padding: 0 var(--s5);
    display: flex; align-items: center; gap: var(--s5);
}
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand .mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--brand-600); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand .name { font-weight: 690; color: var(--text); letter-spacing: -.02em; font-size: var(--fs-md); }
.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a {
    padding: 8px 13px; border-radius: var(--r);
    color: var(--text-muted); font-weight: 550; font-size: var(--fs-base);
    text-decoration: none; white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a.active { background: var(--brand-50); color: var(--brand-700); }
.topbar-actions { display: flex; align-items: center; gap: var(--s3); margin-left: auto; }

.cart-link { position: relative; display: flex; align-items: center; gap: var(--s2); padding: 8px 13px; border-radius: var(--r); color: var(--text-muted); font-weight: 560; }
.cart-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.cart-link .pill-count { position: absolute; top: 1px; right: 3px; }

.avatar-menu { position: relative; }
.avatar-btn {
    display: flex; align-items: center; gap: var(--s2);
    padding: 5px 9px 5px 5px; border-radius: var(--r-full);
    background: var(--surface-2); border: 1px solid var(--border);
    cursor: pointer; font: inherit; color: var(--text);
}
.avatar-btn:hover { background: var(--surface-3); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand-600); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-xs); font-weight: 700; flex-shrink: 0;
}
.avatar.lg { width: 44px; height: 44px; font-size: var(--fs-md); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
    min-width: 216px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); box-shadow: var(--shadow-lg);
    padding: 6px;
}
.dropdown[hidden] { display: none; }
.dropdown-head { padding: var(--s3); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: var(--s3);
    width: 100%; padding: 8px 11px; border: 0; border-radius: var(--r-sm);
    background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-muted);
    text-align: left; cursor: pointer; text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.dropdown .danger { color: var(--danger-600); }
.dropdown .danger:hover { background: var(--danger-50); color: var(--danger-700); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--text-muted); border-radius: var(--r-sm); }
.nav-toggle:hover { background: var(--surface-2); }

.page { max-width: 1240px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s8); }
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5);
}
.page-head h1 { margin: 0 0 3px; }
.page-head .sub { color: var(--text-muted); font-size: var(--fs-base); margin: 0; }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--text-subtle); margin-bottom: var(--s3); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--border-strong); }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .main-nav {
        position: fixed; inset: var(--topbar-h) 0 auto 0; z-index: 59;
        flex-direction: column; gap: 0;
        background: var(--surface); border-bottom: 1px solid var(--border);
        padding: var(--s3); box-shadow: var(--shadow-lg);
    }
    .main-nav[hidden] { display: none; }
    .main-nav a { padding: 11px 14px; }
    .topbar-inner { gap: var(--s3); padding: 0 var(--s4); }
    .brand .name { display: none; }
}

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

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
    z-index: 55;
}
.sidebar-brand {
    display: flex; align-items: center; gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-600); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-brand .name { font-weight: 690; color: var(--text); font-size: var(--fs-base); line-height: 1.2; }
.sidebar-brand .role { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .06em; }

.sidebar-nav { padding: var(--s4) var(--s3); flex: 1; }
.nav-group { margin-bottom: var(--s5); }
.nav-group-title {
    font-size: 11px; font-weight: 660; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-subtle); padding: 0 var(--s3) var(--s2);
}
.sidebar-nav a {
    display: flex; align-items: center; gap: var(--s3);
    padding: 9px var(--s3); margin-bottom: 2px;
    border-radius: var(--r);
    color: var(--text-muted); font-size: var(--fs-base); font-weight: 550;
    text-decoration: none;
}
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar-nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.sidebar-nav a .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a .pill-count { margin-left: auto; }
.sidebar-foot { padding: var(--s3); border-top: 1px solid var(--border); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    height: var(--topbar-h); flex-shrink: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: var(--s4);
    padding: 0 var(--s5);
    position: sticky; top: 0; z-index: 50;
}
.admin-search { flex: 1; max-width: 420px; }
.admin-content { padding: var(--s6) var(--s5) var(--s8); flex: 1; }
.sidebar-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--text-muted); border-radius: var(--r-sm); }
.sidebar-toggle:hover { background: var(--surface-2); }
.sidebar-scrim { display: none; }

@media (max-width: 1080px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .sidebar-toggle { display: block; }
    .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 54; }
    .sidebar-scrim[hidden] { display: none; }
    .admin-content { padding: var(--s5) var(--s4) var(--s7); }
    .admin-topbar { padding: 0 var(--s4); }
}

/* ----------------------------------------------------------- two-column */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.split-side { position: sticky; top: calc(var(--topbar-h) + var(--s5)); }
@media (max-width: 980px) {
    .split { grid-template-columns: 1fr; }
    .split-side { position: static; order: -1; }
}

/* --------------------------------------------------------- line editor */
.line-editor { width: 100%; border-collapse: collapse; }
.line-editor th {
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-subtle); text-align: left; padding: 0 var(--s2) var(--s2); font-weight: 640;
}
.line-editor td { padding: var(--s2); vertical-align: top; border-top: 1px solid var(--border); }
.line-editor .input, .line-editor .select { padding: 7px 9px; font-size: var(--fs-sm); }
.line-row-rx td { border-top: 0; padding-top: 0; }

.picker-results {
    position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 4px);
    max-height: 320px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r); box-shadow: var(--shadow-lg);
}
.picker-results[hidden] { display: none; }
.picker-item {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    padding: var(--s3) var(--s4); cursor: pointer; border-bottom: 1px solid var(--border);
}
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover, .picker-item.active { background: var(--brand-50); }
.picker-empty { padding: var(--s4); color: var(--text-subtle); text-align: center; font-size: var(--fs-sm); }

/* ----------------------------------------------------------------- misc */
.divider-label {
    display: flex; align-items: center; gap: var(--s3);
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-subtle); font-weight: 640; margin: var(--s5) 0 var(--s3);
}
.divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.bank-box {
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--r);
    padding: var(--s4);
}
.copy-btn {
    background: none; border: 0; cursor: pointer; padding: 2px 5px;
    color: var(--brand-600); font-size: var(--fs-xs); font-weight: 600; border-radius: var(--r-sm);
}
.copy-btn:hover { background: var(--brand-100); }

.thumb-sm { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.thumb-md { width: 64px; height: 64px; border-radius: var(--r); object-fit: cover; background: var(--surface-3); flex-shrink: 0; }

.spinner {
    width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
    animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; opacity: .8; }

/* ---------------------------------------------------------------- print */
@media print {
    .no-print, .topbar, .sidebar, .admin-topbar, .toast-stack, .page-actions, .pagination { display: none !important; }
    body { background: #fff; color: #000; }
    .page, .admin-content { padding: 0; max-width: none; }
    .card { border: 0; box-shadow: none; }
}
