/*
 * ═══════════════════════════════════════════════════════════════
 * LEODIS FINANCE PORTAL — SHARED STYLESHEET
 * src/style.css · copied to the site root at build time
 *
 * This file is the single source of truth for all shared styles.
 * To change a colour, font, or component across the whole portal,
 * edit here. Page-specific styles remain in each page's
 * pageStyles front matter.
 *
 * Colour palette: Charcoal, Grey, Gold (gold is the highlight)
 * Fonts: DM Serif Display (headings) · DM Sans (body)
 * ═══════════════════════════════════════════════════════════════
 */

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

/* ─────────────────────────────────────────
   DESIGN TOKENS  ← edit here to retheme
───────────────────────────────────────── */
:root {
  /* Ink */
  --ink:       #1a1a18;
  --ink-mid:   #4a4a46;
  --ink-muted: #7a7a74;
  --ink-faint: #c8c6bc;

  /* Surfaces */
  --paper: #f7f5f0;
  --white: #ffffff;
  --rule:  #e2e0d8;

  /* Brand */
  --charcoal:      #2a2a27;   /* sidebar, dark backgrounds */
  --nav-bg:        #3d3d3a;   /* nav bar and page header backgrounds */
  --gold:          #c8920a;   /* links, hover borders, active labels */
  --on-dark-muted: rgba(255,255,255,0.55); /* subtext on dark backgrounds */

  /* Amber — brand highlight; also replaces the retired --teal-light / --teal-pale */
  --amber:      #ef9f27;
  --amber-pale: #faeeda;
  --amber-deep: #854f0b;      /* dark amber text on pale amber backgrounds */

  /* Semantic */
  --red:        #a32d2d;
  --red-pale:   #fcebeb;
  --red-soft:   #f87171;      /* negative values on dark backgrounds and dark charts */
  --green:      #1e7a34;
  --green-pale: #eaf3de;
  --row-even:   #faf9f5;      /* alternating table row shading */

  /* Dark chart panels (Chart.js on var(--ink) backgrounds) — read these
     from JS via getComputedStyle rather than hardcoding hex in scripts */
  --chart-line:     #c8c6bc;  /* baseline / confirmed series */
  --chart-accent:   #ef9f27;  /* scenario / forecast series (amber) */
  --chart-positive: #22c55e;  /* positive values — vibrant green */
  --chart-negative: #ef4444;  /* negative values — vibrant red */

  /* Typography */
  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
}

/* ─────────────────────────────────────────
   BASE
───────────────────────────────────────── */
html, body { min-height: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
strong { font-weight: 500; }

/* ─────────────────────────────────────────
   NAV  (used on all non-index pages)
───────────────────────────────────────── */
.nav {
  background: var(--nav-bg);
  padding: 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 20px;
  color: #ffffff;
  letter-spacing: 0.01em;
}
.nav-logo span {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 300;
  color: var(--on-dark-muted);
  margin-left: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
}
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: #ffffff; }
.nav-links a.active { color: var(--amber); }

/* ─────────────────────────────────────────
   BREADCRUMB
───────────────────────────────────────── */
.breadcrumb, .breadcrumb-bar {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 0 52px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}
.breadcrumb a, .breadcrumb-bar a { color: var(--gold); }
.breadcrumb a:hover, .breadcrumb-bar a:hover { text-decoration: underline; }
.bc-sep, .breadcrumb-sep { color: var(--ink-faint); }

/* ─────────────────────────────────────────
   PAGE HEADER  (dark charcoal background block)
───────────────────────────────────────── */
.header {
  background: var(--nav-bg);
  padding: 48px 52px 44px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
}
.header::after {
  content: '';
  position: absolute;
  right: 80px; bottom: -120px;
  width: 240px; height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.03);
}
.header-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  font-weight: 500;
  margin-bottom: 10px;
}
.header-title {
  font-family: var(--serif);
  font-size: 38px;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 6px;
  font-weight: 400;
}
.header-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 36px;
}

