/* ============================================================
   Store-Panel admin stylesheet
   Dark editorial design with brass accents.
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
    color-scheme: dark;

    /* Surfaces */
    --bg:        #0a0a0c;
    --surface:   #131318;
    --surface-2: #181820;
    --surface-3: #1f1f28;
    --panel:     var(--surface);
    --panel-2:   var(--surface-2);

    /* Borders */
    --border:        #26262e;
    --border-strong: #34343d;

    /* Text */
    --text:       #f3f3f5;
    --text-muted: #a1a1aa;
    --muted:      #71717a;
    --muted-2:    #a1a1aa;

    /* Brand */
    --gold:       #d4af37;
    --gold-soft:  rgba(212, 175, 55, 0.10);
    --gold-line:  rgba(212, 175, 55, 0.25);
    --accent:     var(--gold);

    /* Status */
    --danger:        #f87171;
    --danger-soft:   rgba(248, 113, 113, 0.10);
    --danger-line:   rgba(248, 113, 113, 0.22);
    --success:       #86efac;
    --success-soft:  rgba(134, 239, 172, 0.10);
    --success-line:  rgba(134, 239, 172, 0.22);
    --warning:       #fbbf24;
    --warning-soft:  rgba(251, 191, 36, 0.10);
    --warning-line:  rgba(251, 191, 36, 0.22);
    --info:          #60a5fa;
    --info-soft:     rgba(96, 165, 250, 0.10);
    --info-line:     rgba(96, 165, 250, 0.22);
    --violet:        #c084fc;
    --violet-soft:   rgba(192, 132, 252, 0.10);

    /* Typography */
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Layout */
    --sidebar-w:    240px;
    --topbar-h:     56px;
    --radius-sm:    6px;
    --radius:       8px;
    --radius-md:    10px;
    --radius-lg:    12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
    --shadow:    0 4px 14px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}
::selection { background: var(--gold); color: #111; }

/* ── Shell ──────────────────────────────────────────────────── */
.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 30;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    height: var(--topbar-h);
}
.brand-mark {
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: #111;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 1px 2px rgba(0,0,0,.2);
}
.brand-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .01em;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.nav-section {
    padding: 14px 10px 6px;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.nav-section:first-child { padding-top: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: background .12s ease, color .12s ease;
    border: 1px solid transparent;
    background: transparent;
}
.nav-item:hover {
    background: rgba(255,255,255,.04);
    color: var(--text);
}
.nav-active {
    background: var(--gold-soft);
    color: var(--text);
    border-color: var(--gold-line);
}
.nav-active .nav-icon { color: var(--gold); opacity: 1; }
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .75;
}
.nav-divider { display: none; }

.sidebar-footer {
    padding: 10px 10px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}
.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-store {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.sidebar-user-role {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
}
.nav-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    transition: background .12s, color .12s;
    text-align: left;
}
.nav-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ── Main + Topbar ──────────────────────────────────────────── */
.main {
    min-width: 0;
    padding: 28px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: -28px -28px 28px;
    padding: 0 24px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    background: rgba(19, 19, 24, .85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-left  { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-mobile-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    color: var(--text-muted);
}
.topbar-mobile-toggle:hover { color: var(--text); }

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--muted); opacity: .6; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ── Page header ────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header-action { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}
.page-copy {
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 6px;
    max-width: 680px;
    font-size: 14px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.card + .card { margin-top: 16px; }
.card[id] { scroll-margin-top: calc(var(--topbar-h) + 80px); }
.card-heading {
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 14px;
}
.card-title { font-size: 16px; font-weight: 600; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    transition: border-color .15s ease, transform .15s ease;
    display: flex;
    flex-direction: column;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-label {
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-top: 6px;
}
.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}
.stat-link {
    display: inline-block;
    font-size: 12px;
    color: var(--gold);
    margin-top: 10px;
    font-weight: 500;
}
.stat-link:hover { text-decoration: underline; }

/* ── Grids ──────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.split { display: grid; gap: 20px; grid-template-columns: minmax(0,1fr) minmax(300px,360px); }

/* ── Buttons ────────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    white-space: nowrap;
    line-height: 1.4;
}
.button:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
}
.button.primary {
    background: var(--gold);
    color: #111;
    border-color: var(--gold);
    font-weight: 600;
}
.button.primary:hover {
    background: #c19f30;
    border-color: #c19f30;
}
.button.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-line);
}
.button.danger:hover {
    background: rgba(248,113,113,.18);
}
.button.ghost {
    background: transparent;
    border-color: transparent;
}
.button.ghost:hover { background: rgba(255,255,255,.05); }
.button.sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.button[disabled],
.button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.form-input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.form-input::placeholder { color: var(--muted); opacity: .8; }
.form-input:hover { border-color: var(--border-strong); }
.form-input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px var(--gold-soft);
}
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                      linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-hint { font-size: 12px; color: var(--muted); }

/* ── Data tables ────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    background: rgba(255,255,255,.015);
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr {
    transition: background .12s ease;
}
.data-table tbody tr:hover { background: var(--gold-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr.row-link { cursor: pointer; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ── Status pills ───────────────────────────────────────────── */
.status-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
    border: 1px solid transparent;
}
.status-pending,
.payment-pending {
    background: rgba(161,161,170,.12);
    color: var(--text-muted);
    border-color: rgba(161,161,170,.20);
}
.status-paid,
.payment-paid,
.status-delivered,
.status-published,
.status-active {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success-line);
}
.status-processing {
    background: var(--info-soft);
    color: var(--info);
    border-color: var(--info-line);
}
.status-shipped {
    background: var(--violet-soft);
    color: var(--violet);
    border-color: rgba(192,132,252,.22);
}
.status-cancelled,
.payment-failed {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-line);
}
.status-refunded,
.payment-refunded,
.payment-partially_refunded {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: var(--warning-line);
}
.status-draft,
.status-inactive {
    background: rgba(161,161,170,.10);
    color: var(--text-muted);
    border-color: rgba(161,161,170,.18);
}

