/* ==========================================================================
   Admin console — shell, navigation and dashboard.
   ========================================================================== */

:root { --rail: 264px; --rail-collapsed: 78px; --topbar: 64px; --sidebar-bg: var(--surface); --sidebar-ink: var(--ink-2); --sidebar-muted: var(--ink-3); --sidebar-strong: var(--ink); --sidebar-hover: var(--surface-3); --sidebar-active: var(--brand-soft); --sidebar-active-ink: var(--brand-strong); --sidebar-line: var(--line); }

.admin { min-height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .22s var(--ease); }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-line); color: var(--sidebar-ink); display: flex; flex-direction: column; z-index: 50; overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; height: var(--topbar); padding: 0 18px; flex: none; color: var(--sidebar-strong); }
.sidebar-brand:hover { color: var(--sidebar-strong); }
.sidebar-brand img { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid var(--sidebar-line); padding: 3px; flex: none; }
.sidebar-brand .brand-text { display: grid; line-height: 1.1; min-width: 0; }
.sidebar-brand strong { font-family: var(--font-display); font-size: 1.08rem; letter-spacing: -.01em; }
.sidebar-brand small { color: var(--sidebar-muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-section { margin: 18px 10px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sidebar-muted); white-space: nowrap; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--sidebar-ink); font-weight: 650; font-size: .9rem; white-space: nowrap; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.nav-link .icon { color: var(--sidebar-muted); transition: color .15s; }
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.nav-link:hover .icon { color: var(--sidebar-strong); }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-active-ink); }
.nav-link.active .icon { color: var(--brand); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav-link .nav-count { margin-left: auto; font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--lime); color: #15240b; }
.nav-link .chev { margin-left: auto; width: 15px; height: 15px; transition: transform .2s; }
.nav-group.open > .nav-link .chev { transform: rotate(180deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s var(--ease); }
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub > div { overflow: hidden; }
.nav-sub a { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-left: 21px; padding: 0 12px 0 18px; border-left: 1.5px solid var(--sidebar-line); color: var(--sidebar-muted); font-size: .86rem; font-weight: 650; white-space: nowrap; }
.nav-sub a:hover { color: var(--sidebar-strong); }
.nav-sub a.active { color: var(--sidebar-active-ink); border-left-color: var(--brand); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--sidebar-line); flex: none; }
.sidebar-store { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--sidebar-line); color: var(--sidebar-ink); font-size: .84rem; font-weight: 700; white-space: nowrap; }
.sidebar-store:hover { color: var(--sidebar-strong); background: var(--sidebar-hover); }

/* Collapsed rail (desktop only) */
@media (min-width: 1024px) {
  .rail-collapsed .shell { grid-template-columns: var(--rail-collapsed) minmax(0, 1fr); }
  .rail-collapsed .sidebar .brand-text,
  .rail-collapsed .sidebar .nav-label,
  .rail-collapsed .sidebar .nav-count,
  .rail-collapsed .sidebar .chev,
  .rail-collapsed .sidebar .nav-sub,
  .rail-collapsed .sidebar .store-label { display: none; }
  .rail-collapsed .sidebar .nav-section { font-size: 0; margin: 14px 0 6px; height: 1px; background: var(--sidebar-line); }
  .rail-collapsed .sidebar-brand { padding: 0 22px; }
  .rail-collapsed .nav-link, .rail-collapsed .sidebar-store { justify-content: center; padding: 0; }
  .rail-collapsed .nav-link .icon { width: 20px; height: 20px; }
  .rail-collapsed .nav-link[data-tip]:hover::after { content: attr(data-tip); position: fixed; left: calc(var(--rail-collapsed) - 4px); transform: translateY(0); background: var(--ink); color: var(--paper); padding: 6px 10px; border-radius: 8px; font-size: .8rem; z-index: 100; pointer-events: none; }
}

