/* ═══════════════════════════════════════════════════════════════════════
   Organizer Dashboard — v4 "Marquee", the backstage side
   (26/10/2026, follows the megaticketsusa.com redesign)

   The public site is built from three objects of a live night: the
   marquee, the poster and the ticket. The dashboard is the room behind
   them — so it borrows the same language:

   • Stage black sidebar with the original lockup and the bulb gold —
     the "backstage" of the organizer door on /account/login/.
   • Ticket stock (paper #ffffff) for the work surface; white cards.
   • Archivo condensed for page titles, Geist Mono for the data printed
     on a stub (labels, dates, money, table heads), Instrument Serif only
     as an accent.
   • KPI cards are ticket stubs: a perforation with real notches cut out
     of the card (CSS mask), the same trick as the event cards on the site.

   This sheet loads LAST and only restyles: no selector here changes
   behaviour, data binding or auth. dashboard.css keeps the layout and the
   responsive floors (design-system layer, 2026-08-04); this file swaps the
   tokens and dresses the components on top of it.

   Themes: paper is the house look (data-theme="light"); "Stage" (no
   attribute) is the dark option for organizers who pick it with the
   sun/moon toggle. Both are defined here because dashboard.css's
   [data-theme="light"] block sits before this file — anything defined
   only in :root here would leak into the light theme.
   ═══════════════════════════════════════════════════════════════════════ */

/* Archivo Narrow (Omnibus-Type) and Inter (brand refresh, Nov 2026) — SIL OFL 1.1,
   same files as the site (marquee/*.woff2, licences alongside). */
