/* Advertiser dashboard — same spec-sheet system as the marketing site.
 * Hairlines instead of cards, mono tabular figures for everything countable,
 * radius reserved for live status. No gradients. */

:root {
  --paper: #ffffff;
  --wash: #f4f6fa;
  --ink: #0b1220;
  --ink-soft: #5a6474;
  --rule: #e3e6ec;
  --rule-strong: #c3cad6;
  --blue: #1633cc;
  --blue-bright: #2b5cff;
  --blue-wash: #eef1fe;
  --gold: #c9971f;
  --gold-wash: #fbf3e0;
  --good: #17794f;
  --good-wash: #e6f4ee;
  --bad: #b3261e;
  --bad-wash: #fbeceb;
  --mod: 24px;
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--wash); color-scheme: light; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0; background: var(--wash); color: var(--ink);
  font-family: var(--display); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
.hidden { display: none !important; }
h1, h2, h3 { margin: 0 0 10px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.muted { color: var(--ink-soft); font-weight: 400; }
.small { font-size: 12.5px; }
.error { font-family: var(--mono); font-size: 12px; color: var(--bad); min-height: 1.2em; margin: 8px 0 0; }
.hint, .note { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--ink-soft); }
.empty { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); padding: var(--mod) 0; }

.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.logo.small { font-size: 16px; }
.logo span { color: var(--blue); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--mod); }
.auth-card { width: 400px; max-width: 100%; background: var(--paper); border: 1px solid var(--rule); padding: calc(var(--mod) * 1.5); }
.tagline { color: var(--ink-soft); font-size: 14px; margin: 4px 0 0; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); margin: var(--mod) 0 4px; }
.tab {
  border: none; background: none; cursor: pointer; padding: 9px 14px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--blue); }

label { display: block; margin: 14px 0 0; font-size: 13px; font-weight: 600; }
input, textarea, select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  font-family: var(--display); font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 0;
}
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }
.char-count { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink); cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-bright); border-color: var(--blue-bright); }
.btn.ghost { border-color: var(--rule-strong); }
.btn.ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.wide { width: 100%; margin-top: var(--mod); }
.btn:disabled { opacity: .4; cursor: default; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px;
  background: var(--paper); border-bottom: 1px solid var(--rule); padding: 0 var(--mod);
  height: calc(var(--mod) * 2.5);
}
.topbar nav { flex: 1; display: flex; gap: 0; align-self: stretch; }
nav .tab { flex: 0 0 auto; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav .tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.container { max-width: 1080px; margin: 0 auto; padding: calc(var(--mod) * 1.5) var(--mod) calc(var(--mod) * 3); }
.row { display: flex; align-items: center; gap: 12px; }
.row.spread { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 8px; }

/* ---------- status pills: radius means "live" ---------- */
.pill {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent;
}
.pill.test { background: var(--gold-wash); color: var(--gold); border-color: var(--gold); }
.pill.active, .pill.good { background: var(--good-wash); color: var(--good); border-color: var(--good); }
.pill.paused, .pill.draft { background: var(--paper); color: var(--ink-soft); border-color: var(--rule-strong); }
.pill.exhausted, .pill.completed, .pill.bad { background: var(--bad-wash); color: var(--bad); border-color: var(--bad); }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--rule); padding: calc(var(--mod) * .9); margin-top: var(--mod); }
.card h3 { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: var(--mod); }
.campaign-card { cursor: pointer; transition: border-color .12s ease; margin-top: 0; }
.campaign-card:hover { border-color: var(--ink); }
.camp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.camp-head strong { font-size: 15.5px; letter-spacing: -0.015em; }
.camp-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); margin-top: 8px; }
.camp-stats { display: flex; gap: 0; margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 12px; }
.camp-stats div { padding-right: 20px; margin-right: 20px; border-right: 1px solid var(--rule); }
.camp-stats div:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.camp-stats div b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.camp-stats div:nth-child(2) b { color: var(--gold); }
.camp-stats div span { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- metrics: a readout row, not tiles ---------- */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0; margin: var(--mod) 0; background: var(--paper);
  border: 1px solid var(--rule); border-left: 2px solid var(--ink);
}
.metric { padding: 14px 18px; border-right: 1px solid var(--rule); }
.metric:last-child { border-right: none; }
.metric span {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px;
}
.metric b { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }

