/* ================================================================
   Pillar ABA — Design Tokens
   ----------------------------------------------------------------
   Author:   Grain (Visual Design & Brand)
   Date:     2026-04-20
   Status:   Wednesday 4/22 handoff draft for Forge — Thursday
             merge target. Token shape finalized; hex values locked
             from JJ-approved voice samples in docs/design/mockups/.
   Scope:    Dashboard surfaces only (Compliance Snapshot, RBT
             Leaderboard, RBT Detail). Checker + Admin Settings
             polish post-Friday; tokens here will cover those
             surfaces when they activate.
   Voice:    Calm but firm. MMWR/Economist/NYRB reference points.
             Clinical gravity, Nebraska-practical restraint.
             See memory: grain_voice_direction.md.
   ----------------------------------------------------------------
   Drop this block at the top of dashboard/static/css/dashboard.css
   (before the component bands). Forge swaps hardcoded hex values
   throughout the file to var(--token-name) references during the
   Thursday merge.
   ================================================================ */

:root {

  /* -------- Neutrals -------- */
  /* Warm paper, not stark white. Background reads as document, not app. */
  --paper:              #f6f2e9;   /* primary page background */
  --paper-raised:       #fbf8f1;   /* cards, tiles, tables, raised surfaces */
  --paper-sunk:         #efe9db;   /* inset elements, disabled fields (reserve) */
  --rule:               #e4dccb;   /* hairline rules between cells, cards, sections */
  --rule-strong:        #d5c9ac;   /* emphasized rules, focused borders (reserve) */

  /* -------- Ink (text) -------- */
  --ink:                #1a1f2c;   /* primary body text, tile values, table cells */
  --ink-muted:          #5e5a50;   /* secondary text, sub-lines, filter labels */
  --ink-faint:          #8f8a7d;   /* tertiary labels, eyebrows, disabled text */

  /* -------- Primary (architectural navy) -------- */
  --navy:               #1f2a44;   /* topbar background, primary button fill */
  --navy-deep:          #121a2e;   /* sidebar background, pressed/active states */
  --navy-soft:          #2e3a56;   /* sidebar active row, topbar divider borders */

  /* -------- Accent (muted brass) -------- */
  /* Single warm accent across the whole palette. Wordmark dot,
     link underlines, eyebrow labels on sidebar, accent indicators.
     Do not add a second accent color without re-opening voice doctrine. */
  --brass:              #a37f2b;   /* primary accent — links, wordmark dot, sidebar eyebrows */
  --brass-soft:         #e7d9ae;   /* accent-tinted surfaces, subtle borders */
  --brass-deep:         #7f6120;   /* accent hover states, pressed links */

  /* -------- Semantic bands -------- */
  /* Muted, not saturated. Think margin-annotation, not alarm.
     Each band has a body color + a soft background variant for chips/pills. */
  --pass:               #4d7a46;   /* sage green — PASS verdicts, improving trends */
  --pass-soft:          #dce5d3;
  --risk:               #b0802b;   /* brass-adjacent amber — RISK verdicts, flag states */
  --risk-soft:          #ece1bc;
  --fail:               #8a3a2f;   /* muted brick red — FAIL verdicts, declining trends */
  --fail-soft:          #ebd2c9;

  /* -------- Type stacks -------- */
  /* All three self-hosted under dashboard/static/fonts/ per Plumb ruling
     on grain-intro thread (2026-04-20). Google Fonts CDN is NOT BAA-covered.
     See @font-face declarations below for file paths. */
  --serif:              "Fraunces", "Source Serif 4", Georgia, serif;
  --sans:               "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:               "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* -------- Type scale -------- */
  /* Anchored to body 15px; ratios chosen for document feel, not app feel.
     Use the variable names where possible — lets future retuning cascade. */
  --text-xs:            11px;      /* eyebrow labels, table column headers (uppercase) */
  --text-sm:            12px;      /* captions, meta lines, footer notes */
  --text-base:          15px;      /* body default */
  --text-md:            16px;      /* emphasis body, sub-titles */
  --text-lg:            17px;      /* report-link titles, raised section titles */
  --text-h2:            24px;      /* secondary headings (reserve — not used on Tier 2 pages) */
  --text-h1:            34px;      /* page headings, Compliance Snapshot + Leaderboard */
  --text-h1-large:      38px;      /* RBT Detail — RBT name serif display */
  --text-tile-value:    40px;      /* tile big number — RBT Detail Row 1 */
  --text-tile-value-lg: 44px;      /* tile big number — Compliance Snapshot tiles */

  /* -------- Letter spacing -------- */
  --track-eyebrow:      0.20em;    /* uppercase small-caps labels */
  --track-column:       0.16em;    /* table column headers */
  --track-button:       0.08em;    /* button labels, verdict pills */
  --track-tight:        -0.01em;   /* page headlines (optical correction) */
  --track-tighter:      -0.02em;   /* display-serif big numbers */

  /* -------- Spacing scale -------- */
  /* 4px base unit. Use variables for common spacings so rhythm stays
     consistent between tiles, tables, sections. */
  --space-1:            4px;
  --space-2:            8px;
  --space-3:            12px;
  --space-4:            16px;
  --space-5:            20px;
  --space-6:            24px;
  --space-7:            28px;
  --space-8:            32px;
  --space-9:            36px;
  --space-10:           44px;
  --space-12:           60px;

  /* -------- Layout constants -------- */
  --sidebar-width:      220px;
  --page-max-width:     1180px;
  --page-padding-x:     44px;      /* main content horizontal padding */
  --page-padding-top:   32px;
  --page-padding-bot:   60px;

  /* -------- Border radii -------- */
  /* Kept small — document-feel, not app-feel. No pill-shaped buttons
     except semantic pill badges (trend indicators, verdicts). */
  --radius-0:           0;
  --radius-sm:          2px;       /* buttons, cards, most UI */
  --radius-pill:        999px;     /* trend pills ONLY */

  /* -------- Transitions -------- */
  /* Short, subtle. Design language is restrained — don't animate
     attention-seeking. Fade states, don't bounce. */
  --transition-fast:    0.12s ease;
  --transition-base:    0.15s ease;
}


