@font-face{font-family:'Barlow';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/barlow-latin-400-normal.woff2') format('woff2');}
@font-face{font-family:'Barlow';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/barlow-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'Barlow';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/barlow-latin-600-normal.woff2') format('woff2');}
@font-face{font-family:'Barlow';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/barlow-latin-700-normal.woff2') format('woff2');}

/* ============================================================================
   WEIDNER DASHBOARD DESIGN SYSTEM
   Extracted from weidner-sales-dashboard.netlify.app (Aug 2026)
   Drop this in, add the Barlow font link, and every component below is ready.

   Barlow is self-hosted below (CSP on this site forbids third-party origins).
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. TOKENS
   Eleven colors. That is the whole palette. Resist adding a twelfth.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  --navy:     #101B22;  /* primary text, headers, brand bar, drawer header */
  --red:      #C12027;  /* Weidner accent — the ONLY saturated color */
  --red-dk:   #9E1A20;  /* hover / depth on red */
  --gray:     #95A3B2;  /* tertiary text, hints, footnotes */
  --charcoal: #535C62;  /* secondary body text, labels */
  --bg:       #F4F5F7;  /* page background */
  --surface:  #FFFFFF;  /* card background */
  --border:   #E1E5EA;  /* card border */
  --rule:     #EDF0F3;  /* table row rule, chart gridline, divider */
  --pos:      #1F7A4D;  /* on-track / positive */
  --warn:     #B8650E;  /* warning amber */
  --neg:      var(--red);

  /* Tinted status backgrounds (derived — do not invent new ones) */
  --pos-bg:   #E3F1EA;
  --warn-bg:  #FEF3E2;
  --neg-bg:   #FBEEEF;
  --neg-brd:  #F0C8CB;
  --gray-bg:  #ECEFF2;
  --tint:     #FAFBFC;  /* table header + row hover + callout background */
  --tint-2:   #F2F5F7;  /* clickable row hover */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--navy);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 24px 32px; }

/* ---------------------------------------------------------------------------
   2. BRAND BAR
   Navy, full-bleed, 4px red underline. Logo | hairline divider | eyebrow+name
   on the left; labelled selects on the right.
   --------------------------------------------------------------------------- */
.brandbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  margin: -22px -24px 24px;              /* cancels .wrap padding to full-bleed */
  border-bottom: 4px solid var(--red);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand .logo { height: 42px; width: auto; display: block; }
.brand .divider { width: 1px; height: 34px; background: rgba(255,255,255,0.25); }
.brand .title { display: flex; flex-direction: column; line-height: 1.15; }
.brand .title .eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: 0.16em;
  color: #fff; opacity: 0.55; text-transform: uppercase;
}
.brand .title .name {
  font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.005em;
}
.brandbar .controls { display: flex; gap: 10px; align-items: center; }
.brandbar .controls label {
  font-size: 11px; color: rgba(255,255,255,0.7); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 600;
}
.brandbar .controls select {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #fff; border-radius: 4px; padding: 6px 10px; font-size: 13px;
  font-family: inherit; font-weight: 500; cursor: pointer; appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.brandbar .controls select:hover { border-color: rgba(255,255,255,0.4); }
.brandbar .controls select option { background: var(--navy); color: #fff; }

.pagesub { color: var(--charcoal); font-size: 13px; margin: 0 0 18px 0; }

/* ---------------------------------------------------------------------------
   3. SECTION HEADERS
   The narrative spine. Red left bar, uppercase H2, plain-English description
   sitting on the same baseline. One per major idea, not per card.
   --------------------------------------------------------------------------- */
.section-header {
  margin: 28px 0 14px 0; padding: 0 0 0 14px;
  border-left: 4px solid var(--red);
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.section-header:first-of-type { margin-top: 4px; }
.section-header h2 {
  margin: 0; font-size: 18px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.section-header .desc { font-size: 13px; color: var(--charcoal); font-weight: 500; }

/* ---------------------------------------------------------------------------
   4. LAYOUT GRIDS
   --------------------------------------------------------------------------- */
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.aging-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.row.full { grid-template-columns: 1fr; }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------------
   5. CARD — the universal container
   --------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 0 rgba(16, 27, 34, 0.02);   /* barely there, on purpose */
}
.card h3 {
  margin: 0 0 14px 0; font-size: 13px; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.card h3 .hint {   /* the lower-case scope note that follows every title */
  font-size: 11px; color: var(--gray); font-weight: 500;
  text-transform: none; letter-spacing: 0;
}

/* ---------------------------------------------------------------------------
   6. HERO CARD — top-of-page headline numbers
   4px status bar across the top says on-track / warning / off-track at a glance.
   --------------------------------------------------------------------------- */
.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 18px 18px; position: relative;
  box-shadow: 0 1px 0 rgba(16, 27, 34, 0.02);
}
.hero-card::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 4px;
  background: var(--red); border-radius: 6px 6px 0 0;
}
.hero-card.is-pos::before  { background: var(--pos); }
.hero-card.is-warn::before { background: var(--warn); }
.hero-card.is-neg::before  { background: var(--red); }
.hero-card.is-gray::before { background: var(--gray); }
.hero-card .lbl {
  font-size: 11px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.hero-card .val {
  font-size: 30px; font-weight: 700; color: var(--navy);
  margin-top: 8px; line-height: 1.05; letter-spacing: -0.02em;
}
.hero-card .val.is-pos  { color: var(--pos); }
.hero-card .val.is-warn { color: var(--warn); }
.hero-card .val.is-neg  { color: var(--red); }
.hero-card .delta {
  font-size: 12px; margin-top: 6px; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.hero-card .footnote {
  font-size: 11px; color: var(--gray); margin-top: 4px; font-weight: 500;
  line-height: 1.3;
}

/* ---------------------------------------------------------------------------
   7. KPI CARD — secondary stat strip (lives inside .kpi-grid, uses .card)
   --------------------------------------------------------------------------- */
.kpi-label {
  font-size: 11px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700;
}
.kpi-value {
  font-size: 26px; font-weight: 700; margin-top: 6px;
  letter-spacing: -0.015em; color: var(--navy);
}
.kpi-sub { font-size: 12px; color: var(--gray); margin-top: 4px; font-weight: 500; }
.delta-pos { color: var(--pos); }
.delta-neg { color: var(--neg); }

/* ---------------------------------------------------------------------------
   8. TILE — bucketed counts (aging buckets, WO status buckets, etc.)
   Colored 4px left border carries the severity.
   --------------------------------------------------------------------------- */
.aging-tile {
  border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px;
  background: var(--surface); position: relative;
  cursor: pointer; transition: border-color 0.12s, transform 0.12s;
}
.aging-tile:hover { border-color: var(--navy); transform: translateY(-1px); }
.aging-tile.is-pos  { border-left: 4px solid var(--pos); }
.aging-tile.is-warn { border-left: 4px solid var(--warn); }
.aging-tile.is-neg  { border-left: 4px solid var(--red); }
.aging-tile.is-gray { border-left: 4px solid var(--gray); }
.aging-tile .lbl {
  font-size: 10px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700;
}
.aging-tile .val { font-size: 20px; font-weight: 700; color: var(--navy); margin-top: 4px; }
.aging-tile .sub { font-size: 11px; color: var(--gray); margin-top: 2px; font-weight: 500; }

/* ---------------------------------------------------------------------------
   9. TABLES
   Tiny uppercase headers on a faint tint. Numbers right-aligned and tabular.
   --------------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
th {
  font-size: 10px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 700; background: var(--tint);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td b { color: var(--navy); font-weight: 700; }
tbody tr:hover { background: var(--tint); }
tbody tr:last-child td { border-bottom: none; }

/* Sortable headers */
th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 18px !important; }
th.sortable:hover { color: var(--navy); background: var(--bg); }
th.sortable::after { content: "\2195"; position: absolute; right: 6px; opacity: 0.3; font-size: 10px; }
th.sortable.asc::after  { content: "\25B2"; opacity: 1; color: var(--red); }
th.sortable.desc::after { content: "\25BC"; opacity: 1; color: var(--red); }

/* Drillable rows: hover tint + a small red-on-hover caret in the first cell */
.clickable { cursor: pointer; transition: background-color 0.12s; }
.clickable:hover { background: var(--tint-2) !important; }
.clickable td:first-child::before {
  content: ""; display: inline-block; width: 0; height: 0;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  border-left: 5px solid var(--gray);
  margin-right: 8px; vertical-align: middle; opacity: 0.5;
}
.clickable:hover td:first-child::before { border-left-color: var(--red); opacity: 1; }

/* ---------------------------------------------------------------------------
   10. STATUS PILLS & TAGS
   Square-ish (2px radius) so they read as data labels, not buttons.
   --------------------------------------------------------------------------- */
.status-pill, .status-tag, .dormancy-pill {
  display: inline-block; border-radius: 2px; text-transform: uppercase;
  font-weight: 700; letter-spacing: 0.06em;
}
.status-pill   { padding: 2px 8px; font-size: 10px; }
.dormancy-pill { padding: 2px 8px; font-size: 10px; letter-spacing: 0.05em; }
.status-tag    { padding: 1px 7px; font-size: 9px; }

/* NOTE: these are scoped to .status-pill / .status-tag on purpose. `is-warn` and
   friends mean "tint me" on a pill but "color my accent bar" on a hero card or
   tile — leaving them unscoped bleeds pill backgrounds onto the cards. */
.status-pill.is-ok,    .status-tag.won      { background: var(--pos-bg);  color: var(--pos); }
.status-pill.is-warn,  .status-tag.quoted   { background: var(--warn-bg); color: var(--warn); }
.status-pill.is-bad                         { background: var(--neg-bg);  color: var(--red-dk); }
.status-pill.is-gray,  .status-tag.archived { background: var(--gray-bg); color: var(--charcoal); }
.status-tag.other                           { background: var(--bg);      color: var(--gray); }
.dormancy-pill.is-neg                       { background: var(--neg-bg);  color: var(--red-dk); }
.dormancy-pill.is-warn                      { background: var(--warn-bg); color: var(--warn); }

/* Inline numeric severity (age columns) */
.age-pos  { color: var(--pos);  font-weight: 700; }
.age-warn { color: var(--warn); font-weight: 700; }
.age-neg  { color: var(--red);  font-weight: 700; }
.age-gray { color: var(--gray); font-weight: 600; }

/* ---------------------------------------------------------------------------
   11. GAUGE — a single ratio against labelled thresholds
   --------------------------------------------------------------------------- */
.gauge { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.gauge-bar {
  flex: 1; height: 8px; background: var(--rule); border-radius: 2px;
  position: relative; overflow: hidden;
}
.gauge-fill {
  position: absolute; top: 0; left: 0; height: 100%; border-radius: 2px;
  transition: width 0.4s;
}
.gauge-fill.is-pos  { background: var(--pos); }
.gauge-fill.is-warn { background: var(--warn); }
.gauge-fill.is-neg  { background: var(--red); }
.gauge-ticks {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--gray); margin-top: 4px; font-weight: 600;
}

/* ---------------------------------------------------------------------------
   12. LIST ROW — ranked entities with a share bar (top accounts, top assets)
   --------------------------------------------------------------------------- */
.acct-row {
  display: grid; grid-template-columns: 1.4fr auto auto auto;
  gap: 14px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13px;
}
.acct-row:last-child { border-bottom: none; }
.acct-row .name { font-weight: 500; color: var(--navy); }
.acct-row .num  { font-variant-numeric: tabular-nums; }
.acct-row .meta { font-size: 11px; color: var(--gray); font-weight: 500; }
.acct-share {
  display: inline-block; min-width: 48px; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--charcoal); font-weight: 600;
}
.acct-row.clickable { transition: background-color 0.12s; }
.acct-row.clickable:hover { background: var(--tint-2); }

/* ---------------------------------------------------------------------------
   13. CALLOUT — the "so what" box under a chart or gauge
   Bold lead sentence, then the explanation. Border color = severity.
   --------------------------------------------------------------------------- */
.callout {
  margin-top: 14px; padding: 10px 12px; background: var(--tint);
  border-left: 3px solid var(--gray);
  font-size: 12px; color: var(--charcoal); line-height: 1.5;
}
.callout b { color: var(--navy); font-weight: 700; }
.callout.is-pos  { border-left-color: var(--pos); }
.callout.is-warn { border-left-color: var(--warn); }
.callout.is-neg  { border-left-color: var(--red); }

/* ---------------------------------------------------------------------------
   14. INFO TOOLTIP — how a number is calculated, on demand
   --------------------------------------------------------------------------- */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--gray); color: #fff; font-size: 9px; font-weight: 700;
  cursor: help; position: relative; font-family: serif; font-style: italic;
}
.info::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); white-space: normal;
  background: var(--navy); color: #fff; padding: 8px 11px; border-radius: 4px;
  font-size: 11px; font-weight: 500; font-style: normal;
  font-family: "Barlow", sans-serif; width: 240px; line-height: 1.4;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
  z-index: 100; text-align: left; letter-spacing: 0;
}
.info::before {
  content: ""; position: absolute; bottom: calc(100% + 2px); left: 50%;
  transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: var(--navy);
  opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 100;
}
.info:hover::after, .info:hover::before { opacity: 1; }