/* Header KPI strip (used on forecast/report pages) */
.header-kpis {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  flex-wrap: wrap;
}
.hkpi { flex: 1; min-width: 130px; padding-right: 28px; }
.hkpi:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.1); margin-right: 28px; }
.hkpi-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-dark-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.hkpi-value { font-family: var(--serif); font-size: 26px; color: #fff; line-height: 1.1; margin-bottom: 2px; }
.hkpi-value.danger   { color: var(--red-soft); }
.hkpi-value.positive { color: var(--amber); }
.hkpi-note { font-size: 11px; color: rgba(255,255,255,0.45); }

/* Header meta strip (used on project home pages) */
.header-meta {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  flex-wrap: wrap;
}
.meta-cell { flex: 1; min-width: 130px; padding-right: 28px; }
.meta-cell:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.1); margin-right: 28px; }
.meta-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-dark-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.meta-value { font-size: 13px; color: #ffffff; }
.meta-value.danger { color: var(--red-soft); }

.status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(239,159,39,0.2);
  color: var(--amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────
   STATUS BANNERS  (short-term / long-term)
───────────────────────────────────────── */
.status-row { display: flex; gap: 0; }
.status-panel {
  flex: 1;
  padding: 20px 28px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.status-panel.st { background: var(--amber-pale); border-bottom: 3px solid var(--amber); }
.status-panel.lt { background: var(--red-pale);   border-bottom: 3px solid var(--red); }
.status-divider { width: 1px; background: var(--rule); }
.status-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.status-panel.st .status-icon { background: rgba(239,159,39,0.15); color: var(--amber-deep); font-weight: 600; }
.status-panel.lt .status-icon { background: rgba(163,45,45,0.1); color: var(--red); font-weight: 600; }
.status-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; margin-bottom: 4px; }
.status-panel.st .status-label { color: var(--amber-deep); }
.status-panel.lt .status-label { color: var(--red); }
.status-text { font-size: 12px; line-height: 1.6; }
.status-panel.st .status-text { color: #633806; }
.status-panel.lt .status-text { color: var(--red); }

/* ─────────────────────────────────────────
   SNAPSHOT / LIVE PANEL
───────────────────────────────────────── */
.snapshot {
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 24px 36px;
}
.snapshot-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 18px;
}
.snapshot-kpis { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0; }
.snap-kpi { padding: 0 20px 0 0; }
.snap-kpi:not(:first-child) { padding-left: 20px; border-left: 1px solid var(--rule); }
.snap-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); font-weight: 500; margin-bottom: 5px; }
.snap-value { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1.1; margin-bottom: 3px; }
.snap-value.pos { color: var(--green); }
.snap-value.neg { color: var(--red); }
.snap-note { font-size: 11px; color: var(--ink-muted); }
.snap-bar-wrap { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule); }
.snap-bar-header { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; color: var(--ink-mid); }
.snap-bar-track { background: var(--rule); border-radius: 2px; height: 5px; overflow: hidden; }
.snap-bar-fill { height: 5px; background: var(--green); border-radius: 2px; }
.snap-source { margin-top: 10px; font-size: 11px; color: var(--ink-muted); font-style: italic; }

.live-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.live-panel-left { display: flex; align-items: flex-start; gap: 16px; }
.live-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--amber-pale);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.live-icon svg { width: 20px; height: 20px; stroke: var(--gold); fill: none; stroke-width: 1.5; }
.live-panel-text h3 { font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.live-panel-text p { font-size: 12px; color: var(--ink-muted); line-height: 1.5; }
.coming-soon-badge {
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 4px; border: 1px solid var(--rule);
  color: var(--ink-muted); background: var(--paper); white-space: nowrap; flex-shrink: 0;
}

/* ─────────────────────────────────────────
   SECTION HEADERS
───────────────────────────────────────── */
.section { margin-top: 40px; }
.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.section-tag {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--white);
  background: var(--charcoal);
  padding: 3px 10px;
  border-radius: 3px;
}
.section-tag.small-works { background: var(--ink-mid); }
.section-tag.archive { background: var(--ink-faint); color: var(--ink-mid); }
.section-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  font-weight: 400;
  flex: 1;
}
.section-count { font-size: 12px; color: var(--ink-muted); margin-left: auto; }

