/* ZetaRelay Design System — Colors & Type tokens
 * CRT phosphor / classified terminal aesthetic for the operator console.
 * Mono-only typography. Import from any HTML doc. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap');

:root {
  /* ── Surfaces ─────────────────────────────────────────────── */
  --bg:         #050807;
  --bg-deep:    #020403;
  --panel:      #0a1410;
  --panel-2:    #0d1a14;
  --panel-3:    #102018;

  /* ── Lines ────────────────────────────────────────────────── */
  --line:        #1a3026;
  --line-bright: #2a5040;
  --line-soft:   #14241c;

  /* ── Phosphor primary ─────────────────────────────────────── */
  --phos:        #22ff88;
  --phos-bright: #5cffa8;
  --phos-mid:    #14d070;
  --phos-dim:    #4a8068;
  --phos-low:    #2a4030;
  --phos-vlow:   #16241c;

  /* ── Text ramp ────────────────────────────────────────────── */
  --text:        #cef0d8;
  --text-bright: #e8ffec;
  --text-dim:    #88c0a0;
  --text-low:    #4a7060;
  --text-xlow:   #2a4030;

  /* ── Status accents — locked one-event-one-color ──────────── */
  --red:     #ff3344; --red-bright: #ff5566; --red-dim: #882028; --red-bg: #2a0810;
  --amber:   #ffaa22; --amber-dim:  #885000; --amber-bg: #2a1c00;
  --cyan:    #22e0ff; --cyan-dim:   #0a8090; --cyan-bg:  #002028;
  --rose:    #ff5577; --rose-dim:   #882030; --rose-bg:  #28080e;
  --blue:    #5a8aff; --blue-dim:   #2040a0; --blue-bg:  #0a1230;
  --magenta: #ff66cc; --magenta-dim:#903070;

  /* Semantic mapping (campaigns, deliverability, sponsors) */
  --st-running:    var(--phos);    /* In Progress, click, OK, prod */
  --st-done:       var(--phos);    /* Done — same family, dimmer in UI */
  --st-paused:     var(--amber);   /* Paused, deferred, sandbox, TEST */
  --st-killed:     var(--rose);    /* Killed, optout, hard-bounce */
  --st-scheduled:  var(--cyan);    /* Scheduled, open, info */
  --st-interrupted:var(--magenta); /* Interrupted, vpn */
  --st-error:      var(--red);     /* errors, classified banner, tor */
  --st-lead:       var(--blue);    /* leads / conversions */

  /* ── Glow shadows (phosphor, not soft drop) ───────────────── */
  --shadow-glow:        0 0 18px rgba(34, 255, 136, 0.08);
  --shadow-glow-strong: 0 0 24px rgba(34, 255, 136, 0.18);
  --shadow-popover:     0 8px 32px rgba(0,0,0,0.6), 0 0 24px rgba(34,255,136,0.15);

  /* ── Type ────────────────────────────────────────────────── */
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;

  --fs-9:  9px;
  --fs-10: 10px;
  --fs-11: 11px;
  --fs-13: 13px;
  --fs-18: 18px;
  --fs-22: 22px;

  --ls-tight:    0.04em;
  --ls-default:  0.08em;
  --ls-meta:     0.14em;
  --ls-overline: 0.18em;
  --ls-wide:     0.22em;

  /* ── Spacing — 4px base ──────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* ── Layout constants ────────────────────────────────────── */
  --shell-sidebar: 240px;
  --shell-topbar:  60px;
  --shell-footer:  28px;
  --row-h:         38px;
  --listhead-h:    28px;
}

