/* Taste of Stellenbosch — design tokens and components.
   TOKEN NAMING CONTRACT (from the brand pack, design-tokens.json v1): exactly 21 colour tokens, identical
   names in both themes, switched at runtime by [data-theme="dark"] on an ancestor (here: <html>).
   On-* pairing rule: text on a brand fill uses its on-* partner — on-simonsberg on simonsberg and
   simonsberg-deep; on-golden-hour on golden-hour; on-scrim on scrim and on photography darkened with it.
   Theme-invariant tokens (same value in Daylight and After dark): scrim, on-scrim, on-golden-hour.
   Dark mode is first-class: brand hues invert direction (simonsberg #2c4a5e -> #8fb2c7).
   ACCESSIBILITY INTENT: line-strong reaches 3:1 on every surface and is the border of inputs, chips and
   outline buttons. line is decorative only and is never the only boundary of a control. Status colours
   always travel with a word or an icon. Photography gets the scrim at 55%+ over its lower part so names read.
   Focus: 2px ring in --focus with 2px offset on every interactive element. */

:root {
  /* Daylight */
  --surface: #f4f3ee;
  --surface-raised: #ffffff;
  --surface-sunken: #e9e7df;
  --ink: #18232b;
  --ink-muted: #56626a;
  --line: #d5d2c8;
  --line-strong: #8c948f;
  --simonsberg: #2c4a5e;
  --simonsberg-deep: #1c3242;
  --on-simonsberg: #ffffff;
  --fynbos: #5e6b45;
  --sandstone: #d8c3a5;
  --golden-hour: #b8862f;
  --on-golden-hour: #18232b;
  --protea: #8e3b46;
  --success: #2f6d5c;
  --warning: #8a5a00;
  --danger: #a8381f;
  --scrim: #1c3242;
  --on-scrim: #ffffff;
  --focus: #1c3242;

  --shadow-card: 0 1px 2px rgba(24,35,43,0.06), 0 4px 16px rgba(24,35,43,0.06);

  /* Type families (Bodoni Moda / Hanken Grotesk / DM Mono with the brand pack's fallback stacks) */
  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --font-sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing: 7 steps */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  /* Radius: 4 steps */
  --radius-sm: 2px; --radius-md: 6px; --radius-lg: 14px; --radius-pill: 999px;
  --maxw: 1180px;
  color-scheme: light;
}

