:root {
  --bg: #07111b;
  --bg-2: #0a1826;
  --bg-3: #10263a;
  --panel: rgba(10, 24, 38, 0.86);
  --panel-2: rgba(8, 19, 31, 0.94);
  --line: rgba(116, 214, 168, 0.16);
  --line-2: rgba(129, 235, 188, 0.28);
  --text: #edf8f3;
  --muted: #98b0a8;
  --green: #2ee48d;
  --green-2: #17975f;
  --lime: #b5ffd8;
  --amber: #f3c66d;
  --red: #ff8585;
  --blue: #7ac9ff;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(36, 86, 132, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(46, 228, 141, 0.14), transparent 30%),
    linear-gradient(160deg, #05101a 0%, #091726 40%, #07111b 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
.glass {
  background: linear-gradient(180deg, rgba(15, 31, 47, 0.93), rgba(9, 20, 32, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.lead { font-size: 16px; line-height: 1.7; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--green), #42f7a1);
  color: #032111;
  box-shadow: 0 12px 30px rgba(46, 228, 141, 0.22);
}
.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--line);
}
.full { width: 100%; }
input, select {
  width: 100%;
  border: 1px solid rgba(181, 255, 216, 0.14);
  background: rgba(5, 14, 24, 0.78);
  color: var(--text);
  padding: 14px 14px;
  border-radius: 14px;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(46, 228, 141, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 228, 141, 0.08);
}
label { display: grid; gap: 8px; color: var(--muted); }
.banner {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 600;
}
.banner.danger { background: rgba(255, 133, 133, 0.12); color: #ffc7c7; border: 1px solid rgba(255, 133, 133, 0.22); }
.banner.success { background: rgba(46, 228, 141, 0.12); color: #caffdf; border: 1px solid rgba(46, 228, 141, 0.22); }
.hidden { display: none; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px;
}
.login-grid {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.88fr;
  gap: 24px;
}
.login-panel { padding: 34px; }
.brand-mark { display: flex; align-items: center; gap: 16px; }
.brand-mark.slim { margin-bottom: 30px; }
.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #38f29b, #174a39);
  color: #042514;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(46, 228, 141, 0.25);
}
.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 28px;
}
.feature-chip {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.hero-preview {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(7, 19, 31, 0.94), rgba(8, 17, 28, 0.84));
  border: 1px solid var(--line);
}
.preview-top, .topbar, .panel-head, .actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.mini-metrics {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mini-card {
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.mini-card span, .metric-card span, .summary-card .eyebrow, .mini-card small, .metric-card small { color: var(--muted); }
.mini-card strong { display: block; margin-top: 10px; font-size: 24px; }
.mini-card.warning strong { color: #ffe19f; }
.mini-card.danger strong { color: #ffb1b1; }
.auth-panel { max-width: 480px; justify-self: end; }
.login-form, .stack { display: grid; }
.login-form { gap: 16px; margin: 22px 0 24px; }
.login-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.login-notes.single { grid-template-columns: 1fr; }
.note-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(5, 15, 25, 0.56);
  border: 1px solid var(--line);
}
.note-card span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 7px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
}
.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 11, 19, 0.94), rgba(7, 16, 26, 0.92));
}
.nav-item {
  display: block;
  padding: 13px 14px;
  border-radius: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.nav-item.active, .nav-item:hover {
  color: var(--text);
  background: linear-gradient(90deg, rgba(46, 228, 141, 0.12), rgba(122, 201, 255, 0.05));
}
.side-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(9, 21, 33, 0.94);
  border: 1px solid var(--line);
}
.side-panel.compact { padding: 16px; }
.focus-list { display: grid; gap: 10px; color: var(--muted); font-size: 14px; }
.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.blue { background: var(--blue); }
.content { padding: 30px; }
.content.narrow { max-width: 1100px; }
.topbar { align-items: flex-start; margin-bottom: 24px; }
.topbar-rich h1 { margin-bottom: 10px; }
.hero-copy { max-width: 720px; line-height: 1.6; }
.sync-badge {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.sync-badge.mock { background: rgba(243, 198, 109, 0.12); color: #ffe3aa; }
.sync-badge.live { background: rgba(46, 228, 141, 0.12); color: #caffdf; }
.hero-band {
  padding: 24px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}
.hero-band-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.hero-band-stats > div {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.hero-band-stats span { color: var(--muted); display: block; margin-bottom: 10px; }
.hero-band-stats strong { font-size: 28px; }
.card-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card, .summary-card, .panel, .form-panel {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 27, 42, 0.96), rgba(8, 18, 30, 0.96));
  box-shadow: var(--shadow);
}
.metric-card strong { display: block; margin-top: 8px; font-size: 36px; line-height: 1.1; word-break: break-word; hyphens: auto; }
.metric-card strong.text-sm { font-size: 22px; line-height: 1.2; }
.metric-card strong.text-md { font-size: 28px; line-height: 1.15; }
.metric-card small { display: block; margin-top: 10px; }
.metric-card.critical strong { color: #ffb0b0; }
.metric-card.warning strong { color: #ffe09d; }
.metric-card.success strong { color: #b9ffd7; }
.summary-card.highlight {
  background: linear-gradient(135deg, rgba(16, 53, 42, 0.96), rgba(9, 28, 22, 0.96));
  border-color: rgba(46, 228, 141, 0.2);
}
.money { font-size: 38px; font-weight: 800; color: var(--lime); margin: 12px 0; }
.progress-row { display: grid; gap: 8px; }
.progress-row span { color: var(--muted); font-size: 13px; }
.progress {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.progress.slim { width: 100px; height: 8px; margin-top: 6px; }
.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2ee48d, #7ac9ff);
}
.split-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.92fr);
}
.panel-tag {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(157, 181, 172, 0.12);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.risk-cell strong { display: block; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
}
.pill.high-risk { background: rgba(255, 133, 133, 0.16); color: #ffc8c8; }
.pill.developing { background: rgba(243, 198, 109, 0.16); color: #ffe4ad; }
.pill.healthy { background: rgba(46, 228, 141, 0.12); color: #caffdf; }
.alert-list { display: grid; gap: 12px; }
.alert-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(5, 14, 23, 0.62);
}
.alert-item p { margin: 6px 0 0; color: var(--muted); }
.alert-item.critical { border-color: rgba(255,133,133,0.26); }
.alert-item.high { border-color: rgba(243,198,109,0.26); }
.alert-item.medium { border-color: rgba(122,201,255,0.2); }
.clean-list { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-panel.elevated { padding: 24px; }
.settings-callout {
  margin: 18px 0 6px;
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(46, 228, 141, 0.08);
  border: 1px solid rgba(46, 228, 141, 0.16);
  display: grid;
  gap: 6px;
}
.gap-sm { gap: 8px; }
.gap-md { gap: 18px; }

@media (max-width: 1180px) {
  .login-grid { grid-template-columns: 1fr; }
  .auth-panel { max-width: none; justify-self: stretch; }
  .mini-metrics, .hero-band, .card-grid.four, .card-grid.three, .split-layout, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .login-shell, .content, .sidebar { padding: 18px; }
  .login-panel, .metric-card, .summary-card, .panel, .form-panel { padding: 18px; }
  .hero-panel { min-height: auto; }
  .money, .metric-card strong { font-size: 30px; }
  .actions { flex-direction: column; }
}

.table-link { color: #e9fff2; text-decoration: none; }
.table-link:hover { color: var(--lime); }
.lead { color: #dce9e4; font-size: 18px; line-height: 1.6; margin-top: 0; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.info-card, .timeline-item, .history-item {
  padding: 16px;
  border-radius: 16px;
  background: rgba(5, 14, 23, 0.62);
  border: 1px solid rgba(157, 181, 172, 0.12);
}
.info-card h4, .timeline-item strong, .history-item strong { margin: 0 0 8px; display:block; }
.timeline, .history-list { display: grid; gap: 12px; }

.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
@media (max-width:900px){.compact-grid{grid-template-columns:1fr;}}


.queue-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:8px}
.queue-column{background:rgba(8,19,34,.55);border:1px solid rgba(59,130,246,.14);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:12px}
.queue-column h4{margin:0;font-size:1rem}
.queue-item{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border-radius:14px;background:rgba(10,26,44,.78);border:1px solid rgba(74,222,128,.12);text-decoration:none;color:inherit}
.queue-item:hover{border-color:rgba(74,222,128,.35);transform:translateY(-1px)}
.queue-item span{font-size:.94rem}
.queue-item small,.queue-item em{font-size:.82rem;color:#9fb0c6;font-style:normal}
@media (max-width: 1100px){.queue-grid{grid-template-columns:1fr}}


.vehicle-tabs-shell { padding: 20px; }
.tab-bar { display:flex; gap:10px; flex-wrap:wrap; margin: 8px 0 18px; }
.tab-btn { border:1px solid rgba(132,255,181,0.14); background: rgba(10,24,38,0.72); color:#cfe7d8; padding:10px 14px; border-radius:999px; font-weight:600; cursor:pointer; transition: all .18s ease; }
.tab-btn:hover { border-color: rgba(132,255,181,0.32); color:#f4fff8; }
.tab-btn.active { background: linear-gradient(135deg, rgba(35,86,63,0.95), rgba(17,49,39,0.95)); color:#f4fff8; box-shadow: 0 10px 22px rgba(0,0,0,0.18); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.tab-section-gap { margin-top: 4px; }
.inset-panel { background: rgba(8, 19, 31, 0.58); border: 1px solid rgba(132,255,181,0.08); }
.compact-gap { margin-bottom: 18px; }
.compact-info-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.dense-history .history-item { padding: 12px 14px; }
@media (max-width: 900px) { .compact-info-grid { grid-template-columns: 1fr; } .tab-bar { gap:8px; } .tab-btn { width: 100%; text-align:left; } }


/* ── Decision Context & Insight Panel ── */
.insight-fleet-bar .insight-fleet-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  padding: 4px 0;
}
.insight-fleet-stats > div { display: flex; flex-direction: column; gap: 4px; }
.insight-fleet-stats strong { font-size: 1.35rem; color: #f4fff8; }

.insight-card { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.insight-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.insight-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.insight-card-title strong { font-size: 1.1rem; }

.insight-card-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.insight-meta-item { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.insight-meta-item strong { font-size: 1rem; }

.insight-card-body {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: start;
}
.insight-scenario p { line-height: 1.65; color: #cfe7d8; font-size: 0.95rem; margin-top: 6px; }

.insight-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
}
.insight-metric-box {
  background: rgba(10,24,38,0.72);
  border: 1px solid rgba(132,255,181,0.1);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.insight-metric-box span { color: #9fb0c6; }
.insight-metric-box strong { color: #f4fff8; font-size: 0.95rem; }
.insight-metric-box.critical { border-color: rgba(239,68,68,0.25); }
.insight-metric-box.warning { border-color: rgba(245,158,11,0.25); }
.insight-metric-box.success { border-color: rgba(34,197,94,0.25); }

.insight-chart-area { min-width: 260px; }
.sparkline-canvas { display: block; border-radius: 8px; background: rgba(8,19,31,0.55); }

.insight-card-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(132,255,181,0.08);
  font-size: 0.88rem;
}
.insight-card-footer > div { display: flex; flex-direction: column; gap: 2px; }
.insight-card-footer > div span:first-child { font-size: 0.75rem; }
.insight-card-footer > div span:last-child { color: #cfe7d8; }
.insight-card-footer .btn { margin-left: auto; }

.text-critical { color: #ef4444; }
.text-success { color: #22c55e; }

@media (max-width: 1100px) {
  .insight-card-body { grid-template-columns: 1fr; }
  .insight-chart-area { min-width: unset; }
  .insight-fleet-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .insight-card-meta { justify-content: flex-start; }
  .insight-meta-item { text-align: left; }
}
@media (max-width: 600px) {
  .insight-fleet-stats { grid-template-columns: 1fr; }
}


/* ── AI Explanation & Briefing Panels ── */
.ai-briefing-panel {
  padding: 20px 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(132,255,181,0.15);
}
.ai-briefing-header,
.ai-explanation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ai-briefing-header h3,
.ai-explanation-header h4 { margin: 0; }

.ai-briefing-body,
.ai-explanation-body {
  margin-top: 16px;
  padding: 16px 20px;
  background: rgba(8,19,31,0.65);
  border-radius: 12px;
  border-left: 3px solid rgba(132,255,181,0.4);
}
.ai-briefing-body p,
.ai-explanation-body div {
  color: #cfe7d8;
  font-size: 1rem;
  line-height: 1.7;
}

.ai-explanation-panel {
  margin-top: 20px;
  padding: 18px 20px;
  background: rgba(8,19,31,0.45);
  border: 1px solid rgba(132,255,181,0.12);
  border-radius: 14px;
}

.ai-explanation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(132,255,181,0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: #9fb0c6;
  font-size: 0.9rem;
}
.ai-loading-dots {
  display: flex;
  gap: 5px;
}
.ai-loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(132,255,181,0.6);
  animation: aiPulse 1.2s ease-in-out infinite;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
}

.ai-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.9rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(132,255,181,0.2);
  color: #9fb0c6;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: rgba(132,255,181,0.5);
  color: #cfe7d8;
}
.btn-sm { padding: 4px 12px; font-size: 0.8rem; }

.hidden { display: none !important; }


/* ── Security & Status Banners ── */
.status-banner {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}
.status-banner.success {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
}
.status-banner.error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.status-banner.info {
  background: rgba(99,179,237,0.12);
  border: 1px solid rgba(99,179,237,0.3);
  color: #93c5fd;
}


/* ── Cost Modelling Inputs ── */
.cost-model-section { }

.subsystem-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subsystem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.subsystem-inputs {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.subsystem-inputs label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #9fb0c6;
}

.subsystem-input {
  width: 90px !important;
  padding: 6px 10px !important;
  font-size: 0.9rem !important;
}

#costPreviewPanel .data-table td,
#costPreviewPanel .data-table th {
  font-size: 0.88rem;
}


/* ── AI Parts Auto-populate ── */
.parts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ai-populate-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.ai-parts-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(132,255,181,0.06);
  border: 1px solid rgba(132,255,181,0.15);
  border-radius: 10px;
  color: #9fb0c6;
  font-size: 0.9rem;
  margin: 12px 0;
}

.subsystem-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.subsystem-label strong { font-size: 0.92rem; color: #cfe7d8; }
.subsystem-label .muted { font-size: 0.78rem; }

.ai-source-tag {
  font-size: 0.75rem;
  color: #84ffb5;
  font-style: italic;
  margin-top: 2px;
  line-height: 1.4;
}

@keyframes aiPopulatedFlash {
  0%   { border-color: rgba(132,255,181,0.6); background: rgba(132,255,181,0.08); }
  100% { border-color: rgba(132,255,181,0.1); background: transparent; }
}
.subsystem-row.ai-populated {
  animation: aiPopulatedFlash 2s ease-out forwards;
}


/* ── Decision Justification Panel ── */
.justification-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.justification-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
}

.justification-card.highlight-card {
  grid-column: 1 / -1;
  border-color: rgba(132,255,181,0.2);
  background: rgba(132,255,181,0.04);
}

.jc-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
  padding-top: 2px;
}

.jc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.jc-value {
  color: #f4fff8;
  font-size: 0.97rem;
  line-height: 1.5;
  font-weight: 500;
}

.jc-cost-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

.jc-cost-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.1);
}
.jc-cost-box span { font-size: 0.75rem; color: #9fb0c6; }
.jc-cost-box strong { font-size: 1.1rem; color: #f4fff8; }
.jc-cost-box.delayed { border-color: rgba(239,68,68,0.3); }
.jc-cost-box.delayed strong { color: #fca5a5; }
.jc-cost-box.savings { border-color: rgba(34,197,94,0.3); }
.jc-cost-box.savings strong { color: #86efac; }

.jc-cost-arrow {
  color: #9fb0c6;
  font-size: 1.2rem;
}

.rules-fired-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-fired-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #cfe7d8;
  line-height: 1.5;
}

.rule-bullet {
  color: #84ffb5;
  flex-shrink: 0;
  margin-top: 1px;
}

@media (max-width: 900px) {
  .justification-grid { grid-template-columns: 1fr; }
  .justification-card.highlight-card { grid-column: 1; }
}


/* ── Vehicle List Redesign ── */
.vehicle-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(132,255,181,0.1);
  font-size: 0.75rem;
  color: #9fb0c6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.vehicle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(132,255,181,0.06);
  transition: background 0.15s;
}
.vehicle-row:hover {
  background: rgba(132,255,181,0.04);
}
.vehicle-row:last-child { border-bottom: none; }

.vr-reg {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vr-reg strong { font-size: 0.95rem; }
.vr-reg .muted { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

.vr-risk {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vr-risk strong { font-size: 1rem; }

.vr-issue {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.vr-issue-text {
  font-size: 0.88rem;
  color: #cfe7d8;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vr-issue .muted {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cost-now-val {
  font-size: 0.92rem;
  color: #f4fff8;
}
.cost-delayed-val {
  font-size: 0.92rem;
  color: #fca5a5;
}

/* Filter buttons */
.filter-btn {
  background: rgba(132,255,181,0.06);
  border: 1px solid rgba(132,255,181,0.15);
  color: #9fb0c6;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover,
.filter-btn.active {
  background: rgba(132,255,181,0.12);
  border-color: rgba(132,255,181,0.4);
  color: #84ffb5;
}


/* ── Decision Engine Card Layout ── */
.de-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.decision-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.decision-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}
.decision-card:hover {
  border-color: rgba(132,255,181,0.25);
}
.decision-card[data-status="high-risk"] {
  border-left: 3px solid rgba(239,68,68,0.5);
}
.decision-card[data-status="developing"] {
  border-left: 3px solid rgba(245,158,11,0.5);
}
.decision-card[data-status="healthy"] {
  border-left: 3px solid rgba(34,197,94,0.3);
}

.dc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.dc-vehicle {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dc-vehicle strong { font-size: 1rem; }
.dc-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dc-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(132,255,181,0.07);
  border-bottom: 1px solid rgba(132,255,181,0.07);
}
.dc-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dc-stat strong {
  font-size: 0.95rem;
  color: #f4fff8;
}
.dc-stat strong.text-critical { color: #fca5a5; }

.dc-first-check {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dc-first-check p {
  font-size: 0.88rem;
  color: #cfe7d8;
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 768px) {
  .decision-card-grid { grid-template-columns: 1fr; }
  .dc-body { grid-template-columns: repeat(2, 1fr); }
}


/* ── Global Search ── */
.sidebar-search {
  position: relative;
  margin-bottom: 12px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8,19,31,0.7);
  border: 1px solid rgba(132,255,181,0.15);
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}
.search-input-wrap:focus-within {
  border-color: rgba(132,255,181,0.45);
}

.search-icon {
  color: #9fb0c6;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: #f4fff8;
  font-size: 0.88rem;
  width: 100%;
  font-family: inherit;
}
.search-input-wrap input::placeholder {
  color: #9fb0c6;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0d1f30;
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 12px;
  overflow: hidden;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(132,255,181,0.06);
  transition: background 0.15s;
  cursor: pointer;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.focused {
  background: rgba(132,255,181,0.07);
  outline: none;
}

.sri-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.sri-content {
  flex: 1;
  min-width: 0;
}
.sri-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f4fff8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sri-detail {
  font-size: 0.75rem;
  color: #9fb0c6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.sri-meta {
  flex-shrink: 0;
}
.search-type-tag {
  font-size: 0.7rem;
  color: #9fb0c6;
  background: rgba(132,255,181,0.07);
  border: 1px solid rgba(132,255,181,0.12);
  border-radius: 6px;
  padding: 2px 7px;
}
.search-no-results {
  padding: 14px;
  color: #9fb0c6;
  font-size: 0.85rem;
  text-align: center;
}


/* ── v36 Dashboard Zones ── */
.zone-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(132,255,181,0.08);
}
.zone-label h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #cfe7d8;
  margin: 0;
}

.cost-exposure-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.quick-link-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  border-radius: 14px;
  border: 1px solid rgba(132,255,181,0.1);
}
.quick-link-card:hover {
  border-color: rgba(132,255,181,0.3);
  background: rgba(132,255,181,0.05);
}
.quick-link-card strong {
  font-size: 0.95rem;
  color: #84ffb5;
}
.quick-link-card .eyebrow {
  margin-bottom: 2px;
}

.compact-alerts .alert-item {
  padding: 6px 0;
}
.compact-alerts .alert-item p {
  font-size: 0.78rem;
}


/* ── Scrollable vehicle list ── */
.vehicle-list-scroll {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(132,255,181,0.2) transparent;
}
.vehicle-list-scroll::-webkit-scrollbar {
  width: 5px;
}
.vehicle-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.vehicle-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(132,255,181,0.2);
  border-radius: 4px;
}
.vehicle-list-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(132,255,181,0.4);
}


/* ── Supplier Management ── */
.supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.supplier-card {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.supplier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.supplier-card-header > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.supplier-card-header strong { font-size: 0.95rem; }

.supplier-form {
  padding: 20px;
}

.supplier-assign-wrap {
  display: flex;
  flex-direction: column;
  min-width: 260px;
}

.supplier-select {
  background: rgba(8,19,31,0.8);
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 10px;
  color: #f4fff8;
  font-size: 0.88rem;
  padding: 8px 12px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s;
}
.supplier-select:focus {
  outline: none;
  border-color: rgba(132,255,181,0.5);
}
.supplier-select option {
  background: #0d1f30;
  color: #f4fff8;
}


/* ── Login page redesign ── */
.login-value-props {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.lvp-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(8,19,31,0.5);
  border: 1px solid rgba(132,255,181,0.08);
  border-radius: 12px;
}

.lvp-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  padding-top: 2px;
}

.lvp-item strong {
  display: block;
  font-size: 0.88rem;
  color: #f4fff8;
  margin-bottom: 3px;
}

.auth-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}

.login-divider {
  height: 1px;
  background: rgba(132,255,181,0.08);
  margin: 24px 0;
}

.login-setup-note {
  padding: 14px 16px;
}
.login-setup-note p.eyebrow {
  margin-bottom: 6px;
}

.btn.full {
  width: 100%;
  text-align: center;
  justify-content: center;
  margin-top: 8px;
}


/* ── Workshop redesign ── */
.ws-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.ws-queue-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  border-left: 3px solid rgba(132,255,181,0.1);
}
.ws-queue-card.high-risk  { border-left-color: rgba(239,68,68,0.5); }
.ws-queue-card.developing { border-left-color: rgba(245,158,11,0.5); }
.ws-queue-card.healthy    { border-left-color: rgba(34,197,94,0.3); }
.ws-queue-card:hover      { background: rgba(132,255,181,0.04); border-color: rgba(132,255,181,0.25); }

.ws-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.ws-reg { font-size: 1.05rem; display: block; }

.ws-slot-badge {
  font-size: 0.72rem;
  color: #9fb0c6;
  background: rgba(132,255,181,0.06);
  border: 1px solid rgba(132,255,181,0.12);
  border-radius: 6px;
  padding: 2px 8px;
}

.ws-card-issue p {
  font-size: 0.88rem;
  color: #cfe7d8;
  line-height: 1.5;
  margin: 0;
}

.ws-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(132,255,181,0.07);
}
.ws-card-stat { display: flex; flex-direction: column; gap: 3px; }
.ws-card-stat span:last-child { font-size: 0.82rem; color: #cfe7d8; }

.ws-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-badge {
  font-size: 0.75rem;
  color: #9fb0c6;
  background: rgba(132,255,181,0.06);
  border: 1px solid rgba(132,255,181,0.1);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.ws-badge-warn { border-color: rgba(245,158,11,0.3); color: #fcd34d; }

/* Workshop form */
.ws-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.ws-form-section {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(132,255,181,0.07);
}
.ws-form-section:last-of-type { border-bottom: none; }

.ws-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #84ffb5;
  margin-bottom: 12px;
}

.ws-field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.ws-field-row .field { flex: 1; min-width: 160px; }
.ws-field-wide { flex: 2 !important; }

/* Outcome history cards */
.ws-outcomes-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ws-outcome-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ws-outcome-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.ws-outcome-header > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ws-outcome-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ws-outcome-field { display: flex; flex-direction: column; gap: 4px; }
.ws-outcome-field p { font-size: 0.88rem; color: #cfe7d8; line-height: 1.5; margin: 0; }
.ws-outcome-footer {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(132,255,181,0.07);
}

@media (max-width: 768px) {
  .ws-queue-grid { grid-template-columns: 1fr; }
  .ws-field-row { flex-direction: column; }
}


/* ── User Management ── */
.role-guide-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 12px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.user-row-inactive { opacity: 0.55; }

.user-row-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 2;
  min-width: 160px;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(132,255,181,0.12);
  border: 1px solid rgba(132,255,181,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #84ffb5;
  flex-shrink: 0;
}
.user-row-identity > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-you-badge {
  font-size: 0.68rem;
  color: #84ffb5;
  background: rgba(132,255,181,0.1);
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 6px;
}

.user-row-meta {
  display: flex;
  gap: 24px;
  flex: 3;
  flex-wrap: wrap;
  align-items: center;
}
.user-row-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-select {
  background: rgba(8,19,31,0.8);
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 8px;
  color: #f4fff8;
  font-size: 0.85rem;
  padding: 5px 10px;
  font-family: inherit;
  cursor: pointer;
}
.role-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.role-select:focus { outline: none; border-color: rgba(132,255,181,0.5); }
.role-select option { background: #0d1f30; }

.user-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.user-row-result {
  flex-basis: 100%;
  padding-top: 6px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,10,18,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  width: 100%;
  max-width: 440px;
  padding: 28px 32px;
  border-radius: 18px;
}
.modal-box .eyebrow { margin-bottom: 4px; }


/* ── Reports page ── */
.report-date-bar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.report-date-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.report-quick-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.report-date-inputs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.report-date-inputs label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #9fb0c6;
}
.report-date-inputs input[type="date"] {
  background: rgba(8,19,31,0.8);
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 8px;
  color: #f4fff8;
  font-size: 0.88rem;
  padding: 7px 12px;
  font-family: inherit;
  cursor: pointer;
}
.report-date-inputs input[type="date"]:focus {
  outline: none;
  border-color: rgba(132,255,181,0.5);
}

.report-snapshot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.rsl-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(132,255,181,0.06);
}
.rsl-item:last-child { border-bottom: none; }
.rsl-item span { color: #9fb0c6; }
.rsl-item strong { color: #f4fff8; }

@media (max-width: 900px) {
  .report-date-bar { flex-direction: column; }
  .report-date-controls { align-items: flex-start; }
  .report-quick-btns { justify-content: flex-start; }
}


/* ── v54 additions ── */
.sidebar-version {
  padding: 12px 16px;
  border-top: 1px solid rgba(132,255,181,0.06);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-version span {
  font-size: 0.75rem;
  color: #3a4a5a;
}

.zone-financial-summary {
  font-size: 0.82rem;
  color: #9fb0c6;
  flex-basis: 100%;
  padding-top: 2px;
}

/* Cost trio on vehicle detail */
.cost-exposure-card { grid-column: span 2; }
.cost-trio {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ct-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  background: rgba(8,19,31,0.5);
  border-radius: 8px;
  border: 1px solid rgba(132,255,181,0.08);
}
.ct-item.saving {
  border-color: rgba(34,197,94,0.2);
  background: rgba(34,197,94,0.04);
}
.ct-label {
  font-size: 0.72rem;
  color: #9fb0c6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ct-val { font-size: 1.1rem; }
.ct-val.now { color: #f4fff8; }
.ct-val.delayed { color: #fca5a5; }
.ct-val.save { color: #86efac; }
.ct-arrow {
  color: #3a4a5a;
  font-size: 1rem;
}

.ws-badge-info { border-color: rgba(99,179,237,0.3); color: #93c5fd; }


/* ── Positioning strip ── */
.positioning-strip {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.08);
  border-radius: 10px;
  padding: 10px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 4px;
}
.ps-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: #6a8a9a;
  padding: 4px 12px;
  white-space: nowrap;
}
.ps-item strong {
  color: #9fb0c6;
  font-weight: 600;
}
.ps-icon {
  font-size: 0.9rem;
}
.ps-divider {
  width: 1px;
  height: 16px;
  background: rgba(132,255,181,0.08);
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .ps-divider { display: none; }
  .ps-item { padding: 3px 8px; }
}


/* ── Error pages ── */
.error-shell {
  min-height: 100vh;
  background: #070f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.error-card {
  max-width: 480px;
  width: 100%;
  padding: 48px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: rgba(132,255,181,0.15);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -2px;
}
.error-card h2 {
  font-size: 1.4rem;
  color: #f4fff8;
  margin: 0;
}
.error-card .muted {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 360px;
}
.error-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
.error-brand {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(132,255,181,0.06);
  width: 100%;
}


/* ── Accuracy empty state ── */
.accuracy-empty-state {
  display: flex;
  gap: 24px;
  padding: 28px 28px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.aes-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  padding-top: 4px;
}
.aes-content {
  flex: 1;
}
.aes-content h3 {
  font-size: 1.1rem;
  margin: 6px 0 10px;
  color: #f4fff8;
}
.aes-content > .muted {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}
.aes-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aes-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.aes-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(132,255,181,0.1);
  border: 1px solid rgba(132,255,181,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #84ffb5;
  flex-shrink: 0;
}
.aes-step strong {
  display: block;
  font-size: 0.9rem;
  color: #cfe7d8;
  margin-bottom: 2px;
}
.accuracy-empty-hint {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (max-width: 768px) {
  .accuracy-empty-state { flex-direction: column; }
  .aes-icon { font-size: 1.8rem; }
}


/* ── Fault codes & DVIR defects ── */
.fault-code-card, .dvir-defect-card { grid-column: span 2; }

.fault-code-list, .dvir-defect-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.fault-code-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(8,19,31,0.5);
  border-left: 3px solid rgba(132,255,181,0.15);
}
.fault-code-row.critical { border-left-color: #ef4444; background: rgba(239,68,68,0.06); }
.fault-code-row.warning  { border-left-color: #f59e0b; background: rgba(245,158,11,0.06); }
.fault-code-row.info     { border-left-color: #60a5fa; background: rgba(96,165,250,0.06); }

.fc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.5px;
}
.fc-badge.critical { background: rgba(239,68,68,0.2);  color: #fca5a5; }
.fc-badge.warning  { background: rgba(245,158,11,0.2); color: #fcd34d; }
.fc-badge.info     { background: rgba(96,165,250,0.2); color: #93c5fd; }

.fc-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.fc-detail strong { font-size: 0.88rem; color: #f4fff8; }

.fc-light-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
  margin-right: 4px;
  font-weight: 600;
}
.fc-light-badge.stop      { background: rgba(239,68,68,0.25);  color: #fca5a5; }
.fc-light-badge.emissions { background: rgba(245,158,11,0.25); color: #fcd34d; }
.fc-light-badge.warning   { background: rgba(251,191,36,0.2);  color: #fde68a; }

.dvir-defect-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(8,19,31,0.5);
  border-left: 3px solid rgba(132,255,181,0.15);
}
.dvir-defect-row.critical  { border-left-color: #ef4444; background: rgba(239,68,68,0.06); }
.dvir-defect-row.moderate  { border-left-color: #f59e0b; background: rgba(245,158,11,0.06); }
.dvir-defect-row.standard  { border-left-color: #60a5fa; background: rgba(96,165,250,0.06); }
.dvir-defect-row.resolved  { border-left-color: rgba(132,255,181,0.2); opacity: 0.65; }

.dvir-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.5px;
}
.dvir-status-badge.unresolved { background: rgba(239,68,68,0.2);  color: #fca5a5; }
.dvir-status-badge.resolved   { background: rgba(132,255,181,0.1); color: #86efac; }

.dvir-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.dvir-detail strong { font-size: 0.88rem; color: #f4fff8; }


/* ── Driver conversation chat ── */
.driver-chat-panel { padding-bottom: 0; }

.driver-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding: 14px 16px;
  margin-top: 12px;
  background: rgba(4,10,18,0.4);
  border-radius: 10px;
  border: 1px solid rgba(132,255,181,0.06);
  scroll-behavior: smooth;
}
.driver-chat-messages::-webkit-scrollbar { width: 4px; }
.driver-chat-messages::-webkit-scrollbar-track { background: transparent; }
.driver-chat-messages::-webkit-scrollbar-thumb { background: rgba(132,255,181,0.15); border-radius: 2px; }

.driver-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
}
.driver-chat-msg-manager { align-self: flex-end; align-items: flex-end; }
.driver-chat-msg-ai      { align-self: flex-start; align-items: flex-start; }

.driver-chat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #3a4a5a;
  text-transform: uppercase;
}
.driver-chat-msg-manager .driver-chat-label { color: rgba(132,255,181,0.5); }

.driver-chat-msg p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  padding: 9px 13px;
  border-radius: 10px;
}
.driver-chat-msg-manager p {
  background: rgba(132,255,181,0.08);
  border: 1px solid rgba(132,255,181,0.15);
  color: #d0eedd;
  border-radius: 10px 10px 2px 10px;
}
.driver-chat-msg-ai p {
  background: rgba(8,19,31,0.7);
  border: 1px solid rgba(255,255,255,0.06);
  color: #c0d4e4;
  border-radius: 10px 10px 10px 2px;
}

.driver-chat-footer {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.driver-chat-remaining {
  font-size: 0.75rem;
  color: #3a4a5a;
  min-height: 16px;
}
.driver-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.driver-chat-input-row input {
  flex: 1;
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 8px;
  padding: 9px 14px;
  color: #f4fff8;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.driver-chat-input-row input:focus {
  outline: none;
  border-color: rgba(132,255,181,0.45);
}
.driver-chat-input-row input::placeholder { color: #3a4a5a; }
.driver-chat-input-row input:disabled { opacity: 0.5; cursor: not-allowed; }
.driver-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}


/* ── Draft email panel ── */
.draft-email-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 4px;
}
.draft-email-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #9fb0c6;
  flex: 1;
  min-width: 160px;
}
.draft-email-field input,
.draft-email-field select {
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.2);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f4fff8;
  font-size: 0.88rem;
  font-family: inherit;
}
.draft-email-field input:focus,
.draft-email-field select:focus {
  outline: none;
  border-color: rgba(132,255,181,0.45);
}

.draft-email-output {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.draft-email-subject-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.draft-email-subject-row .eyebrow {
  flex-shrink: 0;
}
.draft-email-subject-row input {
  flex: 1;
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f4fff8;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
}
#draftEmailBody {
  width: 100%;
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: #d0eedd;
  font-size: 0.88rem;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}
#draftEmailBody:focus,
#draftEmailSubject:focus {
  outline: none;
  border-color: rgba(132,255,181,0.4);
}

/* ── Login — Option B, form-centered single column ── */
.login-grid-single {
  width: min(480px, 100%);
}
.auth-panel-center {
  padding: 40px 36px;
}
.login-feature-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.lfr-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.lfr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.lfr-item span:last-child {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 640px) {
  .login-grid-single { width: 100%; }
  .auth-panel-center { padding: 26px 20px; }
}

/* ── Detail grid — used on Parts and Welcome pages (previously undefined) ── */
.detail-grid { display: grid; gap: 16px; margin-top: 4px; }
.detail-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 27, 42, 0.9), rgba(8, 18, 30, 0.9));
}
.detail-card span {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.detail-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
}
@media (max-width: 900px) {
  .detail-grid.two, .detail-grid.three { grid-template-columns: 1fr; }
}

/* ── Login — collapsible "need help" support contact ── */
.login-help-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  margin-top: 22px;
  user-select: none;
}
.login-help-toggle span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
}
.login-help-toggle svg {
  width: 14px;
  height: 14px;
  stroke: var(--green);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.login-help-toggle.open svg {
  transform: rotate(180deg);
}
.login-help-panel {
  max-width: 320px;
  margin: 10px auto 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(8,19,31,0.6);
  border: 1px solid rgba(132,255,181,0.15);
  display: none;
}
.login-help-panel.open {
  display: block;
}
.login-help-panel p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 10px;
}
.login-help-email {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}
.login-help-email svg {
  width: 14px;
  height: 14px;
  stroke: var(--green);
  flex-shrink: 0;
}

/* ── Login — fixed enquiry line for prospective customers ── */
.login-enquiry-line {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0 0;
}
.login-enquiry-line a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}
.login-enquiry-line a:hover {
  text-decoration: underline;
}