/* Drawer (tablet & mobile) */
@media (max-width: 1023.98px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-3); }
  .drawer-open .sidebar { transform: none; }
  .drawer-open { overflow: hidden; }
  .scrim { position: fixed; inset: 0; background: rgba(8, 16, 12, .5); z-index: 45; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .drawer-open .scrim { opacity: 1; visibility: visible; }
}
@media (min-width: 1024px) { .scrim, .drawer-close { display: none !important; } }
.drawer-close { margin-left: auto; color: var(--sidebar-ink); }
.drawer-close:hover { color: var(--sidebar-strong); background: var(--sidebar-hover); }

/* ---------- Topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .btn-ghost { color: var(--ink-2); }
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search .input { height: 42px; padding-left: 40px; padding-right: 64px; background: var(--surface); border-radius: 12px; }
.global-search form { position: relative; }
.global-search form > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.global-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 700 .72rem var(--font-ui); color: var(--ink-3); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; background: var(--surface-2); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-3); padding: 6px; max-height: min(70vh, 480px); overflow-y: auto; z-index: 70; }
.search-group-title { padding: 8px 10px 4px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.search-hit { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.search-hit:hover, .search-hit.active { background: var(--surface-3); color: var(--ink); }
.search-hit .icon { color: var(--ink-3); }
.search-hit small { display: block; color: var(--ink-3); font-weight: 600; }
.search-empty { padding: 18px 12px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.search-toggle { display: none !important; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--paper); }
.notif-menu { width: min(380px, calc(100vw - 24px)); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.notif { display: flex; gap: 12px; padding: 10px; border-radius: 10px; color: var(--ink); }
.notif:hover { background: var(--surface-3); color: var(--ink); }
.notif .notif-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.notif.unread strong::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: middle; }
.notif strong { font-size: .88rem; display: block; }
.notif small { color: var(--ink-3); font-weight: 600; }
.notif-foot { padding: 10px; border-top: 1px solid var(--line); text-align: center; }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; border: 0; background: none; cursor: pointer; color: var(--ink); font: inherit; }
.profile-btn:hover { background: var(--surface-3); }
.profile-btn .who { display: grid; text-align: left; line-height: 1.2; }
.profile-btn .who strong { font-size: .86rem; }
.profile-btn .who small { font-size: .74rem; color: var(--ink-3); font-weight: 700; }
@media (max-width: 1023.98px) { .topbar { padding: 0 14px; } }
@media (max-width: 760px) {
  .profile-btn .who, .topbar .hide-sm { display: none; }
  .global-search kbd { display: none; }
  .global-search .input { padding-right: 12px; }
}
@media (max-width: 560px) {
  .topbar { gap: 4px; padding: 0 10px; }
  .global-search.collapsed-sm { flex: 0 0 auto; }
  .global-search.collapsed-sm:not(.expanded) form { display: none; }
  .search-toggle { display: inline-flex !important; }
  .global-search.expanded { position: absolute; left: 8px; right: 8px; top: 11px; max-width: none; z-index: 80; }
}

/* ---------- Page ---------- */
.content { padding: 28px 28px 48px; width: 100%; max-width: 1480px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand); }
.crumbs .icon { width: 14px; height: 14px; }
@media (max-width: 1023.98px) { .content { padding: 22px 18px 40px; } }
@media (max-width: 560px) { .content { padding: 18px 12px 32px; } .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; } }

.layout-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.layout-2.wide-side { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1180px) { .layout-2, .layout-2.wide-side { grid-template-columns: minmax(0, 1fr); } }
.sticky-side { position: sticky; top: calc(var(--topbar) + 20px); }
@media (max-width: 1180px) { .sticky-side { position: static; } }

