/* ============================================================================
   Goose design system
   See plan/05-design-system.md

   Structure, spacing, and geometry adapted from the monday.com design language
   (styles.refero.design). Brand colour is Honda red, not Monday violet — this
   is a Heather Cannon Honda tool.

   That reference documents a MARKETING site. Its palette, spacing, radii, and
   soft-shadow treatment transfer well; its 64px display type, hero gradients,
   and pastel feature panels do not. Goose is dense tables and forms.

   Semantic tokens only. Components reference --surface, --text-primary,
   --hairline — never a literal like --grey-333. Only the VALUES swap per
   theme; get this wrong and every component needs a per-theme special case.
   ========================================================================== */

/* ── fonts (self-hosted, latin subset) ───────────────────────────────────── */

@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap;
  src: url('../fonts/poppins-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/poppins-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/poppins-700.woff2') format('woff2');
}
/* Inter ships as a variable font — one file covers 100–900. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-var.woff2') format('woff2');
}

/* ── tokens: light (default) ─────────────────────────────────────────────── */

:root {
  /* Brand — Honda red. Does not flip between themes. */
  --brand:            #CC0000;
  --brand-hover:      #A80000;
  --brand-soft:       #FDECEC;   /* tinted surface for brand emphasis */
  --brand-text:       #B00000;   /* red text on light; #CC0000 is marginal at small sizes */
  --on-brand:         #FFFFFF;

  /* Surfaces — monday's "white workshop": cloud canvas, snow cards */
  --canvas:           #F5F6F8;
  --surface:          #FFFFFF;
  --surface-raised:   #F5F6F8;
  --surface-sunken:   #EDEFF3;
  --surface-overlay:  #FFFFFF;
  --hairline:         #D0D4E4;
  --hairline-soft:    #E6E7EA;

  /* Text */
  --text-primary:     #333333;
  --text-secondary:   #535768;
  --text-muted:       #808080;
  --text-inverse:     #FFFFFF;

  /* Semantic — the reference defines none, so these are ours. Functional,
     never brand: small scale, paired with an icon and a word, never a
     full-bleed field competing with the primary action. */
  --success:          #1F7A4D;
  --warning:          #9A6700;
  --danger:           #D93025;   /* deliberately warmer than Honda red */
  --info:             #2563C9;
  --success-bg:       #E8F6EE;
  --warning-bg:       #FDF3DC;
  --danger-bg:        #FDECEA;
  --info-bg:          #E9F0FC;

  /* Pastel washes — category and status surfaces only. Never on text,
     borders, or icons. */
  --wash-mint:        #DFF7E6;
  --wash-sky:         #DFF3FB;
  --wash-lavender:    #EDDFF7;
  --wash-periwinkle:  #E7ECFF;
  --wash-aqua:        #D1FAFF;
  --wash-peony:       #FCE7F8;

  --focus-ring:       #2563C9;

  /* Geometry — two tiers, per the reference: 24px surfaces, 6px controls.
     The pill is for page-level actions only; a pill in a table row reads as
     a lozenge and wastes horizontal space. */
  --r-control: 6px;
  --r-input:   6px;
  --r-card:    16px;
  --r-panel:   24px;
  --r-pill:    999px;

  /* Spacing — 8px base */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Type — Poppins for headings and chrome, Inter for data.
     Inter carries the tables because it has true tabular figures; columns of
     prices must align. */
  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --row-height: 52px;

  /* One soft, wide, tinted shadow — the reference is explicit that heavy
     drop shadows are wrong. */
  --shadow-card:  0 2px 24px rgba(205, 208, 223, .38);
  --shadow-float: 0 4px 40px rgba(0, 0, 0, .12);
}

/* ── tokens: dark ────────────────────────────────────────────────────────── */

:root[data-theme="dark"] {
  --brand-soft:       #2A1416;
  --brand-text:       #FF6B6B;

  --canvas:           #14161A;
  --surface:          #1C1F24;
  --surface-raised:   #24282F;
  --surface-sunken:   #101216;
  --surface-overlay:  #24282F;
  --hairline:         #313640;
  --hairline-soft:    #262B33;

  --text-primary:     #F2F4F7;
  --text-secondary:   #A6ADBA;
  --text-muted:       #6E7681;
  --text-inverse:     #14161A;

  --success:          #3FB950;
  --warning:          #D29922;
  --danger:           #F85149;
  --info:             #58A6FF;
  --success-bg:       rgba(63,185,80,.14);
  --warning-bg:       rgba(210,153,34,.14);
  --danger-bg:        rgba(248,81,73,.14);
  --info-bg:          rgba(88,166,255,.14);

  --wash-mint:        rgba(63,185,80,.13);
  --wash-sky:         rgba(88,166,255,.13);
  --wash-lavender:    rgba(163,113,247,.13);
  --wash-periwinkle:  rgba(110,118,255,.13);
  --wash-aqua:        rgba(57,197,214,.13);
  --wash-peony:       rgba(219,119,205,.13);

  --focus-ring:       #58A6FF;

  --shadow-card:  0 2px 24px rgba(0, 0, 0, .32);
  --shadow-float: 0 4px 40px rgba(0, 0, 0, .5);
}