/* ================================================================
   Self-hosted font faces
   ----------------------------------------------------------------
   Files live at dashboard/static/fonts/.
   ================================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/Fraunces-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}


/* ============================================================
   Pillar ABA Dashboard — dashboard.css
   Desktop-only layout (min-width: 1024px)
   ============================================================ */

/* ----------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  min-width: 1024px;
}

body {
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--brass-soft);
  padding-bottom: 1px;
  transition: color var(--transition-base), border-bottom-color var(--transition-base);
}

a:hover {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* ----------------------------------------------------------
   Layout: Fixed topbar + fixed sidebar + scrollable main
   ---------------------------------------------------------- */

/* Top Bar — 56px tall, fixed */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--navy);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left .agency-name {
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.01em;
}

.agency-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brass-soft);
  border-left: 1px solid var(--navy-soft);
  padding-left: 12px;
  margin-left: 12px;
}


.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right .user-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.topbar-right .logout-link {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.topbar-right .logout-link:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

/* Layout wrapper — sits below topbar */
.layout {
  display: flex;
  margin-top: 56px;
  min-height: calc(100vh - 56px);
}

/* Sidebar — 220px wide, fixed */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 220px;
  height: calc(100vh - 56px);
  background-color: var(--navy-deep);
  overflow-y: auto;
  z-index: 90;
  padding-top: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  padding: 0 20px 8px;
  margin-top: 20px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.nav-item.active .nav-link {
  background-color: rgba(163, 127, 43, 0.08);
  color: #FFFFFF;
  font-weight: 600;
  border-left: 3px solid var(--brass, #a37f2b);
}

.nav-label {
  font-size: 14px;
}

/* Pending count badge in sidebar nav (e.g., Approvals queue depth).
   Calm-but-firm brass per admin_approval_queue_spec.md L30 — not alarm-red. */
.nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background-color: var(--brass, #a37f2b);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* Main content — offset by sidebar width */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: 32px 36px;
  background-color: var(--paper);
  min-height: calc(100vh - 56px);
  overflow-y: auto;
}

/* ----------------------------------------------------------
   Stat Tiles / Cards
   ---------------------------------------------------------- */
.tile {
  background-color: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm, 2px);
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.tile-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tile-number--empty {
  font-style: italic;
  color: #BBB;
  font-size: 28px;
}

.tile-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
  font-weight: 500;
}

.tile-trend {
  font-size: 12px;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background-color: var(--paper);
}

/* ----------------------------------------------------------
   Badges & Trend Arrows
   ---------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-pass,
.badge-green {
  background-color: var(--pass-soft);
  color: var(--pass);
}

.badge-fail,
.badge-red {
  background-color: var(--fail-soft);
  color: var(--fail);
}

.badge-flag,
.badge-orange {
  background-color: var(--risk-soft);
  color: var(--risk);
}

.badge-info,
.badge-blue {
  background-color: #DBEAFE;
  color: var(--navy);
}

/* Trend arrows — colored by direction */
.trend-up   { color: var(--pass); }
.trend-down { color: var(--fail); }
.trend-flat { color: #999; }

/* ----------------------------------------------------------
   Verdict utility classes
   ---------------------------------------------------------- */
.text-pass { color: var(--pass); font-weight: 600; }
.text-fail { color: var(--fail); font-weight: 600; }
.text-flag { color: var(--risk); font-weight: 600; }

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  background-color: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm, 2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background-color: #EDEBE6;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  border-bottom: 1px solid var(--rule);
}

tbody tr {
  border-bottom: 1px solid #EDEBE6;
  transition: background-color 0.1s ease;
}

tbody tr:nth-child(even) {
  background-color: #FAFAFA;
}

tbody tr:hover {
  background-color: rgba(163, 127, 43, 0.06);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 10px 14px;
  color: var(--navy);
  vertical-align: middle;
}

/* ----------------------------------------------------------
   Form Elements
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  background-color: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(163, 127, 43, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--navy);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--navy-soft);
  text-decoration: none;
  color: #FFFFFF;
}

.btn-danger {
  background-color: var(--fail);
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: #6e2e25;
  text-decoration: none;
  color: #FFFFFF;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------
   Page Headings & Section Structure
   ---------------------------------------------------------- */
.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 14px;
  color: #888;
  margin-top: 6px;
  line-height: 1.5;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------
   Error / State Pages
   ---------------------------------------------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 0;
  max-width: 560px;
}

