/* ═══════════════════════════════════════════════════════════════════════════
   TrendIntel — WAR ROOM theme (ops terminal). Pure override layer:
   everything scopes under body.theme-warroom; token swaps do most of the
   work, component rules add the terminal grammar (brackets, glow, mono).
   The login page never carries this class — it stays dossier.
   ═══════════════════════════════════════════════════════════════════════════ */

body.theme-warroom {
  /* token overrides — future modules inherit automatically */
  --paper: #050b08;
  --paper-deep: #071009;
  --card: #0a1410;
  --line: #12341f;
  --line-strong: #1d5433;

  --ink: #b9f5cf;
  --ink-soft: #5fd18f;
  --ink-faint: #35744f;

  --gold-700: #2f8f5b;
  --gold-600: #37b872;
  --gold-500: #4ade80;
  --gold-300: #86efac;
  --gold-100: rgba(74, 222, 128, .08);

  --navy-900: #030705;
  --navy-800: #061009;
  --navy-700: #0b1c12;
  --navy-600: #123420;
  --navy-500: #1d5433;

  --ok: #4ade80;    --ok-bg: rgba(74, 222, 128, .10);
  --warn: #fbbf24;  --warn-bg: rgba(251, 191, 36, .10);
  --bad: #ef4444;   --bad-bg: rgba(239, 68, 68, .12);

  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --glow-g: 0 0 8px rgba(74, 222, 128, .45);
  --glow-a: 0 0 8px rgba(251, 191, 36, .45);
  --glow-r: 0 0 8px rgba(239, 68, 68, .5);

  --shadow-1: 0 0 0 1px rgba(74, 222, 128, .05);
  --shadow-2: 0 0 18px rgba(74, 222, 128, .10);

  font-family: var(--mono);
  font-size: 13.5px;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(74, 222, 128, .012) 2px 4px),
    radial-gradient(1100px 500px at 50% -160px, rgba(74, 222, 128, .05), transparent 65%),
    var(--paper);
  color: var(--ink);
}

/* Typography: mono everywhere, Playfair reserved for the page title */
.theme-warroom h2, .theme-warroom h3 { font-family: var(--mono); font-weight: 600; color: var(--gold-300); letter-spacing: .04em; }
.theme-warroom .topbar h1 { font-family: var(--serif); color: var(--gold-300); text-shadow: var(--glow-g); }
.theme-warroom a { color: var(--gold-500); text-decoration-color: rgba(74, 222, 128, .4); }
.theme-warroom .label, .theme-warroom .eyebrow { color: var(--ink-soft); }
.theme-warroom ::selection { background: rgba(74, 222, 128, .3); color: #eafff2; }

/* ── Status bar + ticker ────────────────────────────────────────────────── */
.wr-statusbar { display: none; }
.theme-warroom .wr-statusbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 18px;
  background: #030705;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--ink-soft);
}
.theme-warroom .wr-nominal { color: var(--ok); text-shadow: var(--glow-g); animation: wr-pulse 2.4s ease-in-out infinite; }
.theme-warroom .wr-sep { color: var(--ink-faint); }
.theme-warroom .wr-spacer { flex: 1; }
.theme-warroom #wr-clock { color: var(--gold-300); text-shadow: var(--glow-g); font-variant-numeric: tabular-nums; }
.theme-warroom .wr-logout button {
  font: inherit; letter-spacing: .12em; color: var(--bad);
  background: transparent; border: 1px solid rgba(239, 68, 68, .5);
  border-radius: 2px; padding: 2px 10px; cursor: pointer; min-height: 26px;
}
.theme-warroom .wr-logout button:hover { background: var(--bad-bg); text-shadow: var(--glow-r); }