[data-theme="dark"] {
  /* After dark */
  --surface: #12181d;
  --surface-raised: #1b232a;
  --surface-sunken: #0d1216;
  --ink: #eeece6;
  --ink-muted: #a9b1b6;
  --line: #2c3740;
  --line-strong: #5d6b75;
  --simonsberg: #8fb2c7;
  --simonsberg-deep: #c3d7e3;
  --on-simonsberg: #0d1216;
  --fynbos: #a7b58a;
  --sandstone: #6b5a45;
  --golden-hour: #d9a84e;
  --on-golden-hour: #18232b;
  --protea: #d88a93;
  --success: #7cc4ae;
  --warning: #e0b25a;
  --danger: #f08c74;
  --scrim: #1c3242;
  --on-scrim: #ffffff;
  --focus: #e0b25a;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 24px; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--simonsberg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface-raised); color: var(--ink); padding: var(--space-3); z-index: 100; }
.skip:focus { left: var(--space-4); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Type scale (10 named styles) */
.display-xl { font-family: var(--font-display); font-size: clamp(40px, 7vw, 56px); line-height: 1.07; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.display-l { font-family: var(--font-display); font-size: clamp(30px, 5vw, 40px); line-height: 1.1; font-weight: 500; margin: 0; }
.heading { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 500; margin: 0; }
.heading-s { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 500; font-style: italic; margin: 0; }
.title { font-size: 18px; line-height: 24px; font-weight: 600; margin: 0; }
.body { font-size: 16px; line-height: 24px; }
.body-s, .muted { font-size: 14px; line-height: 20px; }
.muted { color: var(--ink-muted); }
.label { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.data, .money { font-family: var(--font-mono); font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; }
.hero-title { font-family: var(--font-display); font-size: clamp(3rem, 8vw, 4.75rem); line-height: 1.02; font-weight: 500; letter-spacing: -0.015em; margin: 0; }

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-4); }
.section { padding: var(--space-12) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.grid { display: grid; gap: var(--space-6); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: var(--space-3); align-items: center; flex-wrap: wrap; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface-raised); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-card); }
.topbar .wrap { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--ink); font-family: var(--font-display); font-size: 20px; font-weight: 500; }
.brand img { height: 36px; width: auto; }
[data-theme="dark"] .topbar .brand img { background: #f4f3ee; border-radius: var(--radius-md); padding: 2px 6px; }
.nav { display: flex; gap: var(--space-1); margin-left: auto; align-items: center; }
.nav a, .nav button.navbtn { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav a:hover, .nav button.navbtn:hover { background: var(--surface-sunken); }
.nav a[aria-current="page"] { color: var(--simonsberg); box-shadow: inset 0 -2px 0 var(--simonsberg); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--golden-hour); color: var(--on-golden-hour); font-size: 12px; font-weight: 700; }
@media (max-width: 760px) {
  .nav .navtext { display: none; }
  .brand span { display: none; }
  .tabbar { display: flex !important; }
  body.has-tabbar { padding-bottom: 72px; }
}
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--surface-raised); border-top: 1px solid var(--line-strong); justify-content: space-around; padding: var(--space-1) 0 calc(var(--space-1) + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; min-height: 52px; justify-content: center; color: var(--ink-muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--simonsberg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font: 600 15px/20px var(--font-sans); letter-spacing: 0.01em; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--simonsberg); color: var(--on-simonsberg); }
.btn-primary:hover { background: var(--simonsberg-deep); }
.btn-accent { background: var(--golden-hour); color: var(--on-golden-hour); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-sunken); }
.btn-ghost { background: transparent; color: var(--simonsberg); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); cursor: pointer; }

/* Chips */
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); font: 600 14px/20px var(--font-sans); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--simonsberg); color: var(--on-simonsberg); border-color: var(--simonsberg); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid currentColor; background: var(--surface-raised); }
.badge-featured { color: var(--protea); }
.badge-ok { color: var(--success); }
.badge-wait { color: var(--warning); }
.badge-bad { color: var(--danger); }
.badge-info { color: var(--simonsberg); }

/* Cards */
.card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }
.card-body { padding: var(--space-4); }
.farm-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); height: 100%; }
.farm-card .media { position: relative; aspect-ratio: 16/10; background: var(--sandstone); }
.farm-card .media img { width: 100%; height: 100%; object-fit: cover; }
.farm-card .media .name { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-3) var(--space-4); background-color: rgba(28,50,66,.88); color: var(--on-scrim); }
.farm-card .media .name .label { color: var(--on-scrim); }
.farm-card .card-body { flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }
.farm-card:hover { box-shadow: 0 6px 24px rgba(24,35,43,.14); }
.price-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-top: auto; }

/* Hero */
.hero { position: relative; background-color: var(--scrim); background-image: linear-gradient(180deg, rgba(28,50,66,.55) 0%, rgba(28,50,66,.78) 70%, rgba(28,50,66,.94) 100%), url('/assets/stock-1.webp'); background-size: cover; background-position: center; color: var(--on-scrim); }
.hero .wrap { padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(40px, 8vw, 96px); }
.hero p { max-width: 620px; font-size: 18px; line-height: 28px; color: var(--on-scrim); }
.hero .label { color: var(--on-scrim); }
.hero .btn-outline { color: var(--on-scrim); border-color: var(--on-scrim); }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); }
.trust { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-top: var(--space-8); font-size: 14px; }
.trust span { display: inline-flex; gap: var(--space-2); align-items: center; color: var(--on-scrim); }