.error-code {
  font-size: 56px;
  font-weight: 800;
  color: var(--rule);
  line-height: 1;
  margin-bottom: 12px;
}

.error-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.error-message {
  font-size: 14px;
  color: #555;
  margin-bottom: 24px;
  line-height: 1.6;
}

.error-ref {
  font-size: 12px;
  color: #999;
  font-family: monospace;
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  gap: 12px;
}

/* ----------------------------------------------------------
   Misc utilities
   ---------------------------------------------------------- */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.text-muted   { color: #777; }
.text-small   { font-size: 12px; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

/* ----------------------------------------------------------
   Filter Bar (leaderboard + archive pages)
   ---------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  background-color: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm, 2px);
  padding: 18px 24px;
  margin-bottom: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group--clear {
  justify-content: flex-end;
  padding-bottom: 2px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.filter-select {
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--navy);
  background-color: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  outline: none;
  min-width: 150px;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(163, 127, 43, 0.15);
}

.checkbox-group {
  display: flex;
  flex-direction: row;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--navy);
  cursor: pointer;
}

.btn-link-muted {
  font-size: 12px;
  color: #888;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.btn-link-muted:hover {
  color: var(--fail);
}

/* ----------------------------------------------------------
   Sortable table column headers
   ---------------------------------------------------------- */
.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--brass);
  text-decoration: none;
}

.sort-link.sort-active {
  color: var(--navy);
  font-weight: 700;
}

.sort-idle {
  color: #BBB;
  font-size: 10px;
}

/* ----------------------------------------------------------
   Pagination
   ---------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.page-btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background-color: var(--paper-raised);
  color: var(--navy);
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.page-btn:hover {
  background-color: #EDEBE6;
  text-decoration: none;
}

.page-btn--disabled {
  color: #BBB;
  border-color: #EDEBE6;
  cursor: not-allowed;
  pointer-events: none;
}

.page-info {
  font-size: 13px;
  color: #555;
}

/* ----------------------------------------------------------
   Empty state
   ---------------------------------------------------------- */
