/* ═══════════════════════════════════════════════════════════
   Credit Union Analytics Board Pack
   Modern financial design system — gold accent on neutrals
   ═══════════════════════════════════════════════════════════ */

/* ─── FONT IMPORTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ─── DESIGN TOKENS ────────────────────────────────────────── */
:root {
  /* Core palette (variable names kept for back-compat; values reskinned) */
  --ft-paper:         #FFFFFF;   /* main page background */
  --ft-paper-dark:    #FAFAFA;   /* panel / card background */
  --ft-pink:          #FFF7DD;   /* warm hover tint */
  --ft-header-bg:     #000000;   /* true black header */
  --ft-claret:        #C0392B;   /* alert red */
  --ft-blue:          #111111;   /* near-black for data-viz fills */
  --ft-teal:          #E5B821;   /* brand gold (reassigned accent) */
  --ft-slate:         #4B5563;
  --ft-light-grey:    #EAEAEA;
  --ft-rule:          #E5E7EB;   /* divider lines */

  /* Brand */
  --brand-gold:       #E5B821;
  --brand-gold-dark:  #B8911A;
  --brand-gold-tint:  #FFF4C9;

  /* Text */
  --color-text:         #0A0A0A;
  --color-text-muted:   #6B7280;
  --color-text-faint:   #9CA3AF;

  /* Semantic */
  --color-green:  #1B7A3D;
  --color-amber:  #D97706;
  --color-red:    #C0392B;
  --color-green-bg: #E8F4EB;
  --color-amber-bg: #FEF3E2;
  --color-red-bg:   #FBECEA;

  /* Typography */
  --font-display: 'Manrope', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 0.875rem;
  --text-md:   0.9375rem;
  --text-lg:   1rem;
  --text-xl:   1.125rem;
  --text-2xl:  1.375rem;
  --text-3xl:  1.75rem;

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;

  /* Borders */
  --border-rule: 1px solid var(--ft-rule);
  --border-heavy: 2px solid var(--color-text);

  /* Radius — softer, more contemporary */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
}

/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--ft-paper);
  line-height: 1.55;
  min-height: 100vh;
}

img, canvas, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }

/* ─── PAGE LAYOUT ──────────────────────────────────────────── */
html, body { min-width: 1300px; }

.pack-page {
  width: 100%;
  max-width: none;
  min-width: 1300px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-8);
  background: var(--ft-paper);
  min-height: 100vh;
}

/* ─── MASTHEAD ─────────────────────────────────────────────── */
.masthead {
  border-top: 4px solid var(--brand-gold);
  border-bottom: var(--border-rule);
  padding: var(--sp-4) 0;
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.masthead-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.masthead-logo svg { flex-shrink: 0; }

.masthead-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.masthead-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-top: 2px;
}

.masthead-meta {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.masthead-meta strong {
  color: var(--color-text);
  font-weight: 600;
}

.confidential-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  background: var(--color-text);
  color: var(--brand-gold);
  border-radius: var(--radius-pill);
  margin-top: var(--sp-1);
}

/* ─── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  border-bottom: 2px solid var(--color-text);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 64px;
  height: 2px;
  background: var(--brand-gold);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.page-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: var(--sp-1);
}

.page-badge {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-text);
  background: var(--brand-gold-tint);
  border: 1px solid var(--brand-gold);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ─── SECTION HEADERS ──────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: var(--border-rule);
  letter-spacing: -0.01em;
}

.subsection-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-3);
}

/* ─── RAG SCORECARD TILES ──────────────────────────────────── */
.rag-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.rag-tile {
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--ft-rule);
  border-top: 3px solid var(--ft-rule);
  background: var(--ft-paper-dark);
  position: relative;
  transition: box-shadow 0.2s, transform 0.15s;
}

.rag-tile:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.rag-tile.green  { border-top-color: var(--color-green);  background: var(--color-green-bg); }
.rag-tile.amber  { border-top-color: var(--color-amber);  background: var(--color-amber-bg); }
.rag-tile.red    { border-top-color: var(--color-red);    background: var(--color-red-bg);   }

.rag-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.rag-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;
}

