/* ═══════════════════════════════════════════════════════════════
   Organizer Dashboard v2.0 — Pulso Design System
   Matches Admin Dashboard v2.0 design tokens
   ═══════════════════════════════════════════════════════════════ */

/* ── Theme Variables (v2.0) ── */
:root {
  --bg: #0b0d16;
  --bg-elevated: #0a0a24;
  --bg-surface: rgba(255,255,255,0.035);
  --bg-surface2: rgba(255,255,255,0.065);
  --bg-surface3: rgba(255,255,255,0.09);
  --text: #d8d8ee;
  --text-bright: #f0f0ff;
  --text-sub: #a8a8c0;
  /* #707090 measures 4.01:1 on --bg — just under WCAG AA (4.5:1), and it
     carries every stat label, subtitle and hint. #8a8aa8 reaches 5.4:1
     while staying clearly the muted step below --text-sub. */
  --text-muted: #8a8aa8;
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.05);
  --border-subtle: rgba(255,255,255,0.035);
  --nav-bg: rgba(6,6,26,0.94);
  --card-bg: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.06);
  --card-hover: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.055);
  --select-bg: #0d0d28;
  --sidebar-bg: rgba(6,6,26,0.97);
  --sidebar-width: 272px;
  --accent: #D20E36;
  --accent-hover: #d20e36;
  --accent-glow: rgba(210,14,54,0.25);
  --teal: #178048;
  --gold: #a87600;
  --orange: #c4561d;
  --blue: #4a5fd0;
  --purple: #7b68dd;
  --red: #d20e36;
  --green: #178048;
  /* Accent INK — the same palette used as text rather than as fill.
     On the dark theme an accent works for both, so ink == accent here.
     The light theme overrides these: #178048 text on a 12% teal tint over
     white measures 1.80:1, so every status badge and accent figure failed
     WCAG AA in light mode. Keeping fill and ink as separate tokens fixes
     the text without shifting any background, chart or border colour. */
  --teal-ink: var(--teal);
  --gold-ink: var(--gold);
  --red-ink: var(--red);
  --green-ink: var(--green);
  --blue-ink: var(--blue);
  --purple-ink: var(--purple);
  --orange-ink: var(--orange);
  /* Components that hardcoded a hex for text rather than using a token.
     Dark values are the original hexes, so this theme is byte-identical. */
  --ink-teal2: #178048;
  --ink-teal3: #178048;
  --ink-brand: #D20E36;
  --ink-red2: #D20E36;
  --ink-rose: #E0607F;
  --ink-salmon: #E0607F;
  --ink-gold2: #A87600;
  --ink-amber: #A87600;
  --ink-orange2: #C4561D;
  --ink-purple2: #7B68DD;
  --ink-cyan: #4A5FD0;
  --ink-green2: #178048;
  --gradient-brand: linear-gradient(135deg, #D20E36 0%, #8F0824 50%, #a87600 100%);
  --gradient-brand-subtle: linear-gradient(135deg, rgba(210,14,54,0.12) 0%, rgba(196,86,29,0.08) 50%, rgba(168,118,0,0.06) 100%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.2);
  --shadow-modal: 0 24px 80px rgba(0,0,0,0.6);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Theme (v2.0) ── */
[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface2: #f0ede6;
  --bg-surface3: #e8e5de;
  --text: #151a2b;
  --text-bright: #0d0d1f;
  --text-sub: #555;
  /* #888 measures 3.54:1 on white and 3.20:1 on the page background —
     below WCAG AA (4.5:1) for normal text. It carries every stat label,
     section subtitle, hint and empty state in the dashboard, so the whole
     secondary layer failed in light theme. #6b6b6b gives 5.3:1 on white
     and 4.8:1 on --bg, and stays visibly secondary next to --text-sub. */
  --text-muted: #6b6b6b;
  --border: rgba(20,20,60,0.1);
  --border-light: rgba(20,20,60,0.07);
  --border-subtle: rgba(20,20,60,0.05);
  --nav-bg: rgba(245,243,238,0.94);
  --card-bg: #ffffff;
  --card-border: rgba(20,20,60,0.08);
  --card-hover: rgba(20,20,60,0.04);
  --input-bg: rgba(20,20,60,0.05);
  --select-bg: #f0ede6;
  --sidebar-bg: rgba(245,243,238,0.98);
  --accent-glow: rgba(210,14,54,0.15);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-modal: 0 24px 80px rgba(0,0,0,0.15);
  /* Darkened accents for text on light surfaces. Same hues; each clears
     4.5:1 against its own 12% tint over white. */
  --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;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-surface3); }

/* ── Login Gate ── */
.login-gate {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  min-height: 100vh; padding: 20px;
  background: var(--bg); position: relative; overflow: hidden;
}
.login-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login-bg-orb {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.15;
}
.login-bg-orb-1 { width: 500px; height: 500px; background: #D20E36; top: -150px; right: -100px; animation: orbFloat1 8s ease-in-out infinite alternate; }
.login-bg-orb-2 { width: 400px; height: 400px; background: #8F0824; bottom: -100px; left: -100px; animation: orbFloat2 10s ease-in-out infinite alternate; }
.login-bg-orb-3 { width: 300px; height: 300px; background: #7B68DD; top: 40%; left: 40%; animation: orbFloat3 12s ease-in-out infinite alternate; }
@keyframes orbFloat1 { 0% { transform: translate(0, 0); } 100% { transform: translate(-40px, 30px); } }
@keyframes orbFloat2 { 0% { transform: translate(0, 0); } 100% { transform: translate(30px, -40px); } }
@keyframes orbFloat3 { 0% { transform: translate(0, 0); } 100% { transform: translate(-20px, -20px); } }
.login-wrapper {
  display: flex; align-items: center; gap: 80px;
  position: relative; z-index: 1; max-width: 900px; width: 100%;
}
.login-branding { flex: 1; min-width: 0; }
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl); padding: 40px 36px;
  width: 400px; flex-shrink: 0;
  backdrop-filter: blur(24px);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-brand);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { height: 40px; }
.login-title {
  text-align: center; font-size: 22px; font-weight: 800;
  color: var(--text-bright); margin-bottom: 6px; letter-spacing: -0.3px;
}
.login-subtitle { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  background: var(--input-bg); border-radius: var(--radius-sm); padding: 3px;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 10px; border: none; border-radius: calc(var(--radius-sm) - 2px);
  background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.auth-tab.active {
  background: var(--gradient-brand); color: #fff; box-shadow: 0 2px 8px rgba(210,14,54,0.2);
}
.auth-tab:not(.active):hover { color: var(--text); }
.login-footer {
  position: relative; z-index: 1; margin-top: 40px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
}
.login-footer a { color: var(--text-muted); text-decoration: none; }
.login-footer a:hover { color: var(--text); }
@media (max-width: 768px) {
  .login-wrapper { flex-direction: column; gap: 32px; }
  .login-branding { text-align: center; }
  /* The H1 size and the centred paragraphs (24px !important, margin auto
     !important) went: they fought the gate's own layout in index.html and
     marquee.css (an H1 smaller than the card heading, the sub-copy centred
     under a left-aligned headline at 768). */
  .login-branding > div:last-child { align-items: center; }
  .login-card { width: 100%; max-width: 400px; }
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-sub); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.form-input {
  width: 100%; padding: 12px 16px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.btn-login {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff; font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity var(--transition), transform var(--transition); margin-top: 8px;
}
.btn-login:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.login-error { color: var(--red-ink); font-size: 13px; text-align: center; margin-top: 12px; display: none; }

/* ── Admin Shell ── */
.admin-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width); position: fixed; top: 0; left: 0; bottom: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
  backdrop-filter: blur(24px);
  transition: transform 0.3s, width 0.3s, background-color var(--transition);
}
.sidebar-header {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
.sidebar-collapse-btn {
  margin-left: auto;
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.sidebar-collapse-btn:hover {
  background: var(--bg-surface2);
  color: var(--text-bright);
  border-color: var(--text-muted);
}
.sidebar-collapse-btn svg { width: 14px; height: 14px; }

/* Floating reopen button — appears when sidebar is collapsed */
.sidebar-reopen-btn {
  position: fixed;
  top: 18px; left: 16px;
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: all .15s;
}
.sidebar-reopen-btn:hover {
  background: var(--bg-surface2);
  transform: translateX(2px);
  border-color: var(--text-muted);
}
.sidebar-reopen-btn svg { width: 16px; height: 16px; }

/* Collapsed state — hide sidebar, expand content, show reopen btn */
.admin-shell.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  /* Out of the Tab order once it has slid away (see the drawer rule). */
  visibility: hidden;
  transition: transform 0.3s, width 0.3s, background-color var(--transition), visibility 0s linear 0.3s;
}
.admin-shell.sidebar-collapsed .main-content {
  margin-left: 0;
}
.admin-shell.sidebar-collapsed .sidebar-reopen-btn {
  display: inline-flex;
}
/* Push the topbar content to the right so it doesn't sit under the
   floating reopen button (≈ 36px wide + 16px left + 12px breathing) */
.admin-shell.sidebar-collapsed .topbar {
  padding-left: 68px;
}
.sidebar-header img { height: 36px; filter: drop-shadow(0 1px 4px rgba(210,14,54,0.2)); }
.sidebar-header span {
  font-size: 14px; font-weight: 800; color: var(--text-bright);
  letter-spacing: -0.3px;
}
.sidebar-header .sidebar-sub {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  display: block; margin-top: 2px; letter-spacing: 0;
}
.sidebar-brand { display: flex; flex-direction: column; }
.sidebar-brand-name { font-size: 15px; font-weight: 800; color: var(--text-bright); letter-spacing: -0.3px; line-height: 1.2; }
.sidebar-brand-sub { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.sidebar-user { flex: 1; display: flex; flex-direction: column; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text-bright); }
.sidebar-user-role { font-size: 10px; color: var(--text-muted); }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-breadcrumb { font-size: 11px; color: var(--text-muted); }
.nav-item .nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px;
  border-radius: 10px; min-width: 20px; text-align: center;
}
.nav-item .nav-badge.teal { background: var(--teal); }
.nav-item .nav-badge.gold { background: var(--gold); }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-sub); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition); border: none;
  background: none; width: 100%; text-align: left; font-family: inherit;
  position: relative;
}
.nav-item:hover { background: var(--bg-surface2); color: var(--text-bright); }
.nav-item.active {
  background: rgba(210,14,54,0.08); color: var(--accent);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-section {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; padding: 16px 14px 6px;
}
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-surface2); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon svg { width: 16px; height: 16px; }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width); flex: 1; min-height: 100vh;
  transition: margin-left 0.3s;
  /* A flex item defaults to min-width:auto, so it refuses to shrink below its
     content's min-content width. Without this the whole dashboard rendered
     ~886px wide inside a 360px phone viewport — every @media rule below fired
     correctly and was then overpowered by the flex floor. */
  min-width: 0;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
  transition: background-color var(--transition);
}
.topbar-title {
  font-size: 18px; font-weight: 800; color: var(--text-bright);
  letter-spacing: -0.3px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-email { font-size: 12px; color: var(--text-muted); }

/* Page Manual download button — appears in topbar when current page has a PDF guide */
.page-manual-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, #178048, #4A5FD0);
  border: none;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(23,128,72, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.page-manual-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(23,128,72, 0.35);
}
.page-manual-btn:active { transform: translateY(0); }
@media (max-width: 720px) {
  .page-manual-btn span { display: none; }
  .page-manual-btn { padding: 7px 9px; }
}

.hamburger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.hamburger svg { width: 24px; height: 24px; }

.page-content { padding: 28px 32px; min-width: 0; }
.page-section { min-width: 0; }
/* Same min-width:auto floor as .main-content, one level down: grid/flex items
   can't shrink past their content unless told to. */
.charts-grid > *, .stats-grid > *, .fin-kpi-grid > *,
.perf-grid > *, .settings-grid > *, .fin-detail-row > * { min-width: 0; }
/* Currency/number strings have no break opportunity, so they punch out of
   their card instead of wrapping. */
.stat-value, .fin-kpi-value, .calc-result-value { overflow-wrap: anywhere; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; backdrop-filter: blur(12px);
  transition: transform var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-brand);
  opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--card-hover); }
.stat-card:hover::after { opacity: 1; }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.pink { background: rgba(210,14,54,0.12); color: var(--accent); }
.stat-icon.teal { background: rgba(23,128,72,0.12); color: var(--teal-ink); }
.stat-icon.gold { background: rgba(168,118,0,0.12); color: var(--gold-ink); }
.stat-icon.orange { background: rgba(196,86,29,0.12); color: var(--orange-ink); }
.stat-icon.blue { background: rgba(74,95,208,0.12); color: var(--blue-ink); }
.stat-icon.purple { background: rgba(123,104,221,0.12); color: var(--purple-ink); }
.stat-value {
  font-size: 28px; font-weight: 800; color: var(--text-bright);
  line-height: 1.2; letter-spacing: -0.3px;
  transition: all 0.3s;
}
.stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}

/* ── Charts ── */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 28px; }
.chart-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}
.chart-title {
  font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 16px;
}
.chart-wrap { position: relative; height: 260px; }
.chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

/* ── Detail Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 9000; backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 560px; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-modal); animation: cmdIn 0.2s ease-out;
  position: relative;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 16px; font-weight: 800; color: var(--text-bright); letter-spacing: -0.3px; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 20px; padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--accent); }
.modal-body { padding: 24px; }
.modal-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-row:last-child { border-bottom: none; }
.modal-label { font-size: 13px; color: var(--text-muted); }
.modal-value { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.modal-actions {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}
.btn-modal {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all var(--transition);
  border: 1px solid var(--border);
}
.btn-modal:focus { box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-modal-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-modal-primary:hover { background: var(--accent-hover); }
.btn-modal-danger { background: rgba(210,14,54,0.1); color: var(--red-ink); border-color: var(--red-ink); }
.btn-modal-danger:hover { background: rgba(210,14,54,0.2); }
.btn-modal-default { background: var(--bg-surface2); color: var(--text-sub); }
.btn-modal-default:hover { border-color: var(--accent); color: var(--accent); }

/* ── Revenue Goal Progress ── */
.goal-bar-wrap { margin-bottom: 28px; }
.goal-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.goal-label { font-size: 13px; color: var(--text-sub); }
.goal-value { font-size: 13px; font-weight: 700; color: var(--text-bright); }
.goal-bar { height: 8px; background: var(--bg-surface2); border-radius: 4px; overflow: hidden; }
.goal-fill {
  height: 100%; border-radius: 4px; transition: width 1s ease-out;
  background: var(--gradient-brand);
  position: relative;
}
.goal-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

