/* ==========================================================================
   Ovatic Outreach Command — design system
   Black + gold identity, refined to Linear / Stripe / Vercel league:
   near-black canvas, hairline borders (not shadows) for hierarchy,
   one accent (gold) reserved for primary actions + hero, tabular
   numerals everywhere data appears, 4px spacing base, motion only
   on transform/opacity, <=200ms, ease-out, reduced-motion respected.
   Fonts are self-hosted Inter (static/fonts/), no external dependency.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  /* Surfaces: a 4-step ladder carries hierarchy, not shadows. */
  --bg: #0b0c0e;
  --bg-soft: #0f1013;
  --surface: #141519;
  --surface-2: #191b20;
  --surface-3: #1f2228;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #f4f5f6;
  --text-2: #c6cad1;
  --muted: #8b919c;
  --faint: #5c6270;
  --gold: #f9d238;
  --gold-ink: #141414;
  --gold-soft: rgba(249, 210, 56, .12);
  --gold-ring: rgba(249, 210, 56, .28);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .13);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .13);
  --blue: #7aa7ff;
  --blue-soft: rgba(122, 167, 255, .13);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, .13);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --shadow-lift: 0 14px 34px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(249, 210, 56, .28); color: var(--text); }
a { color: var(--blue); }
button { font-family: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* Numbers always tabular so columns never jitter. */
.num, td.num, .kpi-value, .hero-num, .camp-num, .funnel-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ------------------------------------------------------------------ header */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px; height: 60px;
  background: rgba(11, 12, 14, .88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--gold); color: var(--gold-ink);
  font-size: 22px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.02em;
}
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .05em; }
.brand h1 span { color: var(--gold); }
.brand .tag { font-size: 12px; color: var(--muted); margin-top: 1px; letter-spacing: .02em; }
.spacer { flex: 1; }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease-out, border-color .15s ease-out,
    color .15s ease-out, transform .15s ease-out, box-shadow .15s ease-out;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: var(--gold-ink); }
.btn-primary:hover { background: #ffe066; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.btn-ghost.active { color: var(--gold); border-color: rgba(249, 210, 56, .45); background: var(--gold-soft); }
.btn-quiet { background: transparent; color: var(--muted); border-color: transparent; padding: 0 10px; }
.btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: rgba(248, 113, 113, .35); }
.btn-danger:hover { background: rgba(248, 113, 113, .22); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg { flex-shrink: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.dry { background: var(--green-soft); color: var(--green); }
.badge.live { background: var(--red-soft); color: var(--red); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }

/* ------------------------------------------------------------------ layout */
main { max-width: 1200px; margin: 0 auto; padding: 24px 24px 40px; }
.page-head { margin: 8px 0 20px; }
.page-head h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  margin: 0;
}
.page-head h1 span { color: var(--gold); }
.page-head p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold); font-weight: 600; font-size: 14px; text-decoration: none;
  margin-bottom: 12px;
}
.back-link:hover { text-decoration: underline; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin: 20px 0;
}
.panel > h2, .panel-h {
  font-size: 19px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 4px;
}
.panel-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.panel-sub b { color: var(--text-2); font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 28px 28px 24px;
  margin: 4px 0 20px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(640px 220px at 18% -40px, rgba(249, 210, 56, .09), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: end; }
.hero-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-num {
  font-size: 52px; font-weight: 700; letter-spacing: -.035em; line-height: 1;
  margin-top: 10px; color: var(--text);
}
.hero-num small { font-size: 20px; font-weight: 600; color: var(--muted); letter-spacing: -.02em; }
.delta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px;
}
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.delta.flat { background: rgba(255, 255, 255, .06); color: var(--muted); }
.spark-wrap { border-left: 1px solid var(--line); padding-left: 24px; }
.spark-wrap .spark-title { display: flex; justify-content: space-between; align-items: baseline; }
.spark-wrap .spark-today { font-size: 20px; font-weight: 700; }
.spark { width: 100%; height: 64px; display: block; margin-top: 6px; }