/* ---------- Toolbar (filters) ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .input-icon { flex: 1 1 240px; max-width: 360px; }
.toolbar .select { width: auto; min-width: 150px; flex: 0 1 auto; }
.toolbar .spacer { flex: 1; }
@media (max-width: 760px) { .toolbar .input-icon { max-width: none; flex-basis: 100%; } .toolbar .select { flex: 1 1 140px; } }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-softer); border-bottom: 1px solid var(--line); flex-wrap: wrap; font-weight: 700; font-size: .88rem; }
.bulkbar.show { display: flex; }

/* ---------- Dashboard ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hello h1 { margin: 0; }
.hello p { margin: 4px 0 0; color: var(--ink-3); }
.range { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.range a { padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: .84rem; color: var(--ink-2); white-space: nowrap; }
.range a:hover { color: var(--ink); }
.range a.active { background: var(--ink); color: var(--paper); }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi-label { font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.kpi-value { font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-foot { margin-top: 8px; font-size: .8rem; color: var(--ink-3); font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; padding: 1px 6px 1px 4px; border-radius: 6px; }
.delta .icon { width: 14px; height: 14px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--ink-3); background: var(--surface-3); }
.kpi.feature { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.kpi.feature .kpi-label, .kpi.feature .kpi-foot { color: color-mix(in srgb, var(--brand-ink) 80%, transparent); }
.kpi.feature .kpi-icon { background: rgba(255,255,255,.14); color: var(--lime); }
.kpi.feature .delta.up { background: rgba(255,255,255,.16); color: #d8f08a; }
.kpi.feature .delta.down { background: rgba(255,255,255,.16); color: #ffc2b5; }
:root[data-theme="dark"] .kpi.feature .kpi-icon { background: rgba(0,0,0,.14); color: #0b2018; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.feature .kpi-icon { background: rgba(0,0,0,.14); color: #0b2018; } }

.dash-grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; }
@media (max-width: 1180px) { .span-8, .span-4, .span-5, .span-7 { grid-column: span 12; } .span-6 { grid-column: span 6; } }
@media (max-width: 860px) { .span-6 { grid-column: span 12; } }

/* Chart */
.chart { position: relative; height: 280px; margin: 0 -4px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font: 600 11px var(--font-ui); }
.chart .area { fill: url(#areaFill); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .marker { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); padding: 8px 11px; border-radius: 10px; font-size: .8rem; font-weight: 600; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow-2); opacity: 0; transition: opacity .1s; z-index: 5; }
.chart-tip strong { display: block; font-size: .95rem; font-variant-numeric: tabular-nums; }
.chart-summary { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-summary div { display: grid; }
.chart-summary span { font-size: .78rem; color: var(--ink-3); font-weight: 700; }
.chart-summary strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
details.data-table summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--ink-3); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.data-table summary::-webkit-details-marker { display: none; }
details.data-table[open] summary { margin-bottom: 10px; }
details.data-table .table-wrap { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* Horizontal bar list */
.hbars { display: grid; gap: 14px; }
.hbar-row { display: grid; gap: 6px; }
.hbar-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; font-weight: 700; }
.hbar-meta span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hbar-track { height: 10px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; background: var(--brand); min-width: 2px; }

/* Status board */
.status-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.status-tile { padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; color: var(--ink); }
.status-tile:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.status-tile strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .status-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
@media (max-width: 560px) { .list > li { padding: 12px 16px; } }
.feed-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.feed-icon .icon { width: 16px; height: 16px; }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: var(--surface-3); color: var(--ink-2); flex: none; }

.attention { display: grid; gap: 10px; }
.attention a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .9rem; }
.attention a:hover { border-color: var(--line-strong); color: var(--ink); }
.attention a .grow small { display: block; font-weight: 600; color: var(--ink-3); font-size: .8rem; }
.attention .count { font-family: var(--font-display); font-size: 1.25rem; font-weight: 650; }

