/* ═══════════════════════════════════════════════════════════════════════════
   TrendIntel 2.0 — "Classic Intelligence Dossier" design system · v2
   All colour/space/type via custom properties. Never hardcode hex in templates.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Navy scale (dark surfaces) */
  --navy-900: #0a1626;
  --navy-800: #0e1f33;   /* --navy */
  --navy-700: #142b47;
  --navy-600: #1f3a5c;   /* --steel */
  --navy-500: #2c4d75;

  /* Gold (foil accents — use sparingly) */
  --gold-700: #8f7226;
  --gold-600: #a5852f;
  --gold-500: #c8a24a;
  --gold-300: #e3cd96;
  --gold-100: #f4ecd7;

  /* Paper & ink (light surfaces) */
  --paper: #f4f1e9;
  --paper-deep: #ece7da;
  --card: #fffefa;
  --line: #e0d9c7;
  --line-strong: #c9bfa4;
  --ink: #182131;
  --ink-soft: #4c5870;
  --ink-faint: #8b93a5;

  /* INC tricolor — thin rules only */
  --inc-saffron: #f6931e;
  --inc-white: #ffffff;
  --inc-green: #128807;

  /* Status */
  --ok: #256e46;      --ok-bg: #e4efe7;
  --warn: #96691c;    --warn-bg: #f4ecd7;
  --bad: #9c3535;     --bad-bg: #f4e3e3;

  /* Aliases kept for existing templates */
  --navy: var(--navy-800);
  --steel: var(--navy-600);
  --steel-2: var(--navy-500);
  --gold: var(--gold-500);
  --gold-soft: var(--gold-300);

  --serif: "Playfair Display", "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Noto Sans Tamil", system-ui, -apple-system, sans-serif;

  --sidebar-w: 252px;
  --r-sm: 2px;
  --r: 4px;
  --shadow-1: 0 1px 2px rgba(10, 22, 38, .06), 0 2px 8px rgba(10, 22, 38, .05);
  --shadow-2: 0 2px 4px rgba(10, 22, 38, .08), 0 10px 28px rgba(10, 22, 38, .10);
  --touch: 44px;
  --ease: cubic-bezier(.25, .6, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 70% -140px, rgba(200, 162, 74, .05), transparent 65%),
    var(--paper);
  min-height: 100vh;
  font-feature-settings: "cv05";
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; color: var(--ink); }
a { color: var(--navy-600); text-decoration-color: rgba(31, 58, 92, .35); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--gold-500); }

.icon { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none;
        stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 22px; height: 22px; }

::selection { background: var(--gold-300); color: var(--navy-900); }

/* ── Typography helpers ─────────────────────────────────────────────────── */
.label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.tamil { font-family: "Noto Sans Tamil", var(--sans); }
.right { text-align: right; }

/* ── Tricolor + classification ──────────────────────────────────────────── */
.tricolor {
  height: 3px;
  background: linear-gradient(to right,
    var(--inc-saffron) 0 33.33%, var(--inc-white) 33.33% 66.66%, var(--inc-green) 66.66% 100%);
}
.classification {
  position: relative;
  background: var(--navy-900);
  color: var(--gold-300);
  text-align: center;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .34em;
  text-transform: uppercase;
  padding: 6px 10px 5px;
}
.classification::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-600) 20% 80%, transparent);
  opacity: .55;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: calc(100vh - 27px); }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900) 82%);
  color: #c3cddd;
  display: flex;
  flex-direction: column;
  position: relative;
}
.sidebar::after {              /* gold hairline edge */
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, var(--gold-500), rgba(200, 162, 74, .25));
}

.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px;
         border-bottom: 1px solid rgba(200, 162, 74, .22); }