/* Funnel strip: four honest stages, no invented conversion rates. */
.funnel {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 0;
  align-items: stretch; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.funnel-stage { padding: 0 16px; min-width: 0; }
.funnel-stage:first-child { padding-left: 0; }
.funnel-stage:last-child { padding-right: 0; }
.funnel-num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.funnel-arrow { color: var(--faint); font-size: 20px; align-self: center; font-weight: 300; }
.funnel-stage .eyebrow { display: block; margin-top: 2px; }
.funnel-stage .fsub { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------------------------------------------------------------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 4px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px;
}
.kpi .label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; line-height: 1.1; }
.kpi-value.accent { color: var(--gold); }
.kpi-value.green { color: var(--green); }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------------------------------------------------------- campaign cards */
.camp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.camp-card {
  --hue: #f9d238;
  position: relative; display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
  text-decoration: none; color: var(--text);
  overflow: hidden;
  transition: transform .18s var(--ease), border-color .18s ease-out, box-shadow .18s ease-out;
  animation: rise .34s var(--ease) both;
}
.camp-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--hue);
  opacity: .85;
}
.camp-card:hover, .camp-card:focus-visible {
  border-color: rgba(249, 210, 56, .55);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  outline: none;
}
.camp-card:active { transform: translateY(0); box-shadow: none; }
.camp-top { display: flex; align-items: flex-start; gap: 12px; }
.camp-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--hue);
  background: color-mix(in srgb, var(--hue) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue) 26%, transparent);
}
.camp-icon svg { width: 21px; height: 21px; }
.camp-name { font-size: 17px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.camp-tag { font-size: 12px; color: var(--muted); margin-top: 2px; }
.camp-arrow {
  margin-left: auto; color: var(--gold); font-size: 18px; line-height: 1;
  opacity: 0; transform: translateX(-5px);
  transition: opacity .18s ease-out, transform .18s var(--ease);
  flex-shrink: 0; padding-top: 2px;
}
.camp-card:hover .camp-arrow, .camp-card:focus-visible .camp-arrow { opacity: 1; transform: translateX(0); }
.camp-num { font-size: 32px; font-weight: 700; letter-spacing: -.03em; margin-top: 14px; line-height: 1; }
.camp-num small { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.camp-num .dot { color: var(--green); font-size: 10px; vertical-align: middle; margin-right: 2px; }
.camp-bar { height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .08); margin-top: 12px; overflow: hidden; }
.camp-bar i { display: block; height: 100%; border-radius: 999px; background: var(--hue); transition: width .5s var(--ease); }
.camp-health { font-size: 12.5px; color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }
.camp-health b { color: var(--text-2); font-weight: 650; }

/* ------------------------------------------------------------------ tables */
.tblwrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
tbody td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background-color .12s ease-out; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }

/* URLs: never wrap mid-word — ellipsis + copy on click. */
.u {
  color: var(--blue); text-decoration: none;
  display: inline-block; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.u:hover { text-decoration: underline; }
.url-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 300px; }
.copy-btn {
  flex-shrink: 0; width: 24px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--faint); cursor: pointer; opacity: 0;
  transition: opacity .15s ease-out, color .15s ease-out, background-color .15s ease-out;
}
tr:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--gold); background: rgba(255, 255, 255, .06); }

/* Status pills — one system everywhere (dot + label). */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-delivered, .pill-sent { background: var(--green-soft); color: var(--green); }
.pill-failed { background: var(--red-soft); color: var(--red); }
.pill-queued { background: var(--blue-soft); color: var(--blue); }
.pill-held { background: var(--amber-soft); color: var(--amber); }
.pill-suppressed { background: rgba(255, 255, 255, .07); color: var(--muted); }
.pill-manual_sent, .pill-manualsent { background: var(--teal-soft); color: var(--teal); }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-warn { background: var(--amber-soft); color: var(--amber); }