/* ── base ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font: 400 15px/1.55 var(--font-ui);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;   /* columns of numbers must align */
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, samp, .mono, .vin { font-family: var(--font-mono); font-size: 13px; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

/* Display type is Poppins with the reference's negative tracking — that
   tightening is most of its character. Weight 300 is display-only. */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-primary);
}
h1 { font-size: 32px; font-weight: 600; line-height: 1.2;  letter-spacing: -.03em; }
h2 { font-size: 22px; font-weight: 600; line-height: 1.3;  letter-spacing: -.02em; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }

.label {
  font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted);
}
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }

/* ── app shell ───────────────────────────────────────────────────────────── */

.app { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  display: flex; align-items: center; gap: var(--s-6);
  padding: 0 var(--s-6);
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 20;
}

.brand {
  display: flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-display);
  font-weight: 600; font-size: 17px; letter-spacing: -.02em;
  color: var(--text-primary); text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 11px; height: 11px; border-radius: var(--r-pill);
  background: var(--brand); flex: none;
}
.brand-sub {
  color: var(--text-muted); font-family: var(--font-ui);
  font-weight: 400; font-size: 13px; letter-spacing: 0;
  padding-left: var(--s-3); border-left: 1px solid var(--hairline);
  margin-left: var(--s-2);
}

.cats { display: flex; align-items: center; gap: var(--s-1); flex: 1; min-width: 0; }

.cat {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  font-weight: 500; font-size: 14px;
  text-decoration: none; white-space: nowrap;
}
.cat:hover { background: var(--surface-raised); color: var(--text-primary); text-decoration: none; }
.cat[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: var(--s-3); }
.who { color: var(--text-secondary); font-size: 14px; white-space: nowrap; }

/* ── layout ──────────────────────────────────────────────────────────────── */

.body { display: flex; flex: 1; min-height: 0; }

.sidebar {
  width: 240px; flex: none;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  padding: var(--s-6) var(--s-4);
}
.sidebar-title {
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 var(--s-3) var(--s-4);
}
.side-link {
  display: block;
  padding: var(--s-3) var(--s-4);
  margin-bottom: 2px;
  border-radius: var(--r-control);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
}
.side-link:hover { background: var(--surface-raised); color: var(--text-primary); text-decoration: none; }
.side-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

.main { flex: 1; min-width: 0; padding: var(--s-8) var(--s-10); max-width: 1600px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-4); margin-bottom: var(--s-8);
}
.page-head p { margin: var(--s-2) 0 0; color: var(--text-secondary); font-size: 15px; }

/* ── surfaces ────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: var(--s-6);
  box-shadow: var(--shadow-card);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-5);
}
.module-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-panel);
  padding: var(--s-6);
  color: inherit; text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
  border-color: var(--brand);
  text-decoration: none;
}
.module-card h3 { margin-bottom: var(--s-2); }
.module-card p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.module-card .label { margin-bottom: var(--s-3); }

/* ── controls ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  min-height: 42px;
  border: 1px solid transparent;
  /* Pill for page-level actions — the reference's signature. Table-level
     controls override this with .btn-sm. */
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; }

/* Fill = primary action. Outline = destructive. Shape carries the meaning,
   which is what keeps Honda red and error red apart. */
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--hairline);
}
.btn-secondary:hover { background: var(--surface-raised); border-color: var(--text-muted); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }

/* Compact, square-ish variant for table rows and toolbars. */
.btn-sm {
  min-height: 32px;
  padding: var(--s-1) var(--s-3);
  font-size: 13px;
  border-radius: var(--r-control);
}

