/* =============================================================
   ALPHA DESK DMS — UI styles
   Palette adapted from alphaitcloud.com (Alpha Cloud Technologies).
   Strict CSP: no external font CDN; we ship system-font fallbacks
   that read as the same family (Inter / SF / Segoe). To self-host
   Inter later, drop .woff2 in /static/fonts and add @font-face.
   ============================================================= */

:root {
  /* Brand palette */
  --ac-blue-900: #0a1628;
  --ac-blue-800: #0d2147;
  --ac-blue-700: #0f3460;
  --ac-blue-600: #1a4f8a;
  --ac-blue-500: #1e6abf;
  --ac-blue-400: #2d8ce8;
  --ac-blue-300: #5aaaf0;
  --ac-blue-100: #dbeafe;
  --ac-blue-50:  #eff6ff;
  --ac-surface:  #f0f6ff;
  --ac-white:    #ffffff;
  --ac-gray-50:  #f8fafc;
  --ac-gray-100: #f1f5f9;
  --ac-gray-200: #e2e8f0;
  --ac-gray-400: #94a3b8;
  --ac-gray-600: #475569;
  --ac-gray-800: #1e293b;

  /* Semantic tokens */
  --bg-page:           var(--ac-gray-50);
  --bg-surface:        var(--ac-white);
  --bg-sidebar:        var(--ac-blue-900);
  --bg-sidebar-hover:  rgba(255,255,255,.07);
  --bg-sidebar-active: rgba(255,255,255,.12);
  --bg-table-head:     var(--ac-gray-50);
  --text-primary:      var(--ac-gray-800);
  --text-muted:        var(--ac-gray-600);
  --text-faint:        var(--ac-gray-400);
  --text-on-dark:      rgba(255,255,255,.85);
  --border:            var(--ac-gray-200);
  --accent:            var(--ac-blue-500);
  --accent-hover:      var(--ac-blue-400);

  /* Effects */
  --shadow-sm:     0 2px 8px rgba(14,60,120,.07);
  --shadow-md:     0 4px 20px rgba(14,60,120,.11);
  --shadow-lg:     0 12px 40px rgba(14,60,120,.16);
  --shadow-accent: 0 4px 14px rgba(30,106,191,.35);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --transition:    .22s ease;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-page); color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-size: 14px; line-height: 1.55;
}
a { color: inherit; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  background: var(--bg-sidebar); color: var(--text-on-dark);
  padding: 18px 14px; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px;
  color: var(--ac-white);
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
  letter-spacing: .01em;
}
.sidebar .brand .brand-icon {
  font-size: 22px; line-height: 1; color: var(--ac-blue-400);
  display: inline-flex;
  filter: drop-shadow(0 0 8px rgba(45,140,232,.7));
}
.brand .brand-icon svg { width: 1em; height: 1em; display: block; }
.sidebar .brand strong { font-weight: 700; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; overflow-y: auto; }
.sidebar nav a {
  padding: 8px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-on-dark);
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sidebar nav a:hover    { background: var(--bg-sidebar-hover); color: var(--ac-white); }
.sidebar nav a.active   { background: var(--bg-sidebar-active); color: var(--ac-white); box-shadow: inset 3px 0 0 var(--ac-blue-400); }

/* Collapsible nav groups (<details>); enhanced by /static/nav.js which
   marks the active link and auto-opens its group. Works without JS too. */
.sidebar nav .nav-group { margin-top: 8px; }
.sidebar nav .nav-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ac-gray-400);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar nav .nav-group > summary::-webkit-details-marker { display: none; }
.sidebar nav .nav-group > summary::after {
  content: '\203a'; font-size: 15px; line-height: 1;
  transition: transform var(--transition);
}
.sidebar nav .nav-group[open] > summary::after { transform: rotate(90deg); }
.sidebar nav .nav-group > summary:hover { color: var(--text-on-dark); }
/* Links inside a <details> are inline <a> in a block container, so they
   would flow side by side. Force each onto its own row. */
.sidebar nav .nav-group > a { display: block; margin-left: 8px; font-size: 13.5px; }

.userbox {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px; margin-top: 14px; font-size: 13px; color: var(--text-on-dark);
}
.userbox .who   { font-weight: 600; color: var(--ac-white); }
.userbox .role  { color: var(--ac-gray-400); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.userbox a { color: var(--ac-blue-300); font-size: 13px; text-decoration: none; }
.userbox a:hover { text-decoration: underline; }
.userbox button.link { background: none; color: var(--ac-blue-300); padding: 0; font-size: 13px; border: none; cursor: pointer; box-shadow: none; }
.userbox button.link:hover { text-decoration: underline; background: none; transform: none; box-shadow: none; }

/* ---- MAIN ---- */
.main { padding: 28px 36px; max-width: 1500px; }
h1 { margin: 0 0 18px; font-size: 24px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
h2 { margin: 24px 0 12px; font-size: 17px; font-weight: 600; color: var(--text-primary); }
h3 { font-size: 15px; font-weight: 600; }

/* ---- CARDS ---- */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.card summary { font-weight: 600; cursor: pointer; padding: 4px 0; }

/* KPIs — dashboard hero numbers */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--ac-blue-500), var(--ac-blue-300));
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .08em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--ac-blue-700); font-variant-numeric: tabular-nums; }

/* ---- DASHBOARD ---- */
.dash-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.dash-head .greeting { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.dash-head .date { color: var(--text-muted); font-size: 13px; }
.dash-section {
  margin: 22px 0 10px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint);
}