/* ------------------------------------------------------------------- forms */
input[type=text], input[type=password], input[type=number], input[type=date], select {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px; outline: none;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-ring); }
input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; }
label { font-size: 14px; color: var(--text-2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 4px; }
.filters input[type=text] { flex: 1; min-width: 220px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.tab-btn {
  font-size: 13.5px; font-weight: 600; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out;
}
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.tab-btn.active { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }

/* ------------------------------------------------------------------ panels */
.logline {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 10px;
  padding: 12px 14px; margin: 10px 0; font-size: 13.5px;
}
.logline .ts { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.logline .log-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.logline .log-stats b { font-variant-numeric: tabular-nums; }
.logline details { margin-top: 8px; }
.logline summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.logline summary:hover { color: var(--text-2); }
.logline pre {
  margin: 8px 0 0; padding: 10px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; color: var(--muted);
  max-height: 220px; overflow: auto;
}
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#err { color: var(--red); font-weight: 600; font-size: 13.5px; }
footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 0 28px; }
footer b { color: var(--gold); font-weight: 600; }

/* Message preview (campaign detail) */
.msg-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.msg-head { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.msg-head b { color: var(--text); }
.msgbox {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 10px;
  padding: 16px 18px; font-size: 14.5px; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msgbox a { color: var(--blue); text-decoration: none; overflow-wrap: anywhere; }
.msgbox a:hover { text-decoration: underline; }
.msg-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* Screenshots */
.shots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.shot {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; position: relative;
  transition: transform .18s var(--ease), border-color .18s ease-out, box-shadow .18s ease-out;
}
.shot:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.shot .thumb { display: block; overflow: hidden; cursor: zoom-in; }
.shot img { width: 100%; display: block; transition: transform .25s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.shot .shot-status {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.shot .cap { padding: 10px 12px; font-size: 13px; }
.shot .cap b { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.shot .cap .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.shots .shot { padding: 12px; }
.shots .shot .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.shots .shot img { border: 1px solid var(--line); border-radius: 6px; }
.shots .shot .tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 6, 8, .92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .18s ease-out;
}
.lightbox img { max-width: min(92vw, 1100px); max-height: 78vh; border-radius: 10px; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lift); }
.lightbox .lb-cap { margin-top: 14px; color: var(--text-2); font-size: 13.5px; text-align: center; max-width: 92vw; }
.lightbox .lb-cap b { color: var(--text); }
.lb-btn {
  position: absolute; top: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(20, 21, 25, .9);
  color: var(--text); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: var(--surface-3); }
.lb-close { right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120;
  transform: translate(-50%, 16px);
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 11px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none;
  transition: opacity .2s ease-out, transform .2s var(--ease);
  max-width: min(92vw, 480px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Skeletons — replace every "Loading…" flash. */
.skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite linear;
  color: transparent !important;
}
.skel * { visibility: hidden; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise .34s var(--ease) both; }

/* Pager + misc */
.pager { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.dates { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 2px; }
.date-btn { font-size: 13px; padding: 7px 13px; border-radius: 999px; }
.date-btn.active { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }
.empty { color: var(--muted); font-size: 13.5px; padding: 18px 0; text-align: center; }

/* Login / setup card */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lift);
}
.auth-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.auth-card h2 span { color: var(--gold); }
.auth-card p { color: var(--muted); font-size: 14px; margin: 0 0 18px; line-height: 1.5; }
.auth-card label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; color: var(--text-2); }
.auth-card input { width: 100%; }
.auth-card .btn { width: 100%; justify-content: center; height: 44px; font-size: 15px; margin-top: 20px; }
.auth-card .btn-primary { border-radius: 10px; }
#err, .auth-err { color: var(--red); font-weight: 600; font-size: 14px; margin-top: 14px; min-height: 20px; }
.auth-ok { color: var(--green); font-weight: 600; font-size: 14px; margin-top: 14px; min-height: 20px; }
.hidden { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1020px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .camp-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .spark-wrap { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .funnel { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .funnel-arrow { display: none; }
  .funnel-stage { padding: 0 12px 0 0; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; height: auto; min-height: 60px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  main { padding: 16px 14px 32px; }
  .camp-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .hero-num { font-size: 42px; }
  .page-head h1 { font-size: 28px; }
  .hero { padding: 20px 18px; }
}

/* Motion: only transform/opacity, <=200ms feedback, off when reduced. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