.rag-delta {
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.delta-up   { color: var(--color-green); }
.delta-down { color: var(--color-red); }
.delta-flat { color: var(--color-text-muted); }

.rag-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.green .rag-status-dot { background: var(--color-green); }
.amber .rag-status-dot { background: var(--color-amber); }
.red   .rag-status-dot { background: var(--color-red); }

/* ─── KPI STRIP ────────────────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  padding: var(--sp-4);
  background: var(--ft-paper-dark);
  border: var(--border-rule);
  border-radius: var(--radius-md);
}

.kpi-item { padding: var(--sp-2) var(--sp-3); }

.kpi-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ─── CHART CONTAINERS ─────────────────────────────────────── */
.chart-row {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.chart-row-3 { grid-template-columns: repeat(3, 1fr); }
.chart-row-2 { grid-template-columns: repeat(2, 1fr); }
.chart-row-21 { grid-template-columns: 2fr 1fr; }
.chart-row-12 { grid-template-columns: 1fr 2fr; }

.chart-panel {
  background: var(--ft-paper-dark);
  border: var(--border-rule);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.chart-panel-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-3);
  border-bottom: var(--border-rule);
  padding-bottom: var(--sp-2);
}

.chart-canvas-wrap {
  position: relative;
}

/* ─── TABLES ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}

.data-table thead {
  border-top: 2px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
}

.data-table th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  white-space: nowrap;
}

.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }

.data-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--ft-light-grey);
  vertical-align: middle;
  font-variant-numeric: tabular-nums lining-nums;
}

.data-table tbody tr:last-child td { border-bottom: 2px solid var(--color-text); }
.data-table tbody tr:hover td { background: var(--brand-gold-tint); }

.cell-change.positive { color: var(--color-green); font-weight: 600; }
.cell-change.negative { color: var(--color-red);   font-weight: 600; }

.rag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
}
.rag-pill.green { background: var(--color-green-bg); color: var(--color-green); }
.rag-pill.amber { background: var(--color-amber-bg); color: var(--color-amber); }
.rag-pill.red   { background: var(--color-red-bg);   color: var(--color-red);   }

/* ─── FUNNEL ───────────────────────────────────────────────── */
.funnel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
}

.funnel-step {
  width: 100%;
  text-align: center;
  padding: var(--sp-3);
  background: var(--color-text);
  color: var(--ft-paper);
  border-radius: var(--radius-md);
  transition: opacity 0.2s;
}

.funnel-step:hover { opacity: 0.9; }

.funnel-step-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.85;
  margin-bottom: 2px;
  font-weight: 600;
}

.funnel-step-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.funnel-step-pct {
  font-size: var(--text-xs);
  opacity: 0.85;
}

.funnel-arrow {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* ─── NARRATIVE BOX ────────────────────────────────────────── */
.narrative-box {
  background: var(--ft-paper-dark);
  border: 1px solid var(--ft-rule);
  border-left: 3px solid var(--brand-gold);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--color-text);
  border-radius: var(--radius-md);
}

.narrative-box p + p { margin-top: var(--sp-3); }