.field { margin-bottom: var(--s-5); }
.field label {
  display: block; margin-bottom: var(--s-2);
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
}
.input {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  min-height: 42px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--r-input);
  font: 400 14px/1.5 var(--font-ui);
}
.input:focus {
  border-color: var(--focus-ring);
  outline: none;
  box-shadow: 0 0 0 3px var(--info-bg);
}
.input::placeholder { color: var(--text-muted); }

/* ── feedback ────────────────────────────────────────────────────────────── */

/* Status is never colour alone — every alert pairs an icon with a word. */
.alert {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-card);
  border: 1px solid transparent;
  margin-bottom: var(--s-5);
  font-size: 14px;
}
.alert-icon { flex: none; font-weight: 700; line-height: 1.4; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  }
.alert-danger  .alert-icon { color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: var(--success); }
.alert-success .alert-icon { color: var(--success); }
.alert-info    { background: var(--info-bg);    border-color: var(--info);    }
.alert-info    .alert-icon { color: var(--info); }

.empty {
  padding: var(--s-12) var(--s-6);
  text-align: center;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
}

/* ── tables ──────────────────────────────────────────────────────────────── */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: auto;
  max-height: var(--table-max, 70vh);
}

.table {
  width: 100%;
  border-collapse: separate;   /* sticky headers lose real borders */
  border-spacing: 0;
  font-size: 14px;
}

.table thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  padding: var(--s-4) var(--s-6);
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-raised);
  white-space: nowrap;
  border-right: 1px solid var(--hairline-soft);
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.th-sort {
  display: inline-flex; align-items: center; gap: var(--s-1);
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: inherit; cursor: pointer; white-space: nowrap;
}
.th-sort:hover { color: var(--text-primary); text-decoration: none; }
.th-sort .arrow { opacity: .35; font-size: 10px; line-height: 1; }
.th-sort[aria-sort] { color: var(--text-primary); }
.th-sort[aria-sort] .arrow { opacity: 1; color: var(--brand); }

.table td {
  padding: var(--s-3) var(--s-6);
  height: var(--row-height);
  border-bottom: 1px solid var(--hairline-soft);
  border-right: 1px solid var(--hairline-soft);
  vertical-align: middle;
}
.table td:last-child, .table th:last-child { border-right: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-raised); }

.table-zebra tbody tr:nth-child(even) td { background: var(--surface-raised); }
.table-zebra tbody tr:hover td { background: var(--surface-sunken); }

.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .num-neg { color: var(--danger); }
.table .id, .table .mono { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.table .date { white-space: nowrap; color: var(--text-secondary); }
.table .center { text-align: center; }
.table .clip { max-width: var(--clip, 320px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }

.table-pin-first th:first-child,
.table-pin-first td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--hairline);
}
.table-pin-first thead th:first-child { z-index: 3; background: var(--surface-raised); }

.table tfoot td {
  position: sticky; bottom: 0;
  background: var(--surface-raised);
  font-weight: 600;
  box-shadow: inset 0 1px 0 var(--hairline);
  height: var(--row-height);
}

.table .sel { width: 40px; text-align: center; }
.table .sel input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.table tbody tr.is-selected td { background: var(--info-bg); }

.table .table-empty td {
  height: auto; padding: var(--s-12) var(--s-6);
  text-align: center; color: var(--text-secondary);
}

/* ── toolbar, meta, pager ────────────────────────────────────────────────── */

.filter-bar {
  display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center;
  margin-bottom: var(--s-5);
}
.filter-bar .spacer { flex: 1; }
.filter-bar .input { min-height: 42px; }

.table-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); margin-top: var(--s-4);
  font-size: 14px; color: var(--text-secondary);
}

[data-live-region] { transition: opacity .12s ease; }
[data-live-region][data-loading] { opacity: .55; pointer-events: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.pager { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-4); }
.pager a, .pager span {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 var(--s-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none; font-size: 14px;
}
.pager a:hover { background: var(--surface-raised); color: var(--text-primary); text-decoration: none; }
.pager .current { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.pager .disabled { opacity: .4; pointer-events: none; }

/* ── badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 3px var(--s-3);
  border-radius: var(--r-control);
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.badge-muted   { background: var(--surface-raised); color: var(--text-secondary); border-color: var(--hairline); }

/* ── checkbox rows ───────────────────────────────────────────────────────── */

.check {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) 0;
  cursor: pointer; font-size: 14px;
}
.check input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--brand);
  cursor: pointer; flex: none;
}
.check input:disabled { cursor: not-allowed; opacity: .5; }


/* ── month calendar ──────────────────────────────────────────────────────── */

.cal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--s-5);
  margin-bottom: var(--s-8);
}