.empty-state {
  background-color: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 48px 36px;
  text-align: center;
}

.empty-state-icon {
  font-size: 32px;
  color: var(--rule);
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.empty-state-body {
  font-size: 13px;
  color: #777;
  line-height: 1.6;
}

/* Inline empty state — inside a section (e.g. weak points table) */
.empty-state-inline {
  font-size: 13px;
  color: #777;
  padding: 20px 24px;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   Banner — full-width informational strip
   ---------------------------------------------------------- */
.banner {
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.banner--warn {
  background-color: var(--risk-soft);
  color: var(--risk);
  border: 1px solid #FDE68A;
}

.banner--info {
  background-color: #DBEAFE;
  color: var(--navy);
  border: 1px solid #BFDBFE;
}

/* ----------------------------------------------------------
   RBT Detail — header layout
   ---------------------------------------------------------- */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.detail-header-left {
  display: flex;
  flex-direction: column;
}

.detail-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 4px;
}

.back-link {
  font-size: 13px;
  color: var(--brass);
  text-decoration: none;
  margin-bottom: 4px;
}

.back-link:hover {
  text-decoration: underline;
}

.detail-meta {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

/* ----------------------------------------------------------
   Report link rows (RBT Detail trend reports)
   ---------------------------------------------------------- */
.report-links-tile {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.report-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.report-link-row--border {
  border-top: 1px solid #EDEBE6;
}

.report-link-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.report-link-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ----------------------------------------------------------
   Button size variants
   ---------------------------------------------------------- */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-sm--outline {
  background-color: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}

.btn-sm--outline:hover {
  background-color: #EDEBE6;
  color: var(--navy);
  text-decoration: none;
}

/* ----------------------------------------------------------
   CP tag — small label chip for failing criteria
   ---------------------------------------------------------- */
.cp-tag {
  font-size: 12px;
  color: var(--fail);
}

/* ----------------------------------------------------------
   Tier 3 teaser placeholder
   ---------------------------------------------------------- */
.tier3-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FAFAFA;
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 16px 20px;
  opacity: 0.7;
  cursor: default;
}

.tier3-teaser-label {
  font-size: 13px;
  font-weight: 600;
  color: #999;
  margin-bottom: 4px;
}

.tier3-teaser-body {
  font-size: 12px;
  color: #BBB;
}

/* ----------------------------------------------------------
   Action group — for View/Download pairs in tables
   ---------------------------------------------------------- */
.action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------------------------------------------------
   Flash messages
   ---------------------------------------------------------- */
.flash-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.flash--success {
  background-color: var(--pass-soft);
  color: var(--pass);
  border: 1px solid #A7F3D0;
}

.flash--error {
  background-color: var(--fail-soft);
  color: var(--fail);
  border: 1px solid #FECACA;
}

/* ----------------------------------------------------------
   Form errors (inline, below a field)
   ---------------------------------------------------------- */
.form-error {
  font-size: 12px;
  color: var(--fail);
  margin-top: 4px;
}

/* ----------------------------------------------------------
   Attestation label (wider checkbox label, wraps text)
   ---------------------------------------------------------- */
.attestation-label {
  align-items: flex-start;
  line-height: 1.5;
  gap: 10px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.attestation-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Inline button link (used in table cells)
   ---------------------------------------------------------- */
.btn-link-inline {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--brass);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 8px;
}

.btn-link-inline:hover {
  color: var(--navy);
}

/* ----------------------------------------------------------
   Modal overlay + dialog
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background-color: var(--paper-raised);
  border-radius: 8px;
  padding: 32px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.5;
}

.modal-body--warn {
  color: var(--fail);
  font-weight: 500;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* ----------------------------------------------------------
   Section divider — between Admin Settings sections
   ---------------------------------------------------------- */
.section-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0 32px;
}

/* ----------------------------------------------------------
   Deactivated row — muted display for inactive RBT codes
   ---------------------------------------------------------- */
.row-deactivated td {
  opacity: 0.6;
}

/* ----------------------------------------------------------
   Form hint — small helper text below a form field
   ---------------------------------------------------------- */
.form-hint {
  font-size: 12px;
  color: #777;
  margin-top: 4px;
  line-height: 1.4;
}

/* ----------------------------------------------------------
   Voice polish — new components (Grain handoff 2026-04-22)
   ---------------------------------------------------------- */

/* Wordmark (topbar) */
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--paper);
}
.wordmark .dot { color: var(--brass); }

