:root {
  --bg: #06100e;
  --bg-elevated: #091713;
  --surface: #0c1d19;
  --surface-strong: #112722;
  --surface-soft: #0e211d;
  --line: #23413a;
  --line-soft: rgba(134, 182, 169, 0.16);
  --text: #f2faf7;
  --muted: #9ab5ad;
  --muted-strong: #bed1cb;
  --acid: #baf45f;
  --acid-dark: #77a92d;
  --teal: #3ce0c2;
  --amber: #ffbd57;
  --coral: #ff7568;
  --blue: #78a7ff;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
  --sidebar-width: 248px;
  --radius: 10px;
  --radius-small: 6px;
  --transition: 180ms ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 7%, rgba(60, 224, 194, 0.07), transparent 23rem),
    linear-gradient(135deg, #06100e 0%, #071310 55%, #050c0b 100%);
  font-size: 15px;
  line-height: 1.5;
}

button, select { font: inherit; }
button { color: inherit; }
button, [role="button"], select { touch-action: manipulation; }
button:focus-visible, select:focus-visible, [tabindex]:focus-visible, a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  color: #07110e;
  background: var(--acid);
  font-weight: 800;
  text-decoration: none;
  border-radius: var(--radius-small);
}
.skip-link:focus { transform: translateY(0); }

.demo-ribbon {
  position: relative;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 6px 18px;
  color: #d8e7e2;
  background: #101c19;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.01em;
  text-align: center;
}
.demo-ribbon__label {
  padding: 2px 7px;
  color: #08120f;
  background: var(--acid);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh - 34px); }

.sidebar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 34px);
  padding: 24px 18px 18px;
  background: rgba(7, 18, 15, 0.96);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}

.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-lockup > span:last-child { display: grid; }
.brand-lockup strong { font-size: 17px; letter-spacing: 0.01em; }
.brand-lockup small { color: var(--muted); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; }
.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 7px;
  background: var(--acid);
  border-radius: 7px;
  box-shadow: 0 0 24px rgba(186, 244, 95, 0.14);
}
.brand-mark i { display: block; background: #102014; border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 19px; }

.primary-nav { display: grid; gap: 5px; }
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--muted-strong);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}
.nav-item:hover { color: var(--text); background: rgba(186, 244, 95, 0.045); border-color: var(--line-soft); transform: translateX(2px); }
.nav-item.is-active { color: var(--text); background: var(--surface-strong); border-color: var(--line); }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 23px; background: var(--acid); border-radius: 0 3px 3px 0; }
.nav-icon { color: #668078; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; }
.nav-item.is-active .nav-icon { color: var(--acid); }
.nav-count { min-width: 23px; padding: 2px 6px; color: #201703; background: var(--amber); border-radius: 20px; font-size: 10px; font-weight: 900; text-align: center; }

.system-card { margin-top: auto; padding: 14px; background: linear-gradient(145deg, rgba(17, 39, 34, 0.9), rgba(10, 25, 21, 0.86)); border: 1px solid var(--line); border-radius: var(--radius); }
.system-card__heading { display: flex; align-items: center; gap: 8px; }
.system-card h2 { margin: 0; font-size: 12px; }
.system-card dl { margin: 12px 0 0; }
.system-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--muted); border-top: 1px solid var(--line-soft); font-size: 11px; }
.system-card dt, .system-card dd { margin: 0; }
.system-card dd { color: var(--muted-strong); }
.sidebar-footnote { margin: 12px 4px 0; color: #69827a; font-size: 10px; line-height: 1.45; }

.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(60, 224, 194, 0.09), 0 0 15px rgba(60, 224, 194, 0.5); }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 14px clamp(18px, 3vw, 42px);
  background: rgba(6, 16, 14, 0.88);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}