/* Numbered section header (cost reports) */
.section-number, .section-num {
  font-size: 10px; font-weight: 500; color: var(--white);
  background: var(--charcoal);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: 0;
}
.section-date, .section-sub { font-size: 11px; color: var(--ink-muted); }

/* Reports sub-section header (project home pages) */
.reports-header {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 24px; padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.reports-tag {
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--white);
  background: var(--charcoal); padding: 3px 10px; border-radius: 3px;
}
.reports-title { font-family: var(--serif); font-size: 22px; color: var(--ink); font-weight: 400; }

/* ─────────────────────────────────────────
   PROJECT CARDS  (index home page grid)
───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}
.project-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
a.project-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.project-card.placeholder { opacity: 0.6; pointer-events: none; }
.card-top { padding: 20px 20px 16px; flex: 1; }
.card-category { font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 500; margin-bottom: 8px; }
.card-category.small-works { color: var(--ink-muted); }
.card-title { font-family: var(--serif); font-size: 18px; color: var(--ink); font-weight: 400; line-height: 1.25; margin-bottom: 10px; }
.card-meta { font-size: 11px; color: var(--ink-muted); line-height: 1.6; }
.card-meta span { display: block; }
.card-bottom { border-top: 1px solid var(--rule); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.card-status { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-mid); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.active { background: var(--amber); }
.status-dot.placeholder { background: var(--ink-faint); }
.card-arrow { font-size: 16px; color: var(--ink-faint); transition: color 0.15s, transform 0.15s; }
a.project-card:hover .card-arrow { color: var(--gold); transform: translateX(3px); }
.card-latest { font-size: 10px; background: var(--amber-pale); color: var(--charcoal); padding: 3px 10px; border-radius: 3px; font-weight: 500; }

/* ─────────────────────────────────────────
   REPORT ROWS  (project home pages)
───────────────────────────────────────── */
.year-group { margin-bottom: 36px; }
.year-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 12px; }
.report-list { display: flex; flex-direction: column; gap: 8px; }

.report-row {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 20px;
  transition: border-color 0.15s, transform 0.1s;
}
.report-row:hover { border-color: var(--gold); transform: translateX(3px); }
.report-row.latest { border-left: 3px solid var(--gold); }
.report-month { font-family: var(--serif); font-size: 16px; color: var(--ink); width: 100px; flex-shrink: 0; }
.report-desc { flex: 1; font-size: 12px; color: var(--ink-muted); line-height: 1.5; }
.report-desc strong { font-weight: 500; color: var(--ink-mid); }
.report-badges { display: flex; gap: 6px; flex-shrink: 0; }
.report-link { font-size: 12px; font-weight: 500; color: var(--gold); display: flex; align-items: center; gap: 5px; flex-shrink: 0; white-space: nowrap; }
.report-link:hover { text-decoration: underline; }
.report-link-arrow { font-size: 14px; }

/* ─────────────────────────────────────────
   BADGES
───────────────────────────────────────── */
.badge { font-size: 10px; font-weight: 500; padding: 3px 9px; border-radius: 3px; letter-spacing: 0.04em; display: inline-block; }
.badge-latest { background: var(--amber-pale); color: var(--charcoal); }
.badge-green  { background: var(--green-pale); color: var(--green); }
.badge-amber  { background: var(--amber-pale); color: var(--amber-deep); }
.badge-red    { background: var(--red-pale); color: var(--red); }