/* Clickable KPI: the whole card is an <a>, with an icon and accent. */
a.kpi { display: block; text-decoration: none; color: inherit; }
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ac-blue-300); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--ac-blue-50); color: var(--ac-blue-600);
}
.kpi .kpi-icon svg { width: 18px; height: 18px; display: block; }
.kpi .kpi-go { color: var(--text-faint); font-size: 16px; opacity: 0; transition: opacity var(--transition); }
a.kpi:hover .kpi-go { opacity: 1; }
.kpi .hint { margin-top: 4px; font-size: 11px; color: var(--text-faint); }
.kpi.acc-green::before  { background: linear-gradient(90deg,#16a34a,#22c55e); }
.kpi.acc-green  .kpi-icon { background:#dcfce7; color:#166534; }
.kpi.acc-amber::before  { background: linear-gradient(90deg,#d97706,#f59e0b); }
.kpi.acc-amber  .kpi-icon { background:#fef3c7; color:#92400e; }
.kpi.acc-red::before    { background: linear-gradient(90deg,#dc2626,#ef4444); }
.kpi.acc-red    .kpi-icon { background:#fee2e2; color:#991b1b; }
.kpi.acc-violet::before { background: linear-gradient(90deg,#7c3aed,#a78bfa); }
.kpi.acc-violet .kpi-icon { background:#ede9fe; color:#5b21b6; }
.kpi .value.warn { color: #b45309; }

/* ---- TABLES ---- */
table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
th, td { text-align: left; padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--ac-gray-100); }
th {
  background: var(--bg-table-head); font-weight: 600;
  color: var(--text-muted); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--ac-blue-50); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-warn { background: #fef2f2; }

/* ---- BADGES ---- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge.in_stock { background: #dcfce7; color: #166534; }
.badge.sold     { background: var(--ac-blue-100); color: var(--ac-blue-700); }
.badge.open     { background: var(--ac-blue-50); color: var(--ac-blue-600); }
.badge.closed   { background: var(--ac-gray-100); color: var(--text-muted); }
.badge.approved { background: #dcfce7; color: #166534; }

/* ---- BUTTONS ---- */
button, .btn-link {
  background: var(--accent); color: var(--ac-white); border: none;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; cursor: pointer; font-weight: 600;
  text-decoration: none; display: inline-block;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-accent);
  font-family: inherit;
}
button:hover, .btn-link:hover {
  background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30,106,191,.4);
}
button.secondary {
  background: var(--ac-white); color: var(--ac-blue-700);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
button.secondary:hover { background: var(--ac-blue-50); border-color: var(--ac-blue-300); box-shadow: var(--shadow-md); }
button.link { background: transparent; padding: 0; box-shadow: none; color: var(--ac-blue-500); font-weight: 500; }
button.link:hover { background: transparent; transform: none; box-shadow: none; }
button:disabled, button[disabled] { background: var(--ac-gray-200); color: var(--text-faint); cursor: not-allowed; box-shadow: none; transform: none; }
button:disabled:hover { background: var(--ac-gray-200); transform: none; box-shadow: none; }

/* ---- FORMS ---- */
input, select, textarea {
  padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  font-family: inherit; width: 100%;
  background: var(--ac-white); color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ac-blue-500);
  box-shadow: 0 0 0 3px rgba(30,106,191,.15);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; padding: 14px 0; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .08em; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid label.checkbox { flex-direction: row; align-items: center; text-transform: none; font-size: 14px; letter-spacing: 0; color: var(--text-primary); font-weight: 500; }
.form-grid label.checkbox input { width: auto; }

.inline { display: inline; }
.inline input[type=number] { width: 80px; display: inline-block; }
.muted { color: var(--text-muted); font-size: 13px; }
.error { background: #fef2f2; color: #b91c1c; padding: 11px 13px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 13px; border: 1px solid #fecaca; }
.actions { margin: 18px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- PRINT-FORM CHROME (screen view; print.css overrides on paper) ---- */
.form-page {
  max-width: 8.5in; margin: 28px auto; padding: 32px 40px;
  background: var(--ac-white); color: #1f2937;
  font-family: Georgia, 'Times New Roman', serif;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.form-page header.form-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 18px; }
.form-page .form-meta { font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: var(--ac-blue-900); }
.form-page .form-cite { font-size: 12px; margin-top: 2px; color: var(--text-muted); }
.form-page .form-actions { display: flex; gap: 8px; align-items: center; }
.form-page .form-actions a { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.form-page .form-actions a:hover { color: var(--ac-blue-500); }
.form-page footer.form-footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }
.form-page .form-grid-print { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin-bottom: 8px; }
.form-page .form-grid-print .field { border-bottom: 1px solid var(--ac-gray-200); padding: 4px 0; }
.form-page .form-grid-print .field label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); display: block; letter-spacing: .04em; }
.form-page .form-grid-print .field .v { font-size: 14px; min-height: 18px; }
.form-page .full { grid-column: 1 / -1; }
.form-page .sig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.form-page .sig-row .sig-block { border-top: 1px solid var(--ac-gray-800); padding-top: 4px; }
.form-page .sig-row .sig-block .role { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.form-page .cert-block { border: 1px solid var(--ac-gray-800); padding: 12px 16px; font-size: 13px; margin: 16px 0; border-radius: 4px; background: var(--ac-gray-50); }
.form-page h2 { font-size: 14px; text-transform: uppercase; border-bottom: 1px solid var(--ac-gray-800); padding-bottom: 4px; margin: 24px 0 8px; color: var(--ac-blue-900); letter-spacing: .04em; }
.form-page table { box-shadow: none; border-radius: 0; }
.form-page tbody tr:hover td { background: transparent; }

/* Reg-Z federal box — LEGAL ARTIFACT (HANDOFF rule #2). Restyle the
   chrome around it but never the box itself: five fields, that order,
   those headers, that hierarchy — verbatim from 12 CFR §1026.18(d). */
.reg-z-box { border: 2px solid var(--ac-gray-800); border-collapse: collapse; margin-bottom: 16px; }
.reg-z-box th, .reg-z-box td { border: 1px solid var(--ac-gray-800); padding: 8px 10px; vertical-align: top; }
.reg-z-box thead th { background: var(--ac-gray-800); color: white; font-weight: 700; text-transform: uppercase; font-size: 12px; }
.reg-z-box thead tr:nth-child(2) th { background: var(--ac-gray-50); color: var(--ac-gray-800); font-weight: 400; font-size: 11px; text-transform: none; font-style: italic; }
.reg-z-num { font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; padding: 16px 12px; background: var(--ac-white); }

.itemization { background: transparent; border: none; box-shadow: none; }
.itemization tbody tr:hover td { background: transparent; }

/* ---- INVENTORY LIST (AutoMatrix-style grid with thumbnails) ---- */
.inv-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.inv-toolbar .btn-link { padding: 8px 16px; }
.inv-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 720px;
}
.inv-search input[type=search] {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.inv-search select { padding: 8px 10px; font-size: 13px; }
.inv-count { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.inv-count strong { color: var(--ac-blue-700); font-variant-numeric: tabular-nums; }

.inv-table { box-shadow: var(--shadow-sm); }
.inv-table th, .inv-table td { vertical-align: top; }
.inv-table th { font-size: 10px; padding: 10px 12px; }
.inv-table td { padding: 12px; }
.inv-th-thumb { width: 130px; }

.inv-thumb-cell { position: relative; }
.inv-thumb {
  display: block; position: relative;
  width: 110px; height: 70px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--ac-gray-100);
  border: 1px solid var(--border);
}
.inv-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.inv-thumb-none {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 10px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .08em;
}
.inv-photo-count {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(10, 22, 40, .8); color: var(--ac-white);
  padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.inv-vehicle-cell { min-width: 260px; }
.inv-vehicle-link {
  display: block; text-decoration: none; color: var(--text-primary);
  line-height: 1.3;
}
.inv-yr-make { font-size: 13px; font-weight: 600; color: var(--ac-blue-700); }
.inv-make { font-size: 13px; font-weight: 600; }
.inv-model { font-size: 13px; color: var(--text-muted); }
.inv-vin { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.inv-vin code { font-size: 11px; }
.inv-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px; align-items: center;
}
.inv-meta .inv-stock,
.inv-meta .inv-body { font-size: 11px; color: var(--text-muted); }
.inv-meta .inv-stock strong { color: var(--text-primary); font-weight: 600; }
.inv-note {
  max-width: 240px; font-size: 12px; color: var(--text-muted);
  white-space: pre-wrap;
}

.badge.in_transit  { background: #fef3c7; color: #92400e; }
.badge.in_stock    { background: #dcfce7; color: #166534; }
.badge.wholesaled  { background: var(--ac-gray-100); color: var(--text-muted); }
.badge.recall_hold { background: #fee2e2; color: #991b1b; }
.badge.deal_pending{ background: #fef9c3; color: #854d0e; }
.badge.not-advertised { background: #fed7aa; color: #9a3412; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.in_progress { background: #dbeafe; color: #1e40af; }
.badge.open { background: var(--ac-blue-50); color: var(--ac-blue-600); }
.badge.cancelled { background: var(--ac-gray-100); color: var(--text-muted); }

/* ---- VEHICLE DETAIL (AutoMatrix-style depth) ---- */
.veh-pager {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.veh-pager .veh-back { color: var(--text-muted); font-size: 13px; text-decoration: none; }
.veh-pager .veh-back:hover { color: var(--ac-blue-500); }
.veh-pager .veh-stock { font-weight: 700; color: var(--ac-blue-700); font-size: 16px; }
.veh-pager-spacer { flex: 1; }
.veh-pager a, .veh-pager span.disabled {
  font-size: 13px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ac-blue-700); background: var(--ac-white);
}
.veh-pager span.disabled { opacity: 0.4; }
.veh-pager a:hover { background: var(--ac-blue-50); border-color: var(--ac-blue-300); }

.veh-status-banner {
  padding: 10px 18px; margin-bottom: 14px;
  border-radius: var(--radius-sm);
  font-weight: 700; text-align: center; letter-spacing: .04em;
}
.veh-status-banner.banner-warn { background: #fef9c3; color: #854d0e; }
.veh-status-banner.banner-info { background: #dbeafe; color: #1e40af; }
.veh-status-banner.banner-good { background: #dcfce7; color: #166534; }
.veh-status-banner.banner-bad  { background: #fee2e2; color: #991b1b; }

.veh-detail { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

.veh-summary {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 16px; align-self: start;
}
.veh-photo {
  width: 100%; aspect-ratio: 16/10; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--ac-gray-100);
  margin-bottom: 12px; border: 1px solid var(--border);
}
.veh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.veh-photo-none {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-faint); font-size: 12px;
  text-transform: uppercase; letter-spacing: .08em;
}

/* AI document intake on the open-deal page. */
.intake-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.intake-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.intake-status { min-height: 1em; margin: 10px 0 0; font-size: 13px; }
.intake-status.ok   { color: #166534; }
.intake-status.warn { color: #b45309; }
.intake-meta, .intake-veh { font-size: 13px; margin: 8px 0; }
.intake-veh { color: var(--ac-blue-700); }
table.intake-fields { margin-top: 10px; }
table.intake-fields td, table.intake-fields th { font-size: 12px; padding: 4px 8px; }
.intake-note { margin-top: 8px; font-size: 12px; }
input.ai-filled, .ai-filled { background: #ecfdf5; }

/* Multi-file drop zone + staged-file list. */
.intake-drop {
  flex: 1 1 320px; min-height: 64px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 14px 16px; border: 2px dashed var(--ac-border, #cbd5e1);
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #475569; transition: border-color .15s, background .15s;
}
.intake-drop:hover, .intake-drop.dragover { border-color: var(--ac-blue-700, #1d4ed8); background: #f8fafc; }
.intake-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.intake-files { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.intake-file-row {
  display: grid; grid-template-columns: 18px minmax(80px, 1fr) auto minmax(0, 1.4fr) 24px;
  align-items: center; gap: 10px; font-size: 13px; padding: 6px 8px; border: 1px solid var(--ac-border, #e2e8f0); border-radius: 6px;
}
.intake-file-row .if-icon { text-align: center; }
.intake-file-row.status-ok    .if-icon { color: #166534; }
.intake-file-row.status-error .if-icon { color: #991b1b; }
.intake-file-row .if-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-file-row .if-type { font-size: 12px; padding: 3px 6px; }
.intake-file-row .if-detail { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-file-row .if-err { color: #991b1b; }
.intake-file-row .if-remove {
  border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: #94a3b8; padding: 0;
}
.intake-file-row .if-remove:hover { color: #991b1b; }
.intake-file-result { margin: 8px 0; font-size: 13px; }
.intake-file-result > summary { cursor: pointer; padding: 4px 0; }

/* Discrepancy modal — current vs document-extracted values. */
.intake-diff { max-width: 640px; }
.intake-diff-table { width: 100%; margin: 10px 0; }
.intake-diff-table td, .intake-diff-table th { font-size: 13px; padding: 6px 8px; vertical-align: top; }
.intake-diff-table .diff-cur { color: #991b1b; }
.intake-diff-table .diff-new { color: #166534; font-weight: 600; }
.intake-diff .diff-block { margin: 10px 0; padding: 8px 10px; border: 1px solid var(--ac-border, #e2e8f0); border-radius: 6px; }
.intake-diff .diff-field { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.intake-diff .diff-opt { display: block; font-size: 13px; padding: 3px 0; cursor: pointer; }
.intake-diff .diff-opt .diff-cur { color: #991b1b; font-weight: 600; }
.intake-diff .diff-opt .diff-new { color: #166534; font-weight: 600; }

/* Photos panel — upload form + thumbnail grid with delete affordance. */
.photo-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.photo-cell {
  position: relative; margin: 0; aspect-ratio: 16/10; overflow: hidden;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--ac-gray-100);
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell figcaption { position: absolute; left: 6px; bottom: 6px; }
.photo-del { position: absolute; top: 4px; right: 4px; margin: 0; }
.photo-del button {
  width: 24px; height: 24px; padding: 0; line-height: 1;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(17,17,17,.6); color: #fff; font-size: 16px;
}
.photo-del button:hover { background: #b91c1c; }
.veh-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.veh-kpis > div { text-align: center; }
.veh-kpis .lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.veh-kpis .val { font-size: 14px; font-weight: 700; color: var(--ac-blue-700); margin-top: 2px; font-variant-numeric: tabular-nums; }

.veh-id { padding: 12px 0; }
.veh-yr-mk { font-size: 16px; font-weight: 700; color: var(--ac-blue-700); }
.veh-id .veh-model { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.veh-line { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.veh-line code { font-size: 11px; }

.veh-status-form { margin: 10px 0; }
.veh-status-form select { width: 100%; }

.veh-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.veh-tags-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.veh-tag {
  background: var(--ac-blue-50); color: var(--ac-blue-700);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.veh-tag-x {
  background: transparent; color: var(--ac-blue-700);
  padding: 0; font-size: 14px; line-height: 1;
  border: 0; cursor: pointer; box-shadow: none;
}
.veh-tag-x:hover { color: #b91c1c; background: transparent; transform: none; box-shadow: none; }
.veh-tag-add input {
  padding: 4px 8px; font-size: 11px; width: 100px;
  border: 1px dashed var(--border); border-radius: 999px;
}

.veh-externals { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.veh-ext-link {
  display: block; padding: 6px 10px; font-size: 12px;
  text-decoration: none; color: var(--ac-blue-700);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; background: var(--ac-white);
}
.veh-ext-link:hover { background: var(--ac-blue-50); border-color: var(--ac-blue-300); }

.veh-panels { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.veh-pricing-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px;
}
.veh-pricing-grid label {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ac-blue-700);
}
.veh-pricing-grid input { padding: 5px 8px; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.veh-pricing-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.veh-pricing-summary > div { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.veh-pricing-summary label { font-size: 12px; font-weight: 600; color: var(--ac-blue-700); }
.veh-pricing-summary span { font-size: 16px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.veh-pricing-summary span.neg { color: #b91c1c; }

.veh-note {
  padding: 8px 12px; border-left: 3px solid var(--ac-blue-300);
  background: var(--ac-gray-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 8px;
}
.veh-note-body { font-size: 13px; white-space: pre-wrap; }
.veh-note-meta { font-size: 11px; margin-top: 4px; }

table.line-grid tfoot td { padding: 8px; font-size: 12px; background: var(--ac-gray-50); }

/* ---- DEAL WORKSPACE (DT-style tabs) ---- */
.deal-toolbar {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.deal-toolbar-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-primary);
  font-size: 13px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.deal-toolbar-item:hover { background: var(--ac-blue-50); color: var(--ac-blue-700); }
.deal-toolbar-item .dt-icon { font-size: 16px; line-height: 1; color: var(--ac-blue-500); display: inline-flex; }
.deal-toolbar-item .dt-icon svg { width: 16px; height: 16px; display: block; }
.deal-toolbar-spacer { flex: 1; }

.deal-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; }
.deal-header h1 { font-size: 26px; margin: 0; }
.deal-header p  { margin: 6px 0; color: var(--text-muted); font-size: 14px; }

.deal-workspace { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.deal-rail {
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border); padding-right: 10px;
  max-height: calc(100vh - 240px); overflow-y: auto;
  position: sticky; top: 16px;
}
.deal-rail a {
  flex: 0 0 auto;
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--text-primary); text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deal-rail a:hover { background: var(--ac-blue-50); color: var(--ac-blue-700); }
.deal-rail a.active {
  background: var(--ac-blue-500); color: var(--ac-white);
  font-weight: 600; border-left-color: var(--ac-blue-700);
  box-shadow: var(--shadow-accent);
}
.deal-pane { min-width: 0; }

.deal-pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
}
.deal-pager a, .deal-pager span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  background: var(--ac-white); color: var(--ac-blue-700);
  border: 1px solid var(--border); font-weight: 600; font-size: 14px;
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}
.deal-pager a:hover { background: var(--ac-blue-50); border-color: var(--ac-blue-300); }
.deal-pager span.disabled { opacity: 0.4; cursor: not-allowed; }

/* Reynolds-style two-column block layout used by Recap, Aftermarkets summary, etc. */
.dt-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dt-block {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.dt-block h3 {
  font-size: 12px; text-transform: uppercase; color: var(--text-muted);
  letter-spacing: .08em; border-bottom: 1px solid var(--border);
  padding-bottom: 8px; margin: 0 0 12px;
}
.dt-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 10px; padding: 4px 0; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.dt-row.head { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.dt-row .num { text-align: right; min-width: 80px; }
.dt-row.total { border-top: 1px solid var(--ac-gray-200); padding-top: 8px; margin-top: 8px; font-weight: 700; }

/* Dense line-grid table used by Aftermarkets, Rebates, Dealer Fees, Warranty 4-slot, We Owes */
table.line-grid { font-size: 13px; }
table.line-grid th { padding: 6px 8px; font-size: 10px; }
table.line-grid td { padding: 4px 6px; }
table.line-grid input, table.line-grid select { padding: 5px 7px; font-size: 13px; }
table.line-grid input[type=checkbox] { width: auto; }
table.line-grid input.num { text-align: right; font-variant-numeric: tabular-nums; }
table.line-grid .row-idx { color: var(--text-muted); text-align: right; padding-right: 6px; width: 28px; font-variant-numeric: tabular-nums; }

/* Card-style 4-slot grid (Warranty ESC/Maintenance), 3-slot trade-in */
.slot-grid { display: grid; gap: 14px; }
.slot-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.slot-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.slot-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.slot-card h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 0 0 10px;
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.slot-card label { display: block; font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .08em; margin-top: 8px; }
.slot-card input, .slot-card select { padding: 6px 8px; font-size: 13px; margin-top: 2px; }

/* Hint rows under fields (e.g. "Allowance -14,000.00 Over" in Trade-In) */
.hint-row { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.hint-row.over { color: #b91c1c; }
.hint-row.under { color: #166534; }

/* Inline two-column rate display (e.g. Selling Rate vs Buy Rate on Recap) */
.dt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.dt-pair label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .08em; }

/* ---- CUSTOMER SEARCH MODAL ---- */
.cs-dialog { border: none; border-radius: var(--radius); padding: 28px; min-width: 480px; max-width: 90vw; box-shadow: var(--shadow-lg); }
.cs-dialog::backdrop { background: rgba(10,22,40,.6); backdrop-filter: blur(2px); }
.cs-dialog h2 { margin: 0 0 14px; }
.cs-dialog input[type=search] { padding: 11px 14px; font-size: 16px; }
.cs-results { list-style: none; padding: 0; margin: 14px 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cs-results:empty { display: none; }
.cs-result { padding: 10px 12px; border-bottom: 1px solid var(--ac-gray-100); cursor: pointer; }
.cs-result:last-child { border-bottom: none; }
.cs-result:hover, .cs-result:focus { background: var(--ac-blue-50); outline: none; }
.cs-name { font-weight: 600; }
.cs-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cs-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.cs-pick { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--ac-white); }
.cs-pick .cs-pick-name { font-weight: 600; flex: 1; }
.cs-pick .cs-pick-name.muted { font-weight: normal; color: var(--text-faint); }

/* ---- LOGIN ---- */
.login-bg {
  background: linear-gradient(135deg, var(--ac-blue-900) 0%, var(--ac-blue-700) 60%, var(--ac-blue-500) 100%);
  min-height: 100vh; display: grid; place-items: center; margin: 0;
  position: relative; overflow: hidden;
}
.login-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(45,140,232,.20) 0%, transparent 60%);
  pointer-events: none;
}
.login-card {
  background: var(--ac-white); padding: 36px; border-radius: var(--radius);
  width: 380px; box-shadow: var(--shadow-lg);
  position: relative; z-index: 2;
}
.login-card .brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 20px; margin-bottom: 4px; color: var(--ac-blue-900); }
.login-card .brand .brand-icon { font-size: 26px; color: var(--ac-blue-600); display: inline-flex; filter: drop-shadow(0 0 8px rgba(45,140,232,.5)); }
.login-card .brand strong { font-weight: 700; }
.login-card h1 { margin: 0; font-size: 22px; text-align: center; color: var(--text-primary); }
.login-card p.muted { text-align: center; margin: 6px 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .08em; }
.login-card button { margin-top: 10px; padding: 12px; width: 100%; }

/* ---- Phase B (013): closing shallow surfaces -------------------- */

/* Trade-In slot navigation chips */
.slot-strip { display: flex; gap: 8px; margin: 12px 0 16px; }
.slot-chip {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--ac-gray-200); background: var(--ac-white);
  color: var(--text-secondary);
}
.slot-chip.empty { color: var(--text-muted); border-style: dashed; }
.slot-chip.filled { color: var(--ac-blue-700); border-color: var(--ac-blue-200); background: var(--ac-blue-50); }
.slot-chip.active {
  background: var(--ac-blue-500); color: #fff; border-color: var(--ac-blue-500);
  box-shadow: 0 0 0 2px rgba(45,140,232,.18);
}

/* Alerts page */
.alert-counts { display: flex; gap: 10px; margin: 8px 0 18px; }
.alerts-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.alerts-table th, .alerts-table td { padding: 10px 12px; border-bottom: 1px solid var(--ac-gray-200); text-align: left; vertical-align: middle; }
.alerts-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .06em; }
.alert-row.severity-critical { background: rgba(220, 38, 38, .04); }
.alert-row.severity-warning  { background: rgba(202, 138, 4, .04); }
.alert-row.severity-info     { background: rgba(45, 140, 232, .04); }
.badge.critical { background: #dc2626; color: #fff; }
.badge.warning  { background: #ca8a04; color: #fff; }
.badge.info     { background: var(--ac-blue-500); color: #fff; }

/* Suppress Sensitive Info — toolbar visual indicator */
.deal-toolbar.suppressed {
  background: linear-gradient(90deg, rgba(220,38,38,.08) 0%, rgba(220,38,38,.02) 100%);
  border-color: rgba(220, 38, 38, .25);
}
.deal-toolbar.suppressed::after {
  content: "PII masked"; margin-left: 8px; font-size: 11px;
  color: #b91c1c; font-weight: 600;
}

/* Vendor residual lookup form */
.vendor-lookup-form {
  margin: 16px 0; padding: 14px 18px;
  background: var(--ac-blue-50); border: 1px solid var(--ac-blue-200);
  border-radius: 10px;
}
.vendor-lookup-form h3 { margin-top: 0; }
.vendor-lookup-form .form-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }

/* ---- Phase U (017): Reg M federal lease disclosure box ------------ */
.reg-m-box {
  border: 2px solid var(--ac-blue-900);
  background: var(--ac-white);
  padding: 18px;
  border-radius: 6px;
  margin-top: 14px;
}
.reg-m-header {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--ac-gray-200);
}
.reg-m-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .08em; font-weight: 600; }
.reg-m-value { font-size: 14px; font-weight: 600; margin-top: 2px; }
.reg-m-sub { font-size: 11px; color: var(--text-muted); }
.reg-m-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
.reg-m-cell { border: 1px solid var(--ac-gray-200); padding: 14px; border-radius: 4px; background: var(--ac-gray-50); }
.reg-m-cell.big { grid-column: span 1; text-align: center; background: var(--ac-blue-50); border-color: var(--ac-blue-300); }
.reg-m-title { font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .08em; margin-bottom: 8px; color: var(--ac-blue-900); border-bottom: 1px solid var(--ac-gray-200); padding-bottom: 4px; }
.reg-m-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.reg-m-table td { padding: 4px 0; }
.reg-m-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.reg-m-table tr.total td { border-top: 1px solid var(--ac-gray-200); padding-top: 6px; }
.reg-m-big { font-size: 28px; color: var(--ac-blue-700); margin: 14px 0 8px; font-variant-numeric: tabular-nums; }
.reg-m-block { margin-top: 14px; padding: 12px; border-top: 1px solid var(--ac-gray-200); }
/* =============================================================
   SHARED COMPONENTS (polish pass 2026-05-31)
   Classes referenced across templates that previously had no CSS:
   .btn anchors, page headers, form cards, KPI grids, key/value
   lists, accent cards, override boxes, CTA rows. Built on the
   existing tokens so the look stays consistent site-wide.
   ============================================================= */

/* Anchor buttons (templates use <a class="btn">; only <button> was styled). */
.btn {
  display: inline-block; background: var(--accent); color: var(--ac-white);
  border: none; padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30,106,191,.4); }
.btn.secondary, a.btn.secondary {
  background: var(--ac-white); color: var(--ac-blue-700);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { background: var(--ac-blue-50); border-color: var(--ac-blue-300); box-shadow: var(--shadow-md); }
.btn.btn-primary { background: var(--accent); color: var(--ac-white); }
/* Destructive actions (close deal, override, delete). */
.btn.danger, button.danger {
  background: #dc2626; color: #fff; box-shadow: 0 4px 14px rgba(220,38,38,.30);
}
.btn.danger:hover, button.danger:hover { background: #b91c1c; box-shadow: 0 6px 18px rgba(220,38,38,.40); }

/* Page header band — title + actions on one line. */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 0 0 18px;
}
.page-header h1 { margin: 0; }
.page-header .muted { margin: 2px 0 0; }

/* CTA / quick-action row of buttons. */
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }

/* Form cards (centered single-column forms: incident, ad, comm entry). */
.form-card, .grid-form {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm);
  max-width: 760px; margin-bottom: 18px;
}
.form-card label, .grid-form > label {
  display: block; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; font-weight: 600; letter-spacing: .08em;
  margin: 0 0 14px;
}
.form-card label > input, .form-card label > select, .form-card label > textarea,
.grid-form > label > input, .grid-form > label > select, .grid-form > label > textarea {
  margin-top: 5px; text-transform: none; font-weight: 400; letter-spacing: 0;
}
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; align-items: start; }
.grid-form > label.full, .grid-form .full { grid-column: 1 / -1; }
.grid-form .form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 4px; }
/* Inline checkbox label (don't uppercase, keep checkbox beside text). */
.inline-check, label.inline-check, label.checkbox {
  display: flex; align-items: flex-start; gap: 8px;
  text-transform: none; font-weight: 500; letter-spacing: 0;
  font-size: 13.5px; color: var(--text-primary);
}
.inline-check input, label.checkbox input { width: auto; margin-top: 2px; }

/* Inline action forms sitting side by side (incident detail actions). */
.inline-form { display: inline-flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0 14px 12px 0; }
.inline-form label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: .08em; display: flex; flex-direction: column; gap: 4px; }

/* Override disclosure box on the deal close card. */
.override-box { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.override-box > summary { font-size: 13px; font-weight: 600; color: var(--ac-blue-600); cursor: pointer; }
.override-box > summary:hover { color: var(--ac-blue-700); }
.override-box label { display: block; font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: .08em; margin: 10px 0 12px; }
.override-box label input { margin-top: 5px; text-transform: none; font-weight: 400; letter-spacing: 0; max-width: 420px; }

/* Accent / status card (danger banner on overdue incidents, etc.). */
.card-danger {
  border-left: 4px solid #dc2626; background: #fef2f2;
}
.card.card-danger { background: #fef2f2; border-color: #fecaca; border-left: 4px solid #dc2626; }

/* Section subhead used on landing/register pages. */
.section-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin: 22px 0 10px; }

/* Generic data table alias (.data == .table look). */
table.data { width: 100%; border-collapse: collapse; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }

/* Key/value description lists (incident detail, summaries). */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 6px 0 0; }
dl.kv dt { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Generic KPI-card grid (compliance/security pages use kpi-grid + kpi-card). */
.kpi-grid, .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 6px; }
.kpi-grid .kpi, .kpi-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.kpi-card { align-items: flex-start; }
.kpi-label, .kpi .kpi-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .08em; order: 2; }
.kpi-value, .kpi .kpi-value { font-size: 26px; font-weight: 700; color: var(--ac-blue-700); font-variant-numeric: tabular-nums; order: 1; }
.kpi-meta, .kpi .kpi-meta { font-size: 11px; color: var(--text-faint); order: 3; margin-top: 2px; }

/* Badge variants referenced but undefined. */
.badge.ok       { background: #dcfce7; color: #166534; }
.badge.active   { background: var(--ac-blue-100); color: var(--ac-blue-700); }
.badge.danger   { background: #fee2e2; color: #991b1b; }
.badge.badge-danger { background: #dc2626; color: #fff; }
.badge.badge-active { background: #dcfce7; color: #166534; }

/* Print-only artifacts (document-control line, printed legal notice) are
   hidden in the on-screen rendering; print.css reveals them on paper. */
.print-only { display: none; }

@media print {
  .reg-m-box { border-color: #000; }
  .deal-toolbar, .deal-rail, .deal-pager, .sidebar { display: none !important; }
}

/* ===================================================================
   Deal-action workflow engine (D1) — board, lifecycle, tasks.
   =================================================================== */
.wf-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr);
  gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.wf-col { background: var(--ac-gray-50); border: 1px solid var(--border); border-radius: 12px;
  border-top: 3px solid var(--accent); min-height: 80px; }
.wf-col-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); }
.wf-col-count { background: var(--ac-white); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; font-size: 11px; color: var(--text-primary); }
.wf-col-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; }
.wf-empty { text-align: center; padding: 6px 0; }
.wf-card { display: block; background: var(--ac-white); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s, border-color .08s; }
.wf-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--ac-blue-300); }
.wf-card.overdue { border-left: 3px solid #dc2626; }
.wf-card.done { opacity: .7; }
.wf-card-top { display: flex; justify-content: space-between; align-items: baseline; }
.wf-card-age { font-size: 11px; }
.wf-card-buyer { font-size: 13px; margin-top: 2px; }
.wf-card-veh { font-size: 11px; margin-top: 1px; }
.wf-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
/* Stage accent stripes. */
.wf-col.accent-amber  { border-top-color: #d97706; }
.wf-col.accent-blue   { border-top-color: var(--ac-blue-500); }
.wf-col.accent-indigo { border-top-color: #4f46e5; }
.wf-col.accent-teal   { border-top-color: #0d9488; }
.wf-col.accent-violet { border-top-color: #7c3aed; }
.wf-col.accent-green  { border-top-color: #16a34a; }
.wf-col.accent-slate  { border-top-color: var(--ac-gray-400); }

/* Notifications inbox. */
.wf-notifs { margin: 6px 0 18px; }
.wf-notif { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ac-white); border: 1px solid var(--border); border-left: 3px solid var(--ac-gray-400);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.wf-notif.warning  { border-left-color: #d97706; }
.wf-notif.critical { border-left-color: #dc2626; }
.wf-notif-meta { font-size: 11px; margin-top: 2px; }

/* Lifecycle progress strip (deal tab). */
.wf-progress { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 16px; }
.wf-step { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px;
  border-radius: 999px; background: var(--ac-gray-100); font-size: 12px; color: var(--text-muted); }
.wf-step-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ac-gray-400); flex: none; }
.wf-step.done { background: #dcfce7; color: #166534; }
.wf-step.done .wf-step-dot { background: #16a34a; }
.wf-step.current { background: var(--ac-blue-50); color: var(--ac-blue-700); font-weight: 700; }
.wf-step.current .wf-step-dot { background: var(--ac-blue-500); box-shadow: 0 0 0 3px var(--ac-blue-100); }

.wf-status { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.wf-status-stage { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.wf-advance summary, .wf-addtask summary { cursor: pointer; color: var(--text-muted); font-size: 13px; }
.wf-tasks .wf-t-done td { color: var(--text-faint); }
.wf-tasks .wf-t-skip td { color: var(--text-faint); text-decoration: line-through; }
.wf-t-actions { white-space: nowrap; text-align: right; }
.wf-check { display: inline-flex; align-items: center; gap: 6px; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

/* ===================================================================
   Native video (D2) — record, detail, public watch page.
   =================================================================== */
.video-detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.vd-player video, .vr-stage video, .watch-stage video {
  width: 100%; background: #000; border-radius: var(--radius); display: block; }
.vd-player { margin-bottom: 14px; }
.vd-manage { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cta-list { list-style: none; padding: 0; margin: 0 0 10px; }
.cta-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.share-link-banner { background: var(--ac-blue-50); border-color: var(--ac-blue-300); }
.share-link-input { width: 100%; margin-top: 6px; font-family: ui-monospace, monospace; font-size: 12px; }
.danger-text { color: #dc2626 !important; }

/* Record page */
.vr-stage { max-width: 640px; }
.vr-stage video { aspect-ratio: 16/10; }
.vr-controls { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.vr-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
#vr-record { background: #dc2626; color: #fff; }
#vr-record:hover:not(:disabled) { background: #b91c1c; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* Public watch page (no sidebar) */
body.video-watch { background: var(--ac-blue-900); display: flex; justify-content: center;
  align-items: flex-start; min-height: 100vh; }
.watch-card { max-width: 760px; width: 100%; margin: 24px 16px; background: var(--bg-surface);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-md); }
.watch-brand { font-weight: 700; color: var(--ac-blue-700); letter-spacing: .01em; }
.watch-title { font-size: 22px; margin: 4px 0 14px; }
.watch-stage { border-radius: var(--radius); overflow: hidden; }
.watch-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.watch-cta { display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 11px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-accent); }
.watch-cta:hover { background: var(--accent-hover); }
.watch-foot { margin-top: 16px; font-size: 12px; }
@media (max-width: 880px) { .video-detail-grid { grid-template-columns: 1fr; } }

/* ===================================================================
   Developer console (D4) + public API docs.
   =================================================================== */
.dev-actions { white-space: nowrap; }
.dev-actions form { display: inline; }
.dev-actions .link { margin-right: 8px; }
body.api-docs { background: var(--bg-page); }
.docs-card { max-width: 820px; margin: 32px auto; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.docs-card h2 { margin-top: 22px; }
.docs-card pre { background: var(--ac-gray-50); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px; }
.docs-card code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===================================================================
   Data export (D3 "gets out") + status page (D3 "stays up").
   =================================================================== */
.export-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.export-cta .btn { white-space: nowrap; }

body.status-page { background: var(--bg-page); display: flex; justify-content: center; align-items: flex-start; }
.status-card { max-width: 560px; width: 100%; margin: 48px 16px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); text-align: center; }
.status-brand { font-size: 15px; color: var(--ac-blue-700); margin-bottom: 14px; }
.status-hero { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700;
  padding: 12px 20px; border-radius: 999px; margin-bottom: 18px; }
.status-hero.ok { background: #dcfce7; color: #166534; }
.status-hero.down { background: #fee2e2; color: #991b1b; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 4px rgba(22,101,52,.15); }
.status-hero.down .status-dot { box-shadow: 0 0 0 4px rgba(153,27,27,.15); }
.status-table { text-align: left; }
.status-table td:first-child { font-weight: 600; }
.status-foot { margin-top: 14px; font-size: 12px; }

/* ===================================================================
   Declined-service capture + follow-up (Tier 2).
   =================================================================== */
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px;
  text-decoration: none; background: var(--ac-gray-100); color: var(--text-muted);
  border: 1px solid var(--border); text-transform: capitalize; }
.chip:hover { background: var(--ac-blue-50); color: var(--ac-blue-700); }
.chip.active { background: var(--ac-blue-500); color: #fff; border-color: var(--ac-blue-500); }
.row-overdue { background: #fff7ed; }
.dec-actions { white-space: nowrap; }
.dec-actions form { display: inline; }
.dec-actions .link { margin-left: 8px; }
.dec-contact { display: inline-block; }
.dec-contact summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.dec-contact form { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }

/* ===================================================================
   Service scheduling + digital MPI (Tier 2).
   =================================================================== */
body.book-service { background: var(--ac-blue-900); display: flex; justify-content: center; align-items: flex-start; }
.book-card { max-width: 560px; width: 100%; margin: 32px 16px; background: var(--bg-surface);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-md); }
.book-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.book-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.book-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.book-success { text-align: center; padding: 22px 0; }
.hp-field { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

.mpi-cat { margin: 20px 0 8px; font-size: 15px; }
.mpi-table td { vertical-align: middle; }
.mpi-item-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mpi-item-form select { min-width: 110px; }
.mpi-item-form input[type=text] { flex: 1; min-width: 140px; }
.mpi-item-form input[type=number] { width: 95px; }
tr.mpi-green  td:first-child { border-left: 3px solid #16a34a; }
tr.mpi-yellow td:first-child { border-left: 3px solid #d97706; }
tr.mpi-red    td:first-child { border-left: 3px solid #dc2626; }
.kpi.mpi-green  .kpi-value { color: #16a34a; }
.kpi.mpi-yellow .kpi-value { color: #d97706; }
.kpi.mpi-red    .kpi-value { color: #dc2626; }

/* =====================================================================
   THEME V2 — "OBSIDIAN AURORA"  (2026-06-09 visual overhaul)
   A full reskin layered over the v1 foundation via the cascade: the
   tokens are redefined (which restyles everything var-driven), then the
   signature components are upgraded. No template changes; remove this
   block to fall back to the Alpha Cloud look.
   Identity: deep ink chrome, an electric indigo-to-cyan "aurora" accent,
   hairline borders, layered tinted shadows, springy micro-motion.
   ===================================================================== */

:root {
  /* Aurora identity */
  --aur-ink-950: #07090f;
  --aur-ink-900: #0b101e;
  --aur-ink-800: #121a30;
  --aur-indigo:  #6366f1;
  --aur-violet:  #8b5cf6;
  --aur-cyan:    #22d3ee;
  --aur-blue:    #3b82f6;
  --aurora:      linear-gradient(135deg, var(--aur-indigo), var(--aur-blue) 55%, var(--aur-cyan));
  --aurora-soft: linear-gradient(135deg, rgba(99,102,241,.12), rgba(34,211,238,.10));

  /* Re-point the v1 token system at the new identity */
  --ac-blue-900: var(--aur-ink-900);
  --ac-blue-800: #16204a;
  --ac-blue-700: #3640a8;
  --ac-blue-600: #4f56e3;
  --ac-blue-500: var(--aur-indigo);
  --ac-blue-400: #818cf8;
  --ac-blue-300: #a5b4fc;
  --ac-blue-100: #e0e7ff;
  --ac-blue-50:  #eef2ff;
  --ac-gray-50:  #f7f8fc;
  --ac-gray-100: #eef0f7;
  --ac-gray-200: #e3e6f0;
  --ac-gray-400: #9aa3b8;
  --ac-gray-600: #4b5468;
  --ac-gray-800: #161b2c;

  --bg-page:      #f4f5fa;
  --bg-sidebar:   var(--aur-ink-900);
  --bg-table-head:#f7f8fd;
  --accent:       var(--aur-indigo);
  --accent-hover: #7c80f5;

  --shadow-sm: 0 1px 2px rgba(18,22,48,.05), 0 2px 10px rgba(18,22,48,.05);
  --shadow-md: 0 2px 6px rgba(18,22,48,.06), 0 10px 28px rgba(70,80,180,.12);
  --shadow-lg: 0 6px 16px rgba(18,22,48,.08), 0 24px 56px rgba(70,80,180,.18);
  --shadow-accent: 0 4px 16px rgba(99,102,241,.35);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --transition: .18s cubic-bezier(.4,.2,.2,1);
}

/* ---- Global feel ---- */
html, body { letter-spacing: .005em; }
::selection { background: rgba(99,102,241,.25); }
:focus-visible { outline: 2px solid var(--aur-indigo); outline-offset: 2px; border-radius: 4px; }
body {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(99,102,241,.07), transparent 60%),
    radial-gradient(700px 380px at -10% 30%, rgba(34,211,238,.05), transparent 55%),
    var(--bg-page);
}
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { letter-spacing: -.01em; }
* { scrollbar-width: thin; scrollbar-color: #c3c8da transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c3c8da; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- Sidebar: obsidian with aurora glow ---- */
.sidebar {
  background:
    radial-gradient(420px 260px at 110% 0%, rgba(99,102,241,.28), transparent 60%),
    radial-gradient(380px 300px at -30% 100%, rgba(34,211,238,.12), transparent 55%),
    linear-gradient(180deg, var(--aur-ink-900), var(--aur-ink-950));
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar .brand { border-bottom-color: rgba(255,255,255,.07); }
.sidebar .brand .brand-icon { color: var(--aur-cyan); filter: drop-shadow(0 0 10px rgba(34,211,238,.8)); }
.sidebar nav a:hover { background: rgba(255,255,255,.06); }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(34,211,238,.10));
  box-shadow: inset 3px 0 0 var(--aur-cyan);
  color: #fff;
}
.userbox a, .userbox button.link { color: #9fb4ff; }

/* ---- Buttons: aurora primary ---- */
button, .btn-link, .btn {
  background: var(--aurora);
  box-shadow: var(--shadow-accent);
  border-radius: var(--radius-sm);
}
button:hover, .btn-link:hover, .btn:hover {
  background: var(--aurora);
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(99,102,241,.45);
}
button:active, .btn-link:active, .btn:active { transform: translateY(0) scale(.985); }
button.secondary {
  background: var(--ac-white); color: var(--ac-blue-700);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); filter: none;
}
button.secondary:hover { background: var(--ac-blue-50); border-color: var(--ac-blue-300); transform: translateY(-1px); }
button.link {
  background: transparent; box-shadow: none; color: var(--aur-indigo); font-weight: 600; filter: none;
}
button.link:hover { background: transparent; color: var(--aur-violet); transform: none; box-shadow: none; filter: none; }
button.danger, #vr-record { background: linear-gradient(135deg,#ef4444,#dc2626); box-shadow: 0 4px 16px rgba(220,38,38,.35); }
button.danger:hover, #vr-record:hover:not(:disabled) { background: linear-gradient(135deg,#f05252,#e02424); }
button:disabled, button[disabled] { background: var(--ac-gray-200); box-shadow: none; filter: none; }
.userbox button.link { box-shadow: none; background: none; }

/* ---- Inputs ---- */
input, select, textarea { border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus {
  border-color: var(--aur-indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,.16), 0 1px 2px rgba(18,22,48,.04);
}

/* ---- KPIs: aurora bar + gradient numerals ---- */
.kpi::before { background: var(--aurora); height: 3px; }
.kpi-grid .kpi { position: relative; overflow: hidden; }
.kpi-grid .kpi::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; }
.kpi .value, .kpi-value, .kpi .kpi-value {
  background-image: linear-gradient(135deg, #2a2f8f, var(--aur-indigo) 55%, #0e7490);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  letter-spacing: -.02em;
}
.kpi.mpi-green  .kpi-value { background-image: linear-gradient(135deg,#15803d,#22c55e); }
.kpi.mpi-yellow .kpi-value { background-image: linear-gradient(135deg,#b45309,#f59e0b); }
.kpi.mpi-red    .kpi-value { background-image: linear-gradient(135deg,#b91c1c,#ef4444); }
.kpi .value.warn { background-image: linear-gradient(135deg,#b45309,#f59e0b); }

/* ---- Tables ---- */
tbody tr:hover td { background: #f3f4ff; }

/* ---- Deal workspace ---- */
.deal-rail a.active {
  background: var(--aurora);
  border-left-color: transparent;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

/* ---- Workflow ---- */
.wf-step.current .wf-step-dot { background: var(--aur-indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }

/* ---- Chips ---- */
.chip.active { background: var(--aurora); border-color: transparent; color: #fff; }

/* ---- Public pages: aurora backdrop ---- */
body.video-watch, body.book-service, .login-bg {
  background:
    radial-gradient(800px 500px at 80% -10%, rgba(99,102,241,.35), transparent 60%),
    radial-gradient(700px 480px at 0% 110%, rgba(34,211,238,.18), transparent 55%),
    linear-gradient(180deg, var(--aur-ink-900), var(--aur-ink-950));
}
.watch-cta { background: var(--aurora); box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.watch-cta:hover { background: var(--aurora); filter: brightness(1.08); }

/* ---- Login polish ---- */
.login-card { box-shadow: var(--shadow-lg); border-radius: var(--radius-lg); }
.login-card .brand .brand-icon { color: var(--aur-indigo); filter: drop-shadow(0 0 10px rgba(99,102,241,.55)); }

/* ---- Motion guard ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Theme V2 fixes from the visual sweep */
body.book-service { min-height: 100vh; }
body.status-page  { min-height: 100vh; }
body.api-docs     { min-height: 100vh; }

/* ---- Brand mark: the Alpha Desk cloud (vector remake of
   Alpha_Desk_Logo_Subline — small, borderless, aurora-gradient). ---- */
.brand-cloud { display: inline-flex; filter: drop-shadow(0 0 8px rgba(34,211,238,.45)); }
.brand-cloud svg { width: 32px; height: auto; display: block; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 20px; margin-bottom: 4px; color: var(--text-primary); }
.login-brand strong { font-weight: 800; }
.login-brand .brand-cloud svg { width: 46px; }
.login-brand .brand-cloud { filter: drop-shadow(0 2px 10px rgba(99,102,241,.35)); }

/* Unit cost ledger */
.credit-amt { color: #15803d; font-weight: 600; }

/* Lead conversation thread (AI-BDC Phase 1) */
.msg-thread { display: flex; flex-direction: column; gap: 8px; max-width: 680px; margin: 10px 0 14px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; }
.msg.outbound { align-self: flex-end; background: var(--aurora); color: #fff; border-bottom-right-radius: 4px; }
.msg.outbound .msg-meta { color: rgba(255,255,255,.75); }
.msg.inbound { align-self: flex-start; background: var(--ac-gray-100); border-bottom-left-radius: 4px; }
.msg.failed { opacity: .75; outline: 1px dashed #dc2626; }
.msg-meta { font-size: 11px; margin-top: 3px; }
.msg-compose { display: flex; gap: 10px; align-items: flex-end; max-width: 680px; }
.msg-compose textarea { flex: 1; }

/* AI draft meta line (Phase 2) */
.draft-meta { font-size: 12px; color: var(--aur-indigo); margin: 4px 0 6px; font-weight: 600; }

/* Observability dashboard (Sprint 3b) */
.badge.ok      { background: #dcfce7; color: #166534; }
.badge.warn    { background: #fef9c3; color: #854d0e; }
.badge.down    { background: #fee2e2; color: #991b1b; }
.badge.unknown { background: var(--ac-gray-100); color: var(--text-muted); }
.obs-window { display: flex; align-items: center; gap: 8px; margin: 8px 0 16px; }
.obs-pill, .obs-tab { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--ac-gray-200, #e5e7eb); color: var(--text-muted); text-decoration: none; }
.obs-pill.active, .obs-tab.active { background: var(--ac-blue-500, #2563eb); color: #fff; border-color: transparent; }
.obs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 12px 0 24px; }
.obs-card { border: 1px solid var(--ac-gray-200, #e5e7eb); border-radius: 12px; padding: 14px 16px; background: #fff; }
.obs-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.obs-card-title { font-weight: 600; }
.obs-card-metrics { display: flex; gap: 16px; font-size: 18px; }
.obs-card-metrics .obs-err strong { color: #991b1b; }
.obs-card-detail { font-size: 12px; margin: 6px 0 2px; }
.obs-card-foot { font-size: 11px; }
.obs-tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.obs-custom { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.obs-custom input[type=date] { padding: 3px 6px; font-size: 13px; }

/* Financial statements (real-time GL slice 1) */
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; align-items: start; }
.fin-section td { font-weight: 700; background: var(--ac-gray-50, #f9fafb); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; padding-top: 10px; }
.fin-total td { font-weight: 600; border-top: 1px solid var(--ac-gray-200, #e5e7eb); }
.fin-grand td { font-weight: 700; border-top: 2px solid var(--ac-blue-500, #2563eb); font-size: 15px; }

/* Executive dashboard (GL slice 3) */
.exec-stages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.exec-stage { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border: 1px solid var(--border, #d8dee9); border-radius: 999px; font-size: 13px;
  text-decoration: none; color: inherit; }
.exec-stage-n { font-weight: 700; }