/* ── Semantic type recipes ─────────────────────────────────── */
.ds-h1 { font-family: var(--mono); font-size: var(--fs-22); font-weight: 600; letter-spacing: var(--ls-tight); color: var(--text-bright); margin: 0; }
.ds-h2 { font-family: var(--mono); font-size: var(--fs-18); font-weight: 600; letter-spacing: var(--ls-tight); color: var(--text-bright); margin: 0; }
.ds-overline { font-family: var(--mono); font-size: var(--fs-9);  letter-spacing: var(--ls-wide);     color: var(--text-low); text-transform: uppercase; }
.ds-meta     { font-family: var(--mono); font-size: var(--fs-10); letter-spacing: var(--ls-meta);     color: var(--text-low); }
.ds-body     { font-family: var(--mono); font-size: var(--fs-11); letter-spacing: var(--ls-default); color: var(--text); }
.ds-num      { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--phos); text-shadow: 0 0 6px rgba(34,255,136,0.2); }
.ds-mono     { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Reset & base ──────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-13);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ── CRT atmosphere ────────────────────────────────────────── */
.crt-bg {
  background:
    radial-gradient(ellipse at top left,  rgba(34,255,136,0.04), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(34,255,136,0.03), transparent 50%),
    var(--bg);
  min-height: 100vh;
  position: relative;
}
.crt-bg::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  background: repeating-linear-gradient(0deg, rgba(34,255,136,0.06) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; opacity: 0.55;
}
.crt-bg::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1001;
  background: rgba(34,255,136,0.012);
  animation: crt-flicker 6s steps(1) infinite;
}
@keyframes crt-flicker {
  0%, 96%, 100% { opacity: 1; }
  97%           { opacity: 0.7; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ── Atoms shared by previews + UI kit ─────────────────────── */
.panel       { background: rgba(10,20,16,0.4); border: 1px solid var(--line); }
.panel-band  { background: linear-gradient(180deg, rgba(34,255,136,0.04), transparent); border-bottom: 1px solid var(--line); }

.btn {
  font-family: var(--mono); font-size: var(--fs-10); letter-spacing: var(--ls-overline);
  text-transform: uppercase; background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); padding: 6px 12px; cursor: pointer;
  transition: color 120ms linear, border-color 120ms linear, background 120ms linear, box-shadow 120ms linear;
}
.btn:hover { color: var(--phos); border-color: var(--phos-dim); }
.btn.primary { color: var(--phos); border-color: var(--phos-dim); background: rgba(34,255,136,0.08); box-shadow: var(--shadow-glow); }
.btn.primary:hover { background: rgba(34,255,136,0.14); box-shadow: var(--shadow-glow-strong); }
.btn.danger { color: var(--rose); border-color: var(--rose-dim); }
.btn.danger:hover { background: var(--rose-bg); }
.btn:focus { outline: 0; border-color: var(--phos-dim); box-shadow: var(--shadow-glow); }

.chip {
  font-family: var(--mono); font-size: var(--fs-9); letter-spacing: var(--ls-overline);
  text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line);
  background: var(--panel-3); color: var(--text-dim);
}
.chip.on { background: rgba(34,255,136,0.08); border-color: var(--phos-dim); color: var(--phos); text-shadow: 0 0 6px rgba(34,255,136,0.3); }

.qflag {
  font-family: var(--mono); font-size: var(--fs-9); letter-spacing: var(--ls-overline);
  text-transform: uppercase; padding: 2px 6px; border: 1px solid currentColor;
}
.qflag.ok    { color: var(--phos);   background: rgba(34,255,136,0.06); }
.qflag.bot   { color: var(--amber);  background: rgba(255,170,34,0.06); }
.qflag.vpn   { color: var(--magenta);background: rgba(255,102,204,0.06); }
.qflag.tor   { color: var(--red);    background: rgba(255,51,68,0.06); }
.qflag.err   { color: var(--rose);   background: rgba(255,85,119,0.06); }

.tp {
  font-family: var(--mono); font-size: var(--fs-10); letter-spacing: var(--ls-meta);
  padding: 2px 6px; border: 1px solid currentColor;
}
.tp.open    { color: var(--cyan); }
.tp.click   { color: var(--phos); }
.tp.unsub   { color: var(--amber); }
.tp.optout  { color: var(--rose); }
.tp.lead    { color: var(--blue); }
.tp.bounce  { color: var(--magenta); }

.input {
  font-family: var(--mono); font-size: var(--fs-11); letter-spacing: var(--ls-default);
  background: var(--bg-deep); color: var(--text-bright);
  border: 1px solid var(--line); padding: 8px 10px; width: 100%;
}
.input:focus { outline: 0; border-color: var(--phos-dim); box-shadow: var(--shadow-glow); }
.input::placeholder { color: var(--text-xlow); }

.label-overline {
  font-family: var(--mono); font-size: var(--fs-9); letter-spacing: var(--ls-wide);
  color: var(--text-low); text-transform: uppercase;
}

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; vertical-align: middle; }
.dot.live { background: var(--phos); box-shadow: 0 0 8px var(--phos); animation: blink 2s steps(2) infinite; }
.dot.warn { background: var(--amber); }
.dot.err  { background: var(--red); }

.divider-band {
  height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