/* ─────────────────────────────────────────
   QUARTERLY CARDS
───────────────────────────────────────── */
.q-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.q-card { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; padding: 16px 18px; }
.q-card.ok      { border-top: 3px solid var(--green); }
.q-card.warning { border-top: 3px solid var(--amber); }
.q-card.danger  { border-top: 3px solid var(--red); }
.q-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); font-weight: 500; margin-bottom: 10px; }
.q-row { display: flex; justify-content: space-between; font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid var(--rule); color: var(--ink-mid); }
.q-row:last-child { border-bottom: none; }
.q-row span:last-child { font-weight: 500; }
.q-row.pos span:last-child { color: var(--green); }
.q-row.neg span:last-child { color: var(--red); }
.q-row.neutral span:last-child { color: var(--ink); }
.q-row.margin span:last-child { color: var(--ink-muted); font-style: italic; font-weight: 400; }

/* ─────────────────────────────────────────
   CHART HERO (dark panel with Chart.js)
───────────────────────────────────────── */
.chart-hero {
  background: var(--ink);
  border-radius: 0 0 8px 8px;
  padding: 32px 36px 28px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}
.chart-hero::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04); pointer-events: none;
}
.chart-hero-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.chart-hero-title { font-family: var(--serif); font-size: 18px; color: #fff; font-weight: 400; }
.chart-hero-sub { font-size: 11px; color: rgba(255,255,255,0.4); }
.zero-line-note { font-size: 11px; color: rgba(255,255,255,0.35); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.zero-line-note::before { content: ''; display: inline-block; width: 20px; height: 1px; background: rgba(239,159,39,0.6); }
.chart-wrap { position: relative; height: 220px; }
.chart-milestones { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.milestone { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255,255,255,0.5); }
.milestone-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ─────────────────────────────────────────
   MONTHLY TABLE
───────────────────────────────────────── */
.month-table-wrap { overflow-x: auto; border-radius: 6px; border: 1px solid var(--rule); }
.month-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 860px; }
.month-table thead th { background: var(--ink); color: var(--white); padding: 7px 10px; text-align: right; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; white-space: nowrap; }
.month-table thead th:first-child { text-align: left; min-width: 120px; }
.month-table tbody td { padding: 6px 10px; border-bottom: 1px solid var(--rule); text-align: right; color: var(--ink); }
.month-table tbody td:first-child { text-align: left; font-weight: 500; color: var(--ink-mid); }
.month-table tbody tr:nth-child(even) td { background: var(--row-even); }
.month-table tbody tr.total-row td { background: var(--ink); color: var(--white); font-weight: 500; border-bottom: none; font-size: 11px; }
.month-table tbody tr.subtotal-row td { background: var(--amber-pale); font-weight: 600; }
.month-table tbody tr.subtotal-row td:first-child { color: var(--charcoal); }
.month-table tbody tr.margin-row td { background: var(--paper); color: var(--ink-muted); font-style: italic; font-size: 10px; }
.month-table .neg-val  { color: var(--red); font-weight: 500; }
.month-table .pos-val  { color: var(--green); font-weight: 500; }
.month-table .warn-val { color: var(--amber-deep); font-weight: 500; }
.month-table .q-sep { background: var(--amber-pale) !important; }
.month-table .q-sep td { color: var(--charcoal) !important; font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 10px; font-weight: 500; }

/* ─────────────────────────────────────────
   DATA TABLE  (cost reports)
───────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead th { background: var(--ink); color: var(--white); font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; padding: 8px 12px; text-align: right; }
.data-table thead th:first-child { text-align: left; }
.data-table tbody td { padding: 7px 12px; border-bottom: 1px solid var(--rule); text-align: right; color: var(--ink); }
.data-table tbody td:first-child { text-align: left; }
.data-table tbody tr:nth-child(even) td { background: var(--row-even); }
.data-table tbody tr.subtotal td { background: var(--amber-pale); color: var(--charcoal); font-weight: 500; font-style: italic; }
.data-table tbody tr.total td { background: var(--ink); color: var(--white); font-weight: 500; border-bottom: none; }
.data-table .muted { color: var(--ink-faint); font-style: italic; }
.data-table .pos   { color: var(--green); font-weight: 500; }
.data-table .neg   { color: var(--red); font-weight: 500; }
.data-table .good  { color: var(--green); font-weight: 500; }

/* ─────────────────────────────────────────
   PANELS & LAYOUTS
───────────────────────────────────────── */
.panel { background: var(--white); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.panel-pad { padding: 20px 24px; }
.panel-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); font-weight: 500; margin-bottom: 14px; }

