/* =========================================================================
   Provantis — redesign layer
   Additive. Load AFTER app.css:

     <link rel="stylesheet" href="{{ url_for('static', filename='css/app.css') }}?v={{ asset_version('css/app.css') }}">
     <link rel="stylesheet" href="{{ url_for('static', filename='css/redesign.css') }}?v={{ asset_version('css/redesign.css') }}">

   Uses your existing tokens (--ink, --gold, --line, --surface, --bg-soft,
   --muted, --font-serif, --font-sans) and your geometry: zero radius,
   1px hairlines, no shadows. Nothing here overrides an existing rule.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Grouped sidebar navigation
   Works with your .sidebar / .sidebar-nav / .sidebar-section-label classes.
   ------------------------------------------------------------------------- */
.sidebar-group + .sidebar-group { margin-top: 2px; }
.sidebar-nav a .nav-label { flex: 1; }
.sidebar-nav a .nav-flag {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-ink);
  background: var(--gold-soft);
  border: 1px solid #ecd6a0;
  padding: 1px 6px;
  flex-shrink: 0;
}
.sidebar-nav a.active .nav-flag { border-color: var(--gold); }

/* -------------------------------------------------------------------------
   Scan provenance strip — host, date, staleness.
   Sits directly under a page title or inside a boardroom-card head.
   ------------------------------------------------------------------------- */
.scan-provenance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 6px 0 0;
}
.scan-provenance strong { color: var(--ink); font-weight: 500; }
.scan-provenance .sep { color: var(--line-strong); }
.scan-provenance .age-stale { color: var(--warn); font-weight: 500; }
.scan-provenance .fetch-warning {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bad);
  background: var(--bad-soft);
  border: 1px solid #fecaca;
  padding: 2px 8px;
}

/* -------------------------------------------------------------------------
   Tranche rail — phased conduct assessment
   ------------------------------------------------------------------------- */
.tranche-progress {
  height: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  margin: 14px 0 20px;
}
.tranche-progress > span { display: block; height: 100%; background: var(--gold-2); }

.tranche-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  margin-bottom: 24px;
  background: var(--surface);
}
.tranche-tile {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  transition: background 0.12s ease;
}
.tranche-tile:hover { background: var(--bg-soft); }
.tranche-tile--current { background: var(--bg-soft); border-left: 3px solid var(--gold); }
.tranche-tile--done .tranche-tile-name { color: var(--muted); }
.tranche-tile-num {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--gold-ink);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 3px;
}
.tranche-tile-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.25;
}
.tranche-tile-meta { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }
.tranche-tile-count {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.tranche-tile--done .tranche-tile-count { color: var(--good); }

/* -------------------------------------------------------------------------
   Answer states on individual rules
   ------------------------------------------------------------------------- */
.audit-rule--unanswered { border-left: 2px solid var(--warn); padding-left: calc(1.25rem - 2px); }
.audit-rule--verified { border-left: 2px solid var(--good); padding-left: calc(1.25rem - 2px); }

.rule-flag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.rule-flag--verified { background: var(--good-soft); color: var(--good); border-color: #bbf7d0; }
.rule-flag--changed  { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.rule-flag--carried  { background: var(--bg-soft); color: var(--muted); border-color: var(--line); }

.rule-provenance {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.5;
}
.rule-provenance strong { color: var(--ink); font-weight: 500; }

/* Evidence list — replaces the raw Python list that currently renders */
.evidence-list { margin: 6px 0 0; padding-left: 1.1rem; }
.evidence-list li { font-size: 0.85rem; color: var(--muted); line-height: 1.55; margin-bottom: 2px; }

/* -------------------------------------------------------------------------
   Tranche footer — per-tranche finalise
   ------------------------------------------------------------------------- */
.tranche-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.tranche-foot-note { color: var(--muted); font-size: 0.88rem; line-height: 1.6; max-width: 560px; }
.tranche-foot-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 720px) {
  .tranche-rail { grid-template-columns: 1fr; }
  .tranche-tile { border-right: none; }
}

/* =========================================================================
   Typography reset — single sans family (Feb 2027 spec)
   Inter only, weights 400 and 500, sentence case except the wordmark.
   Loaded after app.css, so these override the serif/weight rules there.
   ========================================================================= */
:root {
  --font-serif: var(--font-sans); /* collapse every serif usage to the sans */
}
body { font-weight: 400; }

/* Nothing on the platform renders heavier than 500 */
h1, h2, h3, h4, h5, h6, strong, b, th,
.btn, .bc-title, .score-large, .bc-score-value,
.tranche-tile-count, .metric-box .score-large {
  font-weight: 500;
}

/* Sentence case everywhere — kill the uppercase/letter-spacing treatments,
   except the wordmark (handled below). */
.bc-eyebrow, .eyebrow, .serif-italic,
.sidebar-section-label, .plan-badge,
.badge, .rule-flag, .nav-flag,
.autosave-status {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-style: normal;
}

/* Wordmark — the one uppercase survivor */
.wordmark {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Masthead meta + section labels */
.sidebar-section-label { font-size: 12px; }
.sidebar-company { font-size: 12px; font-weight: 400; }
.plan-badge { font-size: 11px; }

/* ── Assessment page scale (per mockup) ─────────────────────────────── */
.audit-page-head .bc-eyebrow { font-size: 12px; }          /* masthead meta */
.audit-page-title { font-size: 18px; font-weight: 500; }   /* page title */
.audit-page-meta { font-size: 12px; font-weight: 400; }    /* counter + intro */

.tranche-tile-num { font-size: 11px; letter-spacing: 0; }
.tranche-tile-name { font-size: 13px; font-weight: 400; font-family: var(--font-sans); }
.tranche-tile-meta { font-size: 11px; }
.tranche-tile-count { font-size: 11px; font-weight: 400; font-family: var(--font-sans); }

.audit-cat-block .bc-title { font-size: 16px; font-weight: 500; }  /* card title */
.audit-cat-block .bc-lede, .audit-cat-block .bc-eyebrow { font-size: 12px; } /* card meta */
.bc-score-label { font-size: 11px; }
.bc-score-value { font-size: 13px; }

.audit-rule h4 { font-size: 14px; font-weight: 400; margin: 2px 0; } /* question */
.bc-citation, .audit-rule .bc-eyebrow { font-size: 12px; }           /* citation */
.badge.priority, .rule-flag { font-size: 11px; font-weight: 400; }   /* badges */
.audit-status-row label { font-size: 13px; font-weight: 400; }       /* answers */
.audit-evidence-required, .evidence-list li { font-size: 12px; }
.rule-provenance { font-size: 12px; }
.tranche-foot-note { font-size: 12px; }                              /* footer note */
.autosave-status { font-size: 12px; }