.view-heading { margin-right: auto; }
.view-heading h1 { margin: 1px 0 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.15; letter-spacing: -0.03em; }
.eyebrow, .panel-kicker { margin: 0; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.simulation-time { display: grid; min-width: 82px; padding-right: 15px; border-right: 1px solid var(--line); text-align: right; }
.simulation-time span { color: var(--muted); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.simulation-time strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.menu-toggle { display: none; width: 42px; height: 42px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); cursor: pointer; }
.menu-toggle span:not(.sr-only) { display: block; width: 100%; height: 2px; margin: 4px 0; background: var(--text); }

.primary-button, .secondary-button, .control-button, .text-button, .chip {
  border: 0;
  cursor: pointer;
  transition: transform var(--transition), color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 15px;
  color: #0a130b;
  background: var(--acid);
  border: 1px solid var(--acid);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 7px 22px rgba(186, 244, 95, 0.08);
}
.primary-button:hover { background: #cbff78; transform: translateY(-1px); box-shadow: 0 9px 27px rgba(186, 244, 95, 0.14); }
.primary-button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.secondary-button { min-height: 42px; padding: 10px 15px; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 750; }
.secondary-button:hover { background: var(--surface-strong); border-color: #3b5f56; }
.control-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 13px; color: var(--muted-strong); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 750; }
.control-button:hover { color: var(--text); border-color: #3b5f56; }
.control-button__symbol { color: var(--acid); font-weight: 900; }
.text-button { padding: 7px 0; color: var(--acid); background: transparent; font-size: 11px; font-weight: 800; }
.text-button:hover { color: #d6ff91; }

main { width: min(1640px, 100%); margin: 0 auto; padding: 24px clamp(18px, 3vw, 42px) 48px; }
.view-panel { animation: panel-in 260ms ease both; }
.view-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.status-line { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.status-line p { display: flex; align-items: center; gap: 7px; margin: 0; }
.status-line strong { color: var(--muted-strong); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { position: relative; min-width: 0; min-height: 126px; padding: 17px; overflow: hidden; background: linear-gradient(145deg, rgba(14, 33, 29, 0.96), rgba(9, 24, 20, 0.98)); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.metric-card::after { content: ""; position: absolute; right: -42px; bottom: -60px; width: 130px; height: 130px; background: radial-gradient(circle, rgba(60, 224, 194, 0.08), transparent 68%); }
.metric-card--accent { border-color: rgba(186, 244, 95, 0.36); }
.metric-card > p:first-child { margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-card > div:not(.metric-spark):not(.progress-track):not(.crew-pips) { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.metric-card strong { font-size: clamp(25px, 2.6vw, 36px); line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.trend { margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 800; }
.trend--up { color: var(--acid); }
.trend--good { color: var(--teal); }
.metric-detail { position: relative; z-index: 1; margin: 14px 0 0; color: #78948b; font-size: 10px; }
.metric-spark { position: absolute; right: 14px; bottom: 13px; display: flex; align-items: end; gap: 3px; width: 65px; height: 33px; opacity: 0.68; }
.metric-spark i { flex: 1; background: var(--acid); border-radius: 1px 1px 0 0; }
.progress-track { height: 4px; margin-top: 21px; overflow: hidden; background: #1a332d; border-radius: 4px; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--acid)); border-radius: inherit; }
.crew-pips { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-top: 18px; }
.crew-pips i { height: 5px; background: var(--teal); border-radius: 3px; }
.crew-pips i.is-idle { background: #365049; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.72fr); gap: 14px; margin-bottom: 14px; }
.insight-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 14px; }
.panel { min-width: 0; background: rgba(10, 25, 21, 0.92); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.11); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px 19px; border-bottom: 1px solid var(--line-soft); }
.panel-heading h2, .panel-heading h3 { margin: 3px 0 0; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.2; letter-spacing: -0.025em; }
.panel-heading--compact { align-items: center; padding: 16px 18px; }

.map-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.chip { min-height: 30px; padding: 6px 10px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 5px; font-size: 9px; font-weight: 800; }
.chip:hover, .chip.is-active { color: #0d160c; background: var(--acid); border-color: var(--acid); }

.map-stage { position: relative; min-height: 410px; overflow: hidden; isolation: isolate; background: #091814; }
.map-stage::before { content: ""; position: absolute; inset: 0; z-index: -3; background: radial-gradient(circle at 36% 44%, rgba(60, 224, 194, 0.07), transparent 26%), linear-gradient(110deg, transparent 45%, rgba(186, 244, 95, 0.025) 45%, rgba(186, 244, 95, 0.025) 60%, transparent 60%); }
.map-grid { position: absolute; inset: 0; z-index: -2; opacity: 0.4; background-image: linear-gradient(rgba(79, 133, 119, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 133, 119, 0.12) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(to bottom, black 80%, transparent); }
.road { position: absolute; z-index: -1; height: 2px; background: rgba(136, 176, 165, 0.18); box-shadow: 0 0 0 6px rgba(95, 134, 123, 0.025); transform-origin: left center; }
.road::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(186, 244, 95, 0.35) 18px 23px, transparent 23px 42px); }
.road--one { top: 18%; left: -8%; width: 82%; transform: rotate(17deg); }
.road--two { top: 8%; left: 43%; width: 72%; transform: rotate(70deg); }
.road--three { top: 70%; left: -5%; width: 80%; transform: rotate(-13deg); }
.road--four { top: 54%; left: 26%; width: 90%; transform: rotate(2deg); }
.map-zone { position: absolute; color: rgba(154, 181, 173, 0.38); border: 1px dashed rgba(154, 181, 173, 0.12); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; }
.map-zone span { position: absolute; top: 8px; left: 9px; }
.map-zone--north { top: 6%; left: 8%; width: 34%; height: 29%; }
.map-zone--central { top: 23%; left: 40%; width: 38%; height: 37%; }
.map-zone--south { right: 5%; bottom: 11%; width: 45%; height: 28%; }

.map-marker { position: absolute; z-index: 3; top: var(--y); left: var(--x); display: grid; place-items: center; transform: translate(-50%, -50%); cursor: pointer; transition: top 600ms ease, left 600ms ease, opacity var(--transition), transform var(--transition); }
.map-marker--unit { width: 39px; height: 39px; color: #07120e; background: var(--teal); border: 4px solid rgba(7, 20, 17, 0.92); border-radius: 8px; box-shadow: 0 0 0 1px var(--teal), 0 7px 22px rgba(0, 0, 0, 0.35); font-size: 9px; font-weight: 950; }
.map-marker--unit[data-state="available"] { background: var(--acid); box-shadow: 0 0 0 1px var(--acid), 0 0 22px rgba(186, 244, 95, 0.18); }
.map-marker--unit:hover, .map-marker--unit:focus-visible { z-index: 6; transform: translate(-50%, -50%) scale(1.12); }
.map-marker--unit.is-moving::after { content: ""; position: absolute; inset: -9px; border: 1px solid rgba(60, 224, 194, 0.34); border-radius: 12px; animation: marker-pulse 1.8s ease-out infinite; }
@keyframes marker-pulse { 0% { opacity: 0; transform: scale(0.7); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
.map-marker--job { width: 29px; height: 29px; color: #131a16; background: var(--amber); border: 3px solid #091814; border-radius: 50%; box-shadow: 0 0 0 1px var(--amber); font-size: 13px; font-weight: 900; }
.map-marker--job.is-critical { color: #fff; background: var(--coral); box-shadow: 0 0 0 1px var(--coral), 0 0 25px rgba(255, 117, 104, 0.32); }
.map-marker.is-filtered { opacity: 0.12; pointer-events: none; }

.map-callout { position: absolute; z-index: 9; top: 15px; left: 15px; display: grid; min-width: 190px; padding: 13px 35px 13px 14px; background: rgba(13, 31, 26, 0.97); border: 1px solid #3c6258; border-radius: 7px; box-shadow: var(--shadow); }
.map-callout button { position: absolute; top: 6px; right: 7px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 19px; }
.map-callout__type { margin: 0; color: var(--teal); font-size: 8px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.map-callout strong { margin: 2px 0; font-size: 14px; }
.map-callout span { color: var(--muted); font-size: 10px; }
.map-legend { position: absolute; right: 13px; bottom: 13px; z-index: 2; display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 10px; color: var(--muted); background: rgba(5, 16, 13, 0.83); border: 1px solid var(--line); border-radius: 5px; font-size: 8px; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend i { width: 7px; height: 7px; border-radius: 2px; }
.legend-unit { background: var(--teal); }
.legend-available { background: var(--acid); }
.legend-priority { background: var(--coral); border-radius: 50% !important; }

.queue-summary { display: flex; gap: 8px; padding: 12px 15px 0; }
.queue-summary span { flex: 1; padding: 8px 10px; color: var(--muted); background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line-soft); border-radius: 5px; font-size: 9px; }
.queue-summary strong { color: var(--text); font-size: 14px; }
.job-list { display: grid; gap: 8px; padding: 12px 15px 15px; }
.empty-state { margin: 0; padding: 18px; color: var(--muted); background: rgba(255, 255, 255, 0.02); border: 1px dashed var(--line); border-radius: 6px; font-size: 10px; text-align: center; }
.job-card { position: relative; width: 100%; padding: 12px; color: inherit; background: #0d211c; border: 1px solid var(--line-soft); border-left: 3px solid var(--amber); border-radius: 6px; cursor: pointer; text-align: left; transition: transform var(--transition), border-color var(--transition), background var(--transition); }
.job-card:hover { background: #112a24; border-color: #41665c; transform: translateX(2px); }
.job-card[data-priority="critical"] { border-left-color: var(--coral); }
.job-card[data-priority="planned"] { border-left-color: var(--blue); }
.job-card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; }
.job-card__id { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.priority-label { padding: 2px 6px; color: var(--amber); background: rgba(255, 189, 87, 0.08); border: 1px solid rgba(255, 189, 87, 0.2); border-radius: 3px; font-size: 8px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.priority-label--critical { color: var(--coral); background: rgba(255, 117, 104, 0.08); border-color: rgba(255, 117, 104, 0.25); }
.priority-label--planned { color: var(--blue); background: rgba(120, 167, 255, 0.08); border-color: rgba(120, 167, 255, 0.22); }
.job-card h3, .job-card h4 { margin: 0 0 4px; font-size: 12px; }
.job-card p { margin: 0; color: var(--muted); font-size: 9px; }
.job-card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; color: #afc4bd; font-size: 8px; }

.chart-total { margin: 0; color: var(--muted); font-size: 9px; }
.chart-total strong { color: var(--text); font-size: 18px; }
.bar-chart { display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; gap: clamp(6px, 1.4vw, 16px); height: 225px; padding: 24px 20px 15px; border-bottom: 1px solid var(--line-soft); background: repeating-linear-gradient(to top, transparent 0 43px, rgba(130, 175, 163, 0.08) 43px 44px); }
.bar-chart__column { display: grid; grid-template-rows: 1fr auto; align-items: end; gap: 7px; height: 100%; color: var(--muted); font-size: 8px; text-align: center; }
.bar-chart__bar { position: relative; min-height: 4px; background: linear-gradient(to top, #2b8271, var(--teal)); border-radius: 3px 3px 0 0; transition: height 450ms ease; }
.bar-chart__bar::before { content: attr(data-value); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--muted-strong); font-size: 8px; font-weight: 800; }

.live-label { display: flex; align-items: center; gap: 5px; color: var(--teal); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.live-label i { width: 6px; height: 6px; background: var(--teal); border-radius: 50%; }
.activity-list { display: grid; gap: 0; max-height: 225px; margin: 0; padding: 6px 17px 10px; overflow: auto; list-style: none; }
.activity-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-item__dot { width: 7px; height: 7px; margin-top: 5px; background: var(--teal); border-radius: 50%; }
.activity-item[data-kind="urgent"] .activity-item__dot { background: var(--coral); }
.activity-item[data-kind="complete"] .activity-item__dot { background: var(--acid); }
.activity-item p { margin: 0; color: var(--muted-strong); font-size: 9px; }
.activity-item p strong { color: var(--text); }
.activity-item time { color: #69837b; font-size: 8px; font-variant-numeric: tabular-nums; }

.page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin: 8px 0 22px; }
.page-intro h2 { margin: 4px 0 6px; font-size: clamp(27px, 4vw, 44px); line-height: 1; letter-spacing: -0.055em; }
.page-intro p:not(.eyebrow) { max-width: 650px; margin: 0; color: var(--muted); font-size: 12px; }
.board-filters { display: grid; gap: 5px; min-width: 180px; }
.board-filters label { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.board-filters select { min-height: 40px; padding: 8px 34px 8px 11px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.dispatch-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 14px; }
.count-badge { padding: 4px 8px; color: var(--amber); background: rgba(255, 189, 87, 0.07); border: 1px solid rgba(255, 189, 87, 0.2); border-radius: 4px; font-size: 9px; font-weight: 800; }
.count-badge--good { color: var(--acid); background: rgba(186, 244, 95, 0.06); border-color: rgba(186, 244, 95, 0.18); }
.dispatch-job-list, .crew-list { display: grid; gap: 9px; padding: 14px; }
.dispatch-job { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 13px; background: #0d211c; border: 1px solid var(--line-soft); border-radius: 7px; }
.dispatch-job__priority { width: 5px; height: 46px; background: var(--amber); border-radius: 2px; }
.dispatch-job[data-priority="critical"] .dispatch-job__priority { background: var(--coral); }
.dispatch-job[data-priority="planned"] .dispatch-job__priority { background: var(--blue); }
.dispatch-job h4, .crew-row h4 { margin: 0 0 3px; font-size: 12px; }
.dispatch-job p, .crew-row p { margin: 0; color: var(--muted); font-size: 9px; }
.dispatch-job button { min-height: 36px; }
.crew-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; background: #0d211c; border: 1px solid var(--line-soft); border-radius: 7px; }
.crew-badge { display: grid; place-items: center; width: 40px; height: 40px; color: #0a160f; background: var(--acid); border-radius: 7px; font-size: 9px; font-weight: 900; }
.crew-row[data-status="busy"] .crew-badge { background: var(--teal); }
.crew-row[data-status="break"] .crew-badge { color: var(--muted-strong); background: #294039; }
.status-tag { padding: 3px 7px; color: var(--acid); border: 1px solid rgba(186, 244, 95, 0.2); border-radius: 3px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.status-tag--busy { color: var(--teal); border-color: rgba(60, 224, 194, 0.22); }
.status-tag--break { color: var(--muted); border-color: var(--line); }
.route-strip { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-top: 14px; padding: 20px; border-color: rgba(186, 244, 95, 0.25); }
.route-strip h3 { margin: 4px 0; font-size: 17px; }
.route-strip p:not(.panel-kicker) { margin: 0; color: var(--muted); font-size: 10px; }

.capacity-summary { display: grid; min-width: 110px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.capacity-summary strong { color: var(--acid); font-size: 21px; }
.capacity-summary span { color: var(--muted); font-size: 9px; }
.team-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.team-card { min-width: 0; padding: 16px; background: linear-gradient(145deg, #0e241e, #0a1c18); border: 1px solid var(--line-soft); border-top: 3px solid var(--teal); border-radius: var(--radius); }
.team-card[data-status="available"] { border-top-color: var(--acid); }
.team-card[data-status="break"] { border-top-color: #526d65; }
.team-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.team-card__code { display: grid; place-items: center; width: 37px; height: 37px; color: #07120e; background: var(--teal); border-radius: 6px; font-size: 8px; font-weight: 900; }
.team-card[data-status="available"] .team-card__code { background: var(--acid); }
.team-card[data-status="break"] .team-card__code { color: var(--muted-strong); background: #2c453e; }
.team-card h3 { margin: 13px 0 2px; font-size: 13px; }
.team-card > p { margin: 0; color: var(--muted); font-size: 9px; }
.team-card dl { display: grid; gap: 6px; margin: 14px 0 0; }
.team-card dl div { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.team-card dt { color: var(--muted); }
.team-card dd { margin: 0; color: var(--muted-strong); text-align: right; }
.skills-panel { margin-top: 14px; }
.table-note { margin: 0; color: var(--muted); font-size: 9px; }
.table-scroll { max-width: 100%; overflow: auto; }
table { width: 100%; min-width: 670px; border-collapse: collapse; }
th, td { padding: 13px 17px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 10px; }
th { color: var(--muted); background: rgba(255, 255, 255, 0.015); font-size: 8px; letter-spacing: 0.07em; text-transform: uppercase; }
td { color: var(--muted-strong); }
tbody tr:last-child td { border-bottom: 0; }
.skill-yes { color: var(--acid); font-weight: 850; }
.skill-no { color: #546e66; }

.period-switcher { display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.period-switcher button { min-height: 34px; padding: 7px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; cursor: pointer; font-size: 9px; font-weight: 800; }
.period-switcher button.is-active { color: #07110d; background: var(--acid); }
.metric-grid--analytics { margin-bottom: 14px; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 14px; }
.target-label { color: var(--acid); font-size: 9px; font-weight: 800; }
.line-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; height: 290px; padding: 25px 20px 17px; background: repeating-linear-gradient(to top, transparent 0 52px, rgba(130, 175, 163, 0.08) 52px 53px); }
.line-chart__point { position: relative; display: grid; align-content: end; justify-items: center; gap: 7px; height: 100%; color: var(--muted); font-size: 8px; }
.line-chart__stem { position: relative; width: 2px; background: linear-gradient(to top, rgba(60, 224, 194, 0.08), var(--teal)); }
.line-chart__stem::before { content: ""; position: absolute; top: -5px; left: 50%; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); background: var(--acid); box-shadow: 0 0 15px rgba(186, 244, 95, 0.25); }
.line-chart__stem::after { content: attr(data-value); position: absolute; top: -24px; left: 50%; transform: translateX(-50%); color: var(--text); font-size: 8px; font-weight: 800; }
.sector-breakdown { display: grid; gap: 18px; padding: 22px; }
.sector-row { display: grid; grid-template-columns: minmax(90px, auto) 1fr auto; align-items: center; gap: 12px; }
.sector-row__name { font-size: 10px; font-weight: 750; }
.sector-row__track { height: 7px; overflow: hidden; background: #1a332d; border-radius: 4px; }
.sector-row__track i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.sector-row:nth-child(2) .sector-row__track i { background: var(--acid); }
.sector-row:nth-child(3) .sector-row__track i { background: var(--blue); }
.sector-row:nth-child(4) .sector-row__track i { background: var(--amber); }
.sector-row strong { color: var(--muted-strong); font-size: 10px; }

.dispatch-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; color: var(--text); background: #0b1c18; border: 1px solid #3b6257; border-radius: var(--radius); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65); }
.dispatch-dialog::backdrop { background: rgba(2, 8, 6, 0.78); backdrop-filter: blur(5px); }
.dispatch-dialog form { margin: 0; }
.dialog-topline { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--muted); background: #0d241e; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.dialog-close { width: 33px; height: 33px; color: var(--muted-strong); background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: 20px; line-height: 1; }
.dialog-body { padding: 22px; }
.dialog-body h2 { margin: 4px 0 15px; font-size: 27px; letter-spacing: -0.04em; }
.dialog-job-summary { display: grid; gap: 5px; padding: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--coral); border-radius: 6px; font-size: 10px; }
.dialog-job-summary strong { color: var(--text); font-size: 13px; }
.dispatch-dialog fieldset { margin: 20px 0 0; padding: 0; border: 0; }
.dispatch-dialog legend { margin-bottom: 9px; font-size: 11px; font-weight: 800; }
.dialog-crew-options { display: grid; gap: 8px; }
.dialog-crew-option { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 11px; background: #0d211c; border: 1px solid var(--line-soft); border-radius: 6px; cursor: pointer; }
.dialog-crew-option:has(input:checked) { border-color: var(--acid); box-shadow: inset 0 0 0 1px var(--acid); }
.dialog-crew-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--acid); }
.dialog-crew-option span { display: grid; }
.dialog-crew-option strong { font-size: 11px; }
.dialog-crew-option small { color: var(--muted); font-size: 8px; }
.dialog-crew-option > small { color: var(--acid); font-size: 9px; font-weight: 800; }
.dialog-note { margin: 15px 0 0; color: #78928a; font-size: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: #081713; border-top: 1px solid var(--line); }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 86px; display: grid; gap: 8px; width: min(360px, calc(100% - 36px)); pointer-events: none; }
.toast { display: grid; grid-template-columns: 8px 1fr; gap: 11px; padding: 13px 14px; color: var(--muted-strong); background: #102822; border: 1px solid #3b6257; border-radius: 7px; box-shadow: var(--shadow); animation: toast-in 240ms ease both; font-size: 10px; }
.toast::before { content: ""; width: 7px; height: 7px; margin-top: 4px; background: var(--acid); border-radius: 50%; }
.toast strong { display: block; color: var(--text); font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.back-to-site {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px 14px 9px 9px;
  color: #0a130b;
  background: var(--acid);
  border: 1px solid #d5ff93;
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.46), 0 0 0 5px rgba(186, 244, 95, 0.08);
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.back-to-site:hover { background: #cbff78; transform: translateY(-2px); box-shadow: 0 20px 52px rgba(0, 0, 0, 0.52), 0 0 0 7px rgba(186, 244, 95, 0.1); }
.back-to-site__arrow { display: grid; place-items: center; width: 34px; height: 34px; color: var(--acid); background: #102014; border-radius: 6px; font-size: 18px; font-weight: 900; }
.back-to-site > span:last-child { display: grid; line-height: 1.15; }
.back-to-site strong { font-size: 11px; }
.back-to-site small { margin-top: 3px; color: #3d5817; font-size: 8px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.mobile-overlay { position: fixed; z-index: 45; inset: 34px 0 0; background: rgba(0, 0, 0, 0.68); }

@media (max-width: 1180px) {
  :root { --sidebar-width: 218px; }
  .control-button__text { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.75fr); }
  .team-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 34px; bottom: 0; left: 0; width: min(285px, 86vw); height: auto; transform: translateX(-105%); box-shadow: 25px 0 70px rgba(0, 0, 0, 0.45); transition: transform 220ms ease; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .topbar { top: 0; }
  .overview-grid, .insight-grid, .analytics-grid { grid-template-columns: 1fr; }
  .queue-panel { order: -1; }
  .job-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dispatch-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .demo-ribbon { align-items: flex-start; gap: 6px; padding-inline: 10px; }
  .demo-ribbon > span:last-child { max-width: 540px; }
  .topbar { min-height: 70px; padding: 10px 14px; gap: 11px; }
  .view-heading .eyebrow { display: none; }
  .view-heading h1 { font-size: 18px; }
  .simulation-time { display: none; }
  .topbar-actions { gap: 6px; }
  .control-button { width: 40px; padding: 8px; justify-content: center; }
  .primary-button { min-height: 40px; }
  .topbar .primary-button { width: 41px; padding: 8px; font-size: 0; }
  .topbar .primary-button span { font-size: 16px; }
  main { padding: 17px 12px 35px; }
  .status-line { align-items: flex-start; }
  .status-line p:last-child { display: none; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-card strong { font-size: 28px; }
  .overview-grid, .insight-grid { gap: 10px; }
  .panel-heading { flex-direction: column; padding: 15px; }
  .panel-heading--compact { flex-direction: row; align-items: center; }
  .map-controls { justify-content: flex-start; }
  .map-stage { min-height: 365px; }
  .job-list { grid-template-columns: 1fr; }
  .page-intro { display: grid; align-items: start; gap: 15px; }
  .page-intro h2 { font-size: 34px; }
  .board-filters { width: 100%; }
  .dispatch-job { grid-template-columns: auto minmax(0, 1fr); }
  .dispatch-job button { grid-column: 1 / -1; width: 100%; }
  .route-strip { align-items: flex-start; flex-direction: column; }
  .route-strip .primary-button { width: 100%; }
  .team-card-grid { grid-template-columns: 1fr; }
  .period-switcher { width: 100%; }
  .period-switcher button { flex: 1; }
  .analytics-grid { gap: 10px; }
}

@media (max-width: 480px) {
  .demo-ribbon { min-height: 46px; flex-direction: column; justify-content: center; text-align: left; }
  .sidebar { top: 46px; }
  .mobile-overlay { inset-block-start: 46px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 105px; }
  .metric-spark { width: 88px; }
  .map-stage { min-height: 335px; }
  .map-zone span { display: none; }
  .map-marker--unit { width: 36px; height: 36px; }
  .map-legend { left: 10px; right: 10px; justify-content: center; }
  .map-callout { right: 10px; left: 10px; min-width: 0; }
  .panel-heading--compact { gap: 9px; }
  .panel-heading--compact .text-button { white-space: nowrap; }
  .bar-chart { gap: 5px; padding-inline: 10px; }
  .crew-row { grid-template-columns: 36px minmax(0, 1fr); }
  .crew-row .status-tag { grid-column: 1 / -1; text-align: center; }
  .page-intro h2 { font-size: 30px; }
  .capacity-summary { width: 100%; }
  .sector-row { grid-template-columns: 86px 1fr auto; gap: 7px; }
  .dialog-body { padding: 17px; }
  .dialog-actions { padding: 12px 17px; }
  .dialog-actions > * { flex: 1; }
  .back-to-site { right: 10px; bottom: 10px; min-height: 48px; padding: 7px 11px 7px 7px; }
  .back-to-site__arrow { width: 32px; height: 32px; }
  .toast-region { right: 10px; bottom: 72px; width: calc(100% - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  .live-dot, .map-marker, .brand-mark, .metric-spark i, .progress-track i, .crew-pips i, .activity-item__dot { forced-color-adjust: none; }
}