.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Data rows inside panels */
.data-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 12px; }
.data-row:last-child { border-bottom: none; }
.data-row .label { color: var(--ink-mid); }
.data-row .value { font-weight: 500; }
.data-row.total { background: var(--amber-pale); padding: 7px 10px; margin: 0 -22px -18px; border-top: 1px solid var(--amber); }
.data-row.total .label { color: var(--amber-deep); font-weight: 500; }

/* ─────────────────────────────────────────
   STAT ROWS
───────────────────────────────────────── */
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--ink-mid); }
.stat-value { font-weight: 500; }
.stat-row.highlight { background: var(--amber-pale); padding: 10px 16px; margin: 0 -24px; border-bottom: none; border-top: 1px solid var(--amber); }

/* ─────────────────────────────────────────
   HORIZONTAL BARS
───────────────────────────────────────── */
.hbar-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.hbar-item:last-child { border-bottom: none; }
.hbar-name { font-size: 11px; color: var(--ink-mid); width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; background: var(--rule); border-radius: 2px; height: 7px; position: relative; }
.hbar-fill { height: 7px; border-radius: 2px; position: absolute; top: 0; left: 0; }
.hbar-marker { position: absolute; top: -4px; width: 2px; height: 15px; background: var(--amber); border-radius: 1px; }
.hbar-vals { font-size: 10px; color: var(--ink-muted); width: 72px; text-align: right; flex-shrink: 0; }
.hbar-badge { font-size: 10px; font-weight: 500; width: 40px; text-align: right; flex-shrink: 0; }
.hbar-legend { display: flex; gap: 16px; font-size: 11px; color: var(--ink-muted); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.hbar-legend span { display: flex; align-items: center; gap: 5px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.marker-swatch { width: 2px; height: 14px; border-radius: 1px; background: var(--amber); display: inline-block; }

/* Project income / overhead bars */
.proj-bar-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.proj-bar-item:last-child { border-bottom: none; }
.proj-bar-name { font-size: 11px; color: var(--ink-mid); width: 140px; flex-shrink: 0; }
.proj-bar-track { flex: 1; background: var(--rule); border-radius: 2px; height: 7px; }
.proj-bar-fill { height: 7px; border-radius: 2px; background: var(--green); }
.proj-bar-val { font-size: 11px; color: var(--ink-muted); width: 72px; text-align: right; flex-shrink: 0; font-weight: 500; }

.bar-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.bar-item:last-child { border-bottom: none; }
.bar-name { font-size: 11px; color: var(--ink-mid); width: 160px; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--rule); border-radius: 2px; height: 7px; }
.bar-fill { height: 7px; border-radius: 2px; }
.bar-val { font-size: 11px; color: var(--ink-muted); width: 72px; text-align: right; flex-shrink: 0; font-weight: 500; }

.oh-bar-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.oh-bar-item:last-child { border-bottom: none; }
.oh-bar-name { font-size: 11px; color: var(--ink-mid); width: 180px; flex-shrink: 0; }
.oh-bar-track { flex: 1; background: var(--rule); border-radius: 2px; height: 6px; }
.oh-bar-fill { height: 6px; border-radius: 2px; background: var(--amber); }
.oh-bar-val { font-size: 11px; color: var(--ink-muted); width: 72px; text-align: right; flex-shrink: 0; }

/* ─────────────────────────────────────────
   SCHEDULE BARS
───────────────────────────────────────── */
.sch-bar-track { background: var(--rule); border-radius: 2px; height: 5px; overflow: hidden; min-width: 48px; }
.sch-bar-fill  { height: 5px; border-radius: 2px; }
.section-subhead { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); font-weight: 500; background: var(--amber-pale); padding: 5px 12px; border-bottom: 1px solid var(--rule); }