/* ── Data Tables ── */
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.table-title {
  font-size: 16px; font-weight: 800; color: var(--text-bright);
  letter-spacing: -0.3px;
}
.table-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-input {
  padding: 8px 14px 8px 36px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; width: 240px; transition: border-color var(--transition), box-shadow var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23707090' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z' stroke='%23707090' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.filter-select {
  padding: 8px 12px; background: var(--select-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.table-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card); max-height: 500px;
  overflow-x: auto; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg-surface2); color: var(--text-muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; font-size: 13px; color: var(--text-sub);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tr:hover td { background: var(--bg-surface); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Sticky Table Headers ── */
.data-table thead { position: sticky; top: 0; z-index: 5; }
.data-table thead th { background: var(--bg-surface2); backdrop-filter: blur(12px); }
[data-theme="light"] .data-table thead th { background: #eee; }

/* ── Status Badges ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-xl);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-confirmed, .badge-published, .badge-active, .badge-completed { background: rgba(23,128,72,0.12); color: var(--teal-ink); }
.badge-pending, .badge-draft, .badge-processing { background: rgba(168,118,0,0.12); color: var(--gold-ink); }
.badge-refunded, .badge-cancelled, .badge-failed, .badge-inactive { background: rgba(210,14,54,0.12); color: var(--red-ink); }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 6px; }
.page-btn {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-sub); font-size: 12px;
  cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Loading ── */
.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-muted); font-size: 14px;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ── Section Header ── */
.section-header { margin-bottom: 24px; }
.section-title {
  font-size: 20px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 4px; letter-spacing: -0.3px;
}
.section-subtitle { font-size: 13px; color: var(--text-muted); }

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.setting-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-card);
}
.setting-card h3 {
  font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 12px;
}
.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.setting-item:last-child { border-bottom: none; }
.setting-label { font-size: 13px; color: var(--text-sub); }
.setting-value { font-size: 13px; color: var(--text-muted); font-family: 'Inter', sans-serif; }
.btn-setting {
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-surface2); color: var(--text); font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.btn-setting:hover { border-color: var(--accent); color: var(--accent); }
.btn-setting:focus { box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Sparkline in Cards ── */
.stat-sparkline { margin-top: 8px; height: 32px; }
.stat-sparkline svg { width: 100%; height: 32px; }
.stat-sparkline path { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.stat-sparkline .fill { stroke: none; opacity: 0.1; }

/* ── Trend Indicator ── */
.stat-trend {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  font-weight: 600; margin-top: 4px; padding: 2px 8px; border-radius: var(--radius-md);
}
.stat-trend.up { color: var(--teal-ink); background: rgba(23,128,72,0.1); }
.stat-trend.down { color: var(--red-ink); background: rgba(210,14,54,0.1); }
.stat-trend svg { width: 12px; height: 12px; }

/* ── Skeleton Loading ── */
.skeleton { background: var(--bg-surface2); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.5s infinite;
}
[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04), transparent);
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }
.skeleton-row { height: 48px; margin-bottom: 4px; }
.skeleton-chart { height: 260px; border-radius: var(--radius-lg); }

/* ── Toast Notifications ── */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500;
  color: #fff; display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(24px); box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease-out; min-width: 280px;
  border: 1px solid rgba(255,255,255,0.1);
}
.toast.hiding { animation: toastOut 0.3s ease-in forwards; }
.toast-success { background: rgba(23,128,72,0.9); }
.toast-error { background: rgba(210,14,54,0.9); }
.toast-info { background: rgba(74,95,208,0.9); }
.toast-warning { background: rgba(168,118,0,0.9); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ── Command Palette ── */
.cmd-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 10000; backdrop-filter: blur(6px);
}
.cmd-overlay.open { display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.cmd-palette {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 520px; max-height: 400px; overflow: hidden;
  box-shadow: var(--shadow-modal);
  animation: cmdIn 0.2s ease-out;
}
@keyframes cmdIn { from { transform: scale(0.95) translateY(-10px); opacity: 0; } }
.cmd-input-wrap {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.cmd-input-wrap svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.cmd-input {
  flex: 1; background: none; border: none; color: var(--text-bright);
  font-size: 15px; font-family: inherit; outline: none;
}
.cmd-input::placeholder { color: var(--text-muted); }
.cmd-results { max-height: 300px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-sub); font-size: 13px;
  transition: background 0.15s;
}
.cmd-item:hover, .cmd-item.selected { background: var(--bg-surface2); color: var(--text-bright); }
.cmd-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.cmd-item .cmd-shortcut {
  margin-left: auto; font-size: 11px; color: var(--text-muted);
  background: var(--bg-surface); padding: 2px 6px; border-radius: 4px;
}
.cmd-hint {
  padding: 12px 16px; font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--border-subtle); text-align: center;
}

/* ── Activity Feed ── */
.activity-feed {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 16px; max-height: 320px; overflow-y: auto;
  box-shadow: var(--shadow-card);
}
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.green { background: var(--teal); }
.activity-dot.pink { background: var(--accent); }
.activity-dot.gold { background: var(--gold); }
.activity-dot.blue { background: var(--blue); }
.activity-text { font-size: 13px; color: var(--text-sub); line-height: 1.4; }
.activity-text strong { color: var(--text-bright); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Connection Status ── */
.conn-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.conn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.last-updated { font-size: 10px; color: var(--text-muted); }

/* ── Sortable Columns ── */
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--accent); }
.data-table th .sort-icon { display: inline-block; margin-left: 4px; font-size: 10px; opacity: 0.4; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--accent); }

/* ── Row Actions ── */
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
tr:hover .row-actions { opacity: 1; }
.row-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-surface2); color: var(--text-sub); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.row-btn:hover { border-color: var(--accent); color: var(--accent); }
.row-btn svg { width: 14px; height: 14px; }

/* ── Page Transitions ── */
.page-section.active { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Date Range Picker ── */
.date-range { display: flex; gap: 8px; align-items: center; }
.date-input {
  padding: 7px 10px; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 12px;
  font-family: inherit; outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.date-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Bulk Actions Bar ── */
.bulk-bar {
  display: none; position: sticky; bottom: 0; z-index: 60;
  background: var(--accent); color: #fff; padding: 12px 24px;
  border-radius: var(--radius-md) var(--radius-md) 0 0; margin: 0 -1px;
  align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
.bulk-bar.visible { display: flex; }
.bulk-info { font-size: 13px; font-weight: 600; }
.bulk-actions { display: flex; gap: 8px; }
.bulk-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.bulk-btn:hover { background: rgba(255,255,255,0.2); }
.bulk-btn.danger { border-color: rgba(255,255,255,0.5); }

/* ── Checkbox in tables ── */
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Heatmap ── */
.heatmap-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card);
}
.heatmap-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; }
.heatmap-grid { display: grid; grid-template-columns: 40px repeat(4, 1fr); gap: 3px; max-width: 500px; }
.heatmap-label { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; }
.heatmap-cell {
  height: 24px; border-radius: 4px; transition: all var(--transition);
  position: relative; cursor: default;
}
.heatmap-cell:hover { transform: scale(1.1); z-index: 1; }
.heatmap-header { font-size: 10px; color: var(--text-muted); text-align: center; }

/* ── Avatar Initials ── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  color: #fff; flex-shrink: 0; margin-right: 8px; vertical-align: middle;
}
.avatar-1 { background: linear-gradient(135deg, var(--accent), var(--orange)); }
.avatar-2 { background: linear-gradient(135deg, var(--teal), var(--blue)); }
.avatar-3 { background: linear-gradient(135deg, var(--purple), var(--accent)); }
.avatar-4 { background: linear-gradient(135deg, var(--gold), var(--orange)); }
.avatar-5 { background: linear-gradient(135deg, var(--blue), var(--teal)); }

/* ── Results Count ── */
.results-count { font-size: 11px; color: var(--text-muted); margin-left: 8px; }

/* ── Keyboard Shortcuts Modal ── */
.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shortcut-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.shortcut-key {
  background: var(--bg-surface2); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  color: var(--text-sub); font-family: 'Inter', sans-serif; min-width: 60px; text-align: center;
}
.shortcut-desc { font-size: 12px; color: var(--text-muted); }

/* ── Status Mini Chart ── */
.status-chart { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.status-bar-segment { height: 8px; border-radius: 4px; transition: width 0.8s ease-out; }

/* ── Revenue Comparison Widget ── */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.comparison-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}
.comparison-title {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 8px; font-weight: 700;
}
.comparison-value { font-size: 24px; font-weight: 800; color: var(--text-bright); letter-spacing: -0.3px; }
.comparison-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.comparison-bar { display: flex; gap: 4px; align-items: flex-end; height: 40px; margin-top: 12px; }
.comparison-bar-item { flex: 1; border-radius: 3px 3px 0 0; transition: height 0.8s ease-out; min-height: 2px; }

/* ── Event Countdown ── */
.countdown-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.countdown-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); padding: 16px; display: flex; align-items: center; gap: 16px;
  transition: border-color var(--transition); box-shadow: var(--shadow-card);
}
.countdown-card:hover { border-color: var(--accent); }
.countdown-timer { display: flex; gap: 6px; }
.countdown-unit { text-align: center; }
.countdown-num { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1; }
.countdown-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.countdown-info { flex: 1; }
.countdown-name { font-size: 13px; font-weight: 700; color: var(--text-bright); }
.countdown-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Geo Distribution ── */
.geo-list {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card);
}
.geo-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.geo-item:last-child { border-bottom: none; }
.geo-flag { font-size: 18px; }
.geo-city { font-size: 13px; color: var(--text-bright); flex: 1; }
.geo-count { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.geo-bar { width: 80px; height: 6px; background: var(--bg-surface2); border-radius: 3px; overflow: hidden; }
.geo-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.8s ease-out; }

/* ── Quick Action Buttons ── */
.action-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid transparent;
  background: none; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition); padding: 0;
}
.action-btn:hover { color: var(--accent); border-color: var(--border); background: var(--bg-surface2); }
.action-btn.danger:hover { color: var(--red-ink); }
.action-btn svg { width: 14px; height: 14px; }
.actions-cell { display: flex; gap: 2px; }

/* ── Dashboard Footer ── */
.dash-footer {
  padding: 20px 32px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-top: 40px;
}
.dash-footer a { color: var(--text-muted); transition: color var(--transition); }
.dash-footer a:hover { color: var(--accent); }

/* ── Confetti ── */
.confetti-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 99999; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -10px;
  width: 10px; height: 10px; border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ── Fullscreen Toggle ── */
.fullscreen-btn { position: fixed; bottom: 16px; right: 16px; z-index: 200; }

/* ── Session Warning ── */
.session-bar {
  display: none; position: fixed; bottom: 0; left: var(--sidebar-width); right: 0;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  color: #fff; padding: 8px 24px; font-size: 12px; font-weight: 600;
  z-index: 200; text-align: center;
}
.session-bar.visible { display: block; }
.session-bar button {
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 11px;
  cursor: pointer; margin-left: 12px; transition: background var(--transition);
}
.session-bar button:hover { background: rgba(255,255,255,0.3); }

/* ── Welcome Banner ── */
.welcome-banner {
  background: var(--gradient-brand-subtle);
  border: 1px solid rgba(210,14,54,0.15); border-radius: var(--radius-lg);
  padding: 20px 24px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.welcome-text h2 {
  font-size: 18px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 4px; letter-spacing: -0.3px;
}
.welcome-text p { font-size: 13px; color: var(--text-sub); }
.welcome-actions { display: flex; gap: 8px; }
.welcome-btn {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all var(--transition); border: none;
}
.welcome-btn-primary { background: var(--accent); color: #fff; }
.welcome-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.welcome-btn-secondary { background: var(--bg-surface2); color: var(--text-sub); border: 1px solid var(--border); }
.welcome-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Metric Tooltip ── */
.stat-tooltip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 11px; color: var(--text-sub); white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); z-index: 10;
}
.stat-card:hover .stat-tooltip { display: block; }

/* ── Gauge Chart ── */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; }
.gauge-svg { filter: drop-shadow(0 2px 8px rgba(210,14,54,0.15)); }
.gauge-label {
  font-size: 11px; color: var(--text-muted); margin-top: 8px;
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.gauge-score { font-size: 28px; font-weight: 800; letter-spacing: -0.3px; }

/* ── Forecast Banner ── */
.forecast-card {
  background: linear-gradient(135deg, rgba(74,95,208,0.08), rgba(23,128,72,0.08));
  border: 1px solid rgba(74,95,208,0.15); border-radius: var(--radius-lg);
  padding: 20px 24px; margin-bottom: 24px; display: flex; align-items: center; gap: 16px;
}
.forecast-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: rgba(74,95,208,0.12); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.forecast-icon svg { width: 24px; height: 24px; color: var(--blue-ink); }
.forecast-text { flex: 1; }
.forecast-title {
  font-size: 14px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 4px; letter-spacing: -0.3px;
}
.forecast-desc { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.forecast-value { font-size: 24px; font-weight: 800; color: var(--teal-ink); letter-spacing: -0.3px; }

/* ── Anomaly Alert ── */
.anomaly-alert {
  background: linear-gradient(135deg, rgba(210,14,54,0.08), rgba(210,14,54,0.08));
  border: 1px solid rgba(210,14,54,0.2); border-radius: var(--radius-lg);
  padding: 16px 24px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px;
  animation: anomalyPulse 2s infinite;
}
@keyframes anomalyPulse { 0%,100% { border-color: rgba(210,14,54,0.2); } 50% { border-color: rgba(210,14,54,0.5); } }
.anomaly-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: rgba(210,14,54,0.12); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.anomaly-icon svg { width: 20px; height: 20px; color: var(--red-ink); }
.anomaly-text { flex: 1; font-size: 13px; color: var(--text-sub); }
.anomaly-text strong { color: var(--text-bright); }

/* ── Performance Score Cards ── */
.perf-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.perf-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 16px; text-align: center;
  backdrop-filter: blur(12px); box-shadow: var(--shadow-card);
}
.perf-name {
  font-size: 12px; font-weight: 700; color: var(--text-bright); margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.perf-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Narrative Insight ── */
.narrative-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.narrative-title {
  font-size: 14px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.3px;
}
.narrative-title svg { width: 18px; height: 18px; color: var(--blue-ink); }
.narrative-body { font-size: 13px; color: var(--text-sub); line-height: 1.8; }
.narrative-body strong { color: var(--text-bright); }
.narrative-body .highlight { color: var(--accent); font-weight: 600; }
.narrative-body .positive { color: var(--teal-ink); }
.narrative-body .negative { color: var(--red-ink); }

/* ── Live Order Ticker ── */
.ticker-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 24px;
  position: relative; height: 44px;
}
.ticker-label {
  position: absolute; left: 0; top: 0; bottom: 0; width: 80px;
  background: linear-gradient(90deg, var(--accent), rgba(210,14,54,0.6));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; text-transform: uppercase;
  letter-spacing: 1px; z-index: 2;
}
.ticker-label::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; margin-right: 6px; animation: pulse 1.5s infinite;
}
.ticker-track {
  display: flex; align-items: center; height: 44px;
  animation: tickerScroll 40s linear infinite;
  padding-left: 90px;
}
.ticker-item {
  display: flex; align-items: center; gap: 6px; padding: 0 20px;
  white-space: nowrap; font-size: 12px; color: var(--text-sub);
  border-right: 1px solid var(--border-subtle); height: 100%;
}
.ticker-item:last-child { border-right: none; }
.ticker-item strong { color: var(--text-bright); }
.ticker-amount { color: var(--teal-ink); font-weight: 700; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── Funnel Chart ── */
.funnel-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.funnel-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 16px; }
.funnel-stages { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.funnel-stage {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 12px 20px; border-radius: var(--radius-sm); transition: all 0.3s;
  position: relative;
}
.funnel-bar {
  height: 32px; border-radius: 6px; display: flex; align-items: center;
  padding: 0 12px; font-size: 12px; font-weight: 600; color: #fff;
  transition: width 1s ease-out; min-width: 40px; max-width: 100%;
}
.funnel-label { font-size: 13px; color: var(--text-sub); min-width: 120px; }
.funnel-value { font-size: 13px; font-weight: 700; color: var(--text-bright); min-width: 60px; text-align: right; }
.funnel-drop { font-size: 11px; color: var(--red-ink); margin-left: 8px; }

/* ── Leaderboard ── */
.leaderboard {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card);
}
.leaderboard-title {
  font-size: 14px; font-weight: 700; color: var(--text-bright);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.leaderboard-title svg, .leaderboard svg { width: 18px; height: 18px; flex-shrink: 0; }
.leaderboard-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #F5B82E, #A87600); color: #000; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.rank-3 { background: linear-gradient(135deg, #A87600, #A83E00); color: #fff; }
.rank-other { background: var(--bg-surface2); color: var(--text-muted); }
.leaderboard-name { flex: 1; font-size: 13px; color: var(--text-bright); font-weight: 500; }
.leaderboard-stat { font-size: 13px; font-weight: 700; color: var(--teal-ink); }
.leaderboard-bar { width: 80px; height: 6px; background: var(--bg-surface2); border-radius: 3px; overflow: hidden; }
.leaderboard-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease-out; }