/* Eyebrow labels */
.eyebrow {
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}

/* Page titles — Fraunces display */
h1 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 72, "SOFT" 30;
  font-weight: 500;
  font-size: var(--text-h1);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  letter-spacing: var(--track-tight);
}

/* Page subtitles — italic serif */
.sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-md);
  color: var(--ink-muted);
  margin: 0;
}

/* Verdict badges */
.verdict {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid;
}
.verdict.pass { color: var(--pass); border-color: rgba(77,122,70,0.3); background: var(--pass-soft); }
.verdict.fail { color: var(--fail); border-color: rgba(138,58,47,0.3); background: var(--fail-soft); }
.verdict.risk { color: var(--risk); border-color: rgba(176,128,43,0.3); background: var(--risk-soft); }

/* Left-bordered CP fail tiles */
.tile.cp-fail {
  background: var(--paper-raised);
  border-left: 3px solid var(--fail);
  padding-left: 19px;
}
.tile.cp-fail .label { color: var(--fail); opacity: 0.85; }
.tile.cp-fail .value { color: var(--fail); font-weight: 500; }
.tile.cp-fail .value .pct { color: var(--fail); opacity: 0.75; }

/* Primary tile variant — navy fill */
.tile.primary {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy-deep);
}

/* Collapsed / empty-state report link row */
.report-link-row.collapsed {
  background: transparent;
  border-style: dashed;
  border-color: var(--rule);
}
.report-link-row.collapsed .meta .title { color: var(--ink-muted); }
.report-link-row.collapsed .meta .sub-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Trend pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--track-button);
  text-transform: uppercase;
  border: 1px solid;
}
.pill.improving  { color: var(--pass); border-color: rgba(77,122,70,0.3);   background: var(--pass-soft); }
.pill.declining  { color: var(--fail); border-color: rgba(138,58,47,0.3);   background: var(--fail-soft); }
.pill.stable     { color: var(--ink-muted); border-color: var(--rule);      background: var(--paper-sunk); }
.pill.insufficient { color: var(--ink-faint); border-color: var(--rule);    background: var(--paper-sunk); }


/* ============================================================
   Shared modifiers — tile width, padding, placeholder
   (client-onboarding-refactor / Grain visual-QA L81)
   ============================================================ */
.tile--narrow    { max-width: 720px; }
.tile--wide     { max-width: 960px; }
.tile--flush     { padding: 0; }

/* Quiet, centered placeholder for "data-not-ready" tiles
   (e.g. Billing trend-chart awaiting first month). Calm, not error-y. */
.tile--placeholder {
  max-width: 720px;
  padding: var(--space-8) var(--space-5);
  margin-bottom: var(--space-6);
  text-align: center;
  color: var(--ink-muted);
}

/* ============================================================
   Badge — neutral (Disabled / Deactivated)
   (client-onboarding-refactor / Grain visual-QA L81)
   ============================================================ */
.badge-neutral {
  background-color: var(--paper-sunk);
  color: var(--ink-muted);
}

/* ============================================================
   Billing & Usage — Summary cards + drill-down
   (client-onboarding-refactor Part B / Grain visual-QA L81)
   ============================================================ */
.tile-grid--billing {
  display: flex;
  gap: var(--space-4);
  max-width: 720px;
  margin-bottom: var(--space-6);
}

.tile--billing {
  flex: 1;
  padding: var(--space-5);
}

/* Uppercase eyebrow inside billing summary cards ("BCBAs", "RBTs") */
.tile-eyebrow {
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: var(--track-eyebrow);
  font-weight: 600;
}