/* ─────────────────────────────────────────
   COMMENTARY BOX
───────────────────────────────────────── */
.commentary-box, .commentary {
  background: var(--amber-pale);
  border-left: 3px solid var(--gold);
  padding: 20px 24px;
  margin-bottom: 24px;
  border-radius: 0 4px 4px 0;
}
.commentary-box p, .commentary { font-size: 13px; color: var(--charcoal); line-height: 1.75; }
.commentary-box p + p, .commentary p + p { margin-top: 10px; }
.narrative-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); font-weight: 500; margin-bottom: 12px; }
.narrative-text { font-size: 13px; color: var(--ink-mid); line-height: 1.75; }
.narrative-highlight { color: var(--charcoal); font-weight: 500; }

/* ─────────────────────────────────────────
   FOCUS BOXES
───────────────────────────────────────── */
.focus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.focus-box { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 22px; }
.focus-box.st { border-top: 3px solid var(--amber); }
.focus-box.lt { border-top: 3px solid var(--red); }
.focus-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; margin-bottom: 10px; }
.focus-box.st .focus-tag { color: var(--amber-deep); }
.focus-box.lt .focus-tag { color: var(--red); }
.focus-point { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink-mid); line-height: 1.55; align-items: flex-start; }
.focus-point:last-child { border-bottom: none; }
.focus-bullet { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.focus-box.st .focus-bullet { background: var(--amber); }
.focus-box.lt .focus-bullet { background: var(--red); }

/* ─────────────────────────────────────────
   COLLAPSIBLE
───────────────────────────────────────── */
.collapsible-trigger {
  width: 100%; background: none; border: 1px solid var(--rule); border-radius: 4px;
  padding: 14px 20px; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--sans); font-size: 13px; color: var(--ink-mid);
  margin-top: 16px; transition: background 0.15s;
}
.collapsible-trigger:hover { background: var(--white); }
.collapsible-trigger .chevron { font-size: 16px; transition: transform 0.2s; color: var(--ink-muted); }
.collapsible-trigger.open .chevron { transform: rotate(180deg); }
.collapsible-body { display: none; border: 1px solid var(--rule); border-top: none; border-radius: 0 0 4px 4px; overflow: hidden; }
.collapsible-body.open { display: block; }

/* ─────────────────────────────────────────
   RISK ITEMS
───────────────────────────────────────── */
.risk-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.risk-item:last-child { border-bottom: none; }
.risk-rag { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.risk-content { flex: 1; }
.risk-title { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 3px; }
.risk-detail { font-size: 12px; color: var(--ink-mid); line-height: 1.55; }
.risk-owner { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); font-weight: 500; margin-top: 5px; }