/* ── Cohort Matrix ── */
.cohort-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; overflow-x: auto;
  box-shadow: var(--shadow-card);
}
.cohort-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 16px; }
.cohort-table { border-collapse: collapse; width: 100%; }
.cohort-table th {
  font-size: 10px; color: var(--text-muted); padding: 6px 10px;
  text-align: center; text-transform: uppercase; font-weight: 700; letter-spacing: 0.8px;
}
.cohort-table td { padding: 4px; text-align: center; }
.cohort-cell {
  width: 44px; height: 28px; border-radius: 4px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 600;
  color: #fff; transition: all var(--transition);
}
.cohort-cell:hover { transform: scale(1.15); }
.cohort-label {
  font-size: 11px; color: var(--text-muted); text-align: left;
  padding-right: 12px; white-space: nowrap;
}

/* ── Event Comparison ── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.compare-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card);
}
.compare-header {
  font-size: 14px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.3px;
}
.compare-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.compare-row:last-child { border-bottom: none; }
.compare-metric { font-size: 12px; color: var(--text-muted); }
.compare-value { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.compare-winner { color: var(--teal-ink); }

/* ── Top Loading Bar ── */
.loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99999;
  pointer-events: none;
}
.loading-bar-fill {
  height: 100%; width: 0%;
  background: var(--gradient-brand);
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent);
}
.loading-bar-fill.active { animation: loadBarProgress 2s ease-out forwards; }
.loading-bar-fill.done { width: 100% !important; transition: width 0.2s; }
.loading-bar-fill.fade { opacity: 0; transition: opacity 0.4s; }
@keyframes loadBarProgress { 0% { width: 0; } 30% { width: 45%; } 60% { width: 70%; } 80% { width: 85%; } 100% { width: 92%; } }

/* ── Row Hover Tooltip ── */
.row-tooltip {
  display: none; position: fixed; z-index: 9000;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); pointer-events: none;
  font-size: 12px; color: var(--text-sub);
}
.row-tooltip.visible { display: block; animation: fadeIn 0.15s ease-out; }
.row-tooltip-title { font-size: 13px; font-weight: 700; color: var(--text-bright); margin-bottom: 6px; }
.row-tooltip-row { display: flex; justify-content: space-between; padding: 2px 0; }
.row-tooltip-label { color: var(--text-muted); }
.row-tooltip-value { font-weight: 600; color: var(--text-bright); }

/* ── Smart Insights ── */
.insights-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.insight-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); padding: 16px; display: flex; gap: 12px;
  align-items: flex-start; transition: border-color var(--transition);
  box-shadow: var(--shadow-card);
}
.insight-card:hover { border-color: var(--accent); }
.insight-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.insight-icon svg { width: 18px; height: 18px; }
.insight-icon.green { background: rgba(23,128,72,0.12); color: var(--teal-ink); }
.insight-icon.pink { background: rgba(210,14,54,0.12); color: var(--accent); }
.insight-icon.gold { background: rgba(168,118,0,0.12); color: var(--gold-ink); }
.insight-icon.blue { background: rgba(74,95,208,0.12); color: var(--blue-ink); }
.insight-text { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.insight-text strong { color: var(--text-bright); }

/* ── Notification Bell ── */
.notif-bell { position: relative; }
.notif-count {
  position: absolute; top: -4px; right: -4px; width: 16px; height: 16px;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.notif-dropdown {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 320px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 200; overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text-bright);
}
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
  padding: 10px 16px; border-bottom: 1px solid var(--border-subtle);
  font-size: 12px; color: var(--text-sub); cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-surface2); }
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.notif-item.unread { border-left: 3px solid var(--accent); }

/* ── Kbd shortcut hint in topbar ── */
.kbd-hint {
  font-size: 11px; color: var(--text-muted); background: var(--bg-surface);
  border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px;
  cursor: pointer; transition: all var(--transition);
}
.kbd-hint:hover { border-color: var(--accent); color: var(--accent); }

/* ── i18n Language Selector ── */
.lang-selector {
  display: flex; gap: 2px; background: var(--bg-surface2);
  border-radius: 6px; padding: 2px;
}
.lang-btn {
  padding: 3px 8px; border: none; border-radius: 4px; font-size: 10px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--text-muted); transition: all var(--transition);
}
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn:hover:not(.active) { color: var(--text-bright); }

/* ── Audit Log ── */
.audit-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle); font-size: 13px;
}
.audit-item:last-child { border-bottom: none; }
.audit-time { font-size: 11px; color: var(--text-muted); min-width: 80px; flex-shrink: 0; }
.audit-action { color: var(--text-sub); flex: 1; }
.audit-action strong { color: var(--text-bright); }
.audit-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; }
.audit-view { background: rgba(74,95,208,0.1); color: var(--blue-ink); }
.audit-export { background: rgba(23,128,72,0.1); color: var(--teal-ink); }
.audit-login { background: rgba(210,14,54,0.1); color: var(--accent); }

/* ── Revenue Calculator ── */
.calc-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card);
}
.calc-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.calc-input {
  flex: 1; min-width: 0; padding: 10px 14px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.calc-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.calc-label { font-size: 12px; color: var(--text-muted); min-width: 100px; }
.calc-result {
  background: linear-gradient(135deg, rgba(23,128,72,0.08), rgba(74,95,208,0.08));
  border: 1px solid rgba(23,128,72,0.15); border-radius: var(--radius-md);
  padding: 16px; margin-top: 16px; text-align: center;
}
.calc-result-value { font-size: 28px; font-weight: 800; color: var(--teal-ink); letter-spacing: -0.3px; }
.calc-result-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.calc-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.calc-breakdown-item { text-align: center; }
.calc-breakdown-num { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.calc-breakdown-label { font-size: 10px; color: var(--text-muted); }

/* ── Progress Ring ── */
.progress-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-text { position: absolute; font-size: 11px; font-weight: 700; color: var(--text-bright); }

/* ═══════════════════════════════════════════════════════════════
   ORGANIZER-SPECIFIC COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Health Check ── */
.health-check {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.health-title {
  font-size: 14px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.3px;
}
.health-score-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.health-score-num { font-size: 32px; font-weight: 800; letter-spacing: -0.3px; }
.health-score-fill { flex: 1; height: 8px; background: var(--bg-surface2); border-radius: 4px; overflow: hidden; }
.health-score-fill-inner { height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.health-items { display: grid; gap: 6px; }
.health-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); background: var(--bg-surface);
  font-size: 13px; color: var(--text-sub); transition: background var(--transition);
}
.health-item.pass { border-left: 3px solid var(--teal); }
.health-item.fail { border-left: 3px solid var(--red); }
.health-item.warn { border-left: 3px solid var(--gold); }
.health-icon { width: 18px; text-align: center; font-size: 12px; }

/* ── Segmentation Tags ── */
.seg-tag {
  display: inline-flex; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; margin-left: 6px;
}
.seg-vip { background: rgba(168,118,0,0.12); color: var(--gold-ink); }
.seg-repeat { background: rgba(74,95,208,0.12); color: var(--blue-ink); }
.seg-new { background: rgba(23,128,72,0.12); color: var(--teal-ink); }

/* ── Survey Feedback ── */
.survey-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card);
}
.survey-stars { font-size: 20px; margin: 8px 0; }
.survey-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.survey-bar { flex: 1; height: 6px; background: var(--bg-surface2); border-radius: 3px; overflow: hidden; }
.survey-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.8s ease-out; }

/* ── Share Tools ── */
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-sub); font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Revenue Tips ── */
.tip-card {
  background: linear-gradient(135deg, rgba(168,118,0,0.06), rgba(196,86,29,0.06));
  border: 1px solid rgba(168,118,0,0.12); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 8px; font-size: 13px;
  color: var(--text-sub); line-height: 1.5;
  display: flex; gap: 10px; align-items: flex-start;
}
.tip-card strong { color: var(--text-bright); }
.tip-bullet { color: var(--gold-ink); font-size: 16px; flex-shrink: 0; }

/* ── AI Generator ── */
.ai-card {
  background: linear-gradient(135deg, rgba(123,104,221,0.08), rgba(74,95,208,0.08));
  border: 1px solid rgba(123,104,221,0.15); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 16px;
}
.ai-title {
  font-size: 14px; font-weight: 800; color: var(--text-bright);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.3px;
}
.ai-output {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; font-size: 13px;
  color: var(--text-sub); line-height: 1.7; min-height: 60px; white-space: pre-wrap;
}
.ai-btn {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: opacity var(--transition), transform var(--transition);
}
.ai-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.ai-btn:disabled { opacity: 0.5; transform: none; }

/* ── Revenue Simulator ── */
.sim-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card);
}
.sim-scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.sim-scenario {
  text-align: center; padding: 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border); transition: border-color var(--transition);
}
.sim-scenario.pessimistic { border-color: rgba(210,14,54,0.3); }
.sim-scenario.realistic { border-color: rgba(168,118,0,0.3); }
.sim-scenario.optimistic { border-color: rgba(23,128,72,0.3); }
.sim-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 4px; font-weight: 700;
}
.sim-value { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.sim-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Smart Schedule ── */
.schedule-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.schedule-cell {
  text-align: center; padding: 8px 4px; border-radius: 6px;
  font-size: 11px; cursor: default; transition: all var(--transition);
}
.schedule-cell:hover { transform: scale(1.05); }
.schedule-header { font-size: 10px; color: var(--text-muted); font-weight: 700; letter-spacing: 0.8px; }
.schedule-best { border: 2px solid var(--teal); }

/* ── Audience Tracker ── */
.milestone-track {
  display: flex; align-items: center; gap: 0; margin: 16px 0; position: relative;
}
.milestone-line { flex: 1; height: 3px; background: var(--bg-surface2); }
.milestone-line.done { background: var(--teal); }
.milestone-dot {
  width: 24px; height: 24px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 10px;
  font-weight: 700; z-index: 1; flex-shrink: 0;
}
.milestone-dot.done { background: var(--teal); color: #0B0D16; }
.milestone-dot.next { background: var(--gold); color: #0B0D16; animation: pulse 2s infinite; }
.milestone-dot.future { background: var(--bg-surface2); color: var(--text-muted); }

/* ── Marketing ROI ── */
.roi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.roi-channel {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
  transition: border-color var(--transition);
}
.roi-channel:hover { border-color: var(--accent); }
.roi-channel-name { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 700; letter-spacing: 0.8px; }
.roi-channel-value { font-size: 18px; font-weight: 800; color: var(--text-bright); letter-spacing: -0.3px; }
.roi-channel-sub { font-size: 10px; color: var(--text-muted); }

/* ── Exclusive Badge ── */
.exclusive-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: var(--radius-md); font-size: 10px; font-weight: 700;
  background: linear-gradient(135deg, rgba(168,118,0,0.15), rgba(196,86,29,0.15));
  color: var(--gold-ink); border: 1px solid rgba(168,118,0,0.2);
}

/* ── Pinned/Favorites ── */
.pin-btn {
  cursor: pointer; background: none; border: none; color: var(--text-muted);
  padding: 2px; transition: all var(--transition);
}
.pin-btn:hover, .pin-btn.pinned { color: var(--gold-ink); }
.pin-btn svg { width: 14px; height: 14px; }
.pinned-section { margin-bottom: 24px; }
.pinned-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px;
}
.pinned-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pinned-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--bg-surface2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); font-size: 12px; color: var(--text-sub);
  cursor: pointer; transition: all var(--transition);
}
.pinned-chip:hover { border-color: var(--accent); color: var(--accent); }
.pinned-chip svg { width: 12px; height: 12px; color: var(--gold-ink); }

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE EXTRA POLISH
   ═══════════════════════════════════════════════════════════════ */