.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); margin-bottom: var(--s-4);
}
.cal-nav { display: flex; gap: var(--s-2); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline-soft);   /* gap colour draws the gridlines */
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-control);
  overflow: hidden;
}

.cal-dow {
  background: var(--surface-raised);
  padding: var(--s-2) var(--s-3);
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.cal-day {
  background: var(--surface);
  min-height: 92px;
  padding: var(--s-2);
  display: flex; flex-direction: column; gap: 3px;
}
.cal-day.is-weekend { background: var(--surface-raised); }
.cal-day.is-outside { opacity: .45; }
.cal-day.is-today   { box-shadow: inset 0 0 0 2px var(--brand); }

.cal-daynum {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.cal-day.is-today .cal-daynum { color: var(--brand-text); }

/* A name plus a glyph — never colour alone. */
.cal-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 2px var(--s-2);
  border-radius: var(--r-xs, 4px);
  font-size: 11.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}
.cal-chip-approved { background: var(--success-bg); color: var(--success); }
.cal-chip-pending  { background: var(--warning-bg); color: var(--warning); }

.cal-more { font-size: 11px; color: var(--text-muted); padding-left: var(--s-2); }

.cal-legend {
  display: flex; align-items: center; gap: var(--s-5);
  margin-top: var(--s-4);
  font-size: 13px; color: var(--text-secondary);
}
.cal-legend > span { display: flex; align-items: center; gap: var(--s-2); }
.cal-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--r-xs, 4px);
  font-size: 11px;
}

@media (max-width: 800px) {
  .cal-day { min-height: 70px; }
  .cal-chip { font-size: 10.5px; }
  .cal-legend { flex-wrap: wrap; gap: var(--s-3); }
}


/* ── permission grid (module config) ─────────────────────────────────────── */

.table .grouprow td {
  background: var(--surface-raised);
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  height: auto; padding: var(--s-3) var(--s-6);
}
.table .grouprow td .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Whole cell is the click target, not just the 17px box. */
.cellcheck {
  display: flex; align-items: center; justify-content: center;
  margin: calc(var(--s-3) * -1) calc(var(--s-6) * -1);
  padding: var(--s-3) var(--s-6);
  cursor: pointer;
}
.cellcheck input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

/* ── theme picker (account) ──────────────────────────────────────────────── */

.theme-choice { display: flex; gap: var(--s-4); flex-wrap: wrap; }

.theme-option {
  flex: 1 1 180px;
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-4);
  background: var(--surface);
  border: 2px solid var(--hairline);
  border-radius: var(--r-card);
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.theme-option:hover { border-color: var(--text-muted); }
.theme-option.is-current {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.theme-name {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px; color: var(--text-primary);
}
.theme-option.is-current .theme-name { color: var(--brand-text); }
.theme-hint { font-size: 12.5px; color: var(--text-muted); }

/* Miniature of the theme itself. Colours are literal, not tokens — each
   swatch must show ITS theme regardless of which one is currently active. */
.theme-swatch {
  display: block; height: 62px;
  border-radius: var(--r-control);
  padding: var(--s-3);
  border: 1px solid rgba(127,127,127,.28);
  overflow: hidden;
}
.theme-swatch .bar { display: block; height: 7px; border-radius: 3px; margin-bottom: 6px; }
.theme-swatch .bar:nth-child(1) { width: 58%; }
.theme-swatch .bar:nth-child(2) { width: 88%; }
.theme-swatch .bar:nth-child(3) { width: 40%; background: #CC0000 !important; }

.theme-swatch-light { background: #F5F6F8; }
.theme-swatch-light .bar { background: #D0D4E4; }
.theme-swatch-dark  { background: #14161A; }
.theme-swatch-dark  .bar { background: #313640; }

/* ── auth ────────────────────────────────────────────────────────────────── */

.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-6);
  background: var(--canvas);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-panel);
  padding: var(--s-10);
  box-shadow: var(--shadow-card);
}
.auth-head { text-align: center; margin-bottom: var(--s-8); }
.auth-head .brand { justify-content: center; font-size: 24px; margin-bottom: var(--s-2); }
.auth-head p { margin: 0; color: var(--text-secondary); font-size: 14px; }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: var(--s-6) var(--s-5); }
  .brand-sub { display: none; }
  .cats { overflow-x: auto; }
}

@media (max-width: 700px) {
  .table-wrap { max-height: none; }
  .table thead th, .table tfoot td { position: static; }
  h1 { font-size: 26px; }
}
