:root {
  --ink: #edf5ff;
  --muted: #8191a7;
  --faint: #52627a;
  --bg: #06101e;
  --bg-deep: #030914;
  --panel: rgba(13, 29, 50, .82);
  --panel-strong: #0e2138;
  --line: rgba(149, 181, 219, .12);
  --line-strong: rgba(149, 181, 219, .22);
  --blue: #3c91ff;
  --blue-bright: #67b3ff;
  --cyan: #43d6e8;
  --green: #46d69a;
  --amber: #ffbb55;
  --red: #ff6476;
  --violet: #ac88ff;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 18px 55px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 0%, rgba(30, 107, 197, .17), transparent 35rem),
    radial-gradient(circle at 52% 100%, rgba(41, 141, 174, .08), transparent 45rem),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-size: clamp(1.7rem, 2.7vw, 2.45rem); letter-spacing: -.045em; line-height: 1.08; }
h2 { margin-bottom: 0; font-size: 1.06rem; letter-spacing: -.015em; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.block { display: block; margin-top: .25rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.negative { color: var(--red) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(3, 10, 20, .88);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 13px; padding: 0 10px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 1.02rem; letter-spacing: .17em; line-height: 1.15; }
.brand small { color: #7891ad; font-size: .58rem; letter-spacing: .17em; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; position: relative; display: inline-flex; align-items: center; gap: 3px; transform: skew(-10deg); }
.brand-mark span { display: block; width: 8px; border-radius: 3px; background: linear-gradient(180deg, var(--blue-bright), #1e6ddd); box-shadow: 0 0 18px rgba(60, 145, 255, .28); }
.brand-mark span:nth-child(1) { height: 18px; }
.brand-mark span:nth-child(2) { height: 29px; }
.brand-mark span:nth-child(3) { height: 23px; }

.nav { display: flex; flex-direction: column; gap: 5px; margin-top: 44px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 13px;
  color: #8a9bb0;
  font-size: .86rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: .18s ease;
}
.nav a span { width: 20px; color: #657990; font-size: 1.1rem; text-align: center; }
.nav a:hover { color: #d9eaff; background: rgba(88, 145, 207, .08); }
.nav a.active { color: #fff; border-color: rgba(79, 154, 243, .16); background: linear-gradient(90deg, rgba(47, 133, 236, .2), rgba(47, 133, 236, .06)); box-shadow: inset 2px 0 var(--blue); }
.nav a.active span { color: var(--blue-bright); }
.sidebar-footer { margin-top: auto; padding: 17px 11px 0; border-top: 1px solid var(--line); }
.connection { display: flex; gap: 8px; align-items: center; font-size: .72rem; color: #a4b3c7; }
.connection i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px rgba(70, 214, 154, .55); }
.mode-chip { display: inline-block; margin: 12px 0 9px; padding: 5px 8px; border-radius: 5px; color: var(--amber); background: rgba(255, 187, 85, .09); border: 1px solid rgba(255, 187, 85, .18); font-size: .56rem; letter-spacing: .12em; font-weight: 800; }
.mode-chip.write { color: var(--green); background: rgba(70,214,154,.09); border-color: rgba(70,214,154,.2); }
.mode-chip.quote { color: var(--blue-bright); background: rgba(60,145,255,.09); border-color: rgba(60,145,255,.2); }
.sidebar-footer > small { display: block; font-family: ui-monospace, monospace; font-size: .62rem; }

.main { min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 34px 38px 20px; }
.page-subtitle { margin: 0; color: var(--muted); font-size: .88rem; }
.eyebrow { margin-bottom: .55rem; color: #5e7897; font-size: .61rem; font-weight: 800; letter-spacing: .16em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #265da0, #19375d); border: 1px solid rgba(121, 180, 255, .22); box-shadow: var(--shadow); font-size: .72rem; font-weight: 800; }
.safety-banner { margin: 0 38px 6px; padding: 10px 14px; display: flex; gap: 11px; align-items: center; border: 1px solid rgba(255, 187, 85, .14); border-radius: 10px; color: #c5b07e; background: rgba(255, 187, 85, .055); font-size: .72rem; }
.safety-banner strong { color: var(--amber); }
.content { padding: 20px 38px 54px; }

.button { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; cursor: pointer; font-size: .76rem; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button.primary { color: white; background: linear-gradient(135deg, #3389ee, #2465bd); box-shadow: 0 9px 24px rgba(30, 107, 197, .22); }
.button.secondary { border-color: var(--line-strong); background: rgba(83, 121, 165, .1); }
.button.ghost { color: #9fb0c4; border-color: var(--line); background: rgba(255,255,255,.025); }
.button.danger { color: #ff9aa6; border-color: rgba(255,100,118,.25); background: rgba(255,100,118,.08); }
.button.success { color: #9cf0ca; border-color: rgba(70,214,154,.25); background: rgba(70,214,154,.1); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.button.wide { width: 100%; }
.text-link { color: #79b6ff; font-size: .75rem; font-weight: 700; }
.text-link:hover { color: #b8d9ff; }
.row-action { width: 31px; height: 31px; display: grid; place-items: center; color: #83a8d5; border: 1px solid var(--line); border-radius: 8px; font-size: 1.4rem; }

.flash-stack { margin: 12px 38px 0; display: grid; gap: 7px; }
.flash { padding: 11px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-strong); font-size: .78rem; }
.flash.success { color: var(--green); border-color: rgba(70,214,154,.22); }
.flash.error { color: var(--red); border-color: rgba(255,100,118,.22); }
.flash.info { color: var(--blue-bright); border-color: rgba(60,145,255,.22); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.metric-card { position: relative; min-height: 125px; padding: 19px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(15, 35, 59, .92), rgba(8, 24, 42, .84)); box-shadow: var(--shadow); }
a.metric-card { transition: .2s ease; }
a.metric-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.metric-card::after { content: ""; position: absolute; right: -28px; bottom: -50px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(60,145,255,.12), transparent 68%); }
.metric-label { display: flex; justify-content: space-between; color: #8da0b8; font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.metric-label span { color: var(--faint); }
.metric-card > strong { display: block; margin: 13px 0 5px; font-size: 2rem; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric-card > small { font-size: .67rem; }
.metric-card.accent-blue { box-shadow: inset 0 2px #378de9, var(--shadow); }
.metric-card.accent-red { box-shadow: inset 0 2px var(--red), var(--shadow); }
.metric-card.accent-amber { box-shadow: inset 0 2px var(--amber), var(--shadow); }
.metric-card.accent-green { box-shadow: inset 0 2px var(--green), var(--shadow); }
.money-metric { font-size: 1.55rem !important; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 17px; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(13, 30, 51, .9), rgba(8, 22, 39, .86)); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading .eyebrow { margin-bottom: .35rem; }

.job-list { margin: 0 -6px -5px; }
.job-row { display: grid; grid-template-columns: 45px minmax(0,1.6fr) minmax(100px,.7fr) auto 20px; gap: 12px; align-items: center; padding: 11px 7px; border-top: 1px solid var(--line); transition: background .16s ease; }
.job-row:first-child { border-top: 0; }
.job-row:hover { background: rgba(87, 147, 215, .055); }
.date-tile { width: 39px; height: 42px; display: grid; align-content: center; justify-items: center; border-radius: 9px; color: #b9d9ff; background: rgba(60,145,255,.08); border: 1px solid rgba(60,145,255,.16); }
.date-tile strong { font-size: .93rem; line-height: 1; }
.date-tile span { margin-top: 3px; color: #5d83ae; font-size: .55rem; }
.job-main { min-width: 0; display: flex; flex-direction: column; }
.job-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.job-main span, .job-vehicle { color: var(--muted); font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: #49617d; font-size: 1.3rem; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; color: #a7b7ca; background: rgba(133,154,179,.09); border: 1px solid rgba(133,154,179,.13); font-size: .56rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.badge-ready, .badge-complete, .badge-completed, .badge-passed, .badge-approved, .badge-clear, .badge-hard-blocked { color: var(--green); background: rgba(70,214,154,.08); border-color: rgba(70,214,154,.17); }
.badge-at-risk, .badge-critical, .badge-failed, .badge-rejected, .badge-grounded, .badge-missing { color: var(--red); background: rgba(255,100,118,.08); border-color: rgba(255,100,118,.18); }
.badge-blocked, .badge-watch, .badge-pending, .badge-partial, .badge-proposed, .badge-not-assessed { color: var(--amber); background: rgba(255,187,85,.08); border-color: rgba(255,187,85,.18); }
.badge-active, .badge-confirmed, .badge-planned, .badge-booked, .badge-in-planning { color: var(--blue-bright); background: rgba(60,145,255,.08); border-color: rgba(60,145,255,.18); }
.badge-high { color: #ff8e9b; border-color: rgba(255,100,118,.18); }
.badge-medium { color: var(--amber); border-color: rgba(255,187,85,.18); }

.control-summary { display: grid; grid-template-columns: repeat(3, 53px) 1fr; gap: 8px; align-items: center; padding: 11px 0 17px; }
.control-number { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; font-size: 1.18rem; font-weight: 800; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.control-number.critical { color: var(--red); }
.control-number.high { color: #ff96a2; }
.control-number.medium { color: var(--amber); }
.control-summary > div { display: flex; flex-direction: column; gap: 5px; }
.finding-list { display: grid; gap: 8px; }
.finding-list.compact { gap: 0; border-top: 1px solid var(--line); }
.finding-row { display: grid; grid-template-columns: 10px 1fr 15px; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.finding-row span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.finding-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.finding-row small { margin-top: 3px; font-size: .57rem; }
.severity-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--muted); box-shadow: 0 0 9px rgba(129,145,167,.35); }
.severity-dot.critical, .severity-dot.high { background: var(--red); box-shadow: 0 0 9px rgba(255,100,118,.55); }
.severity-dot.medium { background: var(--amber); box-shadow: 0 0 9px rgba(255,187,85,.55); }
.severity-dot.low, .severity-dot.info { background: var(--blue); }
.finding-card { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.018); }
.finding-card.critical { border-color: rgba(255,100,118,.19); background: rgba(255,100,118,.035); }
.finding-card.high { border-color: rgba(255,100,118,.13); }
.finding-card.medium { border-color: rgba(255,187,85,.13); }
.finding-card strong { font-size: .76rem; }
.finding-card p { margin: .3rem 0 .35rem; color: #a4b2c4; font-size: .7rem; line-height: 1.45; }
.finding-card small { font-size: .6rem; }
.finding-heading { display: flex; justify-content: space-between; gap: 10px; }

.phase-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.phase-card { min-width: 0; padding: 12px; display: grid; grid-template-columns: 34px 1fr; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); }
.phase-card .badge { grid-column: 2; justify-self: start; }
.phase-day { width: 32px; height: 35px; display: grid; align-content: center; justify-items: center; border-radius: 8px; color: var(--blue-bright); background: rgba(60,145,255,.08); font-size: .75rem; font-weight: 800; }
.phase-day small { font-size: .5rem; }
.phase-copy { min-width: 0; display: flex; flex-direction: column; }
.phase-copy strong, .phase-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-copy strong { font-size: .68rem; }
.phase-copy small { margin-top: 3px; font-size: .56rem; }

.empty-state { min-height: 150px; padding: 24px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state h3 { margin: 9px 0 5px; font-size: .85rem; }
.empty-state p { max-width: 320px; margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.empty-orbit { width: 28px; height: 28px; border: 1px solid #2e5c8d; border-radius: 50%; box-shadow: inset 0 0 0 7px rgba(60,145,255,.06), 0 0 25px rgba(60,145,255,.09); }

.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }
.search-field { flex: 1; min-width: 170px; position: relative; }
.search-field span { position: absolute; left: 12px; top: 9px; color: var(--faint); }
input, select { height: 38px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: rgba(3,13,25,.72); }
input:focus, select:focus { border-color: rgba(60,145,255,.55); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
input { padding: 0 12px; }
.search-field input { width: 100%; padding-left: 34px; }
select { padding: 0 30px 0 11px; }
.result-count { margin-left: auto; color: var(--muted); font-size: .68rem; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .69rem; }
.data-table th { padding: 10px 11px; color: #627a96; font-size: .57rem; text-align: left; text-transform: uppercase; letter-spacing: .09em; border-bottom: 1px solid var(--line-strong); }
.data-table td { padding: 12px 11px; color: #aab7c7; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: rgba(75,135,205,.045); }
.data-table td strong { color: #e2ecf8; }
.record-title { min-width: 190px; display: flex; flex-direction: column; }
.record-title small { margin-top: 3px; font-family: ui-monospace, monospace; font-size: .57rem; }
.jobs-table th:first-child { min-width: 240px; }

.detail-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.detail-actions { display: flex; align-items: center; gap: 10px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-hero { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(15,36,61,.9), rgba(9,25,43,.86)); box-shadow: var(--shadow); overflow: hidden; }
.detail-hero > div { min-width: 0; padding: 18px 16px; border-right: 1px solid var(--line); }
.detail-hero > div:last-child { border-right: 0; }
.detail-hero small { display: block; margin-bottom: 7px; font-size: .52rem; letter-spacing: .08em; }
.detail-hero strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.alert-panel { margin-bottom: 17px; }
.vertical-timeline { position: relative; display: grid; gap: 0; padding-left: 7px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; min-height: 61px; }
.timeline-item::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: -4px; width: 1px; background: #203b5c; }
.timeline-item:last-child::before { display: none; }
.timeline-item > i { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 2px solid #3e6996; border-radius: 50%; background: #0c1d33; }
.timeline-item > i.done { border-color: var(--green); background: var(--green); box-shadow: 0 0 10px rgba(70,214,154,.3); }
.timeline-item > div { display: flex; flex-direction: column; }
.timeline-item strong { font-size: .73rem; }
.timeline-item span { margin-top: 4px; color: #96a8bc; font-size: .64rem; }
.timeline-item small { margin-top: 3px; font-size: .58rem; }
.commercial-stack { display: grid; gap: 0; }
.commercial-stack > div, .mini-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .7rem; }
.commercial-stack span, .mini-list span { color: var(--muted); }
.commercial-stack .total { margin-top: 5px; border-bottom: 0; color: var(--green); }
.mini-list { margin-top: 9px; }
.assignment-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.assignment-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.assignment-card > div { display: flex; align-items: center; gap: 11px; }
.assignment-card > div > div { display: flex; flex-direction: column; }
.assignment-card strong { font-size: .78rem; }
.assignment-card dl { margin: 15px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.assignment-card dl > div { display: flex; flex-direction: column; }
.assignment-card dt { color: var(--faint); font-size: .52rem; text-transform: uppercase; letter-spacing: .08em; }
.assignment-card dd { margin: 5px 0 0; color: #aebdce; font-size: .65rem; }
.vehicle-symbol { color: var(--blue-bright); }
.vehicle-symbol.large { font-size: 1.45rem; text-shadow: 0 0 22px rgba(60,145,255,.45); }

.fleet-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.vehicle-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(14,34,58,.92), rgba(7,21,38,.88)); box-shadow: var(--shadow); }
.vehicle-card.historical { opacity: .62; }
.vehicle-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vehicle-identity { min-width: 0; display: flex; gap: 12px; align-items: center; }
.vehicle-identity h2 { margin-bottom: 2px; font-size: 1rem; }
.vehicle-identity span { color: var(--muted); font-size: .66rem; }
.vehicle-identity .eyebrow { margin: 0 0 3px; font-size: .5rem; }
.vehicle-plate { display: inline-block; margin: 17px 0; padding: 7px 9px; color: #d7e6f7; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(2,9,17,.55); font: 700 .66rem ui-monospace, monospace; letter-spacing: .08em; }
.vehicle-schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vehicle-schedule > div { min-width: 0; display: flex; flex-direction: column; padding: 11px; border-radius: 9px; background: rgba(255,255,255,.022); }
.vehicle-schedule small { font-size: .51rem; letter-spacing: .08em; }
.vehicle-schedule strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; font-size: .66rem; white-space: nowrap; }
.vehicle-schedule span { margin-top: 3px; color: var(--muted); font-size: .57rem; }
.readiness-pair { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.readiness-pair span { padding: 5px 7px; border-radius: 6px; font-size: .55rem; }
.readiness-pair .ok { color: var(--green); background: rgba(70,214,154,.06); }
.readiness-pair .warning { color: var(--amber); background: rgba(255,187,85,.06); }
.vehicle-notes { margin: 12px 0 0; color: var(--muted); font-size: .61rem; line-height: 1.45; }

.timeline-filters span:first-child { color: var(--muted); font-size: .68rem; }
.chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .62rem; }
.chip.active { color: #d6eaff; border-color: rgba(60,145,255,.28); background: rgba(60,145,255,.1); }
.timeline-table { max-width: 1050px; margin: 0 auto; }
.timeline-day { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 12px; margin: 14px 0 5px; }
.timeline-day strong { color: #6f86a1; font-size: .6rem; }
.timeline-day span { height: 1px; background: var(--line); }
.timeline-row { display: grid; grid-template-columns: 80px 13px minmax(0,1fr) auto 18px; gap: 14px; align-items: center; min-height: 55px; padding: 7px 9px; border-radius: 9px; }
.timeline-row:hover { background: rgba(60,145,255,.045); }
.timeline-time { color: #7187a1; text-align: right; font: .62rem ui-monospace, monospace; }
.phase-node { width: 9px; height: 9px; border: 2px solid var(--blue); border-radius: 50%; background: var(--bg); }
.timeline-copy { min-width: 0; display: flex; flex-direction: column; }
.timeline-copy strong { font-size: .71rem; }
.timeline-copy small { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .59rem; }

.approval-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.approval-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(14,34,58,.92), rgba(7,21,38,.88)); box-shadow: var(--shadow); }
.approval-head { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; }
.approval-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--amber); border-radius: 12px; background: rgba(255,187,85,.08); border: 1px solid rgba(255,187,85,.15); }
.approval-head .eyebrow { margin: 0 0 3px; }
.approval-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decision-copy { margin: 16px 0 0; padding: 13px; color: #b0bdcd; border-left: 2px solid #335f91; background: rgba(255,255,255,.02); font-size: .7rem; line-height: 1.5; }
.approval-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.approval-meta div { display: flex; flex-direction: column; }
.approval-meta dt { color: var(--faint); font-size: .52rem; text-transform: uppercase; }
.approval-meta dd { margin: 5px 0 0; color: #b6c5d6; font-size: .67rem; }
.approval-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

.safety-hero, .control-hero { margin-bottom: 17px; padding: 22px; display: flex; align-items: center; gap: 18px; border: 1px solid rgba(70,214,154,.16); border-radius: var(--radius); background: linear-gradient(135deg, rgba(70,214,154,.07), rgba(12,31,50,.85)); box-shadow: var(--shadow); }
.safety-hero.alerting { border-color: rgba(255,100,118,.2); background: linear-gradient(135deg, rgba(255,100,118,.07), rgba(12,31,50,.85)); }
.shield { width: 53px; height: 53px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green); border: 1px solid rgba(70,214,154,.25); border-radius: 17px; background: rgba(70,214,154,.08); font-size: 1.55rem; }
.safety-hero p:last-child, .control-hero p:last-child { margin: 6px 0 0; color: var(--muted); font-size: .69rem; }
.mini-record { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .7rem; }
.mini-record > span:first-child { display: flex; flex-direction: column; }
.mini-record small { margin-top: 3px; }

.control-hero { border-color: rgba(60,145,255,.18); background: linear-gradient(135deg, rgba(60,145,255,.08), rgba(12,31,50,.86)); }
.control-hero > div:first-child { flex: 1; }
.control-totals { display: flex; gap: 8px; }
.control-totals span { min-width: 58px; padding: 9px; display: flex; flex-direction: column; color: var(--muted); border-radius: 9px; background: rgba(255,255,255,.025); font-size: .51rem; text-transform: uppercase; }
.control-totals strong { margin-bottom: 3px; color: var(--ink); font-size: 1rem; }
.control-totals .critical strong, .control-totals .high strong { color: var(--red); }
.control-totals .medium strong { color: var(--amber); }
.audit-list { display: grid; }
.audit-list > div { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.audit-list i { width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--blue); }
.audit-list span { display: flex; flex-direction: column; }
.audit-list strong { font-size: .68rem; }
.audit-list small { margin-top: 3px; font-size: .56rem; }

.quote-workspace { display: grid; grid-template-columns: minmax(315px, 365px) minmax(0, 1fr); gap: 17px; align-items: start; }
.quote-cockpit { position: sticky; top: 16px; padding: 18px; }
.quote-heading { margin-bottom: 4px; }
.source-chip { padding: 5px 7px; color: var(--green); border: 1px solid rgba(70,214,154,.18); border-radius: 6px; background: rgba(70,214,154,.06); font-size: .5rem; font-weight: 850; letter-spacing: .1em; }
.quote-fields { display: grid; gap: 10px; }
.quote-fields.two { grid-template-columns: 1fr 1fr; }
.quote-field { min-width: 0; display: grid; gap: 6px; }
.quote-field.full { grid-column: 1 / -1; margin-top: 10px; }
.quote-field label, .quote-attach-grid label { color: #9eb0c4; font-size: .59rem; font-weight: 750; letter-spacing: .03em; }
.quote-field input, .quote-field select, .quote-field textarea, .quote-inline input, .quote-inline select { width: 100%; min-width: 0; }
.quote-field textarea { min-height: 76px; padding: 10px 12px; resize: vertical; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: rgba(3,13,25,.72); line-height: 1.4; }
.quote-field textarea:focus { border-color: rgba(60,145,255,.55); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.quote-field small { font-size: .54rem; line-height: 1.4; }
.quote-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.quote-divider { margin: 17px 0 10px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; color: #55718f; font-size: .5rem; font-weight: 850; letter-spacing: .14em; }
.quote-divider::after { content: ""; height: 1px; background: var(--line); }
.input-suffix, .input-prefix { position: relative; }
.input-suffix input { padding-right: 34px; }
.input-suffix span { position: absolute; right: 12px; top: 10px; color: var(--muted); font-size: .65rem; }
.input-prefix input { padding-left: 30px; }
.input-prefix span { position: absolute; left: 12px; top: 9px; color: var(--muted); font-size: .72rem; }
.profile-warning { margin-top: 14px; padding: 10px 11px; display: grid; gap: 4px; color: #cbb883; border: 1px solid rgba(255,187,85,.18); border-radius: 9px; background: rgba(255,187,85,.055); }
.profile-warning strong { color: var(--amber); font-size: .64rem; }
.profile-warning span { font-size: .55rem; line-height: 1.4; }
.quote-summary { margin-top: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(2,10,20,.38); }
.quote-summary > div { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.quote-summary > div:last-child { border-bottom: 0; }
.quote-summary span { color: var(--muted); font-size: .58rem; }
.quote-summary strong { font-size: .68rem; font-variant-numeric: tabular-nums; }
.quote-margin-row strong.positive { color: var(--green); }
.quote-margin-row strong.negative { color: var(--red); }
.quote-save { width: 100%; margin-top: 14px; }
.approval-note { display: block; margin-top: 8px; text-align: center; font-size: .52rem; line-height: 1.4; }
.calculator-panel { padding: 18px; overflow: hidden; }
.calculator-status { margin-bottom: 10px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .59rem; }
.calculator-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgba(255,187,85,.5); }
.calculator-status.ready i { background: var(--green); box-shadow: 0 0 10px rgba(70,214,154,.5); }
.calculator-status.error { color: var(--red); }
.calculator-status.error i { background: var(--red); box-shadow: 0 0 10px rgba(255,100,118,.5); }
.calculator-frame { width: 100%; height: 2240px; display: block; border: 1px solid var(--line-strong); border-radius: 13px; background: #071426; }
.quote-history { margin-top: 17px; }
.quote-draft-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.quote-draft-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.quote-draft-card.official { border-color: rgba(70,214,154,.22); background: rgba(70,214,154,.025); }
.quote-draft-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.quote-draft-head > div { min-width: 0; display: flex; flex-direction: column; }
.quote-draft-head strong { font: 750 .72rem ui-monospace, monospace; }
.quote-draft-head small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .54rem; }
.quote-draft-numbers { margin: 13px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quote-draft-numbers > div { padding: 9px; display: flex; flex-direction: column; gap: 4px; border-radius: 8px; background: rgba(3,12,23,.4); }
.quote-draft-numbers span { color: var(--faint); font-size: .5rem; text-transform: uppercase; }
.quote-draft-numbers strong { font-size: .68rem; }
.quote-draft-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); }
.quote-attach-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quote-attach-grid form { min-width: 0; display: grid; gap: 6px; }
.quote-attach-grid .quote-inline { grid-template-columns: minmax(0, 1fr) auto; }
.official-note { margin: 10px 0 0; color: var(--green); font-size: .57rem; }

.vehicle-edit-link { display: inline-flex; margin-top: 15px; }
.live-edit-notice { margin-bottom: 17px; padding: 14px 17px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(70,214,154,.2); border-radius: 13px; background: linear-gradient(135deg, rgba(70,214,154,.08), rgba(9,27,44,.86)); }
.live-edit-notice.locked { border-color: rgba(255,187,85,.2); background: linear-gradient(135deg, rgba(255,187,85,.07), rgba(9,27,44,.86)); }
.live-edit-notice > div:nth-child(2) { flex: 1; }
.live-edit-notice strong { color: var(--green); font-size: .72rem; }
.live-edit-notice.locked strong { color: var(--amber); }
.live-edit-notice p { margin: 4px 0 0; color: var(--muted); font-size: .62rem; }
.live-edit-notice > span { padding: 5px 8px; color: #9cb0c7; border: 1px solid var(--line); border-radius: 6px; font-size: .52rem; font-weight: 850; letter-spacing: .1em; }
.live-edit-pulse { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(70,214,154,.08), 0 0 16px rgba(70,214,154,.45); }
.locked .live-edit-pulse { background: var(--amber); box-shadow: 0 0 0 5px rgba(255,187,85,.08), 0 0 16px rgba(255,187,85,.35); }
.editor-filter-panel { margin-bottom: 17px; padding: 14px 17px; }
.editor-filter { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.5fr) auto auto; align-items: end; gap: 10px; }
.editor-filter label { min-width: 0; display: grid; gap: 5px; color: #94a8bf; font-size: .59rem; font-weight: 750; }
.editor-filter input, .editor-filter select { width: 100%; }
.editor-filter > small { align-self: center; white-space: nowrap; }
.live-editor-layout { display: grid; grid-template-columns: minmax(245px, 300px) minmax(0, 1fr); gap: 17px; align-items: start; }
.record-browser { position: sticky; top: 16px; padding: 15px; }
.record-browser .panel-heading { padding: 2px 4px 12px; margin-bottom: 0; }
.record-count { min-width: 29px; height: 25px; padding: 0 7px; display: grid; place-items: center; color: #99b7da; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); font-size: .58rem; font-weight: 800; }
.record-list { max-height: min(66vh, 700px); margin: 0 -5px -3px; padding: 0 5px 3px; overflow-y: auto; scrollbar-color: #24486f transparent; }
.record-picker { position: relative; min-width: 0; padding: 11px 30px 11px 10px; display: flex; flex-direction: column; border-top: 1px solid var(--line); border-radius: 8px; transition: .16s ease; }
.record-picker:first-child { border-top-color: transparent; }
.record-picker:hover { background: rgba(60,145,255,.06); }
.record-picker.active { border-color: rgba(60,145,255,.2); background: rgba(60,145,255,.1); box-shadow: inset 2px 0 var(--blue); }
.record-picker strong, .record-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-picker strong { font-size: .68rem; }
.record-picker small { margin-top: 4px; font-size: .54rem; }
.record-picker > span { position: absolute; right: 10px; top: 17px; color: #6686aa; font-size: 1rem; }
.record-editor { padding: 20px; }
.record-editor-head { padding-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.record-editor-head h2 { margin-bottom: 4px; font-size: 1.12rem; }
.record-editor-head small { font: .56rem ui-monospace, monospace; }
.live-badge { padding: 6px 8px; display: flex; align-items: center; gap: 6px; color: var(--green); border: 1px solid rgba(70,214,154,.18); border-radius: 7px; background: rgba(70,214,154,.06); font-size: .5rem; font-weight: 850; letter-spacing: .08em; white-space: nowrap; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(70,214,154,.5); }
.record-edit-form { margin-top: 18px; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.editor-field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.editor-field.wide { grid-column: 1 / -1; }
.editor-field > span:first-child { color: #a4b6cb; font-size: .61rem; font-weight: 750; }
.editor-field > input, .editor-field > select, .editor-field > textarea { width: 100%; min-width: 0; }
.editor-field > textarea { min-height: 94px; padding: 10px 12px; resize: vertical; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: rgba(3,13,25,.72); line-height: 1.45; }
.editor-field > textarea:focus { border-color: rgba(60,145,255,.55); box-shadow: 0 0 0 3px rgba(60,145,255,.08); }
.editor-field > select[multiple] { height: auto; min-height: 108px; padding: 7px; }
.editor-field > select[multiple] option { padding: 6px 7px; border-radius: 5px; }
.editor-field > small { font-size: .52rem; line-height: 1.4; }
.editor-field input:disabled, .editor-field select:disabled, .editor-field textarea:disabled { opacity: .55; cursor: not-allowed; }
.toggle-field { min-height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(3,13,25,.72); }
.toggle-field input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-field i { width: 31px; height: 18px; position: relative; flex: 0 0 auto; border-radius: 999px; background: #23354b; transition: .18s ease; }
.toggle-field i::after { content: ""; width: 12px; height: 12px; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: #8fa2b8; transition: .18s ease; }
.toggle-field input:checked + i { background: rgba(70,214,154,.35); }
.toggle-field input:checked + i::after { left: 16px; background: var(--green); }
.toggle-field em { color: var(--muted); font-size: .59rem; font-style: normal; }
.editor-save-bar { position: sticky; bottom: 10px; z-index: 4; margin-top: 22px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid rgba(60,145,255,.2); border-radius: 12px; background: rgba(7,22,39,.94); backdrop-filter: blur(18px); box-shadow: 0 14px 40px rgba(0,0,0,.34); }
.editor-save-bar > div { display: flex; flex-direction: column; }
.editor-save-bar strong { font-size: .67rem; }
.editor-save-bar small { margin-top: 3px; font-size: .53rem; line-height: 1.35; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 420px); padding: 34px; border: 1px solid var(--line-strong); border-radius: 22px; background: rgba(8,22,39,.94); box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.login-brand { margin-bottom: 44px; padding: 0; }
.login-card h1 { font-size: 2rem; }
.login-card > .muted { line-height: 1.5; }
.stack-form { display: grid; gap: 10px; margin-top: 24px; }
.stack-form label { color: #9eb0c4; font-size: .68rem; font-weight: 700; }
.stack-form input { width: 100%; }
.stack-form .button { margin-top: 8px; }
.error-panel { min-height: 380px; display: grid; place-items: center; align-content: center; text-align: center; }
.error-code { color: var(--red); font-size: 4rem; font-weight: 900; letter-spacing: -.08em; }
.error-panel p { color: var(--muted); }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .phase-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fleet-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-hero { grid-template-columns: repeat(3, 1fr); }
  .detail-hero > div:nth-child(3) { border-right: 0; }
  .detail-hero > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .quote-workspace { grid-template-columns: 320px minmax(0, 1fr); }
  .quote-draft-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 25px 22px 15px; }
  .content { padding: 17px 22px 100px; }
  .safety-banner { margin: 0 22px; }
  .flash-stack { margin: 12px 22px 0; }
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40; min-height: 62px; padding: 6px; display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid rgba(150,183,220,.17); border-radius: 18px; background: rgba(5,14,27,.9); backdrop-filter: blur(22px); box-shadow: 0 18px 50px rgba(0,0,0,.38); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 3px; color: #71859e; border-radius: 12px; font-size: .52rem; font-weight: 700; }
  .mobile-nav a span { font-size: 1.03rem; }
  .mobile-nav a.active { color: #cfe4ff; background: rgba(60,145,255,.12); }
  .mobile-nav a.active span { color: var(--blue-bright); }
  .fleet-grid, .approval-grid { grid-template-columns: 1fr; }
  .control-hero { align-items: flex-start; flex-wrap: wrap; }
  .quote-workspace { grid-template-columns: 1fr; }
  .quote-cockpit { position: static; }
  .calculator-frame { height: 2380px; }
  .live-editor-layout { grid-template-columns: 1fr; }
  .record-browser { position: static; }
  .record-list { max-height: 350px; }
}

@media (max-width: 640px) {
  .topbar { align-items: center; }
  .topbar h1 { font-size: 1.55rem; }
  .topbar .button { display: none; }
  .page-subtitle { max-width: 250px; font-size: .72rem; }
  .safety-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 108px; padding: 15px; }
  .metric-card > strong { font-size: 1.65rem; }
  .metric-label { font-size: .56rem; }
  .dashboard-grid { gap: 12px; }
  .panel { padding: 16px; }
  .job-row { grid-template-columns: 40px 1fr auto 14px; }
  .job-vehicle { display: none; }
  .job-status { display: none; }
  .phase-strip { grid-template-columns: 1fr; }
  .filter-bar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .result-count { order: 5; width: 100%; }
  .detail-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .detail-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  .detail-hero { grid-template-columns: 1fr 1fr; }
  .detail-hero > div { border-bottom: 1px solid var(--line); }
  .detail-hero > div:nth-child(2n) { border-right: 0; }
  .detail-hero > div:nth-last-child(-n+2) { border-bottom: 0; }
  .assignment-grid { grid-template-columns: 1fr; }
  .assignment-card dl { grid-template-columns: 1fr 1fr; }
  .vehicle-schedule { grid-template-columns: 1fr; }
  .timeline-day { grid-template-columns: 72px 1fr; }
  .timeline-row { grid-template-columns: 56px 10px 1fr 16px; gap: 9px; }
  .timeline-row .badge { display: none; }
  .approval-head { grid-template-columns: 38px 1fr; }
  .approval-head > .badge { grid-column: 2; justify-self: start; }
  .control-totals { width: 100%; overflow-x: auto; }
  .control-hero form, .control-hero form .button { width: 100%; }
  .quote-fields.two, .quote-attach-grid { grid-template-columns: 1fr; }
  .quote-draft-actions { justify-content: stretch; }
  .quote-draft-actions .button, .quote-draft-actions form { width: 100%; }
  .quote-draft-actions form .button { width: 100%; }
  .calculator-panel { padding: 10px; }
  .calculator-frame { height: 2600px; border-radius: 9px; }
  .live-edit-notice { align-items: flex-start; }
  .live-edit-notice > span { display: none; }
  .editor-filter { grid-template-columns: 1fr; }
  .editor-filter > small { justify-self: start; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-field.wide { grid-column: auto; }
  .record-editor { padding: 16px; }
  .record-editor-head { align-items: flex-start; flex-direction: column; }
  .editor-save-bar { align-items: stretch; flex-direction: column; }
  .editor-save-bar .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
