/* FleetGuardian — prototype styles
   Palette follows the validated status/chrome palette (see dataviz reference):
   surfaces #fcfcfb / #f9f9f7, primary ink #0b0b0b, secondary ink #52514e,
   muted #898781, brand blue #2a78d6, status good/warning/serious/critical. */

:root {
  --surface: #fcfcfb;
  --page-plane: #f9f9f7;
  --ink-primary: #0b0b0b;
  --ink-secondary: #52514e;
  --ink-muted: #898781;
  --gridline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --brand: #2a78d6;
  --brand-dark: #1c5cab;
  --good: #0ca30c;
  --good-bg: #e7f7e7;
  --warning: #fab219;
  --warning-bg: #fff6e2;
  --serious: #ec835a;
  --serious-bg: #fdeae2;
  --critical: #d03b3b;
  --critical-bg: #fbe7e7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink-primary);
  background: var(--page-plane);
  font-variant-numeric: proportional-nums;
}

a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 24px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-name-group { display: flex; flex-direction: column; line-height: 1.25; }
.brand-sub { font-size: 11px; font-weight: 500; color: var(--ink-secondary); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-secondary);
}
.nav-link:hover { background: var(--page-plane); color: var(--ink-primary); }
.nav-link.active { background: #eaf1fb; color: var(--brand-dark); }
.nav-link.disabled { color: var(--ink-muted); cursor: default; display: flex; justify-content: space-between; align-items: center; }
.nav-link.disabled:hover { background: none; color: var(--ink-muted); }
.soon {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  background: var(--gridline); color: var(--ink-secondary);
  padding: 2px 6px; border-radius: 999px;
}

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 12px; }
.company-pill {
  font-size: 12px; font-weight: 600; color: var(--ink-secondary);
  background: var(--page-plane); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 10px;
}
.user-row { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.user-name { font-size: 13px; font-weight: 600; }
.signout { font-size: 12px; color: var(--ink-muted); }
.signout:hover { color: var(--critical); }

.main { flex: 1; padding: 32px 40px; max-width: 1100px; }

/* ---------- Page header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; }
.page-header h1 { font-size: 24px; margin: 4px 0 2px; }
.page-sub { color: var(--ink-secondary); font-size: 14px; margin: 0; }
.back-link { font-size: 13px; color: var(--ink-muted); }
.back-link:hover { color: var(--ink-primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--ink-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--ink-muted); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--critical); border-color: rgba(208, 59, 59, 0.3); }
.btn-danger:hover { background: var(--critical-bg); border-color: var(--critical); }

/* ---------- Stat tiles (dashboard KPIs) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px;
}
.stat-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-size: 30px; font-weight: 700; margin: 6px 0 4px; line-height: 1; }
.stat-foot { font-size: 12px; color: var(--ink-secondary); display: flex; align-items: center; gap: 6px; }
.stat-value.status-good { color: var(--good); }
.stat-value.status-warning { color: #a97400; } /* darker step for text contrast on light surface */
.stat-value.status-serious { color: var(--serious); }
.stat-value.status-critical { color: var(--critical); }

/* ---------- Panels / tables ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 0 8px; margin-bottom: 20px;
}
.panel-header { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px 8px; }
.panel-header h2 { font-size: 16px; margin: 0; }
.panel-form { padding: 20px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 10px 20px; border-bottom: 1px solid var(--gridline);
}
.table td { padding: 12px 20px; border-bottom: 1px solid var(--gridline); font-size: 14px; }
.table tr:last-child td { border-bottom: none; }
.row-link { font-weight: 600; }
.row-link:hover { color: var(--brand-dark); }
.link { color: var(--brand); font-size: 13px; font-weight: 600; }
.link:hover { color: var(--brand-dark); }
.muted { color: var(--ink-secondary); }
.empty-state { padding: 32px 20px; text-align: center; color: var(--ink-muted); font-size: 14px; }

/* ---------- Status badges (icon/dot + label, never color alone) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge-lg { font-size: 13px; padding: 6px 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.badge-valid, .badge-on-file { background: var(--good-bg); color: #0a5c0a; }
.dot-valid, .dot-on-file { background: var(--good); }

.badge-expiring-soon { background: var(--warning-bg); color: #8a6100; }
.dot-expiring-soon { background: var(--warning); }

.badge-expired { background: var(--critical-bg); color: var(--critical); }
.dot-expired { background: var(--critical); }

.badge-missing { background: var(--serious-bg); color: #a2431f; }
.dot-missing { background: var(--serious); }

/* "Requested" — staff already sent an MVR/PSP/drug-test request off (see
   INTEGRATION_REQUEST_KINDS in app.py) but nothing's back yet. Still ranks
   as urgent as Missing in STATUS_RANK, so this is deliberately its own
   informational tone (brand-tinted) rather than reusing the warning/serious
   colors, which would read as "something's wrong" instead of "in progress". */
.badge-requested { background: rgba(42, 120, 214, 0.12); color: var(--brand-dark); }
.dot-requested { background: var(--brand); }

.badge-not-applicable { background: var(--gridline); color: var(--ink-secondary); }
.dot-not-applicable { background: var(--ink-muted); }

/* ---------- Driver detail: document checklist ---------- */
.doc-list { padding: 4px 20px 12px; }
.doc-row {
  border-bottom: 1px solid var(--gridline);
}
.doc-row:last-child { border-bottom: none; }
.doc-row summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px; font-size: 14px;
}
.doc-row summary::-webkit-details-marker { display: none; }
.doc-name { font-weight: 600; flex: 1 1 auto; min-width: 220px; }
.tag-optional {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: var(--ink-muted); background: var(--page-plane);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; margin-left: 8px;
}
.doc-meta { font-size: 13px; min-width: 160px; }
.chevron { color: var(--ink-muted); font-size: 12px; margin-left: auto; transition: transform 0.15s ease; }
.doc-row[open] .chevron { transform: rotate(180deg); }