.table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); margin-top: var(--mod); }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.table th {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); background: var(--wash);
}
.table td:nth-child(n+3) { font-family: var(--mono); }
.table tr:last-child td { border-bottom: none; }

.chart { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding-top: 8px; justify-content: flex-start; }
.chart:has(> .empty) { height: auto; }
.chart .bar-wrap { flex: 1; max-width: 48px; display: flex; flex-direction: column; height: 100%; justify-content: flex-end; }
.chart .bar { background: var(--blue); min-height: 2px; }
.chart .bar.click { background: var(--gold); }
.chart .day { font-family: var(--mono); font-size: 9px; color: var(--ink-soft); margin-top: 5px; text-align: center; }

.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog { border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); padding: calc(var(--mod) * 1.1); width: 400px; }
dialog::backdrop { background: rgba(11,18,32,.4); }

.ad-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ad-row:last-child { border-bottom: none; }
.ad-thumb {
  width: 40px; height: 40px; background: var(--wash); object-fit: cover; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; color: var(--ink-soft); border: 1px solid var(--rule);
}
.ad-preview-strip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: 12px;
}
.ad-badge { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; opacity: .6; }

/* ---------- onboarding ---------- */
.welcome { border-left: 2px solid var(--blue); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin-top: 16px; border-top: 1px solid var(--rule); }
.step { display: flex; gap: 10px; align-items: baseline; padding: 14px 18px 0 0; border-right: 1px solid var(--rule); }
.step:last-child { border-right: none; }
.step-num { font-family: var(--mono); font-size: 11px; color: var(--gold); flex-shrink: 0; }

/* ---------- new campaign preview ---------- */
.menubar-mock {
  display: flex; justify-content: space-between; align-items: center;
  background: #22303f; border-radius: 6px; padding: 0 12px; height: 42px;
  color: #fff; font-size: 13px; overflow: hidden; user-select: none; margin-top: 8px;
}
.mb-apps { display: flex; gap: 12px; align-items: center; min-width: 0; overflow: hidden; }
.mb-dim { width: 13px; height: 13px; border-radius: 3px; background: #fff; opacity: .8; display: inline-block; flex-shrink: 0; }
.mb-appname { font-weight: 600; }
.mb-menu { opacity: .6; }
.mb-right { display: flex; gap: 12px; align-items: center; min-width: 0; max-width: 64%; }
.mb-icon { font-family: var(--mono); font-size: 11px; opacity: .65; white-space: nowrap; flex-shrink: 0; }
.mb-ad {
  display: inline-flex; align-items: center; gap: 6px; background: #0b1220;
  border: 1px solid var(--brand, #3c4a5c); border-radius: 999px;
  padding: 3px 4px 3px 9px; max-width: 280px; min-width: 0; overflow: hidden;
}
.mb-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d058; flex-shrink: 0; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.mb-adtext {
  white-space: nowrap; overflow: hidden; min-width: 0; font-size: 12.5px;
  mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent 100%);
}
.mb-cta {
  flex-shrink: 0; background: var(--brand, var(--blue-bright)); color: #fff;
  font-family: var(--mono); font-size: 10px; border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}

.estimate-box { border: 1px solid var(--rule); border-left: 2px solid var(--blue); padding: 12px 14px; margin-top: 12px; }
.estimate-box > span:first-child { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.estimate-box b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 600; margin: 3px 0; }

.chips { display: flex; gap: 8px; margin: 10px 0; }
.chip {
  border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 12px; padding: 6px 13px; cursor: pointer; border-radius: 0;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.verify-banner {
  background: var(--gold-wash); border: 1px solid var(--gold); border-left-width: 2px;
  padding: 12px 16px; margin-bottom: var(--mod); font-size: 13.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.toast {
  position: fixed; bottom: var(--mod); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-family: var(--mono); font-size: 12.5px;
  padding: 11px 18px; z-index: 100;
}

@media (max-width: 700px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; }
  .topbar nav { order: 3; flex: 1 0 100%; }
  .container { padding: var(--mod) 16px calc(var(--mod) * 2); }
  .form .grid2 { grid-template-columns: 1fr; }
  .row.spread { flex-wrap: wrap; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .camp-stats div { padding-right: 14px; margin-right: 14px; }
  dialog { width: calc(100vw - 32px); }
}
.metric.money b { color: var(--gold); }