/* ─── PERIOD SELECTOR (screen only) ───────────────────────── */
.period-selector {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.period-btn {
  padding: 8px 18px;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--ft-rule);
  background: var(--ft-paper);
  color: var(--color-text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn:hover { background: var(--brand-gold-tint); color: var(--color-text); border-color: var(--brand-gold); }
.period-btn.active {
  background: var(--brand-gold);
  color: var(--color-text);
  border-color: var(--brand-gold);
  font-weight: 700;
}

/* ─── FILTER BAR (screen only) ─────────────────────────────── */
.filter-bar {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--ft-paper-dark);
  border: var(--border-rule);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.filter-select {
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  border: var(--border-rule);
  background: var(--ft-paper);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 140px;
}

.filter-select:focus {
  outline: 2px solid var(--brand-gold);
  outline-offset: 1px;
  border-color: var(--brand-gold);
}

/* ─── SPARKLINES ───────────────────────────────────────────── */
.sparkline-cell canvas { display: inline-block; vertical-align: middle; }

/* ─── PROGRESS BARS ────────────────────────────────────────── */
.bar-track {
  height: 6px;
  background: var(--ft-light-grey);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 4px;
}

.bar-fill {
  height: 100%;
  background: var(--color-text);
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* ─── COHORT TABLE ─────────────────────────────────────────── */
.cohort-active  { background: var(--brand-gold-tint); color: var(--brand-gold-dark); font-weight: 600; }
.cohort-paid    { background: #D4EFDF; color: #1E8449; font-weight: 600; }
.cohort-arrears { background: #FADBD8; color: #922B21; font-weight: 600; }

/* ─── IFRS9 STAGES ─────────────────────────────────────────── */
.stage1 { border-left: 3px solid var(--color-green); }
.stage2 { border-left: 3px solid var(--color-amber); }
.stage3 { border-left: 3px solid var(--color-red); }

/* ─── VARIANCE COLUMNS ─────────────────────────────────────── */
.variance-fav   { color: var(--color-green); font-weight: 600; }
.variance-unfav { color: var(--color-red);   font-weight: 600; }

/* ─── FOOTER ───────────────────────────────────────────────── */
.pack-footer {
  margin-top: var(--sp-6);
  border-top: var(--border-rule);
  padding-top: var(--sp-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ─── PAGE NAV (screen only) ────────────────────────────────── */
.page-nav {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.nav-link {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  text-decoration: none;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.nav-link:hover { color: var(--color-text); border-bottom-color: var(--brand-gold); }
.nav-link.active { color: var(--color-text); border-bottom-color: var(--brand-gold); }

/* ─── DIVIDER ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: var(--border-rule);
  margin: var(--sp-5) 0;
}

/* ─── MISC UTILITIES ───────────────────────────────────────── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

/* Two-column layout helper */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-4); }

/* ─── PRINT MEDIA ───────────────────────────────────────────── */
@media print {
  @page {
    size: A4 portrait;
    margin: 15mm 12mm;
  }

  /* Hide interactive chrome */
  .no-print,
  .period-selector,
  .filter-bar,
  .page-nav { display: none !important; }

  .pack-page {
    max-width: 100%;
    padding: 0;
    background: white;
    min-height: auto;
  }

  body { background: white; }

  /* Page breaks */
  .page-break { page-break-before: always; break-before: page; }

  /* Charts fit within page */
  canvas { max-width: 100% !important; }

  /* RAG tiles — solid fills survive B&W */
  .rag-tile.green { background: #D5E8D4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rag-tile.amber { background: #FFE6CC !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rag-tile.red   { background: #F8CECC !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Ensure all backgrounds print */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Keep tables together where possible */
  table { page-break-inside: avoid; }
  thead { display: table-header-group; }
}

/* ─── AI NARRATIVE SECTION ─────────────────────────────────── */
.narrative-section {
  margin-top: var(--sp-6);
  border-top: var(--border-rule);
  padding-top: var(--sp-4);
}

.narrative-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.narrative-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.narrative-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--brand-gold);
  border-radius: 1px;
}

.ai-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: var(--brand-gold);
  color: var(--color-text);
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
}

.ai-generate-btn:hover  { background: var(--color-text); color: var(--brand-gold); border-color: var(--color-text); }
.ai-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.narrative-textarea {
  width: 100%;
  min-height: 110px;
  padding: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--ft-paper-dark);
  border: var(--border-rule);
  border-left: 3px solid var(--brand-gold);
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.narrative-textarea:focus {
  border-color: var(--brand-gold);
  border-left-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(229, 184, 33, 0.15);
}

.narrative-textarea::placeholder { color: var(--color-text-faint); font-style: italic; }

.narrative-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--sp-2);
  font-style: italic;
}

/* ─── WATERFALL CHART ───────────────────────────────────────── */
.waterfall-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--ft-light-grey);
  font-size: var(--text-sm);
}

.waterfall-label { flex: 0 0 160px; color: var(--color-text-muted); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.waterfall-bar-wrap { flex: 1; height: 20px; background: var(--ft-light-grey); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.waterfall-bar-fill { height: 100%; border-radius: var(--radius-sm); transition: width 0.5s ease; }
.waterfall-value { flex: 0 0 80px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.waterfall-rate  { flex: 0 0 60px; text-align: right; font-size: var(--text-xs); color: var(--color-text-muted); }

/* ─── HEATMAP TABLE ─────────────────────────────────────────── */
.heatmap-table td {
  text-align: center;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.heat-0  { background: #FAFAFA; color: #6B7280; }
.heat-1  { background: #F3F4F6; color: #4B5563; }
.heat-2  { background: #FFF4C9; color: #7A6200; font-weight: 600; }
.heat-3  { background: #F4D35E; color: #3D2F00; font-weight: 700; }
.heat-4  { background: #E5B821; color: #1A1400; font-weight: 700; }
.heat-5  { background: #0A0A0A; color: #E5B821; font-weight: 700; }

/* ─── FUNNEL V2 ─────────────────────────────────────────────── */
.funnel-v2 { display: flex; flex-direction: column; gap: var(--sp-1); }

.funnel-v2-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: var(--ft-paper);
  position: relative;
}

.funnel-v2-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; flex: 1; opacity: 0.9; }
.funnel-v2-count { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; flex: 0 0 60px; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.funnel-v2-pct   { font-size: var(--text-xs); opacity: 0.8; flex: 0 0 48px; text-align: right; }
.funnel-v2-drop  { font-size: var(--text-xs); color: var(--color-text-faint); text-align: center; padding: 2px 0; }

/* ─── ECHELON CARD ──────────────────────────────────────────── */
.echelon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.echelon-card {
  padding: var(--sp-3);
  border: var(--border-rule);
  border-radius: var(--radius-md);
  background: var(--ft-paper-dark);
  border-top: 3px solid var(--ft-rule);
}

.echelon-card.primary { border-top-color: var(--brand-gold); }
.echelon-card.warning { border-top-color: var(--color-amber); }
.echelon-card.danger  { border-top-color: var(--color-red); }
.echelon-card.success { border-top-color: var(--color-green); }

.echelon-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.09em; color: var(--color-text-muted); font-weight: 700; margin-bottom: var(--sp-1); }
.echelon-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; color: var(--color-text); line-height: 1; font-variant-numeric: tabular-nums lining-nums; margin-bottom: var(--sp-1); letter-spacing: -0.02em; }
.echelon-sub   { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ─── PRINT: AI NARRATIVE ───────────────────────────────────── */
@media print {
  .narrative-textarea { display: none !important; }
  .ai-generate-btn    { display: none !important; }
  .narrative-print-p  { display: block !important; }
  .narrative-hint     { display: none !important; }
}

@media screen {
  .narrative-print-p { display: none; }
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
/* Dashboard has a fixed minimum width of 1300px — below this users scroll horizontally */
@media print {
  html, body, .pack-page { min-width: 0; }
}

/* ─── MASTHEAD LOGO (UTB monogram) ──────────────────────────── */
.masthead-logo img,
.cover-logo img {
  display: block;
  height: 56px;
  width: auto;
}

.cover-logo img { height: 80px; }