.doc-form { padding: 4px 4px 16px 4px; }
.doc-form-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px;
}
.doc-notes { grid-column: span 2; }
.doc-attached-badge { font-size: 13px; margin-left: 4px; }
.doc-file-field { grid-column: span 2; }
.doc-file-control { display: flex; flex-direction: column; gap: 6px; }
.doc-file-current { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.doc-file-link { color: var(--brand); font-weight: 600; text-decoration: none; word-break: break-all; }
.doc-file-link:hover { text-decoration: underline; }
.doc-file-remove-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  color: var(--critical); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.doc-file-remove-toggle input { margin: 0; }
.doc-file-control input[type="file"] { font-size: 12px; }
.doc-retention { font-size: 12px; margin: -4px 0 12px; }
.version-history { margin: 0 4px 12px 4px; }
.version-history summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-secondary);
  list-style: none; padding: 2px 0;
}
.version-history summary::-webkit-details-marker { display: none; }
.version-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.version-list li { font-size: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-secondary); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select {
  font-size: 14px; font-weight: 500; color: var(--ink-primary);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--page-plane);
}
input:focus, select:focus { outline: none; border-color: var(--brand); background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
.form-subhead { font-size: 15px; margin: 22px 0 4px; }
.stacked-form { display: flex; flex-direction: column; gap: 4px; }
.checkbox-label {
  flex-direction: row !important; align-items: center; gap: 8px !important;
  font-weight: 600; color: var(--ink-secondary);
}
.checkbox-label input { margin: 0; width: auto; }

/* ---------- Vehicle detail: OSOW permits / service history logs ---------- */
.log-add-form { padding: 12px 20px 4px; border-bottom: 1px solid var(--gridline); }
.log-add-form .form-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 10px; }
.log-list { list-style: none; margin: 0; padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 0; }
.log-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px;
  border-bottom: 1px solid var(--gridline); font-size: 14px; flex-wrap: wrap;
}
.log-list li:last-child .log-row { border-bottom: none; }
.log-title { font-weight: 600; flex: 1 1 auto; min-width: 200px; }
.log-meta { font-size: 13px; min-width: 160px; }
.deactivate-form { display: inline; }

