/* Client reporting. FSM brand kit v2 (fsm-website/public/brand-kit/README.txt): Black, White, Signal Red,
   Concrete, Field Gray, Graphite, Scope Smoke; Geist 400-700 and Geist Mono 500; square corners;
   the pulsing red square marks live things. Light only. */
@font-face { font-family: "Geist"; src: url(/assets/fonts/Geist-Variable-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/assets/fonts/GeistMono-Variable-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: light;
  /* Brand: Black #0A0A0A, White #FFFFFF, Signal Red #FF2A1F, Concrete #E9E8E4, Field Gray #B9B7B1, Graphite #5C5C5C, Scope Smoke #222222 */
  --bg: #ffffff; --page: #ffffff; --ink: #0a0a0a; --mid: #5c5c5c; --dot: #b9b7b1; --faint: #e9e8e4; --panel: #e9e8e4; --red: #ff2a1f; --smoke: #222222;
  /* Chart series, from the brand colors only. */
  --display: #0a0a0a; --olv: #ff2a1f; --ctv: #5c5c5c; --audio: #b9b7b1;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.label, th { font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mid); }
.num { font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; text-decoration: none; border-radius: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; border-width: 1px; }
input[type=email], input[type=text], input[type=date], select { min-height: 36px; padding: 0 10px; border: 1.5px solid var(--dot); background: var(--bg); border-radius: 0; }
input:focus, select:focus { outline: none; border-color: var(--ink); }

/* Top bar */
.top { background: var(--bg); border-bottom: 1px solid var(--faint); }
@keyframes fsm-breathe { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }
@media (prefers-reduced-motion: reduce) { .fresh::before, .pill.live::before { animation: none !important; } }
.top .in { max-width: 1280px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; }
.top img { height: 30px; width: auto; display: block; }
.top .spacer { flex: 1; }
.top .who { font-size: 13px; color: var(--mid); }
.top nav a { font-size: 14px; text-decoration: none; color: var(--mid); margin-left: 18px; }
.top nav a:hover, .top nav a.on { color: var(--ink); }
main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 6px; }
h2 { font-size: 18px; letter-spacing: -.01em; margin: 0 0 12px; }
.sub { color: var(--mid); font-size: 14px; }
.card { background: var(--bg); border: 1px solid var(--faint); padding: 20px; margin-bottom: 16px; }
.fresh { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mid); }
.fresh::before { content: ""; width: 7px; height: 7px; background: var(--red); animation: fsm-breathe 2.2s ease-in-out infinite; }
.fresh.stale::before { background: var(--dot); animation: none; }
.crumbs { font-size: 13px; color: var(--mid); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.empty { color: var(--mid); padding: 28px 0; text-align: center; }
.err { border-left: 3px solid var(--red); background: var(--panel); padding: 12px 14px; font-size: 14px; }

/* Status pill and delivery bar */
.pill { display: inline-block; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border: 1px solid var(--dot); color: var(--mid); white-space: nowrap; }
.pill.live { border-color: var(--ink); color: var(--ink); }
.pill.live::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--red); margin-right: 6px; vertical-align: 0; animation: fsm-breathe 2.2s ease-in-out infinite; }
.pill.upcoming { border-color: var(--dot); color: var(--mid); }
.bar { position: relative; height: 6px; background: var(--faint); min-width: 80px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); max-width: 100%; }
.bar > span::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }

/* Campaign list */
.clist { display: grid; gap: 0; border: 1px solid var(--faint); background: var(--bg); }
.crow { display: grid; grid-template-columns: minmax(0, 2.4fr) 1.2fr 90px 1fr 1.4fr; gap: 18px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--faint); text-decoration: none; }
.crow:first-child { border-top: 0; }
a.crow:hover { background: var(--faint); }
.crow.head { padding-top: 12px; padding-bottom: 12px; background: var(--bg); border-bottom: 1px solid var(--ink); }
.crow .name { font-weight: 600; }
.crow .adv { font-size: 13px; color: var(--mid); }
.deliv { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; }
@media (max-width: 760px) { .crow { grid-template-columns: 1fr auto; } .crow > :nth-child(2), .crow > :nth-child(4) { display: none; } .crow > :nth-child(5) { grid-column: 1 / -1; } .crow.head { display: none; } }

/* Campaign view */
.chead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); margin-bottom: 18px; position: sticky; top: 0; background: var(--bg); z-index: 3; }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg button { border: 0; background: var(--bg); padding: 0 12px; min-height: 32px; cursor: pointer; font-size: 13px; border-left: 1px solid var(--ink); }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--faint); }
.seg button.on { background: var(--ink); color: #fff; }
.dates { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mid); }
.dates input { min-height: 32px; font-size: 13px; }
.toolbar .spacer { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--faint); background: var(--bg); margin-bottom: 16px; }
.stat { padding: 16px 20px; border-left: 1px solid var(--faint); }
.stat:first-child { border-left: 0; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .n { font-size: 12px; color: var(--mid); margin-top: 2px; }
.stat.wide { grid-column: span 2; }
.stat .bar { height: 8px; margin-top: 10px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--mid); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; }
.chart .tick { fill: var(--mid); font: 11px var(--mono); }
.chart .grid { stroke: var(--faint); }
.chart .partial { opacity: .45; }
.tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--ink); padding: 8px 10px; font-size: 12px; display: none; z-index: 4; min-width: 170px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; }
.tip b { display: block; margin-bottom: 4px; }

/* Tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 300px; }
tr.group td { background: var(--faint); font-weight: 600; border-top: 1px solid var(--dot); }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
td .av { font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mid); border: 1px solid var(--dot); padding: 3px 5px; margin-left: 6px; vertical-align: 1px; }
td.muted { color: var(--dot); }

/* Admin */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.org { border-top: 1px solid var(--faint); padding: 14px 0; }
.org:first-of-type { border-top: 0; }
.mem { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.mem .seen { font-size: 12px; color: var(--mid); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--mid); }
.kv dd { margin: 0; }
@media (max-width: 600px) {
  .top .in, main { padding-left: 16px; padding-right: 16px; }
  .top .in { gap: 12px; }
  .top .who { display: none; }
  .top nav a { margin-left: 10px; }
  .top img { height: 24px; }
  .stat.wide { grid-column: auto; }
  th:first-child, td:first-child { min-width: 220px; }
}