/* ---------------------------------------------------------------------------
   15. FILTER ROW — local, scoped to one card. Always ends with a live count.
   --------------------------------------------------------------------------- */
.filter-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); margin-bottom: 10px;
}
.filter-row label {
  font-size: 11px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700;
  display: flex; flex-direction: column; gap: 3px;
}
.filter-row select, .filter-row input {
  border: 1px solid var(--border); background: #fff;
  padding: 5px 8px; font-size: 12px; font-family: inherit; font-weight: 500;
  color: var(--navy); border-radius: 3px; min-width: 110px;
}
.filter-row input[type=number] { width: 110px; }
.filter-row .clear-btn {
  background: transparent; border: 1px solid var(--gray); color: var(--charcoal);
  padding: 5px 10px; border-radius: 3px; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; margin-top: 16px;
}
.filter-row .clear-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-row .count {
  margin-left: auto; font-size: 12px; color: var(--charcoal);
  font-weight: 600; margin-top: 16px;
}
.filter-row .count b { color: var(--navy); font-weight: 700; }

/* ---------------------------------------------------------------------------
   16. DRAWER — right-side drill-down. Three levels deep, ESC and BACK to exit.
   Header repeats the brand bar treatment: navy + 4px red underline.
   --------------------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(16,27,34,0.45);
  z-index: 1000; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(740px, 94vw);
  background: var(--surface); z-index: 1001;
  transform: translateX(100%); transition: transform 0.25s ease-out;
  box-shadow: -8px 0 32px rgba(16,27,34,0.18);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  background: var(--navy); color: #fff;
  padding: 16px 22px; border-bottom: 4px solid var(--red);
  display: flex; align-items: flex-start; gap: 10px;
}
.drawer-header .back {
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer; padding: 4px 10px; border-radius: 3px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  transition: background 0.12s; line-height: 1.4;
}
.drawer-header .back:hover { background: rgba(255,255,255,0.1); }
.drawer-header .title { flex: 1; }
.drawer-header .eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  opacity: 0.6; text-transform: uppercase; margin-bottom: 4px;
}
.drawer-header h2 {
  margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
}
.drawer-header .meta { font-size: 12px; opacity: 0.7; margin-top: 4px; font-weight: 500; }
.drawer-header .close {
  background: transparent; border: none; color: #fff; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 0 4px; opacity: 0.7;
}
.drawer-header .close:hover { opacity: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }

.drawer-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 18px;
  padding: 14px; background: var(--bg); border-radius: 4px;
}
.drawer-summary .stat .lbl {
  font-size: 10px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700;
}
.drawer-summary .stat .val {
  font-size: 18px; font-weight: 700; color: var(--navy); margin-top: 3px;
}
.drawer .group-header {
  margin: 16px 0 8px 0; padding-bottom: 6px;
  border-bottom: 2px solid var(--navy);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--navy);
}
.drawer .group-header .total { color: var(--red); font-size: 13px; }
.drawer .group-header:first-child { margin-top: 4px; }

/* Repeating record row inside the drawer */
.deal-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--rule);
  cursor: pointer; transition: background 0.12s; align-items: center;
}
.deal-row:hover { background: #F8F9FB; }
.deal-row .company { font-weight: 600; color: var(--navy); font-size: 13px; }
.deal-row .deal-subtitle {
  font-size: 12px; color: var(--charcoal); font-weight: 600; margin-top: 1px;
}
.deal-row .submeta {
  font-size: 11px; color: var(--gray); margin-top: 2px; font-weight: 500;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.deal-row .submeta b { color: var(--charcoal); font-weight: 600; }
.deal-row .right { text-align: right; }
.deal-row .right .rev {
  font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums;
}
.deal-row .right .margin { font-size: 11px; color: var(--gray); font-weight: 500; margin-top: 2px; }
.deal-row .right .won-date {
  font-size: 11px; color: var(--charcoal); font-weight: 600; margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* Leaf-level record detail */
.deal-detail h3 {
  margin: 16px 0 8px 0; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy);
  padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
.deal-detail h3:first-child { margin-top: 0; }
.field-grid {
  display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px;
}
.field-grid dt {
  color: var(--charcoal); font-weight: 600; padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}
.field-grid dd {
  margin: 0; padding: 6px 0; color: var(--navy); font-weight: 500;
  border-bottom: 1px solid var(--rule);
}
.field-grid dd b { font-weight: 700; }

/* ---------------------------------------------------------------------------
   17. BUTTONS & LINKS
   Red = primary action. Navy = secondary. Outline = tertiary/destructive.
   --------------------------------------------------------------------------- */
.btn-primary, .noloco-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red); color: #fff !important; text-decoration: none;
  padding: 8px 14px; border: none; border-radius: 3px;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
  margin-top: 18px; margin-right: 8px; transition: background 0.12s;
}
.btn-primary:hover, .noloco-link:hover { background: var(--red-dk); }

.btn-secondary, .airtable-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy); color: #fff !important; text-decoration: none;
  padding: 8px 14px; border: none; border-radius: 3px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
  margin-top: 18px; transition: background 0.12s;
}
.btn-secondary:hover, .airtable-link:hover { background: #1F2D38; }

.action-btn {
  background: #fff; border: 1px solid var(--border); color: var(--navy);
  padding: 8px 14px; border-radius: 3px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 0.12s, border-color 0.12s;
}
.action-btn:hover:not(:disabled) { background: var(--navy); color: #fff; border-color: var(--navy); }
.action-btn.is-danger { color: var(--red); border-color: var(--red); }
.action-btn.is-danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.deal-actions {
  margin-top: 18px; padding: 14px 0 0; border-top: 1px solid var(--rule);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.deal-actions .lbl {
  font-size: 11px; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700; margin-right: 8px;
}

/* Hover-revealed deep-link chip on a row */
.noloco-chip {
  display: inline-block; margin-left: 8px; padding: 1px 6px;
  border: 1px solid var(--rule); border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--gray); text-decoration: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.12s, color 0.12s, border-color 0.12s;
}
.deal-row:hover .noloco-chip, tr.clickable:hover .noloco-chip { opacity: 1; }
.noloco-chip:hover { color: var(--navy); border-color: var(--navy); }
@media (hover: none) { .noloco-chip { opacity: 1; } }  /* touch has no hover */

/* ---------------------------------------------------------------------------
   18. MODAL — confirmation, overlays the drawer
   --------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,27,34,0.6); z-index: 1100;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -55%);
  background: #fff; border-radius: 6px; padding: 24px; z-index: 1101;
  width: min(440px, 92vw); box-shadow: 0 16px 48px rgba(16,27,34,0.3);
  border-top: 4px solid var(--red);
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal h3 {
  margin: 0 0 6px 0; font-size: 16px; font-weight: 700; color: var(--navy);
  text-transform: none; letter-spacing: 0; padding-bottom: 0; border-bottom: none;
}
.modal p { color: var(--charcoal); font-size: 13px; margin: 0 0 16px 0; }
.modal label {
  display: block; font-size: 11px; font-weight: 700; color: var(--charcoal);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.modal select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  background: #fff; border-radius: 3px; font-size: 14px; font-family: inherit;
  color: var(--navy); font-weight: 500;
}
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------------------------------------------------------------------------
   19. STATES — loading, error, write confirmation, provenance strip, footer
   --------------------------------------------------------------------------- */
.loading {
  text-align: center; padding: 80px 20px; color: var(--charcoal); font-weight: 500;
}
.loading::before {
  content: ""; display: inline-block; width: 28px; height: 28px;
  border: 3px solid var(--rule); border-top-color: var(--red);
  border-radius: 50%; animation: spin 0.9s linear infinite;
  margin-bottom: 14px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err {
  background: var(--neg-bg); border: 1px solid var(--neg-brd); color: var(--red-dk);
  padding: 14px 16px; border-radius: 4px; border-left: 4px solid var(--red);
}
.write-banner {
  margin-top: 14px; padding: 10px 12px; border-radius: 3px;
  font-size: 12px; font-weight: 600;
}
.write-banner.ok  { background: var(--pos-bg); color: var(--pos); border-left: 3px solid var(--pos); }
.write-banner.err { background: var(--neg-bg); color: var(--red-dk); border-left: 3px solid var(--red); }

/* Data-provenance strip. Neutral by design: it states what loaded, it is not a
   warning. Genuine problems get .diag-flag applied to just that segment. */
#diag {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--gray);
  padding: 9px 14px; border-radius: 4px; font-size: 11.5px;
  margin-bottom: 14px; color: var(--gray); font-weight: 500; letter-spacing: 0.01em;
}
#diag b { color: var(--charcoal); font-weight: 700; }
#diag .diag-flag, #diag .diag-flag b { color: var(--red); font-weight: 700; }

.footer-note {
  font-size: 11px; color: var(--gray); margin-top: 18px; text-align: center;
  padding-top: 14px; border-top: 1px solid var(--rule); letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
   20. CHARTS
   --------------------------------------------------------------------------- */
.chart-wrap { position: relative; height: 280px; }