[data-theme="light"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .chart-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .sidebar { box-shadow: 2px 0 8px rgba(0,0,0,0.04); }
[data-theme="light"] .topbar { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
[data-theme="light"] .welcome-banner { background: linear-gradient(135deg, rgba(210,14,54,0.04), rgba(196,86,29,0.04)); }
[data-theme="light"] .forecast-card { background: linear-gradient(135deg, rgba(74,95,208,0.04), rgba(23,128,72,0.04)); }
[data-theme="light"] .anomaly-alert { background: linear-gradient(135deg, rgba(210,14,54,0.04), rgba(210,14,54,0.04)); }
[data-theme="light"] .modal { box-shadow: var(--shadow-modal); }
[data-theme="light"] .cmd-palette { box-shadow: var(--shadow-modal); }
[data-theme="light"] .toast { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
[data-theme="light"] .insight-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .comparison-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .countdown-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .leaderboard { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .narrative-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .perf-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .notif-dropdown { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
[data-theme="light"] .login-card { box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
[data-theme="light"] .badge-confirmed, [data-theme="light"] .badge-published, [data-theme="light"] .badge-active { background: rgba(23,128,72,0.08); }
[data-theme="light"] .badge-pending, [data-theme="light"] .badge-draft, [data-theme="light"] .badge-processing { background: rgba(168,118,0,0.08); }
[data-theme="light"] .badge-refunded, [data-theme="light"] .badge-cancelled, [data-theme="light"] .badge-failed, [data-theme="light"] .badge-inactive { background: rgba(210,14,54,0.08); }
[data-theme="light"] .ai-card { background: linear-gradient(135deg, rgba(123,104,221,0.04), rgba(74,95,208,0.04)); }
[data-theme="light"] .tip-card { background: linear-gradient(135deg, rgba(168,118,0,0.04), rgba(196,86,29,0.04)); }
[data-theme="light"] .health-check { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .survey-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .sim-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .calc-wrap { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Tablet landscape: icon-only sidebar */
  .sidebar { width: 70px; }
  .sidebar-header span, .sidebar-header .sidebar-sub, .nav-item span, .nav-section { display: none; }
  .sidebar-header { justify-content: center; padding: 16px; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 70px; }
  .charts-grid { grid-template-columns: 1fr; }
  .sim-scenarios { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  /* The rail is 70px wide but the logo is a 2.8:1 wordmark at height:36px —
     101px — so it spilled out of the sidebar and over the topbar. */
  .sidebar-header { padding: 18px 8px 16px; }
  .sidebar-header img { height: auto; width: 100%; max-width: 52px; }
}
@media (max-width: 768px) {
  /* ── Sidebar: off-canvas drawer ── */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: 200;
    /* smooth open/close. A closed drawer is also visibility:hidden (after
       the slide) so its ~28 links leave the Tab order and the screen-reader
       tree instead of sitting off-screen in front of the page content. */
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.28s;
  }
  .sidebar.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  /* restore text labels hidden by the 1024px rule */
  .sidebar-header span,
  .sidebar-header .sidebar-sub,
  .nav-item span,
  .nav-section { display: block; }

  /* ── Overlay ── */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 190;
    /* sits just below the sidebar (z-index 200) */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sidebar.open ~ .sidebar-overlay { display: block; }

  /* ── Main content fills full width ── */
  .main-content { margin-left: 0; }

  /* ── Topbar ── */
  .hamburger { display: flex; align-items: center; min-width: 44px; min-height: 44px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
  .topbar-right {
    gap: 6px;
    flex-shrink: 0;
    /* prevent topbar-right from being squashed below title */
    overflow: hidden;
  }
  /* Hide verbose items on small screens */
  .topbar-email { display: none; }
  .conn-status .last-updated { display: none; }
  .kbd-hint { display: none; }

  /* ── Page content ── */
  .page-content { padding: 16px 14px; }

  /* ── Stat/KPI grids ── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
  .countdown-grid { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .sim-scenarios { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: repeat(4, 1fr); }
  .insights-grid { grid-template-columns: 1fr; }
  .roi-grid { grid-template-columns: repeat(2, 1fr); }
  .shortcuts-grid { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Welcome banner ── */
  .welcome-banner { flex-direction: column; gap: 12px; }
  .welcome-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .welcome-btn { min-height: 44px; }

  /* ── Charts ── */
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 200px; }

  /* ── Tables: prevent horizontal page blowout ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-actions { width: 100%; flex-wrap: wrap; }
  .search-input { width: 100%; }
  .filter-select { flex: 1; min-width: 0; }
  .date-range { flex-wrap: wrap; }
  .date-input { flex: 1; min-width: 120px; }

  /* ── Modals: near-full-screen on mobile ── */
  .modal {
    width: 94vw;
    max-width: none;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    margin: 0 auto;
  }
  .modal-overlay { padding: 0 3vw; align-items: flex-end; padding-bottom: 0; }
  .modal-overlay.open { align-items: center; }
  .modal-actions { flex-wrap: wrap; gap: 8px; }
  .modal-actions .btn-modal { flex: 1; min-height: 44px; text-align: center; justify-content: center; }

  /* ── Command palette ── */
  .cmd-palette { width: 94vw; }

  /* ── Session bar ── */
  .session-bar { left: 0; }

  /* ── Financial section: see LATE RESPONSIVE OVERRIDES at the end of this
        file. Its base grids are declared ~700 lines below this block, so a
        rule written here loses on source order and never renders. ── */

  /* ── Bulk actions bar ── */
  .bulk-bar { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .bulk-actions { width: 100%; flex-wrap: wrap; }
  .bulk-btn { flex: 1; min-height: 44px; justify-content: center; }

  /* ── Section header: stack on mobile ── */
  .section-header { margin-bottom: 16px; }

  /* ── Pagination ── */
  .pagination { flex-direction: column; gap: 8px; align-items: flex-start; }

  /* ── Forecast + anomaly ── */
  .forecast-card { flex-direction: column; align-items: flex-start; }
  .anomaly-alert { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* ── Revenue simulator scenarios ── */
  .sim-scenarios { grid-template-columns: 1fr; gap: 8px; }

  /* ── Notification dropdown ── */
  .notif-dropdown { width: calc(100vw - 32px); right: -8px; }

  /* ── Heatmap ── */
  .heatmap-grid { grid-template-columns: 40px repeat(3, 1fr); }

  /* ── Calc breakdown ── */
  .calc-breakdown { grid-template-columns: repeat(2, 1fr); }

  /* ── Settings grid ── */
  .settings-grid { grid-template-columns: 1fr; }

  /* ── Hide collapse + reopen on mobile — hamburger handles open/close ── */
  .sidebar-collapse-btn, .sidebar-reopen-btn { display: none !important; }

  /* ── Topbar-left: prevent title overflow ── */
  .topbar-left { min-width: 0; overflow: hidden; }
  .topbar-left > div { min-width: 0; overflow: hidden; }

  /* ── Touch targets: nav items ── */
  .nav-item { min-height: 48px; }
  .btn-icon { width: 44px; height: 44px; }
  .page-btn { min-height: 40px; padding: 8px 14px; }
  .row-btn { width: 36px; height: 36px; }
  .action-btn { width: 36px; height: 36px; }
}

/* ── 480px and below ── */
@media (max-width: 480px) {
  /* Stats: single column when very narrow */
  .stats-grid { grid-template-columns: 1fr; }
  .perf-grid { grid-template-columns: 1fr; }
  .roi-grid { grid-template-columns: 1fr; }

  /* Financial KPIs: see LATE RESPONSIVE OVERRIDES at the end of this file. */

  /* Topbar title shrinks */
  .topbar-title { font-size: 14px; max-width: 140px; }

  /* Page content */
  .page-content { padding: 12px 10px; }

  /* Revenue calculator */
  .calc-breakdown { grid-template-columns: 1fr; }

  /* Modals fill more screen */
  .modal { width: 98vw; border-radius: var(--radius-md); }

  /* Lang selector: hide on very small */
  .lang-selector { display: none; }

  /* Topbar right: minimum space */
  .topbar-right { gap: 4px; }

  /* Section title scaling */
  .section-title { font-size: 17px; }
  .topbar-breadcrumb { display: none; }

  /* Checklist & day-of sections: see LATE RESPONSIVE OVERRIDES at the end of
     this file — .checklist-progress-header's base style is declared below. */

  /* Heatmap collapses */
  .heatmap-grid { grid-template-columns: 36px repeat(2, 1fr); }

  /* Welcome banner buttons stack */
  .welcome-btn { width: 100%; }
}

/* ── Revenue calculator: label + input stop competing for one row ── */
@media (max-width: 520px) {
  .calc-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .calc-label { min-width: 0; }
}

/* ── Create-promo form (was a hardcoded 5-column inline grid) ── */
.promo-create-grid {
  display: grid; gap: 10px; align-items: end;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
}
.promo-create-grid > * { min-width: 0; }
.promo-create-grid #createPromoBtn { width: 100%; }
@media (max-width: 900px) { .promo-create-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .promo-create-grid { grid-template-columns: 1fr; } }

/* ── Agreement modal: limit iframe height on short screens ── */
@media (max-width: 768px) and (max-height: 700px) {
  #agreementFrame { min-height: 200px !important; }
}

/* ── body: prevent horizontal overflow at any viewport ── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .sidebar-overlay, .toast-container, .cmd-overlay, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .stat-card { border: 1px solid #ddd !important; background: #fff !important; }
  .data-table th { background: #f0f0f0 !important; color: #333 !important; }
  .data-table td { color: #333 !important; }
  .badge { border: 1px solid currentColor; }
}
.trust-card-foot {
  display: flex; gap: 18px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06); flex-wrap: wrap;
}
.trust-card-foot a { font-size: 12px; color: var(--ink-cyan); font-weight: 600; }
.trust-card-foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .trust-card-header { flex-direction: column; align-items: flex-start; }
}

/* ── Profile photo + cover banner upload (settings → public page) ── */
.upload-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.upload-cover-stack {
  display: flex; flex-direction: column; gap: 12px;
}
.upload-preview {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  position: relative;
}
.upload-preview-avatar { width: 96px; height: 96px; border-radius: 50%; }
.upload-preview-cover  { width: 100%; aspect-ratio: 4/1; max-height: 140px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-empty {
  font-size: 11px; color: var(--text-muted); text-align: center; padding: 0 12px;
}
.upload-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1;
}
.btn-upload {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  background: var(--bg-surface2); color: var(--text);
  border: 1px solid var(--border);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 160ms, border-color 160ms;
}
.btn-upload:hover { background: var(--bg-surface3); border-color: var(--text-muted); }
.btn-upload[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn-link-toggle {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--text-sub);
  text-decoration: underline; text-underline-offset: 2px;
}
.btn-link-toggle:hover { color: var(--text); }
.upload-status { font-size: 12px; color: var(--text-sub); }
.upload-status.error   { color: var(--ink-rose); }
.upload-status.success { color: var(--ink-green2); }
.upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Custom URL slug input ────────────────────────── */
.slug-input-wrap {
  display: flex; align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  background: var(--input-bg);
}
.slug-prefix {
  padding: 10px 12px; font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-surface2);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.slug-input.form-input {
  flex: 1; border: 0; background: transparent;
  border-radius: 0; padding: 10px 12px;
}
.slug-input.form-input:focus { outline: none; }
.slug-input-wrap:focus-within {
  border-color: rgba(210,14,54,0.5);
  background: rgba(210,14,54,0.04);
}
#slugHint.error { color: var(--ink-rose); }
#slugHint.success { color: var(--ink-green2); }

/* ════════════════════════════════════════════════════
   DAY-OF TOOLKIT
   ════════════════════════════════════════════════════ */
.dayof-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.dayof-section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.dayof-section-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dayof-section-icon svg { width: 16px; height: 16px; }
.dayof-section-title { font-weight:800;font-size:15px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.dayof-section-sub { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 3px; }

/* Live snapshot — 3 KPI cards */
.dayof-snapshot-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 720px) { .dayof-snapshot-grid { grid-template-columns: 1fr; } }
.dayof-kpi {
  background: var(--bg-surface2);
  border: 1px solid var(--border);
  border-top: 2px solid currentColor;
  border-radius: 12px;
  padding: 14px;
}
.dayof-kpi-label {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px; color: var(--text-muted);
  text-transform: uppercase;
}
.dayof-kpi-value {
  font-weight:800;font-size:24px;line-height:1; letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.dayof-kpi-sub { font-weight:500;font-size:11px;line-height:1.4; color: var(--text-sub); margin-top: 4px; }

/* Quick-share templates grid */
.dayof-templates-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (max-width: 720px) { .dayof-templates-grid { grid-template-columns: 1fr; } }
.dayof-template {
  background: var(--bg-surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.dayof-template-label {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dayof-template-text {
  font-weight:500;font-size:13px;line-height:1.4; color: var(--text-bright);
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: 9px;
  white-space: pre-line; min-height: 60px;
}
.dayof-template-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dayof-template-btn {
  flex: 1; min-width: 90px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  background: rgba(23,128,72,0.12); color: var(--ink-teal2);
  border: 1px solid rgba(23,128,72,0.3);
  font-weight:700;font-size:11px;line-height:1; cursor: pointer;
  transition: all .15s;
}
.dayof-template-btn:hover { background: rgba(23,128,72,0.22); }
.dayof-template-btn.secondary {
  background: var(--bg-surface); color: var(--text);
  border-color: var(--border);
}
.dayof-template-btn.secondary:hover { background: var(--bg-surface2); }

/* QR section */
.dayof-qr-row {
  display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap;
}
.dayof-qr-img-wrap {
  background: #fff; padding: 14px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dayof-qr-img { width: 200px; height: 200px; display: block; }
.dayof-qr-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 10px; }
.dayof-qr-url-input {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  background: var(--bg-surface2); border: 1px solid var(--border);
  color: var(--text-bright); font-weight:600;font-size:12px;line-height:1.3; outline: none;
}
.dayof-qr-url-input:focus { border-color: var(--ink-brand); }
.dayof-qr-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════
   PHASE P — RETENTION CARD
   ════════════════════════════════════════════════════ */
.retention-card {
  background: linear-gradient(135deg, rgba(123,104,221,0.10), rgba(23,128,72,0.04));
  border: 1px solid rgba(123,104,221,0.20);
  border-radius: 14px;
  padding: 18px;
}
.retention-headline {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.retention-pct {
  font-weight:800;font-size:36px;line-height:1; letter-spacing: -1px;
  color: var(--ink-teal2); font-variant-numeric: tabular-nums;
}
.retention-pct.warn { color: var(--ink-gold2); }
.retention-pct.cold { color: var(--ink-orange2); }
.retention-headline-text { flex: 1; min-width: 180px; }
.retention-headline-title { font-weight:800;font-size:14px;line-height:1.2; color: var(--text-bright); }
.retention-headline-sub { font-weight:500;font-size:12px;line-height:1.4; color: var(--text-sub); margin-top: 4px; }

.retention-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 16px;
}
@media (max-width: 720px) { .retention-kpis { grid-template-columns: repeat(2, 1fr); } }
.retention-kpi {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-top: 2px solid currentColor;
  border-radius: 10px; padding: 12px;
  text-align: center;
}
.retention-kpi-label {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px;
  color: var(--text-muted); display: block;
  margin-bottom: 6px;
}
.retention-kpi-value {
  font-weight:800;font-size:18px;line-height:1; font-variant-numeric: tabular-nums;
  display: block;
}

.retention-chain {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.retention-chain-title {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px;
  color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px;
}
.retention-chain-row {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 8px;
  align-items: center;
  padding: 8px 0;
  font-weight:600;font-size:12px;line-height:1.3;
}
.retention-chain-row + .retention-chain-row { border-top: 1px solid var(--border); }
.retention-chain-row.head {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.4px; color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.retention-chain-row.head + .retention-chain-row { border-top: 0; }
.retention-chain-event { color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retention-chain-num { text-align: right; font-variant-numeric: tabular-nums; }
.retention-chain-pct { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.retention-empty {
  background: var(--bg-surface); border: 1px dashed var(--border);
  border-radius: 14px; padding: 32px; text-align: center;
  color: var(--text-muted); font-weight:500;font-size:13px;line-height:1.5;
}

/* ════════════════════════════════════════════════════
   QUICK-CREATE PROMO TEMPLATES
   ════════════════════════════════════════════════════ */
.quick-promo-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 980px) { .quick-promo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .quick-promo-grid { grid-template-columns: 1fr; } }
.quick-promo-card {
  background: var(--bg-surface2); border: 1px solid var(--border);
  border-top: 2px solid currentColor;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.quick-promo-card:hover { transform: translateY(-2px); background: var(--bg-surface3); }
.quick-promo-card-label {
  font-weight:800;font-size:13px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px;
}
.quick-promo-card-discount {
  font-weight:800;font-size:22px;line-height:1; color: currentColor;
  font-variant-numeric: tabular-nums; margin-top: 4px;
}
.quick-promo-card-meta {
  font-weight:600;font-size:11px;line-height:1; color: var(--text-muted);
  letter-spacing: 0.3px; text-transform: uppercase; margin-top: 4px;
}

/* ════════════════════════════════════════════════════
   PRE-LAUNCH CHECKLIST
   ════════════════════════════════════════════════════ */
.checklist-header {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; align-items: flex-end;
  margin-bottom: 18px;
}
.checklist-progress-card {
  background: linear-gradient(135deg, rgba(23,128,72,0.08), rgba(168,118,0,0.04));
  border: 1px solid rgba(23,128,72,0.18);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.checklist-progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; gap: 14px;
}
.checklist-progress-title { font-weight:800;font-size:16px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.checklist-progress-sub { font-weight:500;font-size:12px;line-height:1.4; color: var(--text-sub); margin-top: 4px; }
.checklist-progress-score {
  font-weight:800;font-size:28px;line-height:1; color: var(--ink-teal2);
  font-variant-numeric: tabular-nums;
}
.checklist-progress-bar {
  height: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
:root[data-theme="light"] .checklist-progress-bar { background: rgba(0,0,0,0.08); }
.checklist-progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #D20E36 0%, #A87600 50%, #178048 100%);
  transition: width .6s ease;
}

.checklist-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.checklist-group-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 12px;
}
.checklist-group-title-wrap { display: flex; align-items: center; gap: 10px; }
.checklist-group-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.checklist-group-icon svg { width: 16px; height: 16px; }
.checklist-group-title { font-weight:800;font-size:14px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.checklist-group-sub { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 3px; }
.checklist-group-meta {
  font-weight:700;font-size:11px;line-height:1; color: var(--text-muted);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

.checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  border-radius: 8px;
}
.checklist-item:not(.auto):hover { background: var(--bg-surface2); padding-inline: 8px; margin-inline: -8px; }
.checklist-item.auto { cursor: default; }
.checklist-item + .checklist-item { border-top: 1px solid var(--border); }
.checklist-checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all .15s;
}
.checklist-checkbox svg { width: 12px; height: 12px; }
.checklist-item.checked .checklist-checkbox {
  background: #178048; border-color: var(--ink-teal2); color: #fff;
}
.checklist-item.auto .checklist-checkbox { border-color: rgba(255,255,255,0.12); }
:root[data-theme="light"] .checklist-item.auto .checklist-checkbox { border-color: rgba(0,0,0,0.12); }
.checklist-item-main { flex: 1; min-width: 0; }
.checklist-item-label-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.checklist-item-label {
  font-weight:600;font-size:13px;line-height:1.3; color: var(--text);
}
.checklist-item.checked .checklist-item-label { color: var(--text-muted); text-decoration: line-through; }
.checklist-item-badge {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(74,95,208,0.15); color: var(--ink-cyan);
}
.checklist-item-badge.essential { background: rgba(210, 14, 54,0.15); color: var(--ink-brand); }
.checklist-item-tip {
  font-weight:500;font-size:11px;line-height:1.4; color: var(--text-muted);
  margin-top: 3px;
}
.checklist-item-status {
  font-weight:700;font-size:11px;line-height:1; color: var(--text-muted);
  flex-shrink: 0;
}
.checklist-item-status.done { color: var(--ink-teal2); }

.checklist-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; margin-top: 14px;
  background: rgba(74,95,208,0.06);
  border: 1px solid rgba(74,95,208,0.18);
  border-radius: 12px;
  font-weight:500;font-size:12px;line-height:1.5;
  color: var(--text-sub);
}

/* ════════════════════════════════════════════════════
   FINANCIAL DASHBOARD
   ════════════════════════════════════════════════════ */
.fin-header {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: space-between; align-items: flex-end;
  margin-bottom: 18px;
}
.fin-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.fin-mode-toggle {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.fin-mode-btn {
  border: 0; background: transparent;
  padding: 8px 12px; border-radius: 9px;
  font-weight:700;font-size:12px;line-height:1; letter-spacing: 0.2px;
  color: var(--text); cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.fin-mode-btn .fin-mode-pct {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 3px 5px; border-radius: 5px;
  background: var(--bg-surface2); color: var(--text-muted);
}
.fin-mode-btn:hover {
  background: var(--bg-surface2);
}
.fin-mode-btn.active {
  color: #fff;
  box-shadow: 0 4px 12px rgba(210, 14, 54,0.3);
}
.fin-mode-btn.active .fin-mode-pct { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.95); }
.fin-mode-btn[data-fin-mode="actual"].active      { background: linear-gradient(135deg, #D20E36, #D20E36); }
.fin-mode-btn[data-fin-mode="pessimistic"].active { background: linear-gradient(135deg, #D20E36, #B40B2E); box-shadow: 0 4px 12px rgba(210,14,54,0.3); }
.fin-mode-btn[data-fin-mode="realistic"].active   { background: linear-gradient(135deg, #A87600, #A87600); box-shadow: 0 4px 12px rgba(168,118,0,0.3); }
.fin-mode-btn[data-fin-mode="optimistic"].active  { background: linear-gradient(135deg, #178048, #178048); box-shadow: 0 4px 12px rgba(23,128,72,0.3); }
.fin-event-select {
  padding: 9px 12px; font-size: 12px; font-weight: 600;
}
.btn-icon-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px;
  background: rgba(210, 14, 54,0.1);
  border: 1px solid rgba(210, 14, 54,0.3);
  color: var(--ink-brand); cursor: pointer;
  font-weight:600;font-size:12px;line-height:1;
  transition: all .15s;
}
.btn-icon-pill:hover {
  background: rgba(210, 14, 54,0.18);
  transform: translateY(-1px);
}

/* Sync to server row */
.fin-sync-row {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 16px;
  flex-wrap: wrap;
}
.fin-sync-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.2px;
  transition: all .15s;
}
.fin-sync-btn:hover { background: var(--bg-surface2); border-color: var(--text-muted); }
.fin-sync-btn-primary {
  background: rgba(23,128,72,0.1); color: var(--ink-teal2);
  border-color: rgba(23,128,72,0.3);
}
.fin-sync-btn-primary:hover { background: rgba(23,128,72,0.2); }
.fin-sync-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fin-sync-status { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); }
.fin-sync-status.error { color: var(--ink-red2); }
.fin-sync-status.success { color: var(--ink-teal2); }

/* FX strip */
.fin-fx-strip {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.fin-fx-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 9px;
  background: var(--bg-surface); border: 1px solid var(--border);
  font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.4px;
  color: var(--text); cursor: pointer;
  transition: all .15s;
}
.fin-fx-chip .fin-fx-rate {
  font-weight: 500; color: var(--text-muted); font-size: 10px;
}
.fin-fx-chip.active {
  background: rgba(210, 14, 54,0.12);
  border-color: rgba(210, 14, 54,0.4);
  color: var(--ink-brand);
}
.fin-fx-chip.active .fin-fx-rate { color: var(--ink-brand); }

/* KPI Grid */
.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
/* Column counts for every width live together in LATE RESPONSIVE OVERRIDES at
   the end of this file — splitting them across two places is what let a
   `max-width: 1100px` rule outrank a `max-width: 480px` one. */
.fin-kpi-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 2px solid currentColor;
  border-radius: 14px; padding: 14px 16px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
  min-height: 100px;
}
.fin-kpi-card:hover {
  transform: translateY(-2px);
  background: var(--bg-surface2);
}
.fin-kpi-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; color: inherit;
}
.fin-kpi-label {
  font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted);
  flex: 1; margin-right: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fin-kpi-icon {
  width: 16px; height: 16px;
  color: currentColor;
}
.fin-kpi-icon svg { width: 100%; height: 100%; }
.fin-kpi-value {
  font-weight:800;font-size:22px;line-height:1.1; letter-spacing: -0.5px;
  color: var(--text-bright); margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.fin-kpi-sub {
  font-weight:500;font-size:11px;line-height:1.4; color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Detail row */
.fin-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .fin-detail-row { grid-template-columns: 1fr; }
}
.fin-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.fin-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.fin-detail-title-wrap { display: inline-flex; align-items: center; gap: 8px; }
.fin-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.fin-detail-title { font-weight:800;font-size:14px;line-height:1; color: var(--text-bright); }
.fin-detail-mode { font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.5px; color: var(--text-muted); }

/* Detail row line */
.fin-line {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; cursor: pointer;
  transition: background .15s;
  border-radius: 6px;
}
.fin-line:hover { background: var(--bg-surface2); padding-inline: 6px; margin-inline: -6px; }
.fin-line.read-only { cursor: default; opacity: 0.85; }
.fin-line.read-only:hover { background: transparent; padding-inline: 0; margin-inline: 0; }
.fin-line-icon {
  width: 22px; height: 22px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fin-line-icon svg { width: 12px; height: 12px; }
.fin-line-label { flex: 1; font-weight:500;font-size:13px;line-height:1.2; color: var(--text); }
.fin-line-value { font-weight:700;font-size:13px;line-height:1; font-variant-numeric: tabular-nums; }
.fin-line-add { color: var(--text-muted); margin-left: 6px; }
.fin-line-add svg { width: 14px; height: 14px; }

.fin-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; margin-top: 6px;
  border-top: 1px solid var(--border);
}
.fin-total-label { font-weight:800;font-size:13px;line-height:1; color: var(--text-bright); }
.fin-total-value { font-weight:800;font-size:16px;line-height:1; font-variant-numeric: tabular-nums; }

/* Goals */
.fin-goal {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.fin-goal:last-child { border-bottom: 0; }
.fin-goal:hover { background: var(--bg-surface2); padding-inline: 6px; margin-inline: -6px; border-radius: 8px; }
.fin-goal-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.fin-goal-label { font-weight:700;font-size:13px;line-height:1; color: var(--text-bright); }
.fin-goal-target { font-weight:600;font-size:12px;line-height:1; color: var(--text-muted); }
.fin-goal-target.unset { color: var(--ink-brand); }
.fin-goal-progress-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.fin-goal-current { font-weight:700;font-size:13px;line-height:1; font-variant-numeric: tabular-nums; }
.fin-goal-pct { font-weight:800;font-size:11px;line-height:1; }
.fin-goal-bar {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
:root[data-theme="light"] .fin-goal-bar { background: rgba(0,0,0,0.06); }
.fin-goal-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width .7s cubic-bezier(0.4, 0, 0.2, 1);
}
.fin-goal-sub { font-weight:500;font-size:11px;line-height:1.3; color: var(--text-muted); margin-top: 5px; }
.fin-goal-sub.warning { color: var(--ink-red2); }

/* Help strip */
.fin-help-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 12px;
  background: rgba(74,95,208,0.06);
  border: 1px solid rgba(74,95,208,0.18);
  color: var(--text-sub);
  font-weight:500;font-size:12px;line-height:1.5;
  margin-bottom: 16px;
}
.fin-help-strip svg { color: var(--ink-cyan); }

/* Modal customization for financial */
.fin-modal-formula {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-surface2);
  border-radius: 10px;
}
.fin-modal-formula-label {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase;
}
.fin-modal-formula-text {
  font: 700 13px/1.4 'Inter', 'Inter', sans-serif;
  color: var(--text-bright);
}
.fin-modal-input-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; margin: 12px 0 16px;
  background: var(--bg-surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fin-modal-input-wrap:focus-within {
  border-color: rgba(210, 14, 54,0.5);
}
.fin-modal-input-prefix {
  font-weight:800;font-size:18px;line-height:1;
}
.fin-modal-input {
  flex: 1; border: 0; background: transparent;
  padding: 14px 0;
  font-weight:700;font-size:18px;line-height:1; color: var(--text-bright);
  outline: none;
}
.fin-modal-input-suffix {
  font-weight:600;font-size:12px;line-height:1; color: var(--text-muted);
}

/* Status badges (inline on detail rows + cashflow timeline) */
.fin-status-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 6px;
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.4px; text-transform: uppercase;
  margin-left: 6px;
}
.fin-status-badge-icon { display: inline-flex; }
.fin-status-badge-icon svg { width: 9px; height: 9px; }

/* Status picker chips (in tx modal) */
.fin-status-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text); cursor: pointer;
  font-weight:700;font-size:11px;line-height:1;
  transition: all .15s;
}
.fin-status-chip:hover { background: var(--bg-surface2); }
.fin-status-chip.active { background: var(--st-color); color: #fff; border-color: var(--st-color); }
.fin-status-chip-icon { display: inline-flex; }
.fin-status-chip-icon svg { width: 10px; height: 10px; }
.fin-status-chip:not(.active) .fin-status-chip-icon { color: var(--st-color); }
.fin-due-wrap input[type="date"] {
  color: var(--text-bright);
  font-weight:700;font-size:14px;line-height:1;
  font-family: inherit;
}

/* Sponsorship Tiers */
.fin-add-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 9px;
  background: var(--accent, #A87600)18; color: var(--accent, #A87600);
  border: 1px solid var(--accent, #A87600)30;
  font-weight:800;font-size:12px;line-height:1; cursor: pointer;
  transition: all .15s;
}
.fin-add-btn:hover {
  background: var(--accent, #A87600)30;
  transform: translateY(-1px);
}
.fin-tiers-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.fin-tier-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  cursor: pointer;
  transition: background .15s;
}
.fin-tier-row:hover { background: var(--bg-surface2); }
.fin-tier-row + .fin-tier-row { border-top: 1px solid var(--border); }
.fin-tier-main { flex: 1; min-width: 0; }
.fin-tier-name-row { display: flex; align-items: center; gap: 8px; }
.fin-tier-name { font-weight:800;font-size:14px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.fin-tier-soldout {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.4px;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(23,128,72,0.18); color: var(--ink-teal2);
}
.fin-tier-price {
  font-weight:800;font-size:13px;line-height:1; color: var(--ink-gold2);
  font-variant-numeric: tabular-nums; margin-top: 4px;
}
.fin-tier-price-suffix { font-weight: 500; color: var(--text-muted); }
.fin-tier-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.06);
  margin: 8px 0 4px;
  overflow: hidden;
}
:root[data-theme="light"] .fin-tier-bar { background: rgba(0,0,0,0.06); }
.fin-tier-bar-fill { height: 100%; border-radius: 2px; transition: width .6s ease; }
.fin-tier-meta { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); }
.fin-tier-rev {
  font-weight:800;font-size:14px;line-height:1; color: var(--ink-teal2);
  font-variant-numeric: tabular-nums;
}
.fin-tier-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.fin-tier-total-label { font-weight:800;font-size:13px;line-height:1; color: var(--text-bright); }
.fin-tier-total-value { font-weight:800;font-size:16px;line-height:1; color: var(--ink-gold2); font-variant-numeric: tabular-nums; }

/* Ticket Batches */
.fin-batches-list {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
}
.fin-batch-card {
  padding: 14px;
  cursor: pointer;
  transition: background .15s;
}
.fin-batch-card:hover { background: var(--bg-surface2); }
.fin-batch-card + .fin-batch-card { border-top: 1px solid var(--border); }
.fin-batch-header {
  display: flex; align-items: center; gap: 8px;
}
.fin-batch-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fin-batch-name { font-weight:800;font-size:14px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.fin-batch-dates { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); margin-left: 16px; margin-top: 4px; }
.fin-batch-types { margin-top: 8px; padding-left: 16px; }
.fin-batch-type-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px; align-items: center;
  padding: 6px 0;
}
.fin-batch-type-name { font-weight:600;font-size:12px;line-height:1; color: var(--text); }
.fin-batch-type-price { font-weight:800;font-size:12px;line-height:1; color: var(--ink-purple2); text-align: right; font-variant-numeric: tabular-nums; }
.fin-batch-type-qty { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.fin-batch-type-rev { font-weight:800;font-size:12px;line-height:1; color: var(--ink-teal2); text-align: right; font-variant-numeric: tabular-nums; }
.fin-batch-footer {
  display: flex; align-items: flex-end; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.fin-batch-footer-bar {
  flex: 1;
}
.fin-batch-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
:root[data-theme="light"] .fin-batch-bar { background: rgba(0,0,0,0.06); }
.fin-batch-bar-fill { height: 100%; transition: width .6s ease; }
.fin-batch-meta { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 4px; }
.fin-batch-subtotal { font-weight:800;font-size:14px;line-height:1; color: var(--ink-teal2); font-variant-numeric: tabular-nums; }
/* Type editor in batch modal */
.fin-batch-type-edit {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin-bottom: 10px;
}
.fin-batch-type-edit-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.fin-batch-type-edit-name {
  width: 100%; padding: 8px 12px; border-radius: 9px;
  background: var(--bg-surface2); border: 1px solid var(--border);
  color: var(--text-bright); font-weight:700;font-size:14px;line-height:1; outline: none;
}
.fin-batch-type-edit-name:focus { border-color: var(--ink-purple2); }
.fin-batch-type-edit-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.fin-batch-type-edit-micro {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 4px;
  text-transform: uppercase;
}
.fin-add-type-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px; border-radius: 12px;
  background: rgba(123,104,221,0.1); color: var(--ink-purple2);
  border: 1px dashed rgba(123,104,221,0.4);
  cursor: pointer; font-weight:700;font-size:13px;line-height:1;
  transition: all .15s;
}
.fin-add-type-btn:hover { background: rgba(123,104,221,0.18); }

/* Cashflow timeline */
.fin-cashflow-section { margin: 18px 0; }
.fin-cashflow-empty {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight:500;font-size:12px;line-height:1.4;
}
.fin-cashflow-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 0;
}
.fin-cashflow-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
}
.fin-cashflow-row + .fin-cashflow-row { border-top: 1px solid var(--border); }
.fin-cashflow-date { width: 56px; text-align: center; flex-shrink: 0; }
.fin-cashflow-date-md { font-weight:800;font-size:12px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.fin-cashflow-date-yr { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 2px; }
.fin-cashflow-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fin-cashflow-main { flex: 1; min-width: 0; }
.fin-cashflow-main-row { display: flex; align-items: center; gap: 6px; }
.fin-cashflow-label { font-weight:600;font-size:13px;line-height:1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-cashflow-event { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 2px; }
.fin-cashflow-right { text-align: right; flex-shrink: 0; }
.fin-cashflow-amount { font-weight:800;font-size:13px;line-height:1; font-variant-numeric: tabular-nums; }
.fin-cashflow-amount.pos { color: var(--ink-teal2); }
.fin-cashflow-amount.neg { color: var(--ink-red2); }
.fin-cashflow-balance { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.fin-cashflow-balance.neg { color: var(--ink-red2); }

/* Marketing Budget Allocator */
.fin-mkt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 2px solid #D20E36;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}
.fin-mkt-inputs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 14px;
}
/* Column counts: see LATE RESPONSIVE OVERRIDES at the end of this file. */
.fin-mkt-input-block { display: flex; flex-direction: column; gap: 4px; }
.fin-mkt-viability {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px; border: 1px solid;
}
.fin-mkt-viability-text { flex: 1; }
.fin-mkt-viability-label { font-weight:800;font-size:13px;line-height:1.1; letter-spacing: -0.2px; }
.fin-mkt-viability-advice { font-weight:500;font-size:11px;line-height:1.4; color: var(--text-sub); margin-top: 3px; }
.fin-mkt-metrics {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  padding-top: 14px; margin-top: 14px;
  border-top: 1px solid var(--border);
}
@media (max-width: 720px) { .fin-mkt-metrics { grid-template-columns: repeat(3, 1fr); } }
.fin-mkt-metric { text-align: center; }
.fin-mkt-metric-label {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.5px;
  color: var(--text-muted); display: block; margin-bottom: 4px;
}
.fin-mkt-metric-value {
  font-weight:800;font-size:13px;line-height:1; font-variant-numeric: tabular-nums;
  display: block;
}
/* Phase distribution rows */
.fin-mkt-phases {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
}
.fin-mkt-phase {
  padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.fin-mkt-phase + .fin-mkt-phase { border-top: 1px solid var(--border); }
.fin-mkt-phase-row { display: flex; align-items: center; gap: 8px; }
.fin-mkt-phase-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fin-mkt-phase-name { font-weight:800;font-size:14px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.fin-mkt-phase-pill {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.4px;
  padding: 3px 7px; border-radius: 5px;
}
.fin-mkt-phase-amount {
  font-weight:800;font-size:14px;line-height:1; font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.fin-mkt-phase-sub { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); margin-left: 16px; }

/* What-If Calculators */
.fin-calc-section { margin-bottom: 16px; }
.fin-calc-header { margin-bottom: 12px; }
.fin-calc-section-title { font-weight:800;font-size:16px;line-height:1; color: var(--text-bright); letter-spacing: -0.3px; }
.fin-calc-section-sub { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); margin-top: 4px; }
.fin-calc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 980px) { .fin-calc-grid { grid-template-columns: 1fr; } }
.fin-calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  border-top: 2px solid currentColor;
}
.fin-calc-card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.fin-calc-icon {
  width: 28px; height: 28px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.fin-calc-icon svg { width: 14px; height: 14px; }
.fin-calc-card-title { font-weight:800;font-size:14px;line-height:1; color: var(--text-bright); letter-spacing: -0.2px; }
.fin-calc-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 12px;
}
.fin-calc-input-block { display: flex; flex-direction: column; gap: 4px; }
.fin-calc-input-label {
  font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-muted);
}
.fin-calc-input-wrap {
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px; border-radius: 9px;
  background: var(--bg-surface2);
  border: 1px solid var(--border);
}
.fin-calc-input-wrap:focus-within { border-color: currentColor; }
.fin-calc-input-prefix { font-weight:800;font-size:13px;line-height:1; }
.fin-calc-input-suffix { font-weight:600;font-size:11px;line-height:1; color: var(--text-muted); }
.fin-calc-input {
  flex: 1; border: 0; background: transparent; outline: none;
  padding: 8px 0;
  font-weight:700;font-size:14px;line-height:1; color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  width: 100%;
}
.fin-calc-results {
  display: flex; gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.fin-calc-result-block {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.fin-calc-result-label {
  font-weight:800;font-size:11px;line-height:1; letter-spacing: 0.6px;
  color: var(--text-muted);
}
.fin-calc-result-value {
  font-weight:800;font-size:14px;line-height:1; font-variant-numeric: tabular-nums;
}

/* Generic secondary button (used by financial modals) */
.btn-secondary {
  padding: 12px 18px; border-radius: 10px;
  background: var(--bg-surface2); color: var(--text-sub);
  border: 1px solid var(--border);
  font-weight:700;font-size:13px;line-height:1; cursor: pointer;
  transition: all .15s;
}
.btn-secondary:hover { color: var(--text-bright); border-color: var(--text-muted); }

/* ════════════════════════════════════════════════════
   FIRST-EVENT HERO (empty state for new organizers)
   ════════════════════════════════════════════════════ */
.first-event-hero {
  max-width: 920px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 24px;
  padding: 12px 0 40px;
}
.feh-card {
  background: linear-gradient(135deg, rgba(210, 14, 54,0.08), rgba(196,86,29,0.04));
  border: 1px solid rgba(210, 14, 54,0.15);
  border-radius: 24px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.feh-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(210, 14, 54,0.18), transparent 60%);
  pointer-events: none;
}
.feh-icon {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 22px;
  background: rgba(210, 14, 54,0.18);
  border: 1px solid rgba(210, 14, 54,0.35);
  color: var(--ink-brand);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feh-icon svg { width: 36px; height: 36px; }
.feh-title {
  position: relative;
  font-weight:800;font-size:28px;line-height:1.15; letter-spacing: -0.5px;
  color: var(--text-bright);
  margin: 0 0 10px;
}
.feh-sub {
  position: relative;
  font-weight:500;font-size:15px;line-height:1.5;
  color: var(--text-sub);
  margin: 0 auto; max-width: 480px;
}

/* Templates grid */
.feh-templates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .feh-templates { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .feh-templates { grid-template-columns: 1fr; }
}
.feh-template {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .15s, border-color .15s, background .15s;
}
.feh-template:hover {
  transform: translateY(-3px);
  background: var(--bg-surface2);
}
.feh-template-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.feh-template-icon svg { width: 22px; height: 22px; }
.feh-template-label {
  font-weight:800;font-size:15px;line-height:1; letter-spacing: -0.2px;
  color: var(--text-bright);
}
.feh-template-sub {
  font-weight:500;font-size:12px;line-height:1;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.feh-template-meta {
  display: flex; align-items: center; gap: 6px;
  font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.feh-template-meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
}

/* Divider */
.feh-divider {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 12%;
}
.feh-divider-line { flex: 1; height: 1px; background: var(--border); }
.feh-divider-text { font-weight:700;font-size:11px;line-height:1; letter-spacing: 1.4px; color: var(--text-muted); }

/* Scratch button */
.feh-scratch {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px; border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-weight:700;font-size:14px;line-height:1;
  cursor: pointer;
  align-self: center;
  transition: all .15s;
}
.feh-scratch:hover {
  background: var(--bg-surface2);
  border-color: var(--text-muted);
}

/* Steps */
.feh-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; padding: 10px 0;
}
.feh-step {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 80px;
}
.feh-step-num {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(210, 14, 54,0.12);
  border: 1px solid rgba(210, 14, 54,0.3);
  color: var(--ink-brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight:800;font-size:13px;line-height:1;
}
.feh-step-label {
  font-weight:600;font-size:11px;line-height:1;
  color: var(--text-sub);
  text-align: center;
}
.feh-step-arrow {
  color: var(--text-muted);
  font-weight:600;font-size:16px;line-height:1;
}

/* Proof box */
.feh-proof {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: rgba(23,128,72,0.06);
  border: 1px solid rgba(23,128,72,0.18);
  border-radius: 12px;
  font-weight:500;font-size:12px;line-height:1.5;
  color: var(--text-sub);
}

/* ═══════════════════════════════════════════════════════════════
   QR SCANNER (web camera check-in)
   Built phone-first: the organizer working the door is on a 360px
   screen in one hand, so every control is >=44px and the camera gets
   the whole viewport.
   ═══════════════════════════════════════════════════════════════ */

/* ── Entry card on the Live Check-in page ── */
.scan-card {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 18px;
  padding: 20px 22px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(210,14,54,0.10), rgba(210,14,54,0.03));
  border: 1px solid rgba(210,14,54,0.28);
  border-radius: var(--radius-lg);
}
.scan-card-main { display: flex; align-items: flex-start; gap: 16px; flex: 1 1 320px; min-width: 0; }
.scan-card-icon {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(210,14,54,0.14); color: var(--ink-brand);
}
.scan-card-icon svg { width: 26px; height: 26px; }
.scan-card-copy { min-width: 0; }
.scan-card-title { font-size: 16px; font-weight: 800; color: var(--text-bright); margin-bottom: 4px; }
.scan-card-sub { font-size: 13px; line-height: 1.5; color: var(--text-sub); }
.scan-card-note { font-size: 11.5px; line-height: 1.5; margin-top: 8px; }
.scan-note-ok { color: var(--text-muted); }
.scan-note-warn { color: var(--gold-ink); display: inline-flex; align-items: flex-start; gap: 6px; }
.scan-note-warn svg { flex-shrink: 0; margin-top: 2px; }
.scan-card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.scan-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 22px;
  background: linear-gradient(135deg, #D20E36, #D20E36);
  color: #fff; border: 0; border-radius: var(--radius-sm);
  font-weight:800;font-size:13px;line-height:1; letter-spacing: 0.2px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(210,14,54,0.32);
  transition: transform .15s, box-shadow .15s;
}
.scan-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(210,14,54,0.42); }
.scan-cta:active { transform: translateY(0); }

/* ── Session log ── */
.scan-log-wrap { margin-bottom: 22px; }
.scan-log-title {
  font-weight:700;font-size:11px;line-height:1; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.scan-log {
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); max-height: 220px; overflow-y: auto;
}
.scan-log-empty { padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.scan-log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-light);
}
.scan-log-row:last-child { border-bottom: 0; }
.scan-log-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.scan-log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scan-log-name {
  font-weight:600;font-size:13px;line-height:1.3; color: var(--text-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scan-log-sub { font-weight:500;font-size:11px;line-height:1.3; color: var(--text-muted); }
.scan-log-time { font-weight:500;font-size:11px;line-height:1; color: var(--text-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ── Full-screen scanner overlay ── */
body.scan-locked { overflow: hidden; }
.scan-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none; background: #0B0D16;
}
.scan-overlay.open { display: block; }
.scan-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  background: #0B0D16;
}
/* Only the top and bottom bands are dimmed — enough contrast for the white
   chrome, while the middle of the frame (where the QR actually is) stays at
   full camera brightness. The reticle's own spotlight box-shadow supplies the
   rest of the vignette; stacking a flat 50% scrim on top of it made the
   preview too dark to aim with. */
.scan-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(6,6,26,0.75) 0%, rgba(6,6,26,0.25) 16%,
    rgba(6,6,26,0) 34%, rgba(6,6,26,0) 66%,
    rgba(6,6,26,0.25) 84%, rgba(6,6,26,0.8) 100%);
}
.scan-ui {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  pointer-events: none;
}
.scan-ui > * { pointer-events: auto; }

.scan-topbar { display: flex; align-items: center; gap: 10px; }
.scan-icon-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%; border: 0;
  background: rgba(0,0,0,0.5); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.scan-icon-btn:hover { background: rgba(0,0,0,0.72); }
.scan-icon-btn.on { background: #A87600; color: #0B0D16; }
.scan-icon-btn[hidden] { display: none; }
.scan-top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.scan-event {
  flex: 1; min-width: 0;
  background: rgba(0,0,0,0.5); color: #fff;
  border-radius: 999px; padding: 11px 16px;
  font-weight:600;font-size:13px;line-height:1.2; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.scan-reticle-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; min-height: 0;
}
.scan-reticle {
  position: relative;
  width: min(70vw, 300px); height: min(70vw, 300px);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 100vmax rgba(6,6,26,0.42);
}
/* The per-corner rules below use the `border-top: 3px solid` shorthand, and a
   shorthand with no colour resets that edge to currentColor — a plain
   `border-color` here would be silently overwritten and the marks would come
   out white. Setting `color` is what actually reaches them. */
.scan-corner { position: absolute; width: 26px; height: 26px; color: var(--ink-brand); }
.scan-corner.tl { top: 0; left: 0; border-top: 3px solid; border-left: 3px solid; }
.scan-corner.tr { top: 0; right: 0; border-top: 3px solid; border-right: 3px solid; }
.scan-corner.bl { bottom: 0; left: 0; border-bottom: 3px solid; border-left: 3px solid; }
.scan-corner.br { bottom: 0; right: 0; border-bottom: 3px solid; border-right: 3px solid; }
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #D20E36, transparent);
  animation: scanSweep 2.4s ease-in-out infinite;
}
@keyframes scanSweep { 0% { top: 2%; } 50% { top: 96%; } 100% { top: 2%; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; top: 50%; } }
/* The hint sits over whatever the camera sees, so it carries its own
   background — a text-shadow alone loses against a bright frame. */
.scan-hint {
  color: #fff; font-weight:600;font-size:13.5px;line-height:1.4; text-align: center;
  background: rgba(6,6,26,0.62); border-radius: 999px;
  padding: 9px 16px; max-width: min(90%, 340px);
}

.scan-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scan-tally {
  display: inline-flex; align-items: center; gap: 12px;
  background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 999px; padding: 9px 18px;
  font-weight:600;font-size:12.5px;line-height:1;
}
.scan-tally b { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.scan-tally-ok b { color: var(--ink-teal3); }
.scan-tally-fail b { color: var(--ink-salmon); }
.scan-tally-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.25); }
.scan-manual-btn {
  min-height: 44px; padding: 12px 22px;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 999px;
  font-weight:700;font-size:13px;line-height:1; cursor: pointer; transition: background .15s;
}
.scan-manual-btn:hover { background: rgba(255,255,255,0.22); }

/* ── Result card ── */
.scan-result {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(6,6,26,0.82);
  animation: scanResultIn .16s ease-out;
}
.scan-result[hidden] { display: none; }
@keyframes scanResultIn { from { opacity: 0; } to { opacity: 1; } }
.scan-result-card {
  width: 100%; max-width: 360px;
  background: var(--bg-elevated, #12122E);
  border: 2px solid; border-radius: 20px;
  padding: 26px 22px; text-align: center;
}
.scan-result-icon {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; color: #0B0D16;
}
.scan-result-title { font-weight:800;font-size:24px;line-height:1.2; margin-bottom: 8px; letter-spacing: 0.2px; }
.scan-result-name { font-weight:700;font-size:17px;line-height:1.3; color: var(--text-bright); margin-bottom: 10px; overflow-wrap: anywhere; }
.scan-result-badge {
  display: inline-block; border: 1px solid; border-radius: 999px;
  padding: 5px 14px; margin-bottom: 10px; font-weight:700;font-size:12px;line-height:1.3;
}
.scan-result-msg { font-weight:500;font-size:13px;line-height:1.5; color: var(--text-sub); margin-bottom: 18px; }
.scan-result-actions { display: flex; gap: 10px; }
.scan-result-btn {
  flex: 1; min-height: 48px; padding: 12px 16px;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-surface2); color: var(--text-bright);
  font-weight:700;font-size:14px;line-height:1;
}
.scan-result-btn-primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, #D20E36, #D20E36);
}
.scan-result-auto { font-weight:500;font-size:11px;line-height:1.4; color: var(--text-muted); margin-top: 12px; font-style: italic; }

/* ── Fatal (permission / no camera / insecure origin) ── */
.scan-fatal {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(6,6,26,0.94);
}
.scan-fatal[hidden] { display: none; }
.scan-fatal-card {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--bg-elevated, #12122E);
  border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px;
}
.scan-fatal-icon {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(168,118,0,0.16); color: var(--ink-amber);
}
.scan-fatal-title { font-weight:800;font-size:19px;line-height:1.3; color: var(--text-bright); margin-bottom: 10px; }
.scan-fatal-body { font-weight:500;font-size:13px;line-height:1.6; color: var(--text-sub); }
.scan-fatal-body p { margin: 0 0 10px; }
.scan-fatal-body code { font-size: 12px; overflow-wrap: anywhere; }
/* The raw DOMException name. Quiet on screen, but it is the one string that
   turns "the scanner doesn't open" into an actual diagnosis. */
.scan-fatal-detail {
  font: 600 10.5px/1.4 'Inter', 'Inter', sans-serif;
  color: var(--text-muted); letter-spacing: 0.02em;
  margin: 14px 0 0 !important; padding-top: 10px;
  border-top: 1px solid var(--border); overflow-wrap: anywhere;
}
.scan-fatal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.scan-fatal-btn {
  flex: 1 1 120px; min-height: 46px; padding: 12px 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-surface2); color: var(--text-bright);
  font-weight:700;font-size:13px;line-height:1;
}
.scan-fatal-btn-primary { border: 0; color: #fff; background: linear-gradient(135deg, #D20E36, #D20E36); }

/* ── Phone ── */
@media (max-width: 640px) {
  .scan-card { padding: 16px; gap: 14px; }
  .scan-card-actions { width: 100%; }
  .scan-cta, .scan-card-actions .btn-setting { flex: 1 1 140px; justify-content: center; min-height: 46px; }
  .scan-reticle { width: min(76vw, 280px); height: min(76vw, 280px); }
  .scan-result-card { padding: 22px 18px; }
  .scan-result-title { font-size: 21px; }
}
@media (max-width: 380px) {
  .scan-card-main { gap: 12px; }
  .scan-card-icon { width: 40px; height: 40px; border-radius: 12px; }
  .scan-card-icon svg { width: 22px; height: 22px; }
  .scan-event { font-size: 12px; padding: 10px 12px; }
}
/* Landscape phone at the door: the reticle must not eat the whole height. */
@media (max-height: 480px) and (orientation: landscape) {
  /* The reticle is a fixed square, so it cannot flex-shrink — sized off vh it
     has to leave room for the topbar, hint and tally or it overlaps them. */
  .scan-reticle { width: min(38vh, 190px); height: min(38vh, 190px); }
  .scan-reticle-wrap { gap: 10px; }
  .scan-hint { font-size: 12px; padding: 7px 14px; }
  .scan-result-card { padding: 16px; max-width: 460px; }
  .scan-result-icon { width: 46px; height: 46px; margin-bottom: 8px; }
  .scan-result-title { font-size: 18px; margin-bottom: 4px; }
  .scan-result-msg { margin-bottom: 12px; }
}

[data-theme="light"] .scan-result-card,
[data-theme="light"] .scan-fatal-card { background: #fff; }

/* ═══════════════════════════════════════════════════════════════
   LATE RESPONSIVE OVERRIDES  —  keep this block LAST in the file
   ═══════════════════════════════════════════════════════════════
   The RESPONSIVE section near the middle of this file predates the
   Financial / Checklist / Marketing components, whose base styles are
   declared *after* it. CSS resolves equal-specificity conflicts by source
   order, and an unconditional `.fin-kpi-grid { grid-template-columns:
   repeat(5, 1fr) }` written later beats an earlier `@media (max-width:
   480px)` rule at EVERY width — so those phone rules rendered nothing and a
   360px screen was laying five KPI cards side by side, ~62px each, with
   currency values wrapping mid-number.

   Everything whose base style lives below the RESPONSIVE block belongs here
   instead. New component + new breakpoint ⇒ add it at the bottom of this
   block, not up there.

   Guard: _tools/audit-css-cascade.js fails on any rule that this ordering
   would kill. Run it after touching breakpoints.
   ═══════════════════════════════════════════════════════════════ */

/* ── Financial: KPI grid ── */
@media (max-width: 480px)                          { .fin-kpi-grid { grid-template-columns: 1fr; } }
@media (min-width: 481px) and (max-width: 900px)   { .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 901px) and (max-width: 1300px)  { .fin-kpi-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Financial: detail row, calculator, marketing inputs/metrics ── */
@media (max-width: 1100px) { .fin-detail-row  { grid-template-columns: 1fr; } }
@media (max-width: 980px)  { .fin-calc-grid   { grid-template-columns: 1fr; } }
@media (max-width: 480px)  { .fin-mkt-inputs  { grid-template-columns: 1fr; } }
@media (min-width: 481px) and (max-width: 720px) { .fin-mkt-inputs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .fin-mkt-metrics { grid-template-columns: repeat(2, 1fr); } }

/* ── Financial: header toolbar. Title + 4 scenario buttons + event select +
      share button cannot share one row on a phone. ── */
@media (max-width: 720px) {
  .fin-header      { flex-direction: column; align-items: stretch; }
  .fin-toolbar     { width: 100%; }
  .fin-mode-toggle { display: flex; width: 100%; flex-wrap: wrap; }
  .fin-mode-btn    { flex: 1 1 46%; justify-content: center; min-height: 40px; }
  .fin-event-select { min-width: 0 !important; flex: 1 1 140px; }
  .fin-sync-row    { flex-wrap: wrap; }
}

/* ── Checklist progress header ── */
@media (max-width: 480px) {
  .checklist-progress-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Create-boost form (was a hardcoded 4-column inline grid: on a phone the
      event select got a 60px track) ── */
.boost-create-grid {
  display: grid; gap: 10px; align-items: end;
  grid-template-columns: 1fr 1fr 1fr auto;
}
.boost-create-grid > * { min-width: 0; }
@media (max-width: 900px) { .boost-create-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .boost-create-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .boost-create-grid > button { width: 100%; } }

/* ── Mega Ride organizer rate card: copy column + the ticket glyph. Below the
      tablet break the glyph is decoration, so it steps aside entirely. ── */
.org-rate-card-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  align-items: center; position: relative; z-index: 1;
}
.org-rate-card-grid > * { min-width: 0; }
@media (max-width: 640px) {
  .org-rate-card-grid { grid-template-columns: 1fr; gap: 14px; }
  .org-rate-card-grid > :last-child { display: none; }
  #organizerRateCard { padding: 18px 16px !important; }
}

/* ═══════════════════════════════════════════════════════════════
   TABLES ON A PHONE — row becomes a card
   ═══════════════════════════════════════════════════════════════
   `.table-wrap{overflow-x:auto}` looked like the mobile story was handled,
   but `.data-table{width:100%}` means the table shrinks to the wrap rather
   than overflowing it — so it never scrolls and never overflows, it just
   crushes. On a 360px screen "denisliquidation@gmail.com" wrapped to eight
   lines and the role "SCANNER" rendered one letter per line.

   Horizontal scroll was the other option and it is worse here: these tables
   are read one record at a time (who is this, what role, are they checked
   in), not scanned across. So below 640px each <tr> becomes a card and each
   <td> a label/value line. The labels come from responsive-tables.js, which
   copies <thead> text into data-label — CSS cannot read another element's
   text on its own.

   Keep this block LAST-ish; it must outrank the base .data-table rules above.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .table-wrap {
    max-height: none;              /* the cards ARE the scroll now */
    overflow-x: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td { display: block; width: 100%; }

  /* The header row is the label source, not something to render. */
  .data-table thead { display: none; }

  .data-table tr {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    margin-bottom: 10px;
    padding: 4px 2px;
    overflow: hidden;
  }
  .data-table tr:last-child { margin-bottom: 0; }
  .data-table tr:hover td { background: transparent; }

  .data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    text-align: right;
    /* Long unbroken values (emails, barcodes, URLs) break instead of forcing
       the column wider than the phone. */
    overflow-wrap: anywhere;
  }

  /* `overflow-wrap: anywhere` also drops MIN-CONTENT to a single character —
     that is what separates it from `break-word`. Every element child of this
     flex cell therefore becomes infinitely shrinkable, and the SUSPENDED pill
     rendered as "SUSP / ENDE / D". The bare text runs still want `anywhere`
     (a 26-char email has to break somewhere), so reset it on the boxes and
     re-enable only for values that genuinely have no break opportunity. */
  .data-table td > * { overflow-wrap: normal; }
  .data-table td > code,
  .data-table td > a[href] { overflow-wrap: anywhere; min-width: 0; }
  /* Status pills keep their word and step aside instead of being squeezed. */
  .data-table td > span:not(.avatar) { flex-shrink: 0; white-space: nowrap; }
  .data-table td > strong { min-width: 0; }
  .data-table tr td:last-child { border-bottom: none; }

  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 42%;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 1px;
    overflow-wrap: anywhere;
  }
  /* Icon/action columns ship a blank header — no label gutter for those. */
  .data-table td[data-nolabel]::before { content: none; }
  .data-table td[data-nolabel] { justify-content: flex-end; }

  /* Empty states and spinners span the row: centre them, no label. */
  .data-table td[data-fullspan] { text-align: center; justify-content: center; }
  .data-table td[data-fullspan]::before { content: none; }

  /* The first cell is the record's identity — make it read like a title. */
  .data-table tr td:first-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
  }

  /* Action buttons keep a real touch target inside the card. */
  .data-table td .action-btn,
  .data-table td .row-btn {
    width: 38px; height: 38px;
  }
  .data-table td .action-btn + .action-btn,
  .data-table td .row-btn + .row-btn { margin-left: 6px; }

  /* Badges/avatars sit on the value side without stretching the row. */
  .data-table td .badge { white-space: nowrap; }
  .data-table td .avatar { margin-right: 6px; vertical-align: middle; }
}

/* Above the card breakpoint a wide table must SCROLL inside .table-wrap,
   not compress. Without a floor, width:100% shrinks it to the container and
   the columns crush instead — the same failure the cards fix below 768px. */
@media (min-width: 769px) {
  .data-table { min-width: 640px; }
}

/* A bare <canvas> outside .chart-wrap (the check-in heatmap) is sized by
   Chart.js in px and punched 11px past a 320px viewport. */
.chart-card canvas { max-width: 100%; }

/* Rede de segurança: canvas que ESCAPE do .chart-wrap não pode esticar.
   Com `responsive:true` + `maintainAspectRatio:false` o Chart.js dimensiona
   o canvas pela altura do PAI; um .chart-card sem altura própria cresce
   junto e realimenta a cada redesenho — o heatmap do check-in tomou a
   página inteira assim. A regra acima só prendia a LARGURA.
   O `>` garante que isto atinge apenas canvas solto: os que estão dentro
   de .chart-wrap são netos e continuam governados por ele. */
.chart-card > canvas { height: 260px !important; max-height: 260px; }
@media (max-width: 768px) { .chart-card > canvas { height: 200px !important; max-height: 200px; } }

/* 320px — iPhone SE and small Androids. */
@media (max-width: 359px) {
  .page-content { padding: 10px 8px; }
  .chart-card { padding: 14px; }
  .dayof-templates-grid { grid-template-columns: 1fr; }
  .data-table td { padding: 8px 11px; gap: 10px; }
  .data-table td::before { max-width: 46%; font-size: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM LAYER — consistency + touch/readability floors
   Added 2026-08-04 after measuring all 25 pages at 320/375/390/430/768/
   1024/1280/1440/1920 in headless Chrome against live organizer data.

   Everything here is presentational. No selector touches behaviour, data
   binding, or the auth/permission surfaces.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Control sizing. The dashboard had button heights of 27/29/31/33/35px
     scattered across .btn-setting, .fin-sync-btn, .btn-link-toggle,
     .btn-icon-pill and .fin-fx-chip — every one of them below a
     comfortable touch target. These tokens give them one scale. */
  --tap-min: 44px;          /* WCAG 2.5.5 minimum target */
  --control-h-xs: 32px;     /* compact: table-row and toolbar buttons, desktop only */
  --control-h-sm: 36px;
  --control-h: 40px;
  --control-h-lg: 48px;

  /* Type floor. Measured 9px (.countdown-label), 10px (.exclusive-badge,
     .fin-fx-rate) and 11px (.upload-hint, .perf-detail, .badge) in body
     content — unreadable on a phone without zoom. */
  --fs-micro: 12px;
  --fs-caption: 12.5px;
  --fs-body: 13px;

  /* Breakpoints, for reference — media queries can't read custom props.
     small-mobile <=374 | mobile 375-767 | tablet 768-1023
     notebook 1024-1439 | desktop >=1440 */
}

/* ── Split page header ──────────────────────────────────────────────────
   9 section headers carry inline `display:flex;justify-content:
   space-between` with no flex-wrap. Inline styles win over every media
   query, so at 320px the title column was crushed to 64px and
   "People waiting for sold-out events" rendered 7 lines at ~8 chars each
   while the buttons broke their own labels in half. The class replaces
   the inline style so the layout can respond. */
.section-header-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.section-header-split > :first-child { flex: 1 1 240px; min-width: 0; }
/* Standalone: also used by button rows outside a split header. */
.section-header-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ── Responsive form/content grids ──────────────────────────────────────
   Inline `grid-template-columns:1fr 1fr` cannot collapse. Grid items also
   default to min-width:auto, so a date/time input — which has an intrinsic
   minimum the browser refuses to shrink — pushed the create-event form
   37px past a 320px viewport. */
.ds-grid-2, .ds-grid-3, .ds-grid-4 { display: grid; gap: 12px; }
.ds-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ds-grid-2 > *, .ds-grid-3 > *, .ds-grid-4 > * { min-width: 0; }

@media (max-width: 1023px) {
  .ds-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ds-grid-2, .ds-grid-3, .ds-grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Power-up / add-on cards ────────────────────────────────────────────
   icon | text | toggle. The text column carries no min-width:0, so at
   320-375px it was squeezed to ~99px and broke "MEGA DATING" and
   "Learn more →" across two lines. Below 480px the toggle drops to its
   own row instead of stealing width from the copy. */
.ds-powerup-grid {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: flex-start;
}
.ds-powerup-grid > * { min-width: 0; }
@media (max-width: 480px) {
  .ds-powerup-grid { grid-template-columns: 44px minmax(0, 1fr); }
  .ds-powerup-grid > :nth-child(3) { grid-column: 1 / -1; justify-self: flex-start; }
}

/* ── Upload dropzone ────────────────────────────────────────────────────
   Fixed 72px preview + two flex-shrink:0 buttons left the description
   column 37px wide: "Upload from your device" wrapped to 4 lines and the
   size hint to 9. Let the row wrap instead of crushing its own text. */
.ds-dropzone { flex-wrap: wrap; }
.ds-dropzone > .ds-dropzone-text { flex: 1 1 160px; min-width: 0; }

/* ── Touch targets ──────────────────────────────────────────────────────
   Phone and tablet. Height only: widths stay content-driven so nothing
   reflows on desktop. */
@media (max-width: 1023px) {
  .btn-setting,
  .btn-login,
  .fin-sync-btn,
  .btn-icon-pill,
  .fin-fx-chip,
  .dayof-template-btn,
  .filter-select,
  .search-input {
    min-height: var(--tap-min);
  }
  .btn-link-toggle { min-height: var(--control-h-sm); padding: 8px 0; }

  /* Row action buttons measured 26px wide — under a fingertip that is a
     miss, not a tap. */
  .data-table td .action-btn,
  .data-table td .row-btn { min-width: 40px; min-height: 40px; }

  /* A 15px-tall link is not a target. */
  #publicProfileLink { display: inline-flex; align-items: center; min-height: var(--control-h-sm); }
}

/* ── Action labels ──────────────────────────────────────────────────────
   "+ Add Staff", "Export CSV", "Open scanner", "Request Withdrawal" and
   "+ Create Widget" all broke across two lines at 320-375px, which reads
   as a rendering fault rather than a button. Keep labels whole and let
   the container wrap instead. */
.section-header-split .btn-setting,
.section-header-split .btn-login,
.table-header .btn-setting,
.table-header .btn-login,
.dayof-template-btn,
#requestPayoutBtn,
#scanOpenBtn,
#avatarUploadLabel,
.upload-actions .btn-upload {
  white-space: nowrap;
}

/* ── Readable type floor ────────────────────────────────────────────────
   Applies to phone and tablet only; desktop keeps its denser scale. */
@media (max-width: 1023px) {
  .countdown-label,
  .countdown-date,
  .exclusive-badge,
  .fin-fx-rate,
  .upload-hint,
  .perf-detail,
  .fin-sync-status,
  .calc-breakdown-label,
  .setting-label,
  .setting-value { font-size: var(--fs-micro); }
  .badge { font-size: var(--fs-micro); }

  /* 29 elements carry font-size 9-11px in an inline style attribute, which
     outranks any stylesheet rule. Raising them needs !important — scoped
     to phone/tablet so desktop typography keeps its intended density. */
  .page-content [style*="font-size:9px"],
  .page-content [style*="font-size:10px"],
  .page-content [style*="font-size:10.5px"],
  .page-content [style*="font-size:11px"] { font-size: var(--fs-micro) !important; }
}

/* ── Remaining undersized controls ──────────────────────────────────────
   Measured after the first pass: .fin-add-btn at 29px, the avatar upload
   label breaking "Replace image" across two lines. */
@media (max-width: 1023px) {
  .fin-add-btn, .fin-fx-chip { min-height: var(--tap-min); }

  /* Dropzone buttons are styled entirely inline and carry no class, so they
     missed the pass above. */
  #evtImagePick, #evtGalleryPick, #evtImageClear, #evtGalleryClear {
    min-height: var(--tap-min);
  }

  /* .fin-fx-chip .fin-fx-rate (0,2,0) outranks a bare .fin-fx-rate, so the
     type floor above never reached it. Match the specificity. */
  .fin-fx-chip .fin-fx-rate { font-size: var(--fs-micro); }
  .roi-channel-name { font-size: var(--fs-micro); }
  .roi-channel-sub  { font-size: var(--fs-micro); }
  /* Step markers: a single digit or check at 12px still fits the 24px dot. */
  .milestone-dot { font-size: var(--fs-micro); }
  .sim-label, .sim-detail { font-size: var(--fs-micro); }
  /* "Best Time to Launch" heatmap labels and the scanner status note. */
  .schedule-cell, .schedule-cell > div { font-size: var(--fs-micro); }
  .scan-card-note, .scan-note-ok { font-size: var(--fs-micro); }

  /* "Learn more" in the add-on cards measured 21px tall. It is a real
     destination, not decoration, so give it a usable target. */
  .ds-powerup-grid a {
    display: inline-flex; align-items: center;
    min-height: var(--control-h-sm);
  }
}

/* ── Field label with an inline hint ────────────────────────────────────
   "Numbered tables" broke mid-phrase because its explanatory span shares
   the line. The hint reads better on its own row anyway. */
.form-label > span { display: block; margin-top: 3px; }

/* Label + action on one row: let the action drop below rather than
   squeeze the label until it breaks mid-phrase. */
.ds-field-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.ds-field-head > :first-child { flex: 1 1 180px; min-width: 0; }

/* ── Fee comparison row (Analytics) ─────────────────────────────────────
   Name and fee were fixed-width spans in a non-wrapping flex row; below
   ~420px they shrank to ~68px and wrapped their own labels. */
.fee-compare-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.fee-compare-name { flex: 1 1 110px; min-width: 0; font-size: var(--fs-micro); }
.fee-compare-fee  { flex: 0 1 80px;  min-width: 0; font-size: var(--fs-micro); color: var(--text-muted); }

/* ── Title rows that carry a badge ──────────────────────────────────────
   A title plus an inline badge on one non-wrapping line squeezed both.
   Let the badge drop below instead. */
.ai-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-powerup-grid > div:nth-child(2) > div:first-child { flex-wrap: wrap; }

/* ── Table width floor at notebook sizes ────────────────────────────────
   Cards stop at 768px, so from 769px up the real table returns. The
   existing floor of 640px is enough for a 4-column table but not for the
   7-column ones: at 1024px, with the sidebar taking 272px, "Aug 10, 2026"
   was crushed into three lines of four characters. Raising the floor makes
   .table-wrap scroll — horizontal scrolling inside the component, never on
   the page — instead of compressing the columns. */
@media (min-width: 769px) and (max-width: 1279px) {
  .data-table { min-width: 860px; }
}

/* Dates, money, counts and statuses are short known formats — wrapping
   them is never the right answer, and with table-layout:auto a long event
   name in column 1 starves them until "Aug 10, 2026" becomes three lines
   of four characters. Let column 1 wrap inside a cap and keep the rest on
   one line; if that makes the table wider than its wrap it scrolls, which
   is the intended behaviour for a data table. Card mode (<=768px) is
   unaffected. */
@media (min-width: 769px) {
  .data-table td, .data-table th { white-space: nowrap; }
  /* A cap alone is not enough: once every other column is nowrap they take
     what they need and table-layout:auto squeezes the only wrappable
     column to its min-content — the event name collapsed to 63px over
     seven lines. It needs a floor as well as a cap. */
  .data-table td:first-child, .data-table th:first-child {
    white-space: normal; min-width: 220px; max-width: 340px;
  }
}

/* ── Type floor, desktop ────────────────────────────────────────────────
   9px and 10px are below readable at any width. Scoped to >=1024px on
   purpose: an unconditioned rule here would sit later in the file than the
   <=1023px block above and silently kill the 12px mobile floor — the
   audit-css-cascade check flags exactly that. */
@media (min-width: 1024px) {
  .countdown-label, .exclusive-badge, .sort-icon,
  .fin-fx-chip .fin-fx-rate, .roi-channel-sub,
  .milestone-dot, .calc-breakdown-label { font-size: 11px; }
  .data-table th { font-size: var(--fs-micro); }
  /* Inline 9-10px outranks any class rule; 11px is the desktop floor. */
  .page-content [style*="font-size:9px"],
  .page-content [style*="font-size:10px"],
  .page-content [style*="font-size:10.5px"] { font-size: 11px !important; }
}

/* ── Focus visibility ───────────────────────────────────────────────────
   Keyboard users need to see where they are on every control, not just
   the few that happened to define :focus. */
.btn-setting:focus-visible,
.btn-login:focus-visible,
.btn-icon-pill:focus-visible,
.fin-sync-btn:focus-visible,
.btn-link-toggle:focus-visible,
.nav-item:focus-visible,
.action-btn:focus-visible,
.row-btn:focus-visible,
.filter-select:focus-visible,
.search-input:focus-visible,
.form-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Long dynamic content ───────────────────────────────────────────────
   Event names, venue addresses and organizer names arrive at lengths the
   layout never sized for. */
.section-title, .table-title, .chart-title { overflow-wrap: break-word; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