/* ---------- Product form ---------- */
.variant-table td { padding: 8px; vertical-align: top; }
.variant-table th { padding: 8px; }
.variant-table .input { min-width: 90px; }
@media (max-width: 760px) {
  .variant-table thead { display: none; }
  .variant-table, .variant-table tbody, .variant-table tr { display: block; }
  .variant-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
  .variant-table td { display: grid; gap: 4px; padding: 0; border: 0; }
  .variant-table td::before { content: attr(data-label); font-size: .74rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
  .variant-table td.v-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .variant-table td.v-actions::before { display: none; }
}
.spec-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }
@media (max-width: 480px) { .spec-row { grid-template-columns: 1fr auto; } .spec-row .input:first-child { grid-column: 1 / -1; } }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.image-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.image-tile img { width: 100%; height: 100%; object-fit: contain; }
.image-tile .primary-tag { position: absolute; left: 6px; bottom: 6px; font-size: .66rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--ink); color: var(--paper); }
.image-tile button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(15, 25, 20, .7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.image-tile button:hover { background: var(--bad); }
.image-tile.removed { opacity: .35; }
.image-tile.removed button { background: var(--brand); }
.dropzone { display: grid; place-items: center; gap: 6px; text-align: center; aspect-ratio: 1; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-3); cursor: pointer; font-size: .78rem; font-weight: 700; padding: 8px; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-softer); color: var(--brand); }
.savebar { position: sticky; bottom: 0; z-index: 30; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; margin-top: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-2); flex-wrap: wrap; }
.savebar .dirty-note { margin-right: auto; align-self: center; font-size: .84rem; font-weight: 700; color: var(--warn); display: none; }
.savebar.dirty .dirty-note { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 560px) { .savebar .btn { flex: 1; } .savebar .dirty-note { width: 100%; } }

/* Settings nav */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--topbar) + 20px); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.settings-nav a:hover { background: var(--surface); color: var(--ink); }
.settings-nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .settings-nav a { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
}
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-yes { color: var(--ok); display: inline-grid; }
.perm-no { color: var(--ink-3); opacity: .5; display: inline-grid; }

/* Auth (admin) */
.auth-split { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; background: #0f1d17; color: #e6efe9; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -160px; border-radius: 120px; transform: rotate(45deg); border: 56px solid rgba(180, 207, 44, .12); }
.auth-art::after { content: ""; position: absolute; width: 260px; height: 260px; right: 60px; bottom: 80px; border-radius: 60px; transform: rotate(45deg); background: linear-gradient(135deg, rgba(180,207,44,.25), rgba(23,97,74,.4)); }
.auth-art h1 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); max-width: 14ch; position: relative; z-index: 1; }
.auth-art p { color: #a8bbb0; max-width: 40ch; position: relative; z-index: 1; }
.auth-art .brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; position: relative; z-index: 1; }
.auth-art .brand img { width: 42px; height: 42px; background: #fff; border-radius: 10px; padding: 4px; }
.auth-panel { display: grid; place-items: center; padding: 40px 20px; background: var(--paper); }
.auth-box { width: min(400px, 100%); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-3); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-strong); }
.btn-google { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: var(--line-strong); gap: 10px; }
.btn-google:hover { --btn-bg: var(--surface-3); }
.demo-creds { margin-top: 20px; padding: 14px; border-radius: var(--radius); border: 1px dashed var(--line-strong); font-size: .84rem; }
.demo-creds button { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px; box-sizing: border-box; }
.demo-creds button:hover, .demo-creds button:focus-visible { background: var(--surface-3); }
@media (max-width: 900px) { .auth-split { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* Invoice */
.invoice { max-width: 860px; margin: 0 auto; background: #fff; color: #111; padding: 48px; }
.invoice table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.invoice th, .invoice td { padding: 10px 8px; border-bottom: 1px solid #e5e5e5; text-align: left; }
.invoice .r { text-align: right; }
@media print { .invoice { padding: 0; } }
#drawer-btn { display: none; }
@media (max-width: 1023.98px) { #drawer-btn { display: inline-flex; } #rail-btn { display: none; } }