/* ── Pill badge ─────────────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--gold-line);
    color: var(--gold);
    background: var(--gold-soft);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── Lists ──────────────────────────────────────────────────── */
.list { display: grid; gap: 10px; }
.list-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: var(--surface-2);
}
.stack { display: grid; gap: 4px; }

/* ── Flash messages ─────────────────────────────────────────── */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.flash-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}
.flash-success {
    background: var(--success-soft);
    border: 1px solid var(--success-line);
    color: var(--success);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
.flash-error {
    background: var(--danger-soft);
    border: 1px solid var(--danger-line);
    color: var(--danger);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
.flash-info {
    background: var(--info-soft);
    border: 1px solid var(--info-line);
    color: var(--info);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
.flash-warning {
    background: var(--warning-soft);
    border: 1px solid var(--warning-line);
    color: var(--warning);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
/* Component variant: <div class="flash flash-*"> includes the icon and inherits the box. */
.flash.flash-success,
.flash.flash-error,
.flash.flash-info,
.flash.flash-warning { padding: 12px 14px; }
.flash-error ul { margin: 4px 0 0 18px; }

/* ── Section nav (in-page anchors) ──────────────────────────── */
.section-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    position: sticky;
    top: calc(var(--topbar-h) + 4px);
    z-index: 10;
    backdrop-filter: blur(6px);
}
.section-nav a {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: background .12s, color .12s;
}
.section-nav a:hover { background: var(--surface-2); color: var(--text); }
.section-nav a:target,
.section-nav a:focus { background: var(--gold-soft); color: var(--gold); }

/* ── Color swatch (settings) ────────────────────────────────── */
.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    flex-shrink: 0;
    background-image: linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%),
                      linear-gradient(-45deg, rgba(255,255,255,.04) 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, rgba(255,255,255,.04) 75%),
                      linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.04) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

/* ── Logo preview ───────────────────────────────────────────── */
.logo-preview {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}
.logo-preview img { max-height: 80px; max-width: 100%; object-fit: contain; }

/* ── Settings save bar ──────────────────────────────────────── */
.settings-save-bar {
    position: sticky;
    bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow);
    z-index: 5;
}

/* ── Customer avatar ────────────────────────────────────────── */
.customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.customer-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 20px;
}

/* ── Image grid (catalog images) ────────────────────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.image-tile {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.image-tile-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--surface-3) center/cover no-repeat;
    border-bottom: 1px solid var(--border);
}
.image-tile-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    opacity: .6;
}
.image-tile-meta {
    padding: 14px;
    display: flex;
    flex-direction: column;
}
.image-grid-sortable .image-tile { cursor: grab; }
.image-grid-sortable .image-tile:active { cursor: grabbing; }
.image-grid-sortable .image-tile.is-dragging { opacity: .45; outline: 2px dashed var(--gold); }

/* ── Empty state ────────────────────────────────────────────── */
.empty {
    padding: 40px 20px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.015);
}
.empty-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    color: var(--muted);
    opacity: .8;
}
.empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.empty-copy {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 360px;
    margin: 0 auto 14px;
    line-height: 1.6;
}