.emblem { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-name { font-family: var(--serif); font-size: 20px; color: #fff; letter-spacing: .02em; line-height: 1.15; }
.brand-name em { color: var(--gold-500); font-style: normal; }
.brand-sub { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: #7d90ab; margin-top: 3px; }

.nav-section { padding: 16px 0 2px; }
.nav-section .label {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 8px; color: #647a99;
}
.nav-section .label::after { content: ""; flex: 1; height: 1px; background: rgba(100, 122, 153, .25); }

.nav a {
  display: flex; align-items: center; gap: 11px;
  min-height: 42px; padding: 9px 18px;
  color: #c3cddd; text-decoration: none; font-size: 13.5px; font-weight: 480;
  border-left: 2px solid transparent;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a .icon { width: 16px; height: 16px; opacity: .75; }
.nav a:hover { background: rgba(44, 77, 117, .35); color: #fff; }
.nav a:hover .icon { opacity: 1; }
.nav a.active {
  background: linear-gradient(90deg, rgba(200, 162, 74, .14), rgba(200, 162, 74, .03) 70%);
  border-left-color: var(--gold-500);
  color: #fff; font-weight: 600;
}
.nav a.active .icon { opacity: 1; color: var(--gold-300); }
.nav a.sub { padding-left: 45px; font-size: 12.5px; min-height: 36px; }
.nav a.disabled { color: #51648025; color: #516480; opacity: .55; pointer-events: none; }
.nav a.disabled .soon {
  margin-left: auto; font-size: 8.5px; letter-spacing: .12em;
  border: 1px solid rgba(100, 122, 153, .5); border-radius: 2px;
  padding: 1px 5px; color: #7d90ab;
}

.sidebar-foot { margin-top: auto; padding: 14px 18px 16px; border-top: 1px solid rgba(200, 162, 74, .22); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-600); color: var(--gold-300);
  font-family: var(--serif); font-size: 14px; font-weight: 600;
  border: 1px solid rgba(200, 162, 74, .45);
}
.user-chip .who { color: #eef2f7; font-weight: 600; font-size: 13px; line-height: 1.25; }
.user-chip .role { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #7d90ab; }
.signout-btn {
  margin-top: 10px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: #a9b7cb; background: rgba(20, 43, 71, .6);
  border: 1px solid rgba(125, 144, 171, .3); border-radius: var(--r);
  cursor: pointer; transition: all .15s var(--ease);
}
.signout-btn:hover { color: #fff; border-color: var(--gold-600); }

/* ── Main column ────────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
  padding: 18px 30px 14px;
  background: linear-gradient(180deg, var(--card), rgba(255, 254, 250, .6));
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 24px; line-height: 1.15; margin-top: 2px; }
.topbar .meta { text-align: right; }
.topbar .meta .stamp { margin-top: 4px; }

.stamp {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 550; letter-spacing: .06em;
  color: var(--ink-soft);
  background: var(--gold-100);
  border: 1px solid var(--gold-300);
  border-radius: 2px;
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
.stamp .icon { width: 12px; height: 12px; color: var(--gold-600); }

.content { padding: 28px 30px 44px; max-width: 1220px; width: 100%; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  margin-bottom: 22px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 15px 20px 11px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(200, 162, 74, .045), transparent);
}
.card-head::after {
  content: ""; position: absolute; left: 20px; right: 20px; top: 47px; height: 1px;
}
.card-head h2 { font-size: 16.5px; letter-spacing: .01em; }
.card-head .ref {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.card-body { padding: 18px 20px; }

/* ── Metric tiles ───────────────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.metric {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  padding: 16px 18px 15px;
  overflow: hidden;
}
.metric::before {                 /* gold keyline */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
}
.metric .value {
  font-family: var(--serif);
  font-size: 42px; line-height: 1.05; margin: 8px 0 4px;
  font-variant-numeric: lining-nums tabular-nums;
}
.metric .value .unit { font-size: 22px; color: var(--ink-soft); }
.metric .value.pending { color: var(--ink-faint); font-size: 30px; }
.metric .note { font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.metric.pending-panel { background: var(--paper); }
.metric.pending-panel::before { background: var(--line-strong); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  padding: 2.5px 8px; border-radius: 2px; border: 1px solid; line-height: 1.5;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-high, .badge-ok       { color: var(--ok);   border-color: rgba(37, 110, 70, .4);  background: var(--ok-bg); }
.badge-moderate, .badge-warn { color: var(--warn); border-color: rgba(150, 105, 28, .4); background: var(--warn-bg); }
.badge-low, .badge-bad       { color: var(--bad);  border-color: rgba(156, 53, 53, .4);  background: var(--bad-bg); }
.badge-neutral               { color: var(--navy-600); border-color: rgba(31, 58, 92, .35); background: #e9edf4; }
.badge-gold                  { color: var(--gold-700); border-color: var(--gold-300); background: var(--gold-100); }
.badge-plain::before { display: none; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }
table.doc { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.doc th {
  text-align: left;
  font-size: 10.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--gold-500);
  padding: 8px 12px; white-space: nowrap;
}
table.doc td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.doc tbody tr:nth-child(even) td { background: rgba(236, 231, 218, .35); }
table.doc tbody tr { transition: background .12s var(--ease); }
table.doc tbody tr:hover td { background: var(--gold-100); }
table.doc tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold-500); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: var(--touch);
  padding: 10px 13px;
  font: inherit; color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 2px rgba(10, 22, 38, .04);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
select {
  appearance: none; -webkit-appearance: none;
  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='%234c5870' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px rgba(200, 162, 74, .22), inset 0 1px 2px rgba(10, 22, 38, .04);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
.field .err { color: var(--bad); font-size: 12px; margin-top: 5px; display: flex; gap: 5px; align-items: center; }
.checkbox-row { display: flex; align-items: center; gap: 10px; min-height: var(--touch); }
.checkbox-row input { width: 19px; height: 19px; accent-color: var(--navy-600); }

/* File dropzone (wrap <input type=file> in label.dropzone) */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: 18px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r);
  background: rgba(236, 231, 218, .3);
  color: var(--ink-soft); font-size: 13px; text-align: center;
  cursor: pointer; transition: all .15s var(--ease);
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--gold-600); background: var(--gold-100); }
.dropzone .icon { width: 22px; height: 22px; color: var(--gold-600); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .picked { font-weight: 600; color: var(--ink); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 10px 22px;
  font: inherit; font-size: 12.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  color: #f2f5f9;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-700));
  border: 1px solid var(--navy-800);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 1px 2px rgba(10, 22, 38, .18);
  cursor: pointer; text-decoration: none;
  transition: all .15s var(--ease);
}
.btn:hover { background: linear-gradient(180deg, var(--navy-500), var(--navy-600)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 6px rgba(10,22,38,.22); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(10, 22, 38, .3); }
.btn:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.btn .icon { width: 15px; height: 15px; }

.btn-gold {
  color: var(--navy-900);
  background: linear-gradient(180deg, #d9b566, var(--gold-500));
  border-color: var(--gold-700);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(10, 22, 38, .18);
}
.btn-gold:hover { background: linear-gradient(180deg, #e3c47e, #d0ab54); }
.btn-quiet {
  color: var(--navy-600);
  background: transparent;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.btn-quiet:hover { border-color: var(--navy-600); background: #eef1f6; }
.btn-sm { min-height: 34px; padding: 5px 13px; font-size: 11.5px; }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid rgba(31, 58, 92, .25);
  border-left: 3px solid var(--navy-600);
  background: #e9edf4;
  margin-bottom: 16px; font-size: 13.5px;
  box-shadow: var(--shadow-1);
}
.flash-error   { border-color: rgba(156, 53, 53, .3);  border-left-color: var(--bad);      background: var(--bad-bg); }
.flash-success { border-color: rgba(37, 110, 70, .3);  border-left-color: var(--ok);       background: var(--ok-bg); }
.flash-info    { border-color: var(--gold-300);        border-left-color: var(--gold-500); background: var(--gold-100); }

/* ── Login ──────────────────────────────────────────────────────────────── */
body.login-page {
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(44, 77, 117, .65), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(200, 162, 74, .05) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(200, 162, 74, .05) 47px 48px),
    var(--navy-900);
}
.login-wrap { min-height: calc(100vh - 27px); display: flex; align-items: center; justify-content: center; padding: 26px 16px; }
.login-card {
  width: 100%; max-width: 402px;
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid rgba(200, 162, 74, .5);
  box-shadow: 0 0 0 1px rgba(10, 22, 38, .6), 0 24px 70px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.login-head { background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); padding: 30px 28px 22px; text-align: center; }
.login-head .emblem { width: 52px; height: 52px; margin: 0 auto 12px; display: block; }
.login-head .brand-name { font-size: 27px; }
.login-head .brand-sub { margin-top: 7px; font-size: 9.5px; }
.login-body { padding: 28px 30px 26px; }
.login-body .btn { width: 100%; margin-top: 8px; }
.login-foot {
  padding: 13px 30px 18px; text-align: center;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.stack > * + * { margin-top: 14px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; color: var(--ink-soft);
  padding: 38px 16px; font-size: 14px;
}
.empty .icon { width: 30px; height: 30px; color: var(--line-strong); stroke-width: 1.3; }

.error-hero { text-align: center; padding: 90px 20px; }
.error-hero .code { font-family: var(--serif); font-size: 92px; color: var(--navy-600); line-height: 1; }
.error-hero .rule { width: 72px; height: 2px; background: var(--gold-500); margin: 18px auto; }

/* ── Capture chips ──────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: var(--touch); cursor: pointer; position: relative; }
.chip input { position: absolute; opacity: 0; width: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px;
  border: 1px solid var(--line-strong); border-radius: 19px;
  font-size: 13px; font-weight: 520; color: var(--ink-soft); background: #fff;
  transition: all .13s var(--ease);
}
.chip:hover span { border-color: var(--navy-600); color: var(--navy-600); }
.chip input:checked + span {
  background: var(--navy-700); color: #fff; border-color: var(--navy-900); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.chip input:focus-visible + span { outline: 2px solid var(--gold-500); outline-offset: 1px; }

details.more { margin: 4px 0 16px; border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { cursor: pointer; min-height: var(--touch); display: flex; align-items: center; gap: 8px; list-style: none; }
details.more summary::before { content: "+"; font-size: 16px; color: var(--gold-600); font-weight: 600; }
details.more[open] summary::before { content: "−"; }

/* ── Coverage heat grid ─────────────────────────────────────────────────── */
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.heat-cell {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  text-decoration: none; border: 1px solid;
  transition: all .12s var(--ease);
}
.heat-zero { background: var(--bad-bg);  color: var(--bad);      border-color: rgba(156, 53, 53, .3); }
.heat-low  { background: var(--warn-bg); color: var(--gold-700); border-color: rgba(150, 105, 28, .35); }
.heat-good { background: var(--ok-bg);   color: var(--ok);       border-color: rgba(37, 110, 70, .3); }
.heat-cell:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(10, 22, 38, .18); }

/* ── Filter bar & pager ─────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-bar input[type="text"] { flex: 2 1 220px; }
.filter-bar select { flex: 1 1 150px; width: auto; }
.filter-bar .btn { flex: 0 0 auto; }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 18px; }

/* ── Structure page ─────────────────────────────────────────────────────── */
.structure-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.structure-forms .card { margin-bottom: 0; }

/* ── Events (Module 3) ──────────────────────────────────────────────────── */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.event-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s var(--ease), transform .15s var(--ease);
}
.event-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.event-cover { position: relative; aspect-ratio: 16 / 8.4; background: var(--navy-700); overflow: hidden; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-cover .no-photo {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(200, 162, 74, .5);
}
.event-cover .type-flag {
  position: absolute; top: 10px; left: 10px;
}
.event-card-body { padding: 13px 15px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event-card-body h3 { font-size: 15.5px; line-height: 1.3; }
.event-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-soft); margin-top: auto; }
.event-facts span { display: inline-flex; align-items: center; gap: 5px; }
.event-facts .icon { width: 13px; height: 13px; color: var(--gold-600); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.gallery a { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
             border: 1px solid var(--line); background: var(--paper-deep); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.gallery .press-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
                       color: var(--ink-soft); font-size: 11.5px; text-decoration: none; padding: 10px; text-align: center; }
.gallery .press-tile .icon { width: 26px; height: 26px; color: var(--gold-600); }

.facts-list { list-style: none; }
.facts-list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.facts-list li:last-child { border-bottom: none; }
.facts-list .k { color: var(--ink-soft); }
.facts-list .v { font-weight: 550; text-align: right; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
.menu-toggle {
  display: none; min-width: var(--touch); min-height: var(--touch);
  background: transparent; color: var(--gold-300);
  border: 1px solid rgba(125, 144, 171, .4); border-radius: var(--r);
  cursor: pointer; align-items: center; justify-content: center;
}
@media (max-width: 880px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar::after { display: none; }
  .sidebar { border-bottom: 2px solid var(--gold-500); }
  .sidebar .nav-wrap { display: none; }
  .sidebar.open .nav-wrap { display: block; }
  .brand { padding: 12px 16px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 14px 16px 12px; }
  .topbar .meta { display: none; }
  .topbar h1 { font-size: 20px; }
  .metric .value { font-size: 34px; }
  .sidebar-foot { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Module 4: intel digest ─────────────────────────────────────────────── */
.intel-item {
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.intel-item:last-child { border-bottom: none; }
.intel-title { font-weight: 550; font-size: 14px; line-height: 1.4; display: block; margin-bottom: 4px; }
.intel-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.intel-actions { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 240px; }
.intel-actions .btn-sm { min-height: 30px; padding: 3px 9px; }
.sent-active { background: var(--navy-700); color: #fff; border-color: var(--navy-900); }

/* ── Module 5: timeline + probability bars ──────────────────────────────── */
.timeline { list-style: none; position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--gold-500), var(--line-strong));
}
.timeline li { position: relative; padding: 0 0 18px; }
.timeline li:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute; left: -26px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; border: 2.5px solid var(--line-strong); background: var(--card);
}
.tl-done .tl-dot { border-color: var(--ok); background: var(--ok-bg); }
.tl-slipped .tl-dot { border-color: var(--bad); background: var(--bad-bg); }
.tl-expected .tl-dot { border-color: var(--gold-500); }
.tl-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 3px; }

.prob-bar { height: 6px; background: var(--paper-deep); border-radius: 3px; margin: 8px 0 8px; overflow: hidden; }
.prob-fill { height: 100%; background: linear-gradient(90deg, var(--navy-600), var(--gold-500)); border-radius: 3px; }

/* ── Module 6: results bars ─────────────────────────────────────────────── */
.result-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.result-label { flex: 0 0 130px; font-size: 13px; }
.result-bar { flex: 1; height: 18px; background: var(--paper-deep); border-radius: 2px; overflow: hidden; }
.result-fill { height: 100%; background: linear-gradient(90deg, var(--navy-600), var(--navy-500)); border-right: 2px solid var(--gold-500); }
.result-num { flex: 0 0 84px; text-align: right; font-size: 12.5px; color: var(--ink-soft); }
.survey-q { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
@media (max-width: 620px) { .result-label { flex-basis: 90px; } .intel-item { flex-direction: column; } .intel-actions { justify-content: flex-start; } }

/* ── Theme switch (sidebar footer) ──────────────────────────────────────── */
.theme-switch {
  display: flex; margin-top: 12px;
  border: 1px solid rgba(125, 144, 171, .35); border-radius: var(--r);
  overflow: hidden;
}
.theme-switch button {
  flex: 1; font: inherit; font-size: 10px; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 4px; min-height: 30px;
  background: transparent; color: #7d90ab; border: none; cursor: pointer;
}
.theme-switch button.on { background: var(--gold-500); color: var(--navy-900); }
.theme-switch button:not(.on):hover { color: #fff; }
.theme-warroom .theme-switch { border-color: var(--line-strong); border-radius: 0; }
.theme-warroom .theme-switch button { font-family: var(--mono); color: var(--ink-faint); }
.theme-warroom .theme-switch button.on { background: var(--gold-500); color: #04120a; }