/* ---------- Auth screen ---------- */
.auth-body { background: var(--page-plane); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; justify-content: center; }
.auth-tagline { text-align: center; color: var(--ink-secondary); font-size: 13px; margin: 0 0 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.demo-box {
  background: var(--page-plane); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 12px; color: var(--ink-secondary);
}
.demo-title { font-weight: 700; margin-bottom: 6px; color: var(--ink-primary); }
.demo-cred { margin-bottom: 2px; }

/* ---------- Two-factor setup / verify ---------- */
.auth-card-wide { max-width: 460px; }
.totp-secret-box {
  background: var(--page-plane); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 18px;
}
.totp-secret-code {
  display: block; font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 16px; letter-spacing: 2px; font-weight: 700; color: var(--ink-primary);
  margin: 6px 0 10px; word-break: break-all;
}
.totp-uri { font-size: 11px; color: var(--ink-secondary); word-break: break-all; }
.code-input {
  text-align: center; font-size: 22px; letter-spacing: 6px; font-family: monospace;
}
.demo-box-warn {
  background: var(--warning-bg); border: 1px solid var(--warning); color: #8a6100;
  border-radius: 10px; padding: 12px 14px; font-size: 12px; margin-top: 4px;
}
.demo-box-warn .demo-title { color: #8a6100; }

/* ---------- Flash messages ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash-stack-auth { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10; width: 380px; }
.flash { padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.flash-error { background: var(--critical-bg); color: var(--critical); }
.flash-success { background: var(--good-bg); color: #0a5c0a; }

/* ---------- Driver detail: status control + application answers ---------- */
.status-controls { display: flex; align-items: center; gap: 10px; }
.status-form select {
  font-size: 13px; font-weight: 600; color: var(--ink-secondary);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  background: var(--surface);
}

.application-answers { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 18px; }
.answer-block h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-muted);
  margin: 0 0 8px;
}
.answer-grid { display: grid; grid-template-columns: 220px 1fr; gap: 6px 12px; margin: 0; }
.answer-grid dt { font-size: 13px; color: var(--ink-secondary); font-weight: 600; }
.answer-grid dd { font-size: 13px; margin: 0; }

/* ---------- Settings: branding ---------- */
.color-input { padding: 3px; height: 38px; cursor: pointer; }
.muted-inline { color: var(--ink-muted); font-weight: 400; font-size: 12px; }
.brand-preview { padding: 16px 20px 20px; }
.brand-preview-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.brand-preview-logo { height: 36px; max-width: 140px; object-fit: contain; }
.brand-preview-name { font-size: 18px; font-weight: 700; }
.brand-preview-btn {
  /* A color swatch, not a real control — deliberately a <span> in the
     template (not a <button>) so it carries no click affordance at all. */
  display: inline-block; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--preview-color, var(--brand)); cursor: default; margin-top: 8px;
}

/* ---------- Applications (invites) ---------- */
.link-copy-row { display: flex; gap: 8px; margin-top: 6px; }
.link-copy-row input {
  flex: 1; font-size: 13px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; background: var(--page-plane); color: var(--ink-secondary);
}
.link-group { display: flex; gap: 8px; }

/* ---------- Public branded application page ---------- */
.apply-body { background: var(--page-plane); margin: 0; }
.apply-header {
  background: var(--surface); border-bottom: 3px solid var(--preview-color, var(--brand));
  padding: 22px 32px; display: flex; align-items: center; gap: 14px;
}
.apply-logo { height: 44px; max-width: 180px; object-fit: contain; }
.apply-company { font-size: 20px; font-weight: 700; }
.apply-subtitle { font-size: 13px; color: var(--ink-secondary); font-weight: 600; }
.apply-main { max-width: 780px; margin: 0 auto; padding: 28px 20px 60px; }
.apply-intro { color: var(--ink-secondary); font-size: 14px; margin-bottom: 20px; }
.apply-form { display: flex; flex-direction: column; gap: 20px; }
.apply-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px;
}
.apply-section h2 {
  font-size: 15px; margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--preview-color, var(--brand));
  display: inline-block;
}
.apply-subblock { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--gridline); }
.apply-subblock:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.apply-subblock h3 { font-size: 13px; color: var(--ink-secondary); margin: 0 0 10px; }
.apply-row-grid { grid-template-columns: repeat(5, 1fr); margin-bottom: 14px; }
.apply-checkbox {
  display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 13px;
  color: var(--ink-primary); flex-direction: row;
}
.apply-checkbox input { margin-top: 3px; }
.apply-submit {
  background: var(--preview-color, var(--brand)); color: #fff; align-self: flex-start;
  padding: 12px 28px; font-size: 15px;
}
select {
  font-size: 14px; font-weight: 500; color: var(--ink-primary);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--page-plane);
}

/* ---------- Authorization wizard steps ---------- */
.apply-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.apply-progress span { font-size: 12px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.apply-progress-bar { height: 6px; border-radius: 999px; background: var(--gridline); overflow: hidden; }
.apply-progress-fill { height: 100%; background: var(--preview-color, var(--brand)); border-radius: 999px; transition: width 0.2s ease; }
.auth-disclaimer {
  font-size: 12px; color: var(--ink-muted); background: var(--page-plane);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
}
.auth-text {
  font-size: 14px; line-height: 1.6; color: var(--ink-primary); margin-bottom: 4px;
  white-space: pre-line; /* the legal text uses \n\n / \n for paragraph and bullet breaks */
}

/* ---------- Driver detail: authorizations panel ---------- */
.auth-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 24px;
  border-bottom: 1px solid var(--gridline); font-size: 14px;
}
.auth-row:last-child { border-bottom: none; }
.auth-row .doc-name { font-weight: 600; flex: 1 1 auto; min-width: 220px; }
.auth-row .doc-meta { min-width: 220px; font-size: 13px; }
.auth-row .link { flex-shrink: 0; white-space: nowrap; }