/* Map */
.map-shell { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 900px) { .map-shell { grid-template-columns: 1fr; } }
.map { position: relative; aspect-ratio: 1 / 1; max-height: 640px; width: 100%; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-sunken); }
.map svg.terrain { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px 4px 6px; border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-card); font: 600 12px/16px var(--font-sans); cursor: pointer; white-space: nowrap; max-width: 46%; }
.pin::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--simonsberg); flex: none; }
.pin.featured::before { background: var(--golden-hour); box-shadow: 0 0 0 3px rgba(184,134,47,.35); }
.pin.dim { background: var(--surface-sunken); color: var(--ink-muted); box-shadow: none; border-style: dashed; }
.pin.dim::before { background: var(--line-strong); box-shadow: none; }
.pin[aria-pressed="true"] { background: var(--simonsberg); color: var(--on-simonsberg); border-color: var(--simonsberg); }
.pin .pin-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .pin .pin-name { display: none; } .pin { padding: 4px; min-height: 28px; min-width: 28px; } }
.map-legend { position: absolute; left: var(--space-3); bottom: var(--space-3); background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: 12px; box-shadow: var(--shadow-card); display: flex; gap: var(--space-3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.sheet { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.list-row { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); text-decoration: none; color: var(--ink); min-height: 64px; }
.list-row:hover { background: var(--surface-sunken); }
.thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: var(--sandstone); flex: none; }

/* Farm page */
.farm-hero { position: relative; min-height: 440px; display: flex; align-items: flex-end; background-color: var(--scrim); background-size: cover; background-position: center; color: var(--on-scrim); }
.farm-hero .wrap { width: 100%; padding-top: 120px; padding-bottom: var(--space-12); }
.farm-hero .label, .farm-hero p { color: var(--on-scrim); }
.farm-hero.premium .display-xl { font-style: italic; }
.farm-page.premium .section-mark { border-top: 3px solid var(--golden-hour); }
.subnav { position: sticky; top: 64px; z-index: 30; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: var(--space-1); overflow-x: auto; }
.subnav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--space-3); color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.wine { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: start; padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.wine-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 8px; border: 1px solid var(--line-strong); }
.style-red { background: var(--protea); } .style-white { background: #e7d9a8; } .style-rose { background: #e7a9a9; } .style-sparkling { background: var(--golden-hour); } .style-dessert { background: #b97a2a; }
.exp-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); height: 100%; }
.exp-card .spread .money { font-size: 15px; }
.actionbar { position: sticky; bottom: 0; z-index: 35; background: var(--surface-raised); border-top: 1px solid var(--line-strong); box-shadow: var(--shadow-card); }
.actionbar .wrap { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; min-height: 72px; flex-wrap: wrap; padding-top: var(--space-2); padding-bottom: var(--space-2); }
body.has-tabbar .actionbar { bottom: 0; }
@media (max-width: 760px) { body.has-tabbar .actionbar { bottom: 64px; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field label, .fieldset legend { font-weight: 600; font-size: 14px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); font: 16px/24px var(--font-sans); }
textarea.input { min-height: 120px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; min-height: 0; }
.err:empty { display: none; }
.hint { color: var(--ink-muted); font-size: 14px; }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.summary { border: 1px solid var(--danger); color: var(--danger); background: var(--surface-raised); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.summary:empty { display: none; }
.fieldset { border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); cursor: pointer; font-size: 14px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--simonsberg); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
.slot { min-height: 56px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); cursor: pointer; font: 600 15px/20px var(--font-sans); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slot small { font-weight: 400; font-size: 12px; color: var(--ink-muted); }
.slot[aria-pressed="true"] { background: var(--simonsberg); color: var(--on-simonsberg); border-color: var(--simonsberg); }
.slot[aria-pressed="true"] small { color: var(--on-simonsberg); }
.slot[disabled] { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.stepper { display: inline-flex; align-items: center; gap: var(--space-2); }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-size: 20px; }

/* Cart & delivery */
.code-box { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-6); background: var(--scrim); color: var(--on-scrim); border-radius: var(--radius-lg); text-align: center; }
.code-box .code { font-family: var(--font-mono); font-size: clamp(32px, 9vw, 48px); letter-spacing: .12em; font-weight: 500; }
.code-box p { color: var(--on-scrim); margin: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); align-items: baseline; }
.totals .grand { font-size: 20px; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--space-6) var(--space-8); }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 24px; bottom: 0; width: 2px; background: var(--line-strong); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface-raised); display: grid; place-items: center; }
.timeline li.done .tl-dot { background: var(--success); border-color: var(--success); color: var(--surface-raised); }
.timeline li.now .tl-dot { border-color: var(--golden-hour); box-shadow: 0 0 0 4px rgba(184,134,47,.25); }
.timeline .tl-dot .icon { width: 12px; height: 12px; stroke-width: 3; }
.addr-list { list-style: none; margin: var(--space-1) 0 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); overflow: hidden; }
.addr-list button { width: 100%; text-align: left; padding: var(--space-3); min-height: 44px; background: none; border: 0; color: var(--ink); font: 15px/20px var(--font-sans); cursor: pointer; }
.addr-list li + li { border-top: 1px solid var(--line); }
.addr-list button:hover, .addr-list button:focus-visible { background: var(--surface-sunken); }

