:root {
  --bg: #0b1220;
  --panel: #111a2e;
  --panel2: #16223a;
  --text: #eef4ff;
  --muted: #a8b4ca;
  --line: rgba(255,255,255,0.12);
  --green: #28d17c;
  --yellow: #ffd166;
  --red: #ff5c7a;
  --blue: #8ec5ff;
  --purple: #b48cff;
  --shadow: 0 20px 50px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1b3760 0, #0b1220 42%, #080d18 100%);
  color: var(--text);
  min-height: 100vh;
}
a { color: #b9dcff; }
a:hover { color: #dbeafe; }

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 44px clamp(18px, 4vw, 64px);
  align-items: end;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .12em;
  font-size: .78rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: .98; }
h2 { margin: 0 0 4px; font-size: 1.25rem; }
h3 { margin: 8px 0; }
.subtitle { font-size: 1.35rem; font-weight: 700; margin: 12px 0 0; color: white; }
.hero-detail { color: var(--muted); max-width: 920px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.button {
  border: 0;
  background: linear-gradient(135deg, #3e7cff, #8b5cf6);
  color: white;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.button.secondary { background: rgba(255,255,255,.10); border: 1px solid var(--line); }
.button:hover { filter: brightness(1.08); }
.button:disabled { opacity: .5; cursor: not-allowed; }

.hero-card, .panel, .metric, .campaign-card {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.045));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
}
.hero-card { padding: 22px; }
.hero-card h3 { margin: 0 0 4px; font-size: .78rem; color: var(--blue); letter-spacing: .12em; text-transform: uppercase; }
.hero-card .big { font-size: 2.6rem; font-weight: 900; line-height: 1; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.hero-card .row { display: flex; justify-content: space-between; gap: 14px; }
.hero-card .row > div { flex: 1; }
.hero-card small { color: var(--muted); font-size: .82rem; }

main { padding: 26px clamp(18px, 4vw, 64px) 50px; }

/* ===== Summary metrics ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric { padding: 18px; position: relative; overflow: hidden; }
.metric span { display: block; color: var(--muted); font-size: .86rem; }
.metric strong {
  display: block;
  font-size: 2.4rem;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.metric small { color: var(--muted); font-size: .82rem; }
.metric.green strong { color: var(--green); }
.metric.yellow strong { color: var(--yellow); }
.metric.red strong { color: var(--red); }
.metric .delta {
  display: inline-block;
  margin-left: 6px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--green);
}

/* ===== Controls bar ===== */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.controls .group { display: flex; gap: 8px; align-items: center; }
.controls .group .label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.speed-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: .85rem;
}
.speed-btn.is-active {
  background: linear-gradient(135deg, #3e7cff, #8b5cf6);
  border-color: transparent;
}
.speed-btn:hover:not(.is-active) { background: rgba(255,255,255,.08); }

/* ===== Panels ===== */
.panel { padding: 22px; margin-bottom: 20px; }
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
.section-header h2 { font-size: 1.4rem; }
.section-header .helper { color: var(--muted); font-size: .88rem; max-width: 560px; }

/* ===== Ticker board ===== */
.ticker-board { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ticker-row {
  display: grid;
  grid-template-columns: 220px 1fr 1fr 220px 80px;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .2s, background .2s;
}
.ticker-row.is-bursting {
  border-color: rgba(180, 140, 255, 0.6);
  background: rgba(180, 140, 255, 0.07);
}
.ticker-channel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ticker-channel .swatch {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  flex-shrink: 0;
}
.ticker-channel .name {
  font-weight: 700;
  font-size: .98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker-metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticker-metric .label {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}
.ticker-metric .value {
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.ticker-metric .delta {
  color: var(--green);
  font-size: .78rem;
  font-weight: 700;
}
.ticker-spark { height: 42px; }
.ticker-spark svg { width: 100%; height: 100%; display: block; }
.status-pill {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .72rem;
  border: 1px solid var(--line);
  justify-self: end;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-pill.green { color: var(--green); background: rgba(40,209,124,.10); border-color: rgba(40,209,124,.35); }
.status-pill.yellow { color: var(--yellow); background: rgba(255,209,102,.10); border-color: rgba(255,209,102,.35); }
.status-pill.red { color: var(--red); background: rgba(255,92,122,.10); border-color: rgba(255,92,122,.35); }

@media (max-width: 1100px) {
  .ticker-row { grid-template-columns: 180px 1fr 1fr; }
  .ticker-spark, .status-pill { grid-column: 1 / -1; justify-self: start; width: 100%; height: 36px; }
  .status-pill { width: auto; height: auto; }
}

/* ===== Campaign drill-down ===== */
.layout.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .9fr);
  gap: 18px;
}
.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}
.campaign-card {
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.campaign-card:hover { border-color: rgba(142,197,255,0.4); transform: translateY(-1px); }
.campaign-card.is-active { border-color: var(--blue); background: rgba(142,197,255,0.08); }
.campaign-card .meta {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.campaign-card .meta .swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.campaign-card .live {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.campaign-card .live .imp { font-size: 1.15rem; font-weight: 800; }
.campaign-card .live small { color: var(--muted); font-size: .72rem; }

.detail-view {
  padding: 22px;
  min-height: 420px;
}
.detail-view h3 { margin: 0; font-size: 1.2rem; }
.detail-view .lede { color: var(--muted); margin: 6px 0 16px; font-size: .92rem; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 16px;
}
.detail-grid > div {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.detail-grid strong {
  display: block;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
}
.detail-kvs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.detail-kvs > div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
  font-size: .9rem;
}
.detail-kvs span { color: var(--muted); }

/* ===== Footer ===== */
footer { padding: 28px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); color: var(--muted); }
footer p { margin: 6px 0; }

/* ===== Pages other than dashboard ===== */
.content-page { max-width: 980px; margin: 0 auto; padding: 40px 20px; }
.content-page h1 { font-size: 2.6rem; }
.content-page h2 { font-size: 1.4rem; margin-top: 32px; }
code { color: #dbeafe; background: rgba(255,255,255,.08); padding: 2px 5px; border-radius: 6px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .layout.two-col { grid-template-columns: 1fr; }
}