/* ---------- Super admin console (nocosafety cross-company view) ---------- */
.impersonate-pill {
  background: var(--warning-bg); color: #8a6100; border: 1px solid transparent;
}
.exit-link { display: block; margin-top: 6px; }
.impersonate-banner {
  background: var(--warning-bg); color: #8a6100; border: 1px solid var(--warning);
  border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.impersonate-banner a { color: #8a6100; text-decoration: underline; white-space: nowrap; }
.past-due-banner {
  background: var(--critical-bg); color: var(--critical); border: 1px solid var(--critical);
  border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.past-due-banner a { color: var(--critical); text-decoration: underline; white-space: nowrap; }
.snapshot-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-row-actions { display: flex; gap: 8px; }
.row-deactivated { opacity: 0.6; }
.row-deactivated .row-link { text-decoration: line-through; }

/* ---------- Public marketing pages: pricing / signup ---------- */
.marketing-wrap { max-width: 1000px; margin: 0 auto; padding: 32px 24px 60px; }
.marketing-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.marketing-intro { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.marketing-intro h1 { font-size: 32px; margin: 0 0 12px; }

.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pricing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 10px;
}
.pricing-card-label { font-size: 15px; font-weight: 700; }
.pricing-card-range { font-size: 12px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.pricing-card-price { margin: 8px 0; }
.pricing-card-amount { font-size: 28px; font-weight: 700; }
.pricing-card-unit { font-size: 13px; color: var(--ink-secondary); }
.pricing-card-blurb { font-size: 13px; color: var(--ink-secondary); flex: 1; margin: 0; }

.signup-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.signup-form-panel { padding: 28px; }
.signup-tiers-summary { padding-top: 4px; }
.tier-row-preselected { background: var(--good-bg); }
.auth-footer-link { text-align: center; font-size: 13px; color: var(--ink-secondary); margin-top: 14px; }
.auth-footer-link a { color: var(--brand); font-weight: 600; }

/* ---------- Driver type filter chips (drivers list) ---------- */
.filter-chips { display: flex; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-secondary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px;
}
.chip:hover { border-color: var(--ink-muted); }
.chip-active { background: #eaf1fb; color: var(--brand-dark); border-color: var(--brand); }
.chip-count {
  font-size: 11px; font-weight: 700; color: var(--ink-muted);
  background: var(--page-plane); border-radius: 999px; padding: 1px 7px;
}
.chip-active .chip-count { color: var(--brand-dark); background: #fff; }

/* ---------- Driver type / tag pills ---------- */
.tag-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px;
  background: #eaf1fb; color: var(--brand-dark);
}
.tag-pill-non-cdl { background: #f1eafc; color: #6a3fc0; }
.term-date { color: var(--critical); font-weight: 600; }

/* ---------- Driver detail: tags panel ---------- */
.tags-panel-body { padding: 16px 20px; }
.tags-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.tags-form .form-grid { flex: 1 1 auto; grid-template-columns: repeat(3, 1fr); margin-bottom: 0; min-width: 460px; }
.tags-form .btn { margin-bottom: 1px; }

/* ---------- Driver detail: notes panel ---------- */
.notes-form { display: flex; flex-direction: column; gap: 12px; }
.notes-form textarea {
  width: 100%; resize: vertical; font-family: inherit; font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink-primary); background: var(--surface);
}
.notes-form .btn { align-self: flex-start; }

/* ---------- Thank-you page recap ---------- */
.signed-recap { list-style: none; margin: 16px 0 0; padding: 0; font-size: 13px; color: var(--ink-secondary); }
.signed-recap li { padding: 4px 0; }

/* ---------- Reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.report-card-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.report-card-body .muted { font-size: 13px; line-height: 1.5; margin: 0; }
.report-card-actions { display: flex; gap: 10px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-form-grid { grid-template-columns: repeat(2, 1fr); }
  .apply-row-grid { grid-template-columns: repeat(2, 1fr); }
  .answer-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .signup-layout { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}