@keyframes wr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.wr-ticker { display: none; }
.theme-warroom .wr-ticker {
  display: block; overflow: hidden; white-space: nowrap;
  background: rgba(11, 28, 18, .8);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
}
.theme-warroom .wr-ticker-track {
  display: inline-block; padding: 5px 0;
  animation: wr-scroll 60s linear infinite;
}
.theme-warroom .wr-ticker:hover .wr-ticker-track { animation-play-state: paused; }
.theme-warroom .wr-tick { margin-right: 46px; }
.theme-warroom .wr-tick::before { content: "▸ "; color: var(--gold-600); }
@keyframes wr-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.theme-warroom .classification { background: #030705; color: var(--gold-500); text-shadow: var(--glow-g); }
.theme-warroom .tricolor { opacity: .55; height: 2px; }
.theme-warroom .sidebar { background: linear-gradient(180deg, #061009, #030705 85%); }
.theme-warroom .sidebar::after { background: linear-gradient(180deg, var(--gold-500), rgba(74, 222, 128, .15)); }
.theme-warroom .brand-name { color: var(--gold-300); font-family: var(--mono); font-size: 17px; letter-spacing: .05em; }
.theme-warroom .brand-name em { color: var(--gold-500); text-shadow: var(--glow-g); }
.theme-warroom .brand-sub, .theme-warroom .nav-section .label { color: var(--ink-faint); }
.theme-warroom .nav a { color: var(--ink-soft); font-family: var(--mono); font-size: 12.5px; }
.theme-warroom .nav a:hover { background: rgba(74, 222, 128, .07); color: var(--gold-300); }
.theme-warroom .nav a.active {
  background: linear-gradient(90deg, rgba(74, 222, 128, .14), transparent 75%);
  border-left-color: var(--gold-500); color: var(--gold-300);
  text-shadow: var(--glow-g);
}
.theme-warroom .nav a.active .icon { color: var(--gold-500); }
.theme-warroom .avatar { background: #0b1c12; color: var(--gold-500); border-color: rgba(74, 222, 128, .5); font-family: var(--mono); }
.theme-warroom .user-chip .who { color: var(--gold-300); }
.theme-warroom .sidebar-foot, .theme-warroom .brand { border-color: rgba(74, 222, 128, .18); }
.theme-warroom .signout-btn { background: transparent; border-color: rgba(74, 222, 128, .3); color: var(--ink-soft); }
.theme-warroom .signout-btn:hover { border-color: var(--gold-500); color: var(--gold-300); }

.theme-warroom .topbar { background: rgba(10, 20, 16, .75); border-bottom-color: var(--line); }
.theme-warroom .stamp { background: rgba(74, 222, 128, .06); border-color: var(--line-strong); color: var(--ink-soft); }
.theme-warroom .stamp .icon { color: var(--gold-600); }

/* ── Bracketed terminal panels ──────────────────────────────────────────── */
.theme-warroom .card, .theme-warroom .metric {
  background: linear-gradient(180deg, rgba(74, 222, 128, .025), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
}
.theme-warroom .card-head { border-bottom: 1px solid var(--line); background: none; }
.theme-warroom .card-head h2::before { content: "[ "; color: var(--gold-600); }
.theme-warroom .card-head h2::after { content: " ]"; color: var(--gold-600); }
.theme-warroom .card-head .ref { color: var(--ink-faint); }
.theme-warroom .metric::before { background: linear-gradient(90deg, var(--gold-500), transparent 85%); height: 2px; }
.theme-warroom .metric .value { font-family: var(--mono); color: var(--gold-300); text-shadow: var(--glow-g); font-size: 36px; }
.theme-warroom .metric .value.pending { color: var(--ink-faint); text-shadow: none; }
.theme-warroom .metric .label::before { content: "── "; color: var(--line-strong); }
.theme-warroom .metric .label::after { content: " ──"; color: var(--line-strong); }

/* ── Tables / forms / buttons ───────────────────────────────────────────── */
.theme-warroom table.doc { font-family: var(--mono); font-size: 12.5px; }
.theme-warroom table.doc th { color: var(--ink-soft); border-bottom-color: var(--gold-600); }
.theme-warroom table.doc td { border-bottom-color: var(--line); }
.theme-warroom table.doc tbody tr:nth-child(even) td { background: rgba(74, 222, 128, .025); }
.theme-warroom table.doc tbody tr:hover td { background: rgba(74, 222, 128, .07); }
.theme-warroom table.doc tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold-500); }

.theme-warroom input[type="text"], .theme-warroom input[type="password"],
.theme-warroom input[type="date"], .theme-warroom input[type="number"],
.theme-warroom input[type="tel"], .theme-warroom input[type="month"],
.theme-warroom select, .theme-warroom textarea {
  background: #060f0a; color: var(--ink); border-color: var(--line-strong);
  font-family: var(--mono); box-shadow: none; border-radius: 0;
}
.theme-warroom input:focus, .theme-warroom select:focus, .theme-warroom textarea:focus {
  border-color: var(--gold-500); box-shadow: 0 0 0 2px rgba(74, 222, 128, .2);
}
.theme-warroom select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234ade80' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.theme-warroom .btn {
  background: rgba(74, 222, 128, .08); color: var(--gold-300);
  border: 1px solid var(--line-strong); border-radius: 0;
  font-family: var(--mono); box-shadow: none;
}
.theme-warroom .btn:hover { background: rgba(74, 222, 128, .16); text-shadow: var(--glow-g); border-color: var(--gold-500); }
.theme-warroom .btn-gold {
  background: rgba(74, 222, 128, .18); color: #eafff2;
  border-color: var(--gold-500); text-shadow: var(--glow-g);
}
.theme-warroom .btn-quiet { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.theme-warroom .btn-quiet:hover { color: var(--gold-300); border-color: var(--gold-600); background: rgba(74, 222, 128, .06); }

.theme-warroom .chip span { background: #060f0a; border-color: var(--line-strong); color: var(--ink-soft); border-radius: 0; font-family: var(--mono); }
.theme-warroom .chip input:checked + span { background: rgba(74, 222, 128, .18); color: #eafff2; border-color: var(--gold-500); text-shadow: var(--glow-g); }
.theme-warroom .dropzone { background: rgba(74, 222, 128, .03); border-color: var(--line-strong); color: var(--ink-soft); border-radius: 0; }
.theme-warroom .dropzone:hover, .theme-warroom .dropzone:focus-within { border-color: var(--gold-500); background: rgba(74, 222, 128, .07); }

/* ── Badges + flashes: glow states ──────────────────────────────────────── */
.theme-warroom .badge { border-radius: 0; }
.theme-warroom .badge-ok, .theme-warroom .badge-high { text-shadow: var(--glow-g); }
.theme-warroom .badge-warn, .theme-warroom .badge-moderate { text-shadow: var(--glow-a); }
.theme-warroom .badge-bad, .theme-warroom .badge-low { text-shadow: var(--glow-r); }
.theme-warroom .badge-neutral { color: var(--ink-soft); border-color: var(--line-strong); background: rgba(74, 222, 128, .05); }
.theme-warroom .badge-gold { color: var(--gold-300); border-color: var(--gold-600); background: rgba(74, 222, 128, .08); }
.theme-warroom .flash { background: rgba(74, 222, 128, .06); border-color: var(--line-strong); border-left-color: var(--gold-500); border-radius: 0; color: var(--ink); }
.theme-warroom .flash-error { background: var(--bad-bg); border-left-color: var(--bad); }
.theme-warroom .flash-success { border-left-color: var(--ok); }

/* ── READINESS GRID (coverage heat + status boards) ─────────────────────── */
.theme-warroom .heat-cell { border-radius: 0; font-family: var(--mono); }
.theme-warroom .heat-zero { background: var(--bad-bg); color: var(--bad); border-color: rgba(239, 68, 68, .45); text-shadow: var(--glow-r); box-shadow: inset 0 0 10px rgba(239, 68, 68, .08); }
.theme-warroom .heat-low  { background: var(--warn-bg); color: var(--warn); border-color: rgba(251, 191, 36, .45); text-shadow: var(--glow-a); box-shadow: inset 0 0 10px rgba(251, 191, 36, .08); }
.theme-warroom .heat-good { background: var(--ok-bg); color: var(--ok); border-color: rgba(74, 222, 128, .45); text-shadow: var(--glow-g); box-shadow: inset 0 0 10px rgba(74, 222, 128, .08); }
.theme-warroom .heat-cell:hover { outline: 1px solid var(--gold-500); transform: none; }

.theme-warroom .prob-fill, .theme-warroom .result-fill {
  background: linear-gradient(90deg, var(--gold-700), var(--gold-500));
  border-right-color: var(--gold-300);
  box-shadow: var(--glow-g);
}
.theme-warroom .prob-bar, .theme-warroom .result-bar { background: rgba(74, 222, 128, .06); }
.theme-warroom .timeline::before { background: linear-gradient(180deg, var(--gold-500), var(--line-strong)); }
.theme-warroom .tl-dot { background: var(--card); }

.theme-warroom .intel-title { color: var(--gold-300); }
.theme-warroom .intel-item { border-bottom-color: var(--line); }
.theme-warroom .event-card { border-radius: 0; }
.theme-warroom .event-cover { background: #060f0a; }
.theme-warroom .empty .icon { color: var(--line-strong); }
.theme-warroom .empty { color: var(--ink-faint); }
.theme-warroom .muted { color: var(--ink-soft); }
.theme-warroom .faint { color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) {
  .theme-warroom .wr-ticker-track, .theme-warroom .wr-nominal { animation: none; }
}