@font-face {
  font-family: 'Archivo Narrow';
  src: url('marquee/archivo-narrow-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo Narrow';
  src: url('marquee/archivo-narrow-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('marquee/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}
/* ── Palette constants (both themes) ─────────────────────────────────── */
:root {
  --mq-paper: #ffffff;
  --mq-paper-2: #f3f4f6;
  --mq-paper-3: #e6e8ec;
  --mq-ink: #0b0d16;
  --mq-ink-2: #151a2b;
  --mq-ink-3: #1f2538;
  --mq-on-ink: #f5f6f8;
  --mq-on-ink-2: rgba(245, 246, 248, 0.74);
  --mq-on-ink-3: rgba(245, 246, 248, 0.5);
  --mq-ink-line: rgba(245, 246, 248, 0.12);
  --mq-ink-line-2: rgba(245, 246, 248, 0.22);
  --mq-red: #d20e36;
  --mq-red-2: #b40b2e;
  --mq-red-hot: #ff4d6d;
  --mq-navy: #1b2a6b;
  --mq-gold: #f5b82e;
  --mq-gold-2: #ffd36b;

  --mq-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mq-mono: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mq-serif: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif;
  --mq-ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  /* The tear line of a ticket stub. */
  --mq-perf: radial-gradient(circle, var(--mq-perf-dot) 1.15px, transparent 1.6px);
}

/* ── Stage (dark option) — overrides dashboard.css :root ─────────────── */
:root {
  color-scheme: dark;
  --bg: #0b0d16;
  --bg-elevated: #151a2b;
  --bg-surface: rgba(245, 246, 248, 0.04);
  --bg-surface2: rgba(245, 246, 248, 0.07);
  --bg-surface3: rgba(245, 246, 248, 0.1);
  --text: rgba(255, 255, 255, 0.86);
  --text-bright: #f5f6f8;
  --text-sub: rgba(245, 246, 248, 0.74);
  --text-muted: rgba(245, 246, 248, 0.56);
  --border: rgba(245, 246, 248, 0.1);
  --border-light: rgba(245, 246, 248, 0.08);
  --border-subtle: rgba(245, 246, 248, 0.05);
  --nav-bg: rgba(11, 13, 22, 0.9);
  --card-bg: #151a2b;
  --card-border: rgba(245, 246, 248, 0.09);
  --card-hover: rgba(245, 246, 248, 0.22);
  --input-bg: rgba(245, 246, 248, 0.05);
  --select-bg: #1f2538;
  --sidebar-bg: #07080f;
  --accent: #ef3352;
  --accent-hover: #ff4d6d;
  --accent-glow: rgba(239, 51, 82, 0.28);
  --teal: #1c9459;
  --gold: #f5b82e;
  --orange: #e07a3f;
  --blue: #5b70de;
  --purple: #8f7be6;
  --red: #ef3352;
  --green: #1c9459;
  --teal-ink: #4cc98a;
  --gold-ink: #f5b82e;
  --red-ink: #ff4d6d;
  --green-ink: #4cc98a;
  --blue-ink: #8b9cf0;
  --purple-ink: #ab9df2;
  --orange-ink: #f0955c;
  --ink-teal2: #4cc98a;
  --ink-teal3: #4cc98a;
  --ink-brand: #ff4d6d;
  --ink-red2: #ff4d6d;
  --ink-rose: #ff7a93;
  --ink-salmon: #ff7a93;
  --ink-gold2: #f5b82e;
  --ink-amber: #f5b82e;
  --ink-orange2: #f0955c;
  --ink-purple2: #ab9df2;
  --ink-cyan: #8b9cf0;
  --ink-green2: #4cc98a;
  --gradient-brand: linear-gradient(135deg, #d20e36 0%, #8f0824 100%);
  --gradient-brand-subtle: linear-gradient(135deg, rgba(210, 14, 54, 0.1), rgba(27, 42, 107, 0.12));
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-modal: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --mq-perf-dot: rgba(245, 246, 248, 0.3);
  --mq-wash-red: rgba(239, 51, 82, 0.14);
  --mq-wash-green: rgba(28, 148, 89, 0.16);
  --mq-wash-gold: rgba(245, 184, 46, 0.14);
  --mq-wash-navy: rgba(91, 112, 222, 0.16);
  --mq-wash-violet: rgba(143, 123, 230, 0.16);
  --mq-wash-orange: rgba(224, 122, 63, 0.16);
  --mq-thead: #161a2a;
  --mq-row-hover: rgba(245, 246, 248, 0.035);
  --mq-control-bd: rgba(245, 246, 248, 0.18);
  --mq-control-bd-hover: rgba(245, 246, 248, 0.32);
  /* Field edges only (input / select / textarea): ≥3:1 against the card
     and the ground (WCAG 1.4.11). Outlined buttons keep --mq-control-bd. */
  --control-bd: rgba(245, 246, 248, 0.42);
  --mq-focus-ring: rgba(245, 246, 248, 0.12);
  --mq-strong: #f5f6f8;      /* "ink" buttons flip to paper on stage */
  --mq-on-strong: #0b0d16;
}

/* ── Ticket stock (house look) ───────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface2: #f3f4f6;
  --bg-surface3: #e6e8ec;
  --text: #1f2230;
  --text-bright: #0c0e17;
  --text-sub: #3d3b35;
  --text-muted: #5d6170;     /* 6.4:1 on paper, 7.3:1 on white */
  --border: rgba(12, 14, 23, 0.12);
  --border-light: rgba(12, 14, 23, 0.09);
  --border-subtle: rgba(12, 14, 23, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --card-bg: #ffffff;
  --card-border: rgba(12, 14, 23, 0.1);
  --card-hover: rgba(12, 14, 23, 0.24);
  --input-bg: #ffffff;
  --select-bg: #ffffff;
  --sidebar-bg: #0b0d16;
  --accent: #d20e36;         /* 5.2:1 on white */
  --accent-hover: #b40b2e;
  --accent-glow: rgba(210, 14, 54, 0.16);
  --teal: #157a46;
  --gold: #b07d00;
  --orange: #c4561d;
  --blue: #3346b0;
  --purple: #7b68dd;
  --red: #d20e36;
  --green: #157a46;
  --teal-ink: #157a46;
  --gold-ink: #7a4f00;
  --red-ink: #b40b2e;
  --green-ink: #157a46;
  --blue-ink: #24378c;
  --purple-ink: #4f3fb0;
  --orange-ink: #a83e00;
  --ink-teal2: #157a46;
  --ink-teal3: #157a46;
  --ink-brand: #b40b2e;
  --ink-red2: #b40b2e;
  --ink-rose: #b40b2e;
  --ink-salmon: #b40b2e;
  --ink-gold2: #7a4f00;
  --ink-amber: #7a4f00;
  --ink-orange2: #a83e00;
  --ink-purple2: #4f3fb0;
  --ink-cyan: #24378c;
  --ink-green2: #157a46;
  --gradient-brand: linear-gradient(135deg, #d20e36 0%, #8f0824 100%);
  --gradient-brand-subtle: linear-gradient(135deg, rgba(210, 14, 54, 0.05), rgba(27, 42, 107, 0.05));
  --shadow-card: 0 1px 2px rgba(12, 14, 23, 0.05), 0 1px 1px rgba(12, 14, 23, 0.03);
  --shadow-modal: 0 30px 70px -24px rgba(12, 14, 23, 0.38), 0 8px 18px -8px rgba(12, 14, 23, 0.14);
  --mq-perf-dot: rgba(12, 14, 23, 0.32);
  --mq-wash-red: #f9e3e6;
  --mq-wash-green: #def2e6;
  --mq-wash-gold: #fbefcf;
  --mq-wash-navy: #e3e6f2;
  --mq-wash-violet: #ebe7fa;
  --mq-wash-orange: #fbe6da;
  --mq-thead: #f7f5ef;
  --mq-row-hover: #faf8f3;
  --mq-control-bd: rgba(12, 14, 23, 0.2);
  --mq-control-bd-hover: rgba(12, 14, 23, 0.36);
  --control-bd: rgba(12, 14, 23, 0.5);   /* same value as the site */
  --mq-focus-ring: rgba(12, 14, 23, 0.08);
  --mq-strong: #0b0d16;
  --mq-on-strong: #f5f6f8;
}

/* ── Ground ──────────────────────────────────────────────────────────────
   The create-event form used to link the site-wide
   /css/mtu-design-system.css (bulk-added to every page in 2467771b). The
   dashboard uses none of it, and it leaked in two ways: `html, body
   { background-color: #0B0D16 !important }` kept the light theme on
   near-black, and `.stats-grid { 1fr !important }` under 600px beat the
   dashboard's own two-column phone layout. The link is gone; the ground
   is painted on <html> too so overscroll matches. */
html { background-color: var(--bg); }

/* ── Base type ───────────────────────────────────────────────────────── */
body {
  font-family: var(--mq-font);
  font-size: 14px;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
::selection { background: var(--mq-red); color: #fff; }

/* Every figure in the dashboard is a column of money or counts. */
.stat-value, .data-table td, .fin-kpi-value, .countdown-num, .comparison-value,
.goal-value, .calc-result-value, .modal-value, .retention-kpi-value, .dayof-kpi-value {
  font-variant-numeric: tabular-nums;
}

.loading-bar-fill { background: var(--mq-red) !important; }

/* ═══ SIDEBAR — always stage, in both themes ════════════════════════════
   The tokens are re-pointed on the element, so every child that reads
   --text-* / --border / --bg-surface* (nav, footer, badges, the theme and
   logout buttons) turns stage without one extra selector. */
.sidebar {
  color-scheme: dark;
  --text: rgba(255, 255, 255, 0.86);
  --text-bright: #f5f6f8;
  --text-sub: rgba(245, 246, 248, 0.7);
  --text-muted: rgba(245, 246, 248, 0.5);
  --border: rgba(245, 246, 248, 0.1);
  --border-light: rgba(245, 246, 248, 0.08);
  --bg-surface: rgba(245, 246, 248, 0.04);
  --bg-surface2: rgba(245, 246, 248, 0.08);
  --accent: var(--mq-gold);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(27, 42, 107, 0.45), transparent 60%),
    var(--sidebar-bg);
  border-right: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .sidebar { box-shadow: none; }

/* Header: the original lockup (white lettering) over a stub line —
   ORGANIZER on the left, BACKSTAGE on the right, like the door card. */
.sidebar-header {
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 12px;
  padding: 22px 20px 0;
  border-bottom: 0;
}
.sidebar-lockup { display: block; line-height: 0; flex: none; }
.sidebar-lockup img { height: 36px; width: auto; filter: none; }
.sidebar-header img { filter: none; }
.sidebar-brand {
  order: 3;
  flex: 1 0 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 14px;
  /* --mq-perf resolves its dot colour on <html>; the stage needs its own. */
  background: radial-gradient(circle, rgba(245, 246, 248, 0.3) 1.15px, transparent 1.6px) top left / 9px 4px repeat-x;
}
.sidebar-brand-name { display: none; }
.sidebar-brand-sub,
.sidebar-brand::after {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mq-gold); font-variant-numeric: tabular-nums; }
.sidebar-brand::after { content: 'Backstage'; color: var(--mq-on-ink-3); }
.sidebar-collapse-btn {
  border-radius: 8px;
  border-color: var(--mq-ink-line-2);
  background: transparent;
}

/* Sections are numbered like the site's eyebrows: 01 MAIN ──── */
.sidebar-nav { counter-reset: mqsec; padding: 4px 12px 14px; }
.nav-section {
  counter-increment: mqsec;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mq-on-ink-3);
  padding: 18px 10px 8px; font-variant-numeric: tabular-nums; }
.nav-section::before { content: counter(mqsec, decimal-leading-zero); color: var(--mq-gold); }
.nav-section::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: 0.35; }

.nav-item {
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; }
.nav-item:hover { background: rgba(245, 246, 248, 0.06); color: var(--mq-on-ink); }
.nav-item.active {
  background: rgba(245, 246, 248, 0.09);
  color: var(--mq-on-ink);
  font-weight: 600;
}
.nav-item.active svg { color: var(--mq-gold); opacity: 1; }
.nav-item.active::before {
  left: -12px;
  width: 3px;
  height: 22px;
  background: var(--mq-gold);
  box-shadow: 0 0 12px rgba(245, 184, 46, 0.6);
}
/* "New" — a gold stub tag, not a teal pill. */
.nav-item .nav-badge,
.nav-item .nav-badge.teal,
.nav-item .nav-badge.gold {
  background: transparent;
  color: var(--mq-gold);
  box-shadow: inset 0 0 0 1px rgba(245, 184, 46, 0.45);
  border-radius: 8px;
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px; font-variant-numeric: tabular-nums; }

.sidebar-footer {
  align-items: center;
  border-top: 1px solid var(--mq-ink-line);
  padding: 14px 16px;
}
.sidebar-user-name { font-size: 13.5px; font-weight: 600; color: var(--mq-on-ink); }
.sidebar-user-role {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mq-on-ink-3); font-variant-numeric: tabular-nums; }
.sidebar .btn-icon { background: transparent; border-color: var(--mq-ink-line-2); color: var(--mq-on-ink-2); }
.sidebar .btn-icon:hover { border-color: var(--mq-gold); color: var(--mq-gold); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(245, 246, 248, 0.14); }

.sidebar-reopen-btn { border-radius: 8px; background: var(--mq-ink); color: var(--mq-on-ink); border-color: var(--mq-ink); }

/* ═══ TOPBAR — the masthead ═════════════════════════════════════════════
   Breadcrumb becomes a mono eyebrow above a condensed poster title. */
.topbar {
  padding: 14px 36px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
}
[data-theme="light"] .topbar { box-shadow: none; }
.topbar-left > div:not(.hamburger) { display: flex; flex-direction: column-reverse; gap: 5px; }
.topbar-title {
  font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 0.95;
  letter-spacing: -0.005em;
  color: var(--text-bright);
}
.topbar-breadcrumb {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted); font-variant-numeric: tabular-nums; }
.topbar-email { font-size: 13px; font-weight: 600; color: var(--text); }
.conn-status {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
  color: var(--text-muted); font-variant-numeric: tabular-nums; }
.conn-dot { background: var(--green); }

/* Language: a three-stop mono switch. */
.lang-selector {
  background: transparent !important;
  border: 1px solid var(--mq-control-bd) !important;
  border-radius: 7px !important;
  padding: 2px !important;
  gap: 2px !important;
}
.lang-btn {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 8px;
  color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lang-btn.active { background: var(--mq-strong); color: var(--mq-on-strong); }

.page-manual-btn {
  background: var(--mq-strong);
  color: var(--mq-on-strong);
  box-shadow: none;
  border-radius: 8px;
  font-weight: 600;
}
.page-manual-btn:hover { box-shadow: 0 8px 18px -10px rgba(12, 14, 23, 0.5); filter: none; }

.page-content { padding: 30px 36px 40px; }
@media (max-width: 768px) {
  .topbar { padding: 12px 16px; }
  /* Phones: the section title right below is the poster headline; the
     sticky masthead becomes a plain context line instead of a truncated
     second poster ("FINANCIAL DAS…" over "FINANCIAL DASHBOARD"). */
  .topbar-title {
    font-family: var(--mq-font);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
  }
  .page-content { padding: 20px 16px 32px; }
}

/* ═══ SECTION & CARD HEADINGS ═══════════════════════════════════════════ */
.section-title {
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 0.98;
  letter-spacing: -0.005em;
  color: var(--text-bright);
  margin-bottom: 6px; font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
.section-subtitle { font-size: 14px; color: var(--text-muted); max-width: 72ch; }

.chart-title, .table-title, .setting-card h3, .health-title, .ai-title, .cohort-title,
.dayof-section-title, .fin-detail-title, .fin-calc-section-title, .forecast-title, .funnel-title,
.heatmap-title, .leaderboard-title, .narrative-title, .pinned-title, .retention-chain-title,
.checklist-group-title, .checklist-progress-title, .scan-card-title, .scan-log-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-bright); font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }

/* ═══ CARDS ═════════════════════════════════════════════════════════════ */
.chart-card, .setting-card, .comparison-card, .table-wrap {
  border-radius: var(--radius-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.chart-card:hover { border-color: var(--card-border); }

/* ═══ KPI CARDS = TICKET STUBS ══════════════════════════════════════════
   icon + mono label on the stub, a perforation with two notches cut out
   of the card, the figure below. The notch sits at a fixed y, so the
   head row is a fixed 30px (label never wraps). Extra children a page
   adds (trend, sparkline) stack under the figure. */
.stat-card {
  --notch: 8px;
  --notch-y: 62px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 30px auto;
  align-items: center;
  column-gap: 10px;
  padding: 16px 18px 18px;
  border-radius: 12px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  transition: transform 0.28s var(--mq-ease), box-shadow 0.28s var(--mq-ease);
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 var(--notch-y), transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% var(--notch-y), transparent 98%, #000) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at 0 var(--notch-y), transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% var(--notch-y), transparent 98%, #000) right / 51% 100% no-repeat;
}
/* Condensed figures need less room: four stubs fit a tablet row. */
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-card > * { grid-column: 1 / -1; }
.stat-card::after { display: none; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--card-border); }
.stat-icon {
  grid-column: 1;
  grid-row: 1;
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 8px;
}
.stat-icon svg { width: 16px !important; height: 16px !important; }
.stat-label {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-card:not(:has(.stat-icon)) .stat-label { grid-column: 1 / -1; }
/* A second .stat-label is a caption under the figure ("24 orders"). */
.stat-card > .stat-label ~ .stat-label {
  grid-column: 1 / -1;
  grid-row: auto;
  margin-top: 8px !important;
  font-size: var(--fs-micro) !important;
  letter-spacing: 0.06em;
  white-space: normal;
  /* The attendee captions carry an inline opacity:.65 (3.1:1); the muted
     token is already tuned for small text (6.4–7.3:1). */
  opacity: 1 !important;
  color: var(--text-muted);
}
.stat-value {
  grid-row: 2;
  margin: 14px -18px 0;
  padding: 16px 18px 0;
  background: var(--mq-perf) top left / 9px 4px repeat-x;
  font-weight: 700;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text-bright); font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
/* Phones: stubs sit two to a row (condensed figures fit 165px). */
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { --notch-y: 56px; padding: 14px 14px 16px; }
  .stat-card .stat-icon { display: none; }
  .stat-card .stat-label { grid-column: 1 / -1; font-size: var(--fs-micro); letter-spacing: 0.08em; }
  .stat-value { margin: 10px -14px 0; padding: 14px 14px 0; font-size: 26px; }
}

/* The other KPI families (Financial, Day-of, Retention, comparisons,
   calculator) print the same way: mono label, condensed figure. */
.fin-kpi-label, .dayof-kpi-label, .retention-kpi-label, .comparison-title,
.fin-detail-mode, .calc-breakdown-label, .sim-label {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase; font-variant-numeric: tabular-nums; }
.fin-kpi-value, .dayof-kpi-value, .retention-kpi-value, .comparison-value,
.calc-result-value, .fin-total-value, .health-score-num, .checklist-progress-pct {
  font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.fin-kpi-value { font-size: 28px; }
.fin-kpi-card { background: var(--card-bg); }

.stat-icon.pink, .stat-icon.red { background: var(--mq-wash-red); color: var(--red-ink); }
.stat-icon.teal, .stat-icon.green { background: var(--mq-wash-green); color: var(--teal-ink); }
.stat-icon.gold { background: var(--mq-wash-gold); color: var(--gold-ink); }
.stat-icon.blue { background: var(--mq-wash-navy); color: var(--blue-ink); }
.stat-icon.purple { background: var(--mq-wash-violet); color: var(--purple-ink); }
.stat-icon.orange { background: var(--mq-wash-orange); color: var(--orange-ink); }

/* ═══ WELCOME = THE MARQUEE ═════════════════════════════════════════════
   The one stage moment on the overview: stage black, a row of bulbs
   along the top edge, poster headline, gold call to action. */
.welcome-banner,
[data-theme="light"] .welcome-banner {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(210, 14, 54, 0.32), transparent 55%),
    radial-gradient(70% 120% at 0% 100%, rgba(27, 42, 107, 0.55), transparent 60%),
    var(--mq-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px 24px;
  color: var(--mq-on-ink);
}
[data-theme="light"] .welcome-banner { border-color: transparent; }
.welcome-banner::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 10px;
  height: 8px;
  background: radial-gradient(circle at 50% 50%, var(--mq-gold-2) 0 2.2px, rgba(245, 184, 46, 0.35) 2.6px 3.6px, transparent 4px) 8px 0 / 16px 8px repeat-x;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .welcome-banner::before { animation: mq-bulbs 1.6s steps(2) infinite; }
}
@keyframes mq-bulbs { to { background-position: 24px 0; } }
.welcome-text h2 {
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 0.95;
  letter-spacing: -0.005em;
  color: var(--mq-on-ink);
  margin: 6px 0 8px; font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
.welcome-text p { font-size: 14.5px; color: var(--mq-on-ink-2); }
.welcome-btn { border-radius: 8px; font-weight: 600; font-size: 13.5px; min-height: 44px; padding: 0 18px; }
.welcome-btn-primary { background: var(--mq-gold); color: var(--mq-ink); }
.welcome-btn-primary:hover { background: var(--mq-gold-2); opacity: 1; }
.welcome-btn-secondary { background: transparent; color: var(--mq-on-ink); border: 1.5px solid var(--mq-ink-line-2); }
.welcome-btn-secondary:hover { border-color: var(--mq-on-ink); color: var(--mq-on-ink); }

/* ═══ COUNTDOWN = A STUB WITH ITS COUNTERFOIL ═══════════════════════════
   Stage-black counterfoil with the countdown in gold mono, a tear line,
   then the event. Notches cut at the tear (fixed 128px). */
.countdown-card {
  --tear: 128px;
  padding: 0;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border-radius: 12px;
  -webkit-mask:
    radial-gradient(circle 7px at var(--tear) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 7px at var(--tear) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle 7px at var(--tear) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 7px at var(--tear) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.countdown-card:hover { border-color: var(--card-hover); }
.countdown-timer {
  flex: 0 0 var(--tear);
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--mq-ink);
  border-right: 2px dotted rgba(245, 246, 248, 0.35);
}
.countdown-num {
  font-family: var(--mq-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--mq-gold); font-variant-numeric: tabular-nums; }
.countdown-label {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  color: var(--mq-on-ink-3);
  margin-top: 4px; font-variant-numeric: tabular-nums; }
.countdown-info { padding: 14px 16px; align-self: center; min-width: 0; }
.countdown-name { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.countdown-date {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ═══ TABLES ════════════════════════════════════════════════════════════ */
.data-table th,
.data-table thead th,
[data-theme="light"] .data-table thead th {
  background: var(--mq-thead);
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none; font-variant-numeric: tabular-nums; }
.data-table td { font-size: 14px; color: var(--text); border-bottom-color: var(--border-light); }
.data-table td strong { color: var(--text-bright); font-weight: 600; }
.data-table tr:hover td { background: var(--mq-row-hover); }

/* Status: mono stub tags. */
.badge {
  border-radius: 8px;
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  /* Neutral tag by default: roles, guest types (vip, press, comp…) and any
     status without its own colour print as a paper tag, not bare text.
     Every status group below overrides it. */
  background: var(--bg-surface2);
  color: var(--text-sub);
  box-shadow: inset 0 0 0 1px var(--border); font-variant-numeric: tabular-nums; }
.badge-confirmed, .badge-published, .badge-active, .badge-completed, .badge-checked_in,
[data-theme="light"] .badge-confirmed, [data-theme="light"] .badge-published, [data-theme="light"] .badge-active {
  background: var(--mq-wash-green); color: var(--green-ink); box-shadow: none;
}
.badge-pending, .badge-draft, .badge-processing,
[data-theme="light"] .badge-pending, [data-theme="light"] .badge-draft, [data-theme="light"] .badge-processing {
  background: var(--mq-wash-gold); color: var(--gold-ink); box-shadow: none;
}
.badge-refunded, .badge-cancelled, .badge-failed, .badge-inactive,
[data-theme="light"] .badge-refunded, [data-theme="light"] .badge-cancelled, [data-theme="light"] .badge-failed, [data-theme="light"] .badge-inactive {
  background: var(--mq-wash-red); color: var(--red-ink); box-shadow: none;
}

.page-btn { border-radius: 8px; font-family: var(--mq-mono); font-variant-numeric: tabular-nums; }
.page-btn.active { background: var(--mq-strong); border-color: var(--mq-strong); color: var(--mq-on-strong); }

/* ═══ FORMS ═════════════════════════════════════════════════════════════
   Labels are stub print (mono caps), inputs are white slips with a firm
   1.5px edge — the same fields as the sign-in door. */
.form-label {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-sub); font-variant-numeric: tabular-nums; }
.form-label > span { font-family: var(--mq-font); letter-spacing: 0; text-transform: none; }
.form-input, .filter-select, .search-input, .calc-input, .fin-modal-input,
.page-section select, .page-section textarea {
  background-color: var(--input-bg);
  border: 1.5px solid var(--control-bd);
  border-radius: 8px;
  color: var(--text-bright);
}
.form-input:hover, .filter-select:hover, .search-input:hover { border-color: var(--text); }
.form-input:focus, .filter-select:focus, .search-input:focus, .calc-input:focus, .fin-modal-input:focus,
.page-section select:focus, .page-section textarea:focus {
  border-color: var(--text-bright);
  box-shadow: 0 0 0 4px var(--mq-focus-ring);
  outline: none;
}
.filter-select { background-color: var(--select-bg); }
input[type='checkbox'], input[type='radio'], input[type='range'] { accent-color: var(--mq-red); }

/* ═══ BUTTONS ═══════════════════════════════════════════════════════════
   Primary = ticket red. Secondary = an outlined slip. Inline colours a
   page sets on a specific button (style="background:…") still win. */
.btn-login {
  background: var(--mq-red);
  border-radius: 8px;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.003em;
}
.btn-login:hover { background: var(--mq-red-2); opacity: 1; box-shadow: 0 10px 24px -12px rgba(210, 14, 54, 0.65); }
.btn-setting, .btn-secondary, .btn-modal-default, .share-btn {
  background: transparent;
  border: 1.5px solid var(--mq-control-bd);
  border-radius: 8px;
  color: var(--text-bright);
  font-weight: 600;
}
.btn-setting:hover, .btn-secondary:hover, .btn-modal-default:hover, .share-btn:hover {
  border-color: var(--text-bright);
  color: var(--text-bright);
  background: transparent;
}
.btn-modal { border-radius: 8px; font-weight: 600; }
.btn-modal-primary { background: var(--mq-red); border-color: var(--mq-red); }
.btn-modal-primary:hover { background: var(--mq-red-2); }
.action-btn { border-radius: 8px; }
.action-btn:hover { color: var(--text-bright); }

/* ═══ MODALS & TOASTS ═══════════════════════════════════════════════════ */
.modal-overlay { background: rgba(11, 13, 22, 0.55); }
.modal { border-radius: var(--radius-xl); border-color: var(--border); }
.modal-header {
  border-bottom: 0;
  background: var(--mq-perf) bottom left / 9px 4px repeat-x;
}
.modal-header h2 {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0; font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
.modal-label {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase; font-variant-numeric: tabular-nums; }
.modal-value { font-weight: 600; }
.modal-actions { border-top-color: var(--border-light); }

.toast {
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  border: 0;
  box-shadow: 0 18px 40px -16px rgba(12, 14, 23, 0.55);
}
.toast-info { background: rgba(11, 13, 22, 0.94); }

/* ═══ SMALLER PIECES ════════════════════════════════════════════════════ */
.exclusive-badge {
  font-family: var(--mq-mono);
  letter-spacing: 0.08em;
  border-radius: 8px; font-variant-numeric: tabular-nums; }
.goal-bar, .health-bar { border-radius: 999px; }
.goal-fill { background: var(--mq-red); }
.spinner { border-color: var(--border); border-top-color: var(--mq-red); }
.empty-state svg { opacity: 0.35; }
.dash-footer, .dashboard-footer {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase; font-variant-numeric: tabular-nums; }

:focus-visible { outline-color: var(--mq-red); }

/* ═══ THE DOOR — sign-in / create account at /organizer/ ════════════════
   Same door as "Door 02 · Organizers" on /account/login/: a ticket-stock
   card on a navy-veiled photo, poster headline, stub-print labels, gold
   key. The gate's own <style> block in index.html keeps its layout; this
   only re-dresses it (same or higher specificity, later in the cascade). */
.login-gate {
  color-scheme: dark;
  background:
    radial-gradient(60% 80% at 0% 30%, rgba(210, 14, 54, 0.28), transparent 60%),
    linear-gradient(rgba(14, 22, 56, 0.78), rgba(11, 13, 22, 0.92)),
    url('/images/concert-hero.jpg') 30% center / cover no-repeat;
  background-attachment: fixed;
  font-family: var(--mq-font);
}
@media (max-width: 768px) { .login-gate { background-attachment: scroll; } }
.login-gate .topbar {
  background: transparent;
  border-bottom: 1px solid var(--mq-ink-line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 18px 36px;
}
.login-gate .topbar .logo img { height: 38px; width: auto; }
.login-gate .topbar .back {
  border-radius: 8px;
  border: 1.5px solid var(--mq-ink-line-2);
  background: transparent;
  color: var(--mq-on-ink);
  font-weight: 600;
}
.login-gate .topbar .back:hover { border-color: var(--mq-on-ink); background: transparent; }

/* Left: the poster. The lockup is already in the topbar. */
.login-branding > img { display: none; }
.login-branding .og-eyebrow {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mq-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mq-gold); font-variant-numeric: tabular-nums; }
.login-branding .og-headline {
  font-weight: 700;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.96;
  letter-spacing: -0.005em;
  color: var(--mq-on-ink);
  margin: 14px 0 18px; font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
.login-branding .og-headline-accent {
  font-family: var(--mq-serif);
  font-style: normal;
  font-weight: 700;
  text-transform: none;
  color: var(--mq-gold);
  background: none;
  -webkit-text-fill-color: currentColor;
}
.login-branding .og-sub { color: var(--mq-on-ink-2); font-size: 16px; }
.login-branding .og-point-icon {
  background: transparent;
  border: 1.5px solid rgba(245, 184, 46, 0.45);
  color: var(--mq-gold);
  border-radius: 8px;
}
.login-branding .og-point-title { color: var(--mq-on-ink); font-weight: 700; }
.login-branding .og-point-body { color: var(--mq-on-ink-2); }
.login-branding .og-disclaimer { color: var(--mq-on-ink-3); }

/* Right: the ticket-stock card. */
.login-card {
  color-scheme: light;
  --text: #1f2230;
  --text-bright: #0c0e17;
  --text-sub: #3d3b35;
  --text-muted: #5d6170;
  background: var(--mq-paper);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7);
  padding: 30px 32px 28px;
  color: var(--text);
}
.login-card::before { display: none; }
/* The stub header: ORGANIZER SIGN-IN ………… BACKSTAGE PASS */
.login-logo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  margin-bottom: 18px;
  padding-bottom: 12px;
  background: radial-gradient(circle, rgba(12, 14, 23, 0.32) 1.15px, transparent 1.6px) bottom left / 9px 4px repeat-x;
}
.login-logo img { display: none; }
.login-logo::before, .login-logo::after {
  font-family: var(--mq-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mq-navy); font-variant-numeric: tabular-nums; }
.login-logo::before { content: 'Organizer sign-in'; }
.login-logo::after { content: 'Backstage pass'; }

.auth-tabs {
  background: var(--mq-paper-2);
  border: 0;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  color: var(--text-muted);
  font-family: var(--mq-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 8px; font-variant-numeric: tabular-nums; }
.auth-tab.active { background: var(--mq-ink); color: var(--mq-on-ink); box-shadow: none; }
.auth-tab:not(.active):hover { color: var(--text-bright); }

.login-subtitle {
  text-align: left;
  margin: 4px 0 18px;
  max-width: none;
  font-weight: 700;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: -0.005em;
  color: var(--text-bright); font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
.login-gate .form-label {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-sub); font-variant-numeric: tabular-nums; }
.login-gate .form-input {
  background: #fff;
  border: 1.5px solid rgba(12, 14, 23, 0.5);
  border-radius: 8px;
  color: var(--text-bright);
  box-shadow: none;
}
.login-gate .form-input::placeholder { color: #6b6f7d; }
.login-gate .form-input:focus {
  border-color: var(--mq-navy);
  box-shadow: 0 0 0 4px rgba(27, 42, 107, 0.12);
  background: #fff;
}
/* The key: gold for "open my dashboard", ticket red for a new account. */
.login-gate #loginBtn {
  background: var(--mq-gold) !important;
  color: var(--mq-ink) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
.login-gate #loginBtn:hover { background: var(--mq-gold-2) !important; box-shadow: 0 14px 28px -14px rgba(122, 79, 0, 0.6) !important; }
.login-gate #signupBtn {
  background: var(--mq-red) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
.login-gate #signupBtn:hover { background: var(--mq-red-2) !important; box-shadow: 0 14px 28px -14px rgba(210, 14, 54, 0.6) !important; }
.login-gate #biometricBtn { background: var(--mq-ink) !important; color: var(--mq-on-ink); border-radius: 8px; }
.login-gate #biometricSection > div:first-child { background: rgba(12, 14, 23, 0.1) !important; }
.login-gate .login-error { color: var(--mq-red-2); }
#signupPanel p, #signupPanel p a { color: var(--text-muted) !important; }

.cross-link {
  margin-top: 18px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--mq-paper-2);
  color: var(--text-sub);
  text-align: center;
}
.cross-link a { color: var(--text-bright); font-weight: 700; border-bottom-color: currentColor; }
.cross-link a:hover { color: var(--mq-red-2); }

.login-microcopy, .login-footer {
  font-family: var(--mq-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mq-on-ink-3); font-variant-numeric: tabular-nums; }
.login-footer a { color: var(--mq-on-ink-2); }
/* Phones: the copyright takes its own line and the links follow, instead
   of the name breaking over three lines beside them (12px floor). */
.login-gate .topbar .back { white-space: nowrap; flex-shrink: 0; }   /* "Back to / site" at 320px */
@media (max-width: 480px) {
  .login-footer { flex-wrap: wrap; row-gap: 6px; }
  .login-footer > span:first-child { flex-basis: 100%; text-align: center; }
  .login-footer > span:first-child + span { display: none; }
}
@media (max-width: 880px) {
  .login-card { padding: 26px 22px 24px; }
  .login-subtitle { font-size: 32px; }
}
/* Phones: the page H1 stays the biggest line on the page (the card
   heading right under it is 32px) without pushing the form off screen. */
@media (max-width: 768px) {
  .login-branding .og-headline { font-size: clamp(34px, 9vw, 44px); }
}
/* Touch floor below 1024px (LEAD §4). */
@media (max-width: 1023px) {
  .login-gate .topbar .back { min-height: var(--tap-min); }
}
/* 320px: the stub header broke as "ORGANIZER SIGN- / IN" and
   "BACKSTAGE / PASS"; untracked caps keep both on one line, apart. */
@media (max-width: 359px) {
  .login-logo { column-gap: 12px; }
  .login-logo::before, .login-logo::after { letter-spacing: 0; }
}

/* ═══ LATE RESPONSIVE OVERRIDES ═════════════════════════════════════════
   Everything above is unconditional and loads after dashboard.css, so on
   an equal-specificity tie it would silently kill the dashboard's own
   media queries (_tools/audit-css-cascade.js, run on dashboard.css +
   marquee.css together, lists them). Where the dashboard's responsive
   intent should survive, it is restated here, narrowest last. The
   deliberate overrides that stay: poster-size section titles and the
   two-up KPI stubs on phones. */
.sidebar-mark { display: none; }

/* Tablet landscape: the sidebar is a 70px icon rail. */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar-header { flex-direction: column; justify-content: center; padding: 18px 8px 12px; gap: 10px; }
  .sidebar-lockup picture { display: none; }
  .sidebar-lockup .sidebar-mark { display: block; width: 100%; max-width: 52px; height: auto; }
  .sidebar-brand { display: none; }
  .nav-section { display: none; }
  .sidebar-nav { padding: 8px 8px 14px; }
  .nav-item { justify-content: center; padding: 12px; }
  /* dashboard.css hides the labels with display:none, which also wiped
     every button's accessible name. Hide them visually only; script.js
     mirrors the label into title= for a hover tooltip. */
  .nav-item span {
    display: inline !important;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .nav-item.active::before { left: -8px; }
  .sidebar-footer { flex-direction: column; padding: 12px 8px; }
  .sidebar-user { display: none; }
}

@media (max-width: 1023px) {
  .countdown-label, .countdown-date, .calc-breakdown-label, .sim-label, .badge { font-size: var(--fs-micro); }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { border-radius: var(--radius-lg); }
  /* Tables turn into cards here (responsive-tables.js). */
  .data-table td { font-size: 13px; }
  .data-table tr:hover td { background: transparent; }
}

@media (max-width: 480px) {
  .page-content { padding: 16px 16px 28px; }
  .modal { border-radius: var(--radius-md); }
}

@media (max-width: 359px) {
  .page-content { padding: 12px 10px 24px; }
}

/* ═══ FINISHING PASS (27/10/2026) ═══════════════════════════════════════
   Verified audit findings, CSS only. Same rules as the rest of this sheet:
   restyle, never behaviour. Colour comes from the theme tokens defined at
   the top (both blocks), so every rule below works on paper and on stage. */

/* ── Focus: one ring, same tokens as the site ───────────────────────────
   Red on paper, gold on ink (the sidebar, the welcome marquee, the door's
   photo ground, the whole stage theme). Fields keep their own edge+halo. */
:root { --focus-w: 2.5px; --focus-off: 3px; }
.admin-shell :focus-visible:not(input):not(select):not(textarea),
.login-gate :focus-visible:not(input):not(select):not(textarea),
.modal-overlay :focus-visible:not(input):not(select):not(textarea) {
  outline: var(--focus-w) solid var(--mq-red);
  outline-offset: var(--focus-off);
}
:root:not([data-theme="light"]) .admin-shell :focus-visible:not(input):not(select):not(textarea),
:root:not([data-theme="light"]) .modal-overlay :focus-visible:not(input):not(select):not(textarea),
.admin-shell .sidebar :focus-visible,
.admin-shell .welcome-banner :focus-visible,
.login-gate .topbar :focus-visible,
.login-gate .login-branding :focus-visible,
.login-gate .login-footer :focus-visible { outline-color: var(--mq-gold); }
/* Programmatic focus target of the skip link, not a control. */
#main:focus { outline: none; }

/* Skip link: first stop of the dashboard, above every fixed layer. */
.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--mq-ink);
  color: var(--mq-on-ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.admin-shell .skip-link:focus-visible { outline-color: var(--mq-gold); }
/* A focused control never parks under the sticky masthead (WCAG 2.4.11). */
html { scroll-padding-top: 96px; }

/* The page title is the <h1>; the user-agent heading size must not leak. */
h1.topbar-title { margin: 0; }

/* ── Inline accent literals → theme inks ────────────────────────────────
   script.js / index.html print text in fixed hexes (#178048, #D20E36,
   #A87600, #7B68DD, #4A5FD0, #C4561D) and fixed vars (var(--gold) …) that
   are FILL colours: 2.8–4.5:1 as small text on paper and on stage. Only the
   `color:` declaration is matched (the `^` / `;` anchors skip background-,
   border- and accent-color), and each one moves to its AA ink, which
   resolves per theme. Tinted fills stay as they are. */
:is(.main-content, #modalOverlay) :is([style^="color:#178048" i], [style^="color: #178048" i], [style*=";color:#178048" i], [style*="; color:#178048" i], [style*="; color: #178048" i]) { color: var(--green-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:#d20e36" i], [style^="color: #d20e36" i], [style*=";color:#d20e36" i], [style*="; color:#d20e36" i], [style*="; color: #d20e36" i]) { color: var(--red-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:#a87600" i], [style^="color: #a87600" i], [style*=";color:#a87600" i], [style*="; color:#a87600" i], [style*="; color: #a87600" i]) { color: var(--gold-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:#7b68dd" i], [style^="color: #7b68dd" i], [style*=";color:#7b68dd" i], [style*="; color:#7b68dd" i], [style*="; color: #7b68dd" i]) { color: var(--purple-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:#4a5fd0" i], [style^="color: #4a5fd0" i], [style*=";color:#4a5fd0" i], [style*="; color:#4a5fd0" i], [style*="; color: #4a5fd0" i]) { color: var(--blue-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:#c4561d" i], [style^="color: #c4561d" i], [style*=";color:#c4561d" i], [style*="; color:#c4561d" i], [style*="; color: #c4561d" i]) { color: var(--orange-ink) !important; }
/* The same two fills written by script.js through el.style.color (the
   Create Event description counter): the browser re-serialises the whole
   attribute and stores rgb(), which the hex selectors above miss. In the
   dark theme that left the "met" count at 3.6:1. */
:is(.main-content, #modalOverlay) :is([style^="color: rgb(23, 128, 72)"], [style*="; color: rgb(23, 128, 72)"]) { color: var(--green-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color: rgb(210, 14, 54)"], [style*="; color: rgb(210, 14, 54)"]) { color: var(--red-ink) !important; }
/* Neutral grey literal (the PRIVATE tag and the lock icon): 2.5:1 on paper. */
:is(.main-content, #modalOverlay) :is([style^="color:#a0a0b0" i], [style*=";color:#a0a0b0" i], [style*="; color:#a0a0b0" i]) { color: var(--text-muted) !important; }
/* Accent tokens used as text (fill values on paper: gold 3.2–3.6:1). */
:is(.main-content, #modalOverlay) :is([style^="color:var(--gold)"], [style*=";color:var(--gold)"], [style*="; color:var(--gold)"], [style*="; color: var(--gold)"]) { color: var(--gold-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:var(--teal)"], [style*=";color:var(--teal)"], [style*="; color:var(--teal)"], [style^="color:var(--green)"], [style*=";color:var(--green)"]) { color: var(--green-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:var(--purple)"], [style*=";color:var(--purple)"], [style*="; color:var(--purple)"]) { color: var(--purple-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:var(--blue)"], [style*=";color:var(--blue)"], [style*="; color:var(--blue)"]) { color: var(--blue-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:var(--orange)"], [style*=";color:var(--orange)"], [style*="; color:var(--orange)"]) { color: var(--orange-ink) !important; }
:is(.main-content, #modalOverlay) :is([style^="color:var(--accent)"], [style*=";color:var(--accent)"], [style*="; color:var(--accent)"], [style^="color:var(--red)"], [style*=";color:var(--red)"], [style*="; color:var(--red)"]) { color: var(--red-ink) !important; }
/* "NO PAYMENT" sat on a see-through wash over a tinted card (4.1:1). */
#freeEventCard span[style*="rgba(23,128,72,0.15)"] { background: var(--mq-wash-green) !important; }
/* Inline opacity on small muted text (Analytics "excl. … operational tier",
   the read-only ticket-revenue line): the muted token is already the
   quiet step, so the figure stays at full strength. */
.perf-detail { opacity: 1 !important; }
.fin-line.read-only { opacity: 1; }
.fin-line.read-only .fin-line-icon, .fin-line.read-only .fin-line-label { opacity: 0.85; }

/* Green-on-wash actions (Day-of "Copy", "Sync to server"): 3.8–4.2:1 on
   paper. Same family, the paper wash and the green ink. */
[data-theme="light"] .dayof-template-btn:not(.secondary),
[data-theme="light"] .fin-sync-btn-primary {
  background: var(--mq-wash-green);
  color: var(--green-ink);
  border-color: rgba(21, 122, 70, 0.3);
}
[data-theme="light"] .dayof-template-btn:not(.secondary):hover,
[data-theme="light"] .fin-sync-btn-primary:hover { border-color: var(--green-ink); background: var(--mq-wash-green); }

/* ── Settings: the profile-photo note (both of its states) ──────────────
   Its inline colours are stage literals (#f5b82e / #fde68a, #a7f3c4 /
   #bbf7d0): 1.2–1.7:1 on paper. script.js sets data-state. */
[data-theme="light"] #avatarVisibilityNote[data-state="missing"] {
  color: var(--gold-ink) !important;
  background: var(--mq-wash-gold) !important;
  border-color: rgba(122, 79, 0, 0.3) !important;
}
[data-theme="light"] #avatarVisibilityNote[data-state="ok"] {
  color: var(--green-ink) !important;
  background: var(--mq-wash-green) !important;
  border-color: rgba(21, 122, 70, 0.3) !important;
}
[data-theme="light"] #avatarVisibilityNoteText strong { color: var(--text-bright) !important; }

/* Upload previews were white-alpha on a white card: no visible slot. */
.upload-preview { background: var(--bg-surface2); border: 1.5px dashed var(--mq-control-bd); }
#page-promoters .data-table code { background: var(--bg-surface2) !important; font-family: var(--mq-mono); font-variant-numeric: tabular-nums; }

/* ── Mega Ride: the organizer code is the point of the card ─────────────
   On paper the code sat at 1.26:1 (gold on a 40% black wash over paper).
   It becomes a stage-black stub with the bulb-gold code; the other gold
   prints move to the gold ink. The Copy button keeps its own gold fill. */
[data-theme="light"] #orgRateCodeWrap { background: var(--mq-ink) !important; border-color: var(--mq-ink) !important; }
[data-theme="light"] #organizerRateCard #orgRateCode { color: var(--mq-gold) !important; font-family: var(--mq-mono) !important; font-variant-numeric: tabular-nums; }
[data-theme="light"] #organizerRateCard [style*="color:#A87600"]:not(#orgRateCode) { color: var(--gold-ink) !important; border-color: currentColor !important; }

/* ── Overview: "Best time to launch" labels on a paper chip ─────────────
   The heat fill runs from 10% to 100% green; text straight on it measured
   1.4–3.8:1. Each label gets its own chip, readable at every intensity. */
.schedule-cell > div {
  display: block;            /* stacked and centred at every cell width */
  width: fit-content;
  margin-inline: auto;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-bright) !important;
}
.schedule-cell > div + div { margin-top: 4px; font-family: var(--mq-mono); font-variant-numeric: tabular-nums; }
/* Audience milestones: near-black on the paper green/gold fills was
   3.0–3.7:1. Done = white on green; next = ink on the bulb gold. */
[data-theme="light"] .milestone-dot.done { color: #fff; }
.milestone-dot.next { background: var(--mq-gold); color: var(--mq-ink); }
/* The dashboard's pulse animations (next milestone, live dots) ran even when the
   system asks for reduced motion, and the opacity pulse washed the label out. */
@media (prefers-reduced-motion: reduce) {
  .milestone-dot.next, .pulse, [class*="pulse"] { animation: none !important; }
}

/* ── Overview: health check — failures first, two columns on desktop ── */
.health-items { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 6px 10px; }
.health-item.fail, .health-item.warn { order: -1; }
.health-item { padding-block: 7px; }
/* The 18px status glyph shrank under long labels, so the text column
   started at a different x on every row. */
.health-icon { flex-shrink: 0; }

/* ── KPI families: colour is the accent line, never the figure ───────── */
.fin-kpi-card, .dayof-kpi {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: 3px solid currentColor;
  border-radius: 12px;
}
.fin-kpi-card:hover { background: var(--card-bg); border-color: var(--card-hover); border-top-color: currentColor; }
.dayof-kpi-value, .fin-kpi-value { color: var(--text-bright); font-family: 'Archivo Narrow', 'Archivo Narrow Fallback', 'Arial Narrow', system-ui, sans-serif; }
.quick-promo-card { background: var(--card-bg); }
.quick-promo-card:hover { background: var(--card-bg); }

/* ── Buttons that broke their pairs ─────────────────────────────────── */
/* Financial "+ Add" / "+ Add Batch": `var(--accent)18` is invalid CSS, so
   they rendered as bare coloured text. They become the outlined slip. */
.fin-add-btn {
  background: transparent;
  border: 1.5px solid var(--mq-control-bd);
  color: var(--text-bright);
}
.fin-add-btn:hover { background: transparent; border-color: var(--text-bright); }
/* The AI button drops its off-palette violet gradient for the ink slip. */
.ai-btn { background: var(--mq-strong) !important; color: var(--mq-on-strong); font-weight: 600; border-radius: 8px; }
/* Save / Cancel (Create Event) and Create / Boost sit at the field height. */
#saveEventBtn, #cancelEventBtn { height: 42px; padding-block: 0 !important; box-sizing: border-box; margin-top: 0; }
#createPromoBtn, #createBoostBtn { height: 42px !important; padding-block: 0 !important; align-self: end; }
@media (max-width: 1023px) {
  #saveEventBtn, #cancelEventBtn, #createPromoBtn, #createBoostBtn { height: var(--tap-min) !important; }
  /* Touch floor (LEAD §4: every touch control ≥44px below 1024px). These
     were measured at 31–43px on phones; dashboard.css's list missed them
     or stopped at 36–40px. */
  .data-table td .action-btn, .data-table td .row-btn { min-width: var(--tap-min); min-height: var(--tap-min); }
  .fin-mode-btn, .fin-calc-input, .btn-upload, .ai-btn, .share-btn, .btn-link-toggle,
  #publicProfileLink, .ds-powerup-grid a, .dayof-qr-url-input, #orgRateCopyBtn, .btn-modal { min-height: var(--tap-min); }
  /* The modal × (21×30) and the topbar Page Manual button (32×28). The ×
     keeps its place: the negative margins give back what the 44px box
     adds, so the modal header stays the same height. */
  .modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    margin: -7px -12px -7px 0;
  }
  #pageManualBtn { min-width: var(--tap-min); min-height: var(--tap-min); justify-content: center; }
}
/* .btn-login carries a form margin-top:8px; inside a toolbar row it pushed
   the button below the field beside it ("Search" on Live Check-in). */
.table-actions .btn-login, .section-header-actions .btn-login { margin-top: 0; }
/* Modal buttons: 32px/12px → the control height. */
.btn-modal { min-height: var(--control-h); font-size: 13px; }

/* ── Field and control heights (LEAD §4) ────────────────────────────────
   Fields: one 42px height (textarea excluded); ≥44px below 1024px. */
.main-content :is(input.form-input, select.form-input, select.filter-select, input.search-input, input.calc-input) {
  height: 42px;
  padding-block: 0 !important;
  font-size: 14px;
  box-sizing: border-box;
}
@media (max-width: 1023px) {
  .main-content :is(input.form-input, select.form-input, select.filter-select, input.search-input, input.calc-input) { min-height: var(--tap-min); }
}
/* Desktop: buttons at the 40px control height, table/toolbar buttons at
   the 32px compact height. Phone/tablet keep dashboard.css's 44px floor. */
@media (min-width: 1024px) {
  .btn-login, .btn-setting, .share-btn, .btn-upload, .ai-btn, .btn-icon-pill { min-height: var(--control-h); }
  .action-btn, .fin-mode-btn, .fin-fx-chip, .fin-sync-btn, .fin-add-btn, .btn-link-toggle, .fin-calc-input,
  .dayof-template-btn { min-height: var(--control-h-xs); }
  .action-btn { min-width: var(--control-h-xs); }
}

/* ── Attendees: "not yet in" must not look like "checked in" ───────────
   The pending action was a bare green ✓, the same colour and glyph as the
   done state in the same column. It becomes a neutral outlined control. */
#page-attendees .data-table .action-btn[title="Check In"] {
  width: auto;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1.5px solid var(--mq-control-bd);
  border-radius: 8px;
  color: var(--text-muted) !important;
  background: transparent;
}
#page-attendees .data-table .action-btn[title="Check In"]:hover { color: var(--text-bright) !important; border-color: var(--text-bright); }
@media (max-width: 1023px) {
  #page-attendees .data-table .action-btn[title="Check In"] { min-width: var(--tap-min); height: var(--tap-min); }
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.data-table td a.row-preview-link { color: inherit; text-decoration: none; }
.data-table td a.row-preview-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* Header-only scaffolding (no rows yet, nothing picked) is hidden; :has()
   re-evaluates the moment script.js fills the tbody. */
.table-wrap:has(> table > tbody:empty) { display: none; }
.activity-feed:empty { display: none; }

@media (min-width: 769px) {
  /* `.actions-cell{display:flex}` on a <td> pulled the cell out of the
     table grid: it overflowed the wrap and broke the row rule. */
  .data-table td.actions-cell { display: table-cell; white-space: nowrap; vertical-align: middle; text-align: right; }
  /* …and its header follows ("ACTIONS" on My Team and Promoters). */
  .data-table:has(td.actions-cell) thead th:last-child { text-align: right; }
  .data-table td.actions-cell .action-btn { vertical-align: middle; }
  .data-table td.actions-cell .action-btn + .action-btn { margin-left: 2px; }
  #page-events .data-table td:nth-child(3) { white-space: normal; min-width: 160px; }

  /* Money and counts line up on their units. No !important: empty-state
     rows carry an inline text-align:center and stay centred. */
  #page-events .data-table :is(th, td):is(:nth-child(5), :nth-child(6)),
  #page-attendees .data-table :is(th, td):is(:nth-child(4), :nth-child(5)),
  #page-promos .data-table :is(th, td):is(:nth-child(2), :nth-child(3)),
  #page-promoters .data-table :is(th, td):nth-child(n+3):nth-child(-n+8),
  #page-buyer-plans .data-table :is(th, td):nth-child(n+3):nth-child(-n+5),
  #page-utm .data-table :is(th, td):not(:first-child),
  #page-boosts .data-table :is(th, td):nth-child(3),
  #page-stories .data-table :is(th, td):nth-child(4),
  #page-announce .data-table :is(th, td):nth-child(4),
  #page-payouts .data-table :is(th, td):nth-child(1) { text-align: right; }

  /* A taller window shows more rows; a hidden column casts an edge shadow
     (covers scroll with the content, shades stay on the edges). */
  .table-wrap {
    max-height: max(500px, calc(100vh - 240px));
    background:
      linear-gradient(to right, var(--card-bg) 30%, transparent) left center / 24px 100% no-repeat local,
      linear-gradient(to left, var(--card-bg) 30%, transparent) right center / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, var(--mq-scroll-shade), transparent) left center / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, var(--mq-scroll-shade), transparent) right center / 10px 100% no-repeat scroll,
      var(--card-bg);
  }
}
:root { --mq-scroll-shade: rgba(0, 0, 0, 0.55); }
[data-theme="light"] { --mq-scroll-shade: rgba(12, 14, 23, 0.16); }

/* Staff roles are not statuses: neutral tags beside the green/gold Status. */
#page-staff .data-table td:nth-child(3) .badge { background: var(--bg-surface2) !important; color: var(--text-sub) !important; box-shadow: inset 0 0 0 1px var(--border); }

/* ── Detail modal: a one-cell row is a sentence, not a key/value pair ── */
#modalBody .modal-row:only-child,
#modalBody .modal-row:has(> .modal-value:empty) { display: block; }
#modalBody .modal-row:only-child > .modal-label,
#modalBody .modal-row:has(> .modal-value:empty) > .modal-label {
  font-family: var(--mq-font);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  color: var(--text);
}
/* Inline, the gap between "…want to delete" and "Name?" is the space
   openModal() now writes between the two spans. */
#modalBody .modal-row:only-child > .modal-value { display: inline; font-size: 15px; }

/* ── Forms ──────────────────────────────────────────────────────────── */
/* "Description" is the label itself (a bare span), not a hint: it prints
   like every other stub label. Hint spans carry inline styles. */
.form-label > span:not([style]) { font-family: var(--mq-mono); letter-spacing: inherit; text-transform: inherit; font-variant-numeric: tabular-nums; }

/* Create Event: the Ticket Types card stops at its content. */
#page-create-event .settings-grid { align-items: start; }

/* Promo form: "Event (optional)" is now in the grid, right before Create
   (index.html), so the submit comes after every field it reads in the
   layout, the Tab order and the reading order alike. Desktop: the four
   fields, then Event + Create on one row; two columns and less: Event
   takes the row and Create follows. */
#page-promos .promo-create-grid > .promo-event-field { grid-column: 1 / -2; }
@media (max-width: 900px) {
  #page-promos .promo-create-grid > .promo-event-field { grid-column: 1 / -1; }
}

/* ── Phones ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Row actions wrap from the left instead of overflowing to the left
     edge, where "Edit" sat at x = −43 on every published event. The
     targets are 44px around 16px glyphs, so a 2px column gap is enough
     spacing and keeps all seven on one line at 390px. */
  .data-table td.actions-cell { flex-wrap: wrap; justify-content: flex-start; gap: 4px 2px; }
  /* A labelled actions row (Staff, Promoters: "ACTIONS") keeps the card's
     label-left / value-right reading; the buttons group on the right. */
  .data-table td.actions-cell:not([data-nolabel])::before { margin-right: auto; }
  .data-table td.actions-cell .action-btn + .action-btn { margin-left: 0; }
  /* Card-mode field labels print like the desktop table heads. */
  .data-table td::before {
    font-family: var(--mq-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
}
@media (max-width: 560px) {
  /* Promo form: Create takes the full row under the last field. */
  #page-promos #createPromoBtn { grid-column: 1 / -1; width: 100% !important; }
}
@media (max-width: 480px) {
  /* Financial: 12 KPI cards two-up instead of a 1,400px single column. */
  .fin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fin-kpi-card { padding: 12px; min-height: 0; }
  .fin-kpi-value { font-size: 22px; }
  /* Same move as the stat stubs on phones: the icon steps aside so the
     label keeps its words ("GROSS REVE…" at 320px otherwise). */
  .fin-kpi-icon { display: none; }
  .fin-kpi-label { letter-spacing: 0.06em; margin-right: 0; }
  /* Create Event: the AI prompt gets the full width above its button. */
  .ai-card .section-header-actions { flex-direction: column; align-items: stretch; }
}