/* ── Impersonation banner ──────────────────────────────────── */
.impersonation-banner {
    background: linear-gradient(180deg, var(--warning-soft) 0%, transparent 100%);
    border-bottom: 1px solid var(--warning-line);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--warning);
    font-size: 13px;
    margin: -28px -28px 0;
}
.impersonation-banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}
.impersonation-banner-text strong { color: var(--text); }
.impersonation-banner-meta { opacity: .8; font-size: 12px; margin-left: 4px; }
.impersonation-banner form { margin: 0; }
.impersonation-banner button {
    background: var(--warning);
    color: #1f1700;
    border: 0;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .12s;
}
.impersonation-banner button:hover { background: #f1ad12; }
@media (max-width: 980px) {
    .impersonation-banner { margin: -28px -16px 0; padding: 10px 16px; }
}

/* ── Onboarding checklist ─────────────────────────────────── */
.onboarding-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}
.onboarding-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.onboarding-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, #e8cb8c 100%);
    transition: width .4s ease;
}
.onboarding-progress-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}
.onboarding-list { display: grid; gap: 10px; margin-top: 16px; }
.onboarding-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: border-color .12s;
}
.onboarding-item.complete {
    background: rgba(134, 239, 172, 0.04);
    border-color: var(--success-line);
    opacity: .7;
}
.onboarding-item-check {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1.5px solid var(--border-strong);
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background .12s, border-color .12s, color .12s;
}
.onboarding-item.complete .onboarding-item-check {
    background: var(--success);
    border-color: var(--success);
    color: #0b2010;
}
.onboarding-item-body { flex: 1; min-width: 0; }
.onboarding-item-label { font-size: 14px; font-weight: 600; color: var(--text); }
.onboarding-item.complete .onboarding-item-label { text-decoration: line-through; color: var(--text-muted); }
.onboarding-item-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.onboarding-item-action { flex-shrink: 0; }

/* ── Auth shell ─────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at top, rgba(212,175,55,.08), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(96,165,250,.04), transparent 70%),
        var(--bg);
}
.auth-card {
    width: min(100%, 440px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.auth-eyebrow {
    font-size: 11px;
    color: var(--gold);
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 600;
}
.auth-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
}
.auth-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 22px;
}
.auth-form {
    display: grid;
    gap: 14px;
}
.auth-submit {
    justify-content: center;
    padding: 11px 16px;
    margin-top: 4px;
}
.auth-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-footer a { color: var(--text-muted); }
.auth-footer a:hover { color: var(--text); }

/* ── User menu (topbar dropdown) ────────────────────────────── */
.user-menu { position: relative; }
.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    transition: border-color .12s, background .12s;
}
.user-menu-button:hover { background: var(--surface-2); border-color: var(--border-strong); }
.user-menu-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}
.user-menu-name { line-height: 1.2; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 50;
}
.user-menu[data-open="true"] .user-menu-panel { display: block; }
.user-menu-meta {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.user-menu-meta-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-menu-meta-email { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    text-align: left;
    transition: background .1s, color .1s;
}
.user-menu-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: var(--danger-soft); }

/* ── Misc ───────────────────────────────────────────────────── */
.muted   { color: var(--text-muted); }
.muted-2 { color: var(--muted); }
.mono    { font-family: var(--font-mono); }
.avatar-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.note-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--surface-2);
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.metric { font-size: 32px; font-weight: 700; margin: 8px 0 0; }

/* ── Utility classes ────────────────────────────────────────── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: .08em; }

.w-full { width: 100%; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid.cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: var(--shadow);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 25;
    }
    .topbar-mobile-toggle { display: inline-flex; }
    .topbar { margin: -28px -16px 24px; padding: 0 16px; }
    .main { padding: 24px 16px; }
    .split,
    .form-grid { grid-template-columns: 1fr; }
    .grid.cols-3,
    .grid.cols-2 { grid-template-columns: 1fr; }
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .grid.cols-4 { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
}

/* Range switch on the platform dashboard */
.range-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
}
.range-switch-option {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    border-right: 1px solid var(--border);
    transition: background .15s, color .15s;
}
.range-switch-option:last-child { border-right: none; }
.range-switch-option:hover { color: var(--text); background: var(--surface); }
.range-switch-option.is-active {
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 600;
}

/* Inline SVG sparkline in per-store rollup */
.sparkline { color: var(--gold); display: block; }

/* Recently impersonated widget */
.recent-impersonated {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.recent-impersonated-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.recent-impersonated-info { min-width: 0; overflow: hidden; }
.recent-impersonated-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Platform broadcast banner on admin panels */
.platform-broadcast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
    margin: -28px -28px 16px;
}
.platform-broadcast-info {
    background: var(--info-soft);
    color: var(--info);
    border-bottom-color: var(--info-line);
}
.platform-broadcast-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-bottom-color: var(--warning-line);
}
.platform-broadcast-critical {
    background: var(--danger-soft);
    color: var(--danger);
    border-bottom-color: var(--danger-line);
    font-weight: 600;
}

/* Per-row health dot (store health page) */
.health-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.health-dot-ok {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success-line);
}
.health-dot-fail {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-line);
}