/* States */
.skeleton { background: linear-gradient(90deg, var(--surface-sunken), var(--line), var(--surface-sunken)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-md); min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { scroll-behavior: auto !important; transition: none !important; } }
.state { text-align: center; padding: var(--space-8) var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
.state p { margin: 0 0 var(--space-4); }

/* Toast */
.toast-host { position: fixed; z-index: 90; left: 50%; bottom: 88px; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-2); width: min(92vw, 440px); }
.toast { background: var(--ink); color: var(--surface); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); box-shadow: var(--shadow-card); font-size: 15px; display: flex; gap: var(--space-2); align-items: center; }
.toast.error { background: var(--danger); color: #ffffff; }
[data-theme="dark"] .toast.error { color: #12181d; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { position: sticky; top: 0; background: var(--surface-sunken); color: var(--ink); text-align: left; font-weight: 700; padding: var(--space-3); white-space: nowrap; }
table.t th button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; min-height: 32px; }
table.t td { padding: var(--space-3); border-top: 1px solid var(--line); vertical-align: top; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-tools { display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: var(--space-3); }
.pager { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; padding: var(--space-3); }

/* Footer */
.footer { background: var(--simonsberg-deep); color: var(--on-simonsberg); padding: var(--space-12) 0 var(--space-8); margin-top: var(--space-12); }
.footer a { color: var(--on-simonsberg); }
.footer .muted, .footer p { color: var(--on-simonsberg); }
.footer-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer h2 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 var(--space-3); }
.footer ul { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 28px; }

/* Admin shell */
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--simonsberg-deep); color: var(--on-simonsberg); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: var(--on-simonsberg); margin-bottom: var(--space-4); }
.sidebar a { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--on-simonsberg); text-decoration: none; font-weight: 600; font-size: 15px; }
.sidebar a:hover { background: rgba(255,255,255,.08); }
[data-theme="dark"] .sidebar a:hover { background: rgba(0,0,0,.08); }
.sidebar a[aria-current="page"] { background: var(--surface-raised); color: var(--ink); }
.sidebar .side-label { color: var(--on-simonsberg); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin: var(--space-4) 0 var(--space-1); opacity: 1; }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 30; display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; min-height: 64px; padding: 0 var(--space-6); background: var(--surface-raised); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-content { padding: var(--space-6); max-width: 1280px; }
.kpis { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: var(--space-6); }
.kpi { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-card); }
.kpi .v { font-family: var(--font-display); font-size: 32px; line-height: 40px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart { width: 100%; height: 220px; }
.chart .bar { fill: var(--simonsberg); }
.chart .bar2 { fill: var(--golden-hour); }
.chart text { fill: var(--ink-muted); font-size: 11px; font-family: var(--font-sans); }
.chart line { stroke: var(--line); }
.panel { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-6); box-shadow: var(--shadow-card); }
.panel + .panel { margin-top: var(--space-6); }
dialog { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--ink); padding: var(--space-6); width: min(92vw, 560px); }
dialog::backdrop { background: rgba(28,50,66,.55); }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .2s; z-index: 60; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .admin-content { padding: var(--space-4); }
  .admin-top { padding: 0 var(--space-4); }
}
.signin { min-height: 100vh; display: grid; place-items: center; padding: var(--space-4); background-color: var(--scrim); background-image: linear-gradient(rgba(28,50,66,.82), rgba(28,50,66,.9)), url('/assets/stock-5.webp'); background-size: cover; background-position: center; }
.signin .panel { width: min(100%, 440px); }