/* Tile big number ("3", "8") — display value */
.tile-big-number {
  font-size: var(--text-tile-value);
  font-weight: 600;
  color: var(--ink);
  margin-top: var(--space-3);
  line-height: 1;
}

/* Caption directly under big number ("Active this period") */
.tile-sub {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-top: var(--space-1);
}

/* Secondary line at bottom of summary card ("4 provisioned") */
.tile-divider-line {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}

/* Drill-down <details> wrapping each role's per-user table.
   Tile shell handled by .tile; we only need to neutralize padding
   so the summary controls its own padding. */
.drilldown {
  max-width: 720px;
  padding: 0;
  margin-bottom: var(--space-4);
}
.drilldown > summary {
  cursor: pointer;
  padding: var(--space-3) var(--space-5);
  font-weight: 600;
  font-size: var(--text-base);
  user-select: none;
  list-style: revert;
}
.drilldown .table-wrapper {
  border-top: 1px solid var(--rule);
}
.drilldown .empty-state-inline {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--rule);
}

/* Recessed row for users inactive >14d.
   Visible-but-muted at-risk signal — distinct from FAIL band. */
.row-muted td {
  color: var(--ink-muted);
  opacity: 0.65;
}

/* Warning-state row — approaching cap (80-99%). Subtle amber tint
   distinguishes from .row-muted (inactive/disabled). Left border
   echoes the .badge-flag amber on the same row. */
.row-warn td {
  background-color: var(--risk-soft);
  border-left: 3px solid var(--risk);
}
.row-warn td:first-child { padding-left: 11px; }

/* Cap-reached row — distinct red treatment per sliding-scale-pricing-spec
   AC#16. Brick-red FAIL token tinted softly so the row reads as
   "blocked" without alarm. */
.row-capped td {
  background-color: var(--fail-soft);
  color: var(--fail);
}

/* ============================================================
   Usage Caps slider + Surface 5 rollup
   Spec: docs/product/sliding_scale_pricing_spec.md (Surfaces 1, 5)
   Restrained styling — Grain polish pass deferred.
   ============================================================ */
.usage-cap-slider-wrap {
  margin-top: var(--space-4);
}

.usage-cap-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.usage-cap-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid var(--paper-raised);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.usage-cap-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid var(--paper-raised);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.usage-cap-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.usage-cap-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--ink-faint);
  margin-top: var(--space-1);
}

.usage-cap-readout {
  margin-top: var(--space-4);
}
.usage-cap-value {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
}
.usage-cap-spend {
  margin-top: var(--space-1);
}

.usage-cap-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
  max-width: 720px;
  flex-wrap: wrap;
}

/* Subtle "/ N" suffix used in the rollup tile — keeps the cap-total
   from competing visually with the used-total big number. */
.usage-cap-of {
  font-size: var(--text-md);
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: var(--space-2);
}

/* ============================================================
   Approval queue — card layout + inline forms
   (client-onboarding-refactor Part C / Grain visual-QA L81)
   ============================================================ */
.approval-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 720px;
}

.approval-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.approval-card-body {
  flex: 1;
  min-width: 0;
}

/* 18px is intentional per Grain spec — sits between --text-lg (17)
   and --text-h2 (24); we want this prominent without becoming a heading. */
.approval-client-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.approval-meta {
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.approval-sources {
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

.approval-sources-label {
  font-weight: 500;
}

.approval-actions-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 200px;
}

.approve-form-wrap {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

/* Read-only static value display inside the inline approve form */
.form-value-static {
  font-size: var(--text-base);
  padding: var(--space-2) 0;
  color: var(--ink);
}

.form-actions-row {
  display: flex;
  gap: var(--space-2);
}

/* ============================================================
   Invite codes — Admin Settings
   (client-onboarding-refactor Part A / Grain visual-QA L81)
   ============================================================ */
.invite-code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.invite-code-row:not(:last-child) {
  border-bottom: 1px solid var(--rule);
}

.invite-code-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.invite-code-value {
  font-family: var(--mono);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--paper-raised);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  display: inline-block;
  user-select: all;
}

.invite-code-hint {
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.invite-code-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 180px;
}