/* ─────────────────────────────────────────
   COMPLETION BLOCK  (project pages)
───────────────────────────────────────── */
.completion-block { margin-bottom: 28px; }
.completion-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.completion-label { font-size: 12px; color: var(--ink-mid); }
.completion-pct { font-family: var(--serif); font-size: 18px; color: var(--green); }
.completion-block .bar-track { background: var(--rule); border-radius: 2px; height: 6px; overflow: hidden; margin-bottom: 8px; }
.completion-block .bar-fill, .bar-fill-prog { height: 6px; background: var(--green); border-radius: 2px; }
.completion-note { font-size: 11px; color: var(--ink-muted); display: flex; gap: 24px; flex-wrap: wrap; }
.completion-note span { display: flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.exec-narrative { border-top: 1px solid var(--rule); padding-top: 24px; }

/* ─────────────────────────────────────────
   KPI GRID  (exec summary on cost reports)
───────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0; margin-bottom: 32px; }
.kpi-cell { padding: 0 24px 0 0; }
.kpi-cell:not(:first-child) { padding-left: 24px; border-left: 1px solid var(--rule); }
.kpi-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); font-weight: 500; margin-bottom: 6px; }
.kpi-value { font-family: var(--serif); font-size: 22px; color: var(--ink); line-height: 1.1; margin-bottom: 3px; }
.kpi-value.positive { color: var(--green); }
.kpi-value.negative { color: var(--red); }
.kpi-note { font-size: 11px; color: var(--ink-muted); }

/* ─────────────────────────────────────────
   EXEC SUMMARY PANEL
───────────────────────────────────────── */
.exec-summary {
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 36px 40px;
  margin-top: -1px;
}

/* ─────────────────────────────────────────
   ARCHIVE PLACEHOLDER
───────────────────────────────────────── */
.archive-placeholder {
  background: var(--white);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 36px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}
.archive-placeholder p + p { margin-top: 6px; font-size: 12px; }

/* ─────────────────────────────────────────
   REPORT NOTE
───────────────────────────────────────── */
.report-note { font-size: 11px; color: var(--ink-muted); font-style: italic; margin-top: 8px; line-height: 1.6; }

/* ─────────────────────────────────────────
   UTILITY
───────────────────────────────────────── */
.neg, .neg-val { color: var(--red); font-weight: 500; }
.pos, .pos-val { color: var(--green); font-weight: 500; }
.todo-badge { display: inline-block; font-size: 9px; background: var(--amber-pale); color: var(--amber-deep); padding: 1px 6px; border-radius: 2px; font-weight: 600; letter-spacing: 0.04em; }
.overdue-badge { font-size: 9px; font-weight: 500; padding: 2px 7px; border-radius: 3px; background: var(--red); color: #fff; letter-spacing: 0.04em; display: inline-block; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-muted); }
.empty-state p { font-size: 13px; margin-bottom: 6px; }
.empty-state .hint { font-size: 11px; color: var(--ink-faint); }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.portal-footer {
  border-top: 1px solid var(--rule);
  padding: 24px 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-muted);
}
.report-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-muted);
}
.footer-logo {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--charcoal);
}

/* ─────────────────────────────────────────
   LOGIN / RESET PAGES
───────────────────────────────────────── */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.login-card, .reset-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 40px 44px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-eyebrow, .card-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--gold); font-weight: 500; margin-bottom: 10px;
}
.login-title, .card-title {
  font-family: var(--serif); font-size: 28px; color: var(--ink);
  font-weight: 400; margin-bottom: 6px; line-height: 1.2;
}
.login-sub, .card-sub {
  font-size: 13px; color: var(--ink-muted); margin-bottom: 32px; line-height: 1.6;
}
.login-btn {
  width: 100%; background: var(--charcoal); color: #ffffff;
  border: none; border-radius: 4px; padding: 13px 20px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s; letter-spacing: 0.02em;
}
.login-btn:hover { background: var(--gold); }
.login-note { font-size: 11px; color: var(--ink-muted); text-align: center; margin-top: 20px; line-height: 1.6; }

.logo {
  font-family: var(--serif); font-size: 20px; color: #ffffff; text-decoration: none;
}
.logo span {
  font-family: var(--sans); font-size: 11px; font-weight: 300;
  color: var(--on-dark-muted); margin-left: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; vertical-align: middle;
}

/* ─────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.project-card { animation: fadeUp 0.35s ease both; }
.project-card:nth-child(1) { animation-delay: 0.04s; }
.project-card:nth-child(2) { animation-delay: 0.08s; }
.project-card:nth-child(3) { animation-delay: 0.12s; }
.report-row { animation: fadeUp 0.3s ease both; }
.report-row:nth-child(1) { animation-delay: 0.05s; }
.report-row:nth-child(2) { animation-delay: 0.10s; }
.report-row:nth-child(3) { animation-delay: 0.15s; }
.q-card { animation: fadeUp 0.35s ease both; }
.q-card:nth-child(1) { animation-delay: 0.05s; }
.q-card:nth-child(2) { animation-delay: 0.10s; }
.q-card:nth-child(3) { animation-delay: 0.15s; }
.q-card:nth-child(4) { animation-delay: 0.20s; }
.stage-group { animation: fadeUp 0.35s ease both; }
.stage-group:nth-child(1) { animation-delay: 0.05s; }
.stage-group:nth-child(2) { animation-delay: 0.12s; }
