:root {
  --brand: #d81920;
  --brand-dark: #a90f14;
  --brand-soft: #fff0f0;
  --ink: #101114;
  --ink-2: #272a30;
  --muted: #6f737c;
  --line: #e4e5e8;
  --canvas: #f4f4f2;
  --surface: #ffffff;
  --success: #16845b;
  --success-soft: #e7f6ef;
  --warning: #b56808;
  --warning-soft: #fff4dd;
  --danger: #c91e2a;
  --danger-soft: #ffeaec;
  --blue: #2d64bc;
  --blue-soft: #eaf1fc;
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, 0.05), 0 6px 18px rgba(16, 17, 20, 0.04);
  --shadow-lg: 0 24px 64px rgba(16, 17, 20, 0.18);
  --radius: 16px;
  --sidebar: 232px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(216, 25, 32, 0.06), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(216, 25, 32, 0.24);
  outline-offset: 2px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(216, 25, 32, 0.16), transparent 38%),
    #0f1013;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-zone {
  padding: 24px 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
}

.speed-bars {
  width: 29px;
  height: 30px;
  display: grid;
  gap: 3px;
  align-content: center;
  transform: skewX(-13deg);
}

.speed-bars i {
  display: block;
  height: 5px;
  background: var(--brand);
  border-radius: 1px;
}

.speed-bars i:nth-child(1) { width: 17px; margin-left: 12px; }
.speed-bars i:nth-child(2) { width: 23px; margin-left: 6px; }
.speed-bars i:nth-child(3) { width: 29px; }

.brand-type {
  display: grid;
  line-height: 0.82;
  transform: skewX(-8deg);
}

.brand-type strong {
  color: var(--brand);
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 31px;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 0 #fff;
}

.brand-type small {
  margin-left: 3px;
  color: #fff;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
}

.brand-caption {
  margin: 12px 0 0;
  color: #a8abb3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  padding: 18px 12px;
  display: grid;
  gap: 5px;
}

.nav-link {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  color: #b9bbc1;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(100deg, var(--brand), #b41016);
  box-shadow: 0 8px 24px rgba(216, 25, 32, 0.24);
}

.nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px;
}

.sync-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.sync-card strong,
.sync-card span {
  display: block;
}

.sync-card strong {
  margin-bottom: 5px;
  font-size: 12px;
}

.sync-card span {
  color: #a8abb3;
  font-size: 11px;
  line-height: 1.45;
}

.sync-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  background: #55c991;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(85, 201, 145, 0.12);
}

.main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 26px;
  background: rgba(244, 244, 242, 0.9);
  border-bottom: 1px solid rgba(16, 17, 20, 0.08);
  backdrop-filter: blur(18px);
}

.page-heading h1 {
  margin: 0;
  font-family: "Arial Narrow", "Avenir Next Condensed", ui-sans-serif, sans-serif;
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -0.03em;
}

.page-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.operator {
  min-width: 130px;
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 9px;
  align-items: center;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #17181c;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
}

.operator strong,
.operator small {
  display: block;
}

.operator strong { font-size: 12px; }
.operator small { color: var(--muted); font-size: 10px; }

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 1px rgba(16, 17, 20, 0.03);
}

.btn:hover {
  border-color: #c9cbd0;
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 8px 20px rgba(216, 25, 32, 0.2);
}

.btn.dark {
  color: #fff;
  background: #17181c;
  border-color: #17181c;
}

.btn.success {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.btn.danger-outline {
  color: var(--danger);
  background: #fff;
  border-color: #f3b9be;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.small {
  min-height: 36px;
  padding: 0 10px;
  font-size: 11px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.content {
  width: min(100%, 1640px);
  margin: 0 auto;
  padding: 24px 26px 42px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 14px;
  color: #7d4200;
  background: var(--warning-soft);
  border: 1px solid #f0d39b;
  border-radius: 12px;
  font-size: 12px;
}

.notice strong { color: #5f3300; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.kpi::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 4px;
  background: var(--accent, var(--brand));
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 7px;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.kpi-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 34px;
  padding: 0 30px 0 11px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}

.dispatch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 14px;
  align-items: start;
}

.resource-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f7f7f6;
  border-bottom: 1px solid var(--line);
}

.resource-card {
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.resource-card strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--status-color, var(--success));
  border-radius: 50%;
}

.timeline-scroll {
  overflow-x: auto;
}

.timeline {
  min-width: 760px;
  display: grid;
  grid-template-columns: 58px repeat(4, minmax(160px, 1fr));
  grid-template-rows: 42px 720px;
}

.timeline-corner,
.truck-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.timeline-corner {
  left: 0;
  z-index: 4;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.truck-head {
  gap: 6px;
  border-left: 1px solid var(--line);
  font-size: 11px;
  font-weight: 900;
}

.truck-head svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.time-axis {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  border-right: 1px solid var(--line);
}

.time-label {
  position: absolute;
  left: 10px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.truck-lane {
  position: relative;
  min-height: 720px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 59px, #ececef 59px, #ececef 60px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 29px, rgba(236, 236, 239, 0.55) 29px, rgba(236, 236, 239, 0.55) 30px),
    linear-gradient(#fff, #fff);
  border-right: 1px solid var(--line);
}

.truck-lane:last-child { border-right: 0; }

.run-card {
  position: absolute;
  left: 6px;
  right: 6px;
  z-index: 1;
  overflow: hidden;
  padding: 8px 9px;
  color: #172033;
  background: var(--run-bg, var(--blue-soft));
  border: 1px solid var(--run-border, #aac2e9);
  border-left: 4px solid var(--run-accent, var(--blue));
  border-radius: 9px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(16, 17, 20, 0.06);
}

.run-card:hover,
.run-card.selected {
  z-index: 5;
  box-shadow: 0 10px 24px rgba(16, 17, 20, 0.16);
  transform: translateY(-1px);
}

.run-card.conflict {
  --run-bg: #ffeff0;
  --run-border: #e7a2a8;
  --run-accent: var(--danger);
  background-image: repeating-linear-gradient(135deg, rgba(201, 30, 42, 0.05) 0, rgba(201, 30, 42, 0.05) 6px, transparent 6px, transparent 12px);
}

.run-card.done {
  --run-bg: var(--success-soft);
  --run-border: #a7d9c5;
  --run-accent: var(--success);
}

.run-card.delayed {
  --run-bg: var(--warning-soft);
  --run-border: #e7c77f;
  --run-accent: var(--warning);
}

.run-card strong,
.run-card span {
  display: block;
}

.run-time {
  margin-bottom: 4px;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
}

.run-title {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-driver {
  margin-top: 5px;
  overflow: hidden;
  color: #5f6672;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-time {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  height: 2px;
  background: var(--brand);
  pointer-events: none;
}

.current-time::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 9px;
  height: 9px;
  background: var(--brand);
  border-radius: 50%;
}

.run-detail {
  position: sticky;
  top: 92px;
  overflow: hidden;
}

.detail-hero {
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(216, 25, 32, 0.98), rgba(141, 9, 14, 0.96)),
    #b40e15;
}

.detail-id {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.detail-hero h2 {
  margin: 7px 0 9px;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 23px;
  line-height: 1.05;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.detail-body {
  padding: 15px 17px 18px;
}

.detail-section + .detail-section {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-line {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
}

.route-line + .route-line { margin-top: 11px; }

.route-marker {
  position: relative;
  width: 12px;
  height: 12px;
  margin-top: 2px;
  background: #fff;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.route-line:first-child .route-marker::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 2px;
  width: 2px;
  height: 29px;
  background: var(--line);
}

.route-copy strong,
.route-copy span {
  display: block;
}

.route-copy strong { font-size: 12px; }
.route-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.assignment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.assignment {
  padding: 10px;
  background: #f7f7f6;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.assignment span,
.assignment strong { display: block; }
.assignment span { color: var(--muted); font-size: 9px; }
.assignment strong { margin-top: 4px; font-size: 11px; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}

.tag { color: #444850; background: #f0f1f2; }
.badge.success { color: #0e6947; background: var(--success-soft); }
.badge.warning { color: #874d00; background: var(--warning-soft); }
.badge.danger { color: #a4131e; background: var(--danger-soft); }
.badge.blue { color: #244f92; background: var(--blue-soft); }
.badge.dark { color: #fff; background: #24262b; }

.conflict-box {
  margin-top: 13px;
  padding: 11px;
  color: #8e111c;
  background: var(--danger-soft);
  border: 1px solid #f0b8bd;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.45;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.driver-layout {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.phone {
  width: min(100%, 390px);
  margin: 0 auto;
  overflow: hidden;
  background: #f5f5f3;
  border: 9px solid #16171a;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
}

.phone-top {
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16171a;
}

.phone-notch {
  width: 92px;
  height: 17px;
  background: #060708;
  border-radius: 0 0 14px 14px;
}

.phone-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 12px;
  color: #fff;
  background: #15161a;
}

.mini-brand {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 18px;
  font-style: italic;
  letter-spacing: 0.02em;
}

.mini-brand b { color: var(--brand); }

.phone-content { padding: 14px; }

.next-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mobile-run {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.mobile-run h2 {
  margin: 9px 0 5px;
  font-family: "Arial Narrow", sans-serif;
  font-size: 22px;
  line-height: 1.05;
}

.mobile-run > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.mobile-stop {
  margin-top: 13px;
  padding: 12px;
  background: #f7f7f6;
  border-radius: 11px;
}

.mobile-stop strong,
.mobile-stop span { display: block; }
.mobile-stop strong { font-size: 12px; }
.mobile-stop span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.mobile-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mobile-action-grid .btn {
  min-height: 47px;
  padding: 6px 9px;
  line-height: 1.2;
}

.proof-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.proof-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 10px;
}

.proof-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 8px;
  font-size: 14px;
}

.activity-panel .panel-body,
.billing-panel .panel-body,
.pilot-panel .panel-body {
  padding: 17px;
}

.activity-list {
  display: grid;
  gap: 0;
}

.activity-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child { border-bottom: 0; }

.activity-time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.activity-copy strong,
.activity-copy span { display: block; }
.activity-copy strong { font-size: 11px; }
.activity-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.billing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.money-card {
  padding: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.money-card span,
.money-card strong { display: block; }
.money-card span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.money-card strong { margin-top: 7px; font-family: "Arial Narrow", sans-serif; font-size: 25px; }

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  background: #fafaf9;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table td { font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { display: block; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); }

.split-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.split-card:last-child { border-bottom: 0; }
.split-card strong { font-size: 11px; }
.split-card span { color: var(--muted); font-size: 10px; }
.split-card b { grid-row: span 2; font-size: 12px; }

.pilot-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  color: #fff;
  background:
    linear-gradient(115deg, #131418 0%, #252830 68%, #111216 100%);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.pilot-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 290px;
  height: 230px;
  background: var(--brand);
  clip-path: polygon(32% 0, 100% 0, 68% 100%, 0 100%);
  opacity: 0.9;
}

.pilot-hero > * { position: relative; z-index: 1; }
.pilot-hero .eyebrow { color: #ff9da0; }
.pilot-hero h2 { max-width: 650px; margin: 9px 0; font-family: "Arial Narrow", sans-serif; font-size: clamp(28px, 4vw, 50px); line-height: 0.98; letter-spacing: -0.05em; }
.pilot-hero p { max-width: 650px; margin: 0; color: #c9cbd1; font-size: 13px; line-height: 1.6; }

.eyebrow {
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.flow-step {
  position: relative;
  min-height: 105px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.flow-step:not(:last-child)::after {
  content: "›";
  position: absolute;
  top: 38px;
  right: -8px;
  z-index: 2;
  width: 16px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--canvas);
  font-size: 20px;
  font-weight: 900;
}

.flow-step b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: #fff;
  background: #17181c;
  border-radius: 7px;
  font-size: 10px;
}

.flow-step strong,
.flow-step span { display: block; }
.flow-step strong { font-size: 11px; }
.flow-step span { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.measure-list {
  display: grid;
  gap: 8px;
}

.measure {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 15px;
  padding: 12px;
  background: #f8f8f7;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.measure strong { font-size: 11px; }
.measure span { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.measure b { color: var(--brand); font-size: 11px; }

.boundary {
  padding: 13px;
  background: var(--warning-soft);
  border: 1px solid #efd198;
  border-radius: 11px;
  color: #6f4000;
  font-size: 10px;
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 9, 11, 0.58);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(100%, 670px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: "Arial Narrow", sans-serif; font-size: 21px; }
.modal-body { padding: 18px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink-2); font-size: 10px; font-weight: 800; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 41px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9dade;
  border-radius: 9px;
}
.field textarea { min-height: 76px; resize: vertical; }
.field-help { color: var(--muted); font-size: 9px; }

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  color: #fff;
  background: #17181c;
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  line-height: 1.4;
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }

.mobile-nav {
  display: none;
}

.today-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: stretch;
  margin-bottom: 18px;
  overflow: hidden;
  background: #17181c;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.today-bar > div:not(.view-switch) {
  padding: 14px 17px;
  border-right: 1px solid rgba(255, 255, 255, 0.11);
}

.today-bar span,
.today-bar strong { display: block; }
.today-bar span { color: #aeb1b8; font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.today-bar strong { margin-top: 4px; color: #fff; font-size: 13px; }
.today-bar .today-alert strong { color: #ff8e92; }

.view-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 8px;
  padding: 3px;
  background: #282a30;
  border-radius: 10px;
}

.view-switch button {
  min-height: 38px;
  padding: 0 12px;
  color: #bfc1c7;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
}

.view-switch button.active { color: #17181c; background: #fff; }

.exception-center { margin-bottom: 18px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.section-title h2 { margin: 4px 0 0; font-family: "Arial Narrow", sans-serif; font-size: 21px; }
.decision-count { padding: 6px 9px; color: #a4131e; background: var(--danger-soft); border-radius: 8px; font-size: 10px; font-weight: 900; }
.exception-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.exception-card {
  min-height: 126px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 11px;
  align-items: start;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.exception-card.danger-card { border-top-color: var(--danger); }
.exception-card.warning-card { border-top-color: var(--warning); }
.exception-card.calendar-card { border-top-color: #17181c; }
.exception-card.ok-card { border-top-color: var(--success); }
.exception-card .btn { grid-column: 2; justify-self: start; min-height: 36px; }
.exception-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; }
.warning-card .exception-icon { color: var(--warning); background: var(--warning-soft); }
.calendar-card .exception-icon { color: #fff; background: #17181c; }
.ok-card .exception-icon { color: var(--success); background: var(--success-soft); }
.exception-icon svg { width: 20px; height: 20px; }
.exception-card strong,
.exception-card small,
.exception-label { display: block; }
.exception-label { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.exception-card strong { font-size: 12px; }
.exception-card small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }

.plan-panel { overflow: hidden; }
.plan-groups { padding: 5px 14px 15px; }
.plan-group + .plan-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-group h3 { display: flex; align-items: center; gap: 7px; margin: 5px 0 8px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.plan-group h3 span { min-width: 20px; padding: 3px 6px; color: var(--muted); background: #eff0f1; border-radius: 6px; text-align: center; font-size: 9px; }

.plan-run {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 55px minmax(180px, 1.5fr) minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 5px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
}

.plan-run:hover,
.plan-run.selected { background: #f7f7f6; border-color: var(--line); }
.plan-run.has-conflict { background: #fff4f5; border-color: #efb8bd; }
.plan-run span:not(.badge),
.plan-run strong,
.plan-run small { display: block; }
.plan-time { color: var(--ink); font-size: 12px; font-weight: 900; }
.plan-time small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.plan-route strong,
.plan-resource strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.plan-route small,
.plan-resource small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.empty-inline { margin: 0; padding: 10px; color: var(--muted); font-size: 10px; }

.signal-green { --signal-color: #16845b; --signal-soft: #e9f6f0; }
.signal-yellow { --signal-color: #d58a12; --signal-soft: #fff5df; }
.signal-red { --signal-color: #c91e2a; --signal-soft: #fff0f1; }

.signal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
  padding: 10px 12px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 9px;
  font-weight: 800;
}

.panel > .signal-legend {
  margin: 0;
  border-width: 1px 0;
  border-radius: 0;
}

.signal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.signal-legend-item i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--signal-color);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--signal-soft);
}

.resource-card { border-top: 3px solid var(--signal-color, var(--line)); }
.status-dot { background: var(--signal-color, var(--success)); }
.truck-head { box-shadow: inset 0 3px 0 var(--signal-color, transparent); }
.plan-run { border-left: 4px solid var(--signal-color, transparent); }
.plan-run.has-conflict { border-left-color: var(--danger); }
.run-card.signal-green { --run-bg: var(--success-soft); --run-border: #a7d9c5; --run-accent: var(--success); }
.run-card.signal-yellow { --run-bg: var(--warning-soft); --run-border: #e7c77f; --run-accent: var(--warning); }
.run-card.signal-red { --run-bg: #ffeff0; --run-border: #e7a2a8; --run-accent: var(--danger); }
.fleet-row { box-shadow: inset 4px 0 0 var(--signal-color, transparent); }
.fleet-row .fleet-truck-icon { background: var(--signal-color, #17181c); }
.tracking-map-panel {
  overflow: hidden;
  background: #17191d;
  border-color: #2a2d33;
}

.tracking-map-head {
  position: relative;
  z-index: 3;
  background: #fff;
}

.tracking-map-panel > .signal-legend {
  position: relative;
  z-index: 3;
  color: #e8e9ec;
  background: #202228;
  border-color: #34373e;
}

.tracking-map-stage {
  position: relative;
  min-height: 490px;
  background: #dfe4e7;
}

.leaflet-truck-map {
  width: 100%;
  min-height: 490px;
  z-index: 1;
  font-family: inherit;
}

.map-tile-status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  padding: 6px 8px;
  color: #545861;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 24, 28, 0.14);
  border-radius: 7px;
  font-size: 8px;
  font-weight: 800;
  pointer-events: none;
}

.map-tile-status.is-loaded { color: #0d6e49; }
.map-tile-status.is-error { color: var(--danger); }

.leaflet-truck-map .leaflet-control-zoom a {
  color: #17181c;
  font-weight: 900;
}

.leaflet-truck-map .leaflet-control-attribution {
  font-size: 8px;
}

.leaflet-truck-div-icon {
  width: auto !important;
  height: auto !important;
  background: transparent;
  border: 0;
}

.leaflet-truck-marker {
  width: 126px;
  min-height: 46px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #202228;
  border: 2px solid var(--signal-color);
  border-radius: 10px;
  text-align: left;
  box-shadow: 0 8px 22px rgba(16, 17, 20, 0.32);
  cursor: pointer;
}

.leaflet-truck-marker.is-selected {
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.leaflet-truck-marker-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--signal-color);
}

.leaflet-truck-marker-icon svg { width: 20px; height: 20px; }
.leaflet-truck-marker > span:last-child { min-width: 0; display: grid; align-content: center; padding: 6px 8px; }
.leaflet-truck-marker strong,
.leaflet-truck-marker small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaflet-truck-marker strong { font-size: 11px; }
.leaflet-truck-marker small { margin-top: 2px; color: #c7c9ce; font-size: 8px; }

.tracking-map-fallback {
  min-height: 490px;
  display: grid;
  place-content: center;
  padding: 24px;
  color: var(--ink);
  text-align: center;
}

.tracking-map-fallback strong,
.tracking-map-fallback span { display: block; }
.tracking-map-fallback span { margin-top: 6px; color: var(--muted); font-size: 10px; }
.tracking-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: #0d6e49;
  background: var(--success-soft);
  border: 1px solid #b9dfd0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tracking-live i {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(22, 132, 91, 0.36);
  animation: tracking-pulse 1.8s ease-out infinite;
}

@keyframes tracking-pulse {
  70% { box-shadow: 0 0 0 7px rgba(22, 132, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 132, 91, 0); }
}

.tracking-map-canvas {
  position: relative;
  min-height: 490px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 64% 48%, rgba(216, 25, 32, 0.11), transparent 17rem),
    linear-gradient(128deg, transparent 0 49.65%, rgba(255, 255, 255, 0.025) 49.8% 50.2%, transparent 50.35%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, 0.025) 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(255, 255, 255, 0.025) 28px),
    #17191d;
}

.tracking-map-canvas::before {
  content: "ZONE OPÉRATIONNELLE · QUÉBEC";
  position: absolute;
  top: 19px;
  left: 20px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.34);
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.tracking-map-canvas::after {
  content: "";
  position: absolute;
  top: -28px;
  right: 35px;
  z-index: 1;
  width: 86px;
  height: 145px;
  background: linear-gradient(90deg, transparent 0 24%, rgba(216, 25, 32, 0.92) 24% 36%, transparent 36% 48%, rgba(216, 25, 32, 0.62) 48% 57%, transparent 57%);
  opacity: 0.55;
  transform: skewX(-19deg);
  pointer-events: none;
}

.tracking-map-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tracking-road {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-linecap: round;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.tracking-road-main {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2.2;
}

.tracking-route {
  fill: none;
  stroke: #38a778;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  stroke-width: 2.4;
  opacity: 0.64;
  vector-effect: non-scaling-stroke;
}

.tracking-route.is-delayed { stroke: #e7a93f; }
.tracking-route.is-selected { stroke-width: 3.8; opacity: 1; }

.tracking-city {
  position: absolute;
  top: var(--map-y);
  left: var(--map-x);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8f939c;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px #17191d, 0 0 8px #17191d;
  transform: translate(7px, 7px);
  white-space: nowrap;
}

.tracking-city i {
  width: 5px;
  height: 5px;
  background: #e2e4e8;
  border: 1px solid #17191d;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.map-truck-marker {
  position: absolute;
  top: var(--map-y);
  left: var(--map-x);
  z-index: 4;
  display: flex;
  align-items: stretch;
  min-height: 43px;
  padding: 0;
  overflow: visible;
  color: #fff;
  background: #272a30;
  border: 1px solid #565a64;
  border-radius: 9px;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  transform: translate(-50%, -50%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.map-truck-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #272a30;
  transform: translateY(-50%);
}

.map-truck-marker:hover,
.map-truck-marker.is-selected {
  z-index: 5;
  border-color: #ff6f74;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(216, 25, 32, 0.2);
  transform: translate(-50%, calc(-50% - 2px));
}

.map-truck-marker.is-delayed { border-color: #df9c34; }
.map-truck-marker.is-delayed::after { border-left-color: #272a30; }

.map-truck-icon {
  width: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 8px 0 0 8px;
  transform: skewX(-5deg);
  transform-origin: left center;
}

.map-truck-marker.is-delayed .map-truck-icon { background: var(--warning); }
.map-truck-icon svg { width: 19px; height: 19px; transform: skewX(5deg); }

.map-truck-copy {
  min-width: 76px;
  display: grid;
  align-content: center;
  padding: 7px 10px 7px 8px;
}

.map-truck-copy strong,
.map-truck-copy small { display: block; }
.map-truck-copy strong { font-size: 11px; letter-spacing: 0.04em; }
.map-truck-copy small { margin-top: 2px; color: #b9bbc1; font-size: 8px; }

.tracking-map-privacy {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  padding: 8px 10px;
  color: #aeb1b8;
  background: rgba(15, 16, 19, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  font-size: 8px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.tracking-map-privacy span {
  margin-right: 6px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.tracking-map-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #34373e;
  border-top: 1px solid #34373e;
}

.tracking-map-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  color: #fff;
  background: #1f2126;
  border: 0;
  text-align: left;
}

.tracking-map-row:hover,
.tracking-map-row.is-selected { background: #282b31; }
.tracking-map-row.is-selected { box-shadow: inset 3px 0 0 var(--brand); }
.tracking-map-row > span { min-width: 0; }
.tracking-map-row > span:last-child { text-align: right; }
.tracking-map-row strong,
.tracking-map-row small { display: block; }
.tracking-map-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tracking-map-row small { margin-top: 4px; overflow: hidden; color: #969aa3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.tracking-map-status {
  width: 8px;
  height: 8px;
  background: var(--signal-color, var(--success));
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--signal-soft, rgba(22, 132, 91, 0.14));
}

.tracking-map-status.is-delayed {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(181, 104, 8, 0.16);
}

.tracking-map-status.is-unavailable {
  background: #777c86;
  box-shadow: 0 0 0 3px rgba(143, 147, 156, 0.12);
}

.tracking-map-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  color: #8f939c;
  text-align: center;
}

.tracking-map-empty strong,
.tracking-map-empty span { display: block; }
.tracking-map-empty strong { color: #fff; font-size: 14px; }
.tracking-map-empty span { margin-top: 5px; font-size: 9px; }

.live-tracking-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 31%);
  grid-template-areas:
    "head head"
    "map list"
    "actions actions";
  align-content: start;
}

.live-tracking-panel > .tracking-map-head { grid-area: head; }
.live-map-stage { position: relative; grid-area: map; min-width: 0; background: #17191d; }
.live-tracking-list { grid-area: list; grid-template-columns: 1fr; align-content: start; max-height: 520px; overflow: auto; border-top: 0; border-left: 1px solid #34373e; }
.live-map-actions { grid-area: actions; display: flex; justify-content: flex-end; padding: 10px 13px; background: #fff; border-top: 1px solid var(--line); }

.live-tracking-map,
.live-map-loading {
  min-height: 460px;
}

.live-tracking-map { z-index: 0; background: #dfe4df; }
.live-map-loading { display: grid; place-items: center; padding: 30px; color: #c9cbd0; text-align: center; font-size: 11px; font-weight: 800; }
.live-map-empty { position: static; min-height: 150px; padding: 24px 16px; }
.live-map-error { position: absolute; right: 16px; bottom: 58px; left: 16px; z-index: 500; margin: 0; padding: 10px 12px; color: #fff; background: rgba(122, 15, 21, 0.95); border-radius: 8px; font-size: 10px; }

.live-auth-boundary { grid-column: 1 / -1; padding: 30px; color: var(--ink); background: #fff; }
.live-auth-copy { display: flex; gap: 14px; align-items: flex-start; max-width: 660px; }
.live-auth-copy strong { display: block; font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif; font-size: 22px; }
.live-auth-copy p { max-width: 590px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.live-auth-form { max-width: 660px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 20px; }
.live-auth-form .btn { min-height: 43px; }
.live-auth-error { max-width: 660px; margin: 16px 0 0; padding: 10px 12px; color: #8e151c; background: var(--danger-soft); border: 1px solid #efb8bd; border-radius: 8px; font-size: 10px; overflow-wrap: anywhere; }
.live-tracking-status.is-error { color: #8e151c; background: var(--danger-soft); border-color: #efb8bd; }
.live-tracking-status.is-error i { background: var(--danger); }
.live-tracking-status i { animation: none; box-shadow: none; }

.signal-beacon { position: relative; width: 18px; height: 18px; flex: 0 0 auto; display: inline-block; margin-top: 3px; color: #777c86; border: 2px solid currentColor; border-radius: 4px; }
.signal-beacon::after { content: ""; position: absolute; top: 7px; left: 1px; width: 12px; height: 2px; background: currentColor; transform: rotate(-45deg); }

.live-map-marker {
  width: auto !important;
  height: auto !important;
  color: #fff;
  background: transparent;
  border: 0;
}

.live-map-marker > span {
  position: relative;
  min-width: 54px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 7px 10px 7px 22px;
  color: #fff;
  background: #202329;
  border: 2px solid currentColor;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.live-map-marker > span::before {
  content: "";
  position: absolute;
  left: 8px;
  width: 8px;
  height: 8px;
  background: currentColor;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.live-map-marker > span > strong,
.live-map-marker > span > small { display: block; }
.live-map-marker > span > small { margin-top: 2px; color: #d5d7dc; font-size: 7px; letter-spacing: 0; text-transform: uppercase; }

.live-map-tile-error {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 700;
  padding: 9px 11px;
  color: #fff;
  background: rgba(142, 21, 28, 0.94);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 850;
  text-align: center;
  pointer-events: none;
}

.live-map-marker.signal-live { color: #e2a43d; }
.live-map-marker.signal-weak { color: #e2a43d; }
.live-map-marker.signal-lost { color: #ef5961; }
.live-map-marker.signal-not-shared { color: #ef5961; }
.live-map-marker.signal-weak > span::before { background: transparent; box-shadow: 0 0 0 3px rgba(226, 164, 61, 0.24); }
.live-map-marker.signal-lost > span::before { background: transparent; border-radius: 2px; }
.live-map-marker.signal-lost > span::after { content: ""; position: absolute; top: 15px; left: 6px; width: 12px; height: 2px; background: currentColor; transform: rotate(-45deg); }
.live-map-marker.signal-not-shared > span::before { background: transparent; border-radius: 2px; }
.live-map-marker.is-selected > span { border-color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(216, 25, 32, 0.34); }
.live-map-marker:focus-visible > span { outline: 3px solid rgba(216, 25, 32, 0.45); outline-offset: 3px; }

.tracking-map-status.signal-live { background: var(--warning); border-radius: 50%; box-shadow: 0 0 0 3px rgba(181, 104, 8, 0.16); }
.tracking-map-status.signal-weak { background: transparent; border: 2px solid var(--warning); border-radius: 50%; box-shadow: 0 0 0 3px rgba(181, 104, 8, 0.16); }
.tracking-map-status.signal-lost { position: relative; background: transparent; border: 2px solid var(--danger); border-radius: 2px; box-shadow: none; }
.tracking-map-status.signal-lost::after { content: ""; position: absolute; top: 2px; left: -3px; width: 10px; height: 2px; background: var(--danger); transform: rotate(-45deg); }
.tracking-map-status.signal-not-shared { background: var(--danger); border-radius: 2px; box-shadow: none; opacity: 0.88; }
.live-tracking-row.signal-weak { box-shadow: inset 0 0 0 1px rgba(181, 104, 8, 0.22); }
.live-tracking-row.signal-lost { box-shadow: inset 0 0 0 1px rgba(201, 30, 42, 0.28); }
.live-tracking-row.signal-not-shared { color: #c8cad0; }
.live-tracking-row.is-selected { box-shadow: inset 3px 0 0 var(--brand); }

.live-signal-badge { color: #fff; background: #777c86; }
.live-signal-badge.signal-live { background: var(--warning); }
.live-signal-badge.signal-weak { background: var(--warning); }
.live-signal-badge.signal-lost { background: var(--danger); }
.live-signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.live-signal-grid > div { padding: 10px; background: #f7f7f6; border: 1px solid var(--line); border-radius: 9px; }
.live-signal-grid span,
.live-signal-grid strong { display: block; }
.live-signal-grid span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.live-signal-grid strong { margin-top: 4px; font-size: 11px; }
.live-signal-note,
.live-detail-empty { color: var(--muted); font-size: 9px; line-height: 1.5; }

.leaflet-tooltip { color: #fff; background: #202329; border-color: #4a4e56; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24); font-size: 10px; font-weight: 800; }
.sync-banner {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #efd198;
  border-radius: 11px;
  background: var(--warning-soft);
}

.sync-banner.online { background: var(--success-soft); border-color: #b3ddcc; }
.sync-banner > i { width: 8px; height: 8px; background: var(--warning); border-radius: 50%; }
.sync-banner.online > i { background: var(--success); }
.sync-banner span,
.sync-banner strong { display: block; }
.sync-banner strong { margin-bottom: 2px; font-size: 10px; }
.sync-banner span { color: #684212; font-size: 8px; line-height: 1.35; }
.sync-banner.online span { color: #155f46; }
.sync-banner button { min-height: 44px; padding: 0 7px; color: inherit; background: transparent; border: 0; font-size: 8px; font-weight: 900; text-decoration: underline; }

.dwell-card { display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center; margin-top: 12px; padding: 10px; color: #6f4000; background: var(--warning-soft); border-radius: 10px; }
.dwell-card > span { width: 34px; height: 34px; display: grid; place-items: center; }
.dwell-card svg { width: 21px; height: 21px; }
.dwell-card strong,
.dwell-card small { display: block; }
.dwell-card strong { font-size: 10px; }
.dwell-card small { margin-top: 3px; font-size: 8px; }
.driver-primary { margin-top: 12px; }
.driver-primary .btn { width: 100%; min-height: 54px; font-size: 13px; }
.driver-primary .btn:disabled { cursor: default; opacity: 1; }
.driver-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.driver-secondary .btn { min-height: 46px; }

.proof-check { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 10px; font-weight: 800; }
.proof-check svg { width: 15px; height: 15px; }
.billing-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; color: var(--muted); background: #fafaf9; font-size: 10px; }

.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.template-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 17px; }
.template-chip { min-height: 68px; padding: 9px; color: var(--ink); background: #f8f8f7; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.template-chip.active { color: #8f1118; background: var(--brand-soft); border-color: #edabb0; box-shadow: inset 0 0 0 1px #edabb0; }
.template-chip strong,
.template-chip span { display: block; }
.template-chip strong { font-size: 10px; }
.template-chip span { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.availability-check { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; margin-top: 14px; padding: 11px; color: #0e6947; background: var(--success-soft); border: 1px solid #b4ddcd; border-radius: 10px; font-size: 9px; }
.availability-check svg { width: 22px; height: 22px; }
.availability-check strong { display: block; margin-bottom: 3px; font-size: 10px; }
.availability-check.conflict { color: #95151e; background: var(--danger-soft); border-color: #efb8bd; }

.calendar-modal { width: min(100%, 720px); }
.calendar-safety { display: grid; grid-template-columns: 42px 1fr; gap: 11px; padding: 13px; color: #264c88; background: var(--blue-soft); border-radius: 11px; }
.calendar-safety > span { width: 42px; height: 42px; display: grid; place-items: center; background: #fff; border-radius: 10px; }
.calendar-safety svg { width: 21px; height: 21px; }
.calendar-safety strong { font-size: 11px; }
.calendar-safety p { margin: 3px 0 0; font-size: 9px; line-height: 1.45; }
.calendar-list { display: grid; gap: 8px; margin-top: 13px; }
.calendar-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.calendar-item time { font-size: 14px; font-weight: 900; }
.calendar-item strong,
.calendar-item span,
.calendar-item small { display: block; }
.calendar-item strong { font-size: 11px; }
.calendar-item span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.calendar-item small { margin-top: 5px; color: var(--warning); font-size: 8px; font-weight: 800; }
.modal-note { color: var(--muted); font-size: 9px; }

.orders-summary {
  display: grid;
  grid-template-columns: 180px 180px minmax(0, 1fr);
  margin-bottom: 14px;
  overflow: hidden;
  color: #fff;
  background: #17181c;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(16, 17, 20, 0.12);
}

.orders-summary > div {
  min-height: 76px;
  padding: 14px 17px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.orders-summary span,
.orders-summary strong,
.orders-summary small { display: block; }
.orders-summary > div > span { color: #aeb1b8; font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.orders-summary > div > strong { margin-top: 3px; font-family: "Arial Narrow", sans-serif; font-size: 24px; }
.orders-summary > div > small { margin-top: 2px; color: #aeb1b8; font-size: 9px; }

.orders-summary .orders-summary-note {
  position: relative;
  padding-left: 58px;
  border-right: 0;
  background: linear-gradient(110deg, rgba(216, 25, 32, 0.2), transparent 60%);
}

.orders-summary-note::before {
  content: "";
  position: absolute;
  left: 20px;
  width: 24px;
  height: 30px;
  border: 2px solid var(--brand);
  border-radius: 4px;
  box-shadow: inset 0 -8px 0 rgba(216, 25, 32, 0.22);
}

.orders-summary .orders-summary-note strong { margin: 0 0 4px; font-family: inherit; font-size: 12px; }
.orders-summary .orders-summary-note span { color: #c7c9ce; font-size: 10px; line-height: 1.4; text-transform: none; letter-spacing: 0; }

.orders-layout {
  display: grid;
  grid-template-columns: minmax(285px, 0.68fr) minmax(0, 1.72fr);
  gap: 14px;
  align-items: start;
}

.order-inbox,
.order-review { overflow: hidden; }
.order-inbox .panel-body { padding: 14px; }

.order-dropzone {
  position: relative;
  isolation: isolate;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(216, 25, 32, 0.05), transparent 46%),
    #f8f8f7;
  border: 1px dashed #c4c6cb;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.order-dropzone::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  z-index: -1;
  width: 120px;
  height: 78px;
  background: repeating-linear-gradient(-18deg, transparent 0 9px, rgba(216, 25, 32, 0.08) 9px 15px);
  transform: rotate(-4deg);
}

.order-dropzone:hover,
.order-dropzone.is-dragging,
.order-dropzone:has(input:focus-visible) {
  background-color: #fff;
  border-color: var(--brand);
  transform: translateY(-1px);
}

.order-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.order-drop-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: #fff;
  background: #17181c;
  border-radius: 12px;
  box-shadow: 7px 7px 0 var(--brand-soft);
}

.order-drop-icon svg { width: 23px; height: 23px; }
.order-dropzone strong { font-size: 13px; }
.order-dropzone small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.order-dropzone b {
  min-height: 34px;
  margin-top: 13px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
  font-size: 10px;
}

.order-queue { border-top: 1px solid var(--line); }
.order-queue-head { min-height: 42px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fafaf9; }
.order-queue-head strong { font-size: 10px; }
.order-queue-head span { color: var(--muted); font-size: 9px; }

.order-queue-item {
  position: relative;
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 13px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
}

.order-queue-item:hover { background: #f8f8f7; }
.order-queue-item.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.order-queue-item:focus-visible { z-index: 1; }

.order-file-icon {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #fff;
  border: 1px solid #efc4c7;
  border-radius: 8px;
}

.order-file-icon svg { width: 17px; height: 17px; }
.order-queue-item > span:nth-child(2) { min-width: 0; }
.order-queue-item strong,
.order-queue-item small,
.order-queue-item em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-queue-item strong { font-size: 10px; }
.order-queue-item small { margin-top: 3px; color: var(--ink-2); font-size: 9px; }
.order-queue-item em { margin-top: 3px; color: var(--muted); font-size: 8px; font-style: normal; }
.order-queue-item .badge { font-size: 8px; white-space: nowrap; }

.order-review-head { min-height: 64px; }
.order-review-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(380px, 1.38fr);
  min-height: 590px;
}

.order-document {
  min-width: 0;
  padding: 22px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(216, 25, 32, 0.2), transparent 34%),
    #24262b;
  border-right: 1px solid #34363d;
}

.order-paper {
  position: relative;
  width: min(100%, 260px);
  min-height: 390px;
  padding: 31px 24px 24px;
  overflow: hidden;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 22px 48px rgba(5, 6, 8, 0.34);
  transform: rotate(-0.65deg);
}

.order-paper::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 9px;
  background: var(--brand);
}

.order-paper::after {
  content: "MLB";
  position: absolute;
  right: -13px;
  bottom: 22px;
  color: rgba(216, 25, 32, 0.06);
  font-family: Impact, sans-serif;
  font-size: 72px;
  transform: skewX(-9deg);
}

.order-paper-brand { color: var(--brand); font-size: 8px; font-weight: 900; letter-spacing: 0.12em; }
.order-paper > strong { display: block; margin-top: 8px; font-family: "Arial Narrow", sans-serif; font-size: 25px; }
.order-paper > small { display: block; margin: 4px 0 25px; color: var(--muted); font-size: 9px; }
.order-paper > div { position: relative; z-index: 1; padding: 12px 0; border-top: 1px solid var(--line); }
.order-paper > div span,
.order-paper > div b { display: block; }
.order-paper > div span { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.order-paper > div b { margin-top: 5px; font-size: 9px; line-height: 1.4; }
.order-document-caption { margin-top: 14px; color: #bfc1c7; font-size: 8px; }

.order-extraction { min-width: 0; padding: 18px; }
.extraction-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.extraction-heading h3 { margin: 0; font-family: "Arial Narrow", sans-serif; font-size: 18px; }
.extraction-heading p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.extraction-heading > span { padding: 5px 8px; color: #8f1118; background: var(--brand-soft); border-radius: 7px; font-size: 8px; font-weight: 900; }

.extraction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.extracted-field { min-width: 0; display: grid; gap: 6px; }
.extracted-field.full { grid-column: 1 / -1; }
.extracted-field > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 9px; font-weight: 800; }

.confidence { padding: 3px 5px; border-radius: 5px; font-size: 8px; font-weight: 900; }
.confidence.high { color: #0e6947; background: var(--success-soft); }
.confidence.review { color: #7d4200; background: var(--warning-soft); }

.extracted-field input,
.extracted-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fbfbfa;
  border: 1px solid #d9dade;
  border-radius: 9px;
  font-size: 11px;
}

.extracted-field textarea { min-height: 72px; resize: vertical; line-height: 1.45; }
.extracted-field input:hover,
.extracted-field textarea:hover { border-color: #b9bbc1; }
.extracted-field input:focus,
.extracted-field textarea:focus { background: #fff; border-color: var(--brand); }

.order-warning {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 9px;
  align-items: center;
  margin-top: 13px;
  padding: 11px;
  color: #704100;
  background: var(--warning-soft);
  border: 1px solid #efd198;
  border-radius: 10px;
  font-size: 9px;
  line-height: 1.4;
}

.order-warning svg { width: 21px; height: 21px; }
.order-warning strong { display: block; margin-bottom: 2px; color: #603700; font-size: 10px; }

.order-review-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.order-review-actions .btn:disabled { color: #356c57; background: var(--success-soft); border-color: #b4ddcd; cursor: default; box-shadow: none; }

.order-scanning {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(380px, 1.38fr);
  align-items: center;
  background: #24262b;
}

.scan-document {
  position: relative;
  width: min(72%, 230px);
  aspect-ratio: 0.72;
  margin: auto;
  padding: 52px 26px 20px;
  overflow: hidden;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 22px 48px rgba(5, 6, 8, 0.34);
}

.scan-document::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--brand);
}

.scan-document::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0 42%, rgba(216, 25, 32, 0.18) 49%, rgba(216, 25, 32, 0.7) 50%, rgba(216, 25, 32, 0.18) 51%, transparent 58%);
  animation: scan-document 850ms ease-in-out infinite;
}

.scan-document i,
.scan-document span { display: block; background: #e3e4e6; border-radius: 3px; }
.scan-document i { width: 54%; height: 13px; margin-bottom: 35px; background: #c9cbd0; }
.scan-document span { height: 8px; margin-top: 17px; }
.scan-document span:nth-of-type(2) { width: 76%; }
.scan-document span:nth-of-type(3) { width: 88%; }
.scan-document span:nth-of-type(4) { width: 61%; }

.scan-copy { align-self: stretch; padding: 54px 44px; display: flex; flex-direction: column; justify-content: center; color: #fff; background: #17181c; }
.scan-kicker { color: #ff777c; font-size: 9px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.scan-copy h2 { margin: 9px 0 0; font-family: "Arial Narrow", sans-serif; font-size: clamp(24px, 3vw, 34px); }
.scan-copy p { max-width: 42ch; margin: 8px 0 24px; color: #b9bbc1; font-size: 11px; line-height: 1.5; }
.scan-steps { display: grid; gap: 8px; }
.scan-steps span { position: relative; min-height: 34px; padding: 9px 12px 9px 35px; color: #8f929a; background: #22242a; border: 1px solid #30323a; border-radius: 9px; font-size: 9px; font-weight: 800; }
.scan-steps span::before { content: ""; position: absolute; top: 50%; left: 13px; width: 9px; height: 9px; background: #555861; border-radius: 50%; transform: translateY(-50%); }
.scan-steps .done { color: #9ce3c7; }
.scan-steps .done::before { background: var(--success); }
.scan-steps .active { color: #fff; border-color: rgba(216, 25, 32, 0.65); }
.scan-steps .active::before { background: var(--brand); box-shadow: 0 0 0 4px rgba(216, 25, 32, 0.15); }

@keyframes scan-document {
  from { transform: translateY(-50%); }
  to { transform: translateY(50%); }
}

.fleet-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.fleet-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #fff;
  background: #17181c;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.fleet-toolbar > div:first-child strong,
.fleet-toolbar > div:first-child span { display: block; }
.fleet-toolbar > div:first-child strong { font-size: 13px; }
.fleet-toolbar > div:first-child span { margin-top: 3px; color: #aeb1b8; font-size: 10px; }

.fleet-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fleet-filter {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #b9bbc1;
  background: #24262b;
  border: 1px solid #32343a;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
}
.fleet-filter b { min-width: 19px; padding: 3px 5px; color: #fff; background: #3b3e45; border-radius: 6px; font-size: 9px; }
.fleet-filter.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.fleet-filter.active b { background: rgba(0, 0, 0, 0.18); }

.fleet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.fleet-board { overflow: hidden; }
.fleet-table-head,
.fleet-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.82fr) minmax(180px, 1.25fr) minmax(175px, 1fr) minmax(150px, 0.86fr) 132px;
  gap: 12px;
  align-items: center;
}

.fleet-table-head {
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  background: #f7f7f6;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fleet-row {
  position: relative;
  min-height: 84px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.fleet-row:last-child { border-bottom: 0; }
.fleet-row.selected { background: linear-gradient(90deg, rgba(216, 25, 32, 0.055), transparent 55%); }
.fleet-row.selected::before { content: ""; position: absolute; inset: 12px auto 12px 0; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }

.fleet-truck { min-width: 0; display: flex; align-items: center; gap: 10px; }
.fleet-truck-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: #17181c; border-radius: 10px; }
.fleet-truck-icon svg { width: 21px; height: 21px; }
.fleet-truck strong,
.fleet-truck small,
.fleet-route strong,
.fleet-route small,
.fleet-crew strong,
.fleet-crew small,
.fleet-status small { display: block; }
.fleet-truck strong { font-size: 14px; }
.fleet-truck small,
.fleet-route small,
.fleet-crew small,
.fleet-status small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.fleet-route,
.fleet-crew,
.fleet-status { min-width: 0; }
.fleet-route strong,
.fleet-crew strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.fleet-row-action { display: flex; justify-content: flex-end; }
.fleet-row-action .btn { width: 100%; padding-inline: 8px; }
.fleet-unavailable { color: var(--muted); font-size: 10px; font-weight: 800; }

.fleet-assignment { position: sticky; top: 92px; overflow: hidden; }
.fleet-assignment-body { padding: 16px; }
.fleet-route-card { padding: 14px; color: #fff; background: #17181c; border-radius: 12px; }
.fleet-route-card span,
.fleet-route-card strong,
.fleet-route-card small { display: block; }
.fleet-route-card span { color: #aeb1b8; font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.fleet-route-card strong { margin-top: 7px; font-size: 15px; }
.fleet-route-card small { margin-top: 5px; color: #b9bbc1; font-size: 9px; }
.fleet-people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.fleet-people > div { min-width: 0; padding: 12px; background: #f7f7f6; border: 1px solid var(--line); border-radius: 10px; }
.fleet-people span,
.fleet-people strong { display: block; }
.fleet-people span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.fleet-people strong { margin-top: 5px; overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.fleet-helper-field { margin-top: 4px; }
.fleet-confirm,
.fleet-remove { width: 100%; margin-top: 10px; }
.fleet-assignment-note { padding: 12px; color: #874d00; background: var(--warning-soft); border: 1px solid #f0d39b; border-radius: 10px; }
.fleet-assignment-note strong,
.fleet-assignment-note span { display: block; }
.fleet-assignment-note strong { font-size: 11px; }
.fleet-assignment-note span { margin-top: 4px; font-size: 9px; line-height: 1.45; }

@media (max-width: 1180px) {
  :root { --sidebar: 196px; }
  .dispatch-layout { grid-template-columns: 1fr; }
  .run-detail { position: static; }
  .section-grid { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .flow-step:nth-child(3)::after { display: none; }
  .orders-layout { grid-template-columns: 1fr; }
  .order-inbox { display: grid; grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr); }
  .order-inbox .panel-head { grid-column: 1 / -1; }
  .order-queue { border-top: 0; border-left: 1px solid var(--line); }
  .fleet-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fleet-layout { grid-template-columns: 1fr; }
  .fleet-assignment { position: static; }
}

@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { padding-bottom: 72px; }
  .topbar { padding: 12px 16px; }
  .operator { display: none; }
  .content { padding: 16px 14px 30px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .driver-layout { grid-template-columns: 1fr; }
  .billing-summary { grid-template-columns: 1fr 1fr; }
  .today-bar { grid-template-columns: 1fr 1fr; }
  .today-bar > div:not(.view-switch) { border-bottom: 1px solid rgba(255,255,255,0.1); }
  .view-switch { justify-content: stretch; }
  .view-switch button { flex: 1; }
  .tracking-map-canvas,
  .tracking-map-stage,
  .leaflet-truck-map { min-height: 450px; }
  .live-tracking-panel {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "map" "list" "actions";
  }
  .live-tracking-map,
  .live-map-loading { min-height: 380px; }
  .live-tracking-list { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #34373e; border-left: 0; }
  .exception-grid { grid-template-columns: 1fr; }
  .exception-card { min-height: 0; grid-template-columns: 40px 1fr auto; align-items: center; }
  .exception-card .btn { grid-column: 3; grid-row: 1; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    min-height: 66px;
    padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: rgba(15, 16, 19, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
  }
  .mobile-nav .nav-link {
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px;
    font-size: 9px;
  }
  .mobile-nav .nav-icon { width: 17px; height: 17px; }
  .orders-summary { grid-template-columns: 1fr 1fr; }
  .orders-summary .orders-summary-note { grid-column: 1 / -1; }
  .order-review-body,
  .order-scanning { grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1.45fr); }
  .fleet-table-head { display: none; }
  .fleet-row { grid-template-columns: minmax(140px, 0.8fr) minmax(170px, 1.2fr) minmax(150px, 1fr); }
  .fleet-status { grid-column: 1; }
  .fleet-row-action { grid-column: 3; grid-row: 2; }
}

@media (max-width: 640px) {
  .topbar { align-items: flex-start; }
  .page-heading p { max-width: 210px; }
  .top-actions .btn.ghost { display: none; }
  .top-actions .btn { min-height: 44px; padding: 0 10px; }
  .btn-label-wide { display: none; }
  .notice { align-items: flex-start; flex-direction: column; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 23px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .resource-strip { grid-template-columns: 1fr 1fr; }
  .detail-actions { grid-template-columns: 1fr; }
  .section-grid,
  .billing-summary,
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-step:nth-child(3)::after { display: block; }
  .flow-step:nth-child(even)::after { display: none; }
  .pilot-hero { padding: 23px 19px; }
  .pilot-hero::after { opacity: 0.35; }
  .phone { border-width: 6px; border-radius: 26px; }
  .today-bar { grid-template-columns: 1fr 1fr; }
  .today-bar > div:not(.view-switch) { padding: 12px; }
  .today-bar > div:nth-child(3) { grid-column: 1 / -1; }
  .view-switch { grid-column: 1 / -1; }
  .tracking-map-head { align-items: stretch; }
  .tracking-live { align-self: flex-start; }
  .tracking-map-canvas,
  .tracking-map-stage,
  .leaflet-truck-map { min-height: 410px; }
  .tracking-map-canvas::before { top: 14px; left: 14px; font-size: 8px; }
  .tracking-map-canvas::after { right: 12px; opacity: 0.38; }
  .tracking-city { font-size: 7px; }
  .map-truck-marker { min-height: 40px; }
  .map-truck-icon { width: 34px; }
  .map-truck-icon svg { width: 17px; height: 17px; }
  .map-truck-copy { min-width: 68px; padding-inline: 7px; }
  .tracking-map-privacy { right: 10px; bottom: 10px; left: 10px; text-align: center; }
  .tracking-map-list { grid-template-columns: 1fr; }
  .live-tracking-map,
  .live-map-loading { min-height: 55vh; }
  .live-tracking-list { grid-template-columns: 1fr; }
  .live-auth-boundary { padding: 22px 16px; }
  .live-auth-form { grid-template-columns: 1fr; }
  .live-signal-grid { grid-template-columns: 1fr; }
  .section-title { align-items: flex-start; }
  .section-title h2 { font-size: 18px; }
  .exception-card { grid-template-columns: 38px 1fr; }
  .exception-card .btn { grid-column: 2; grid-row: auto; width: 100%; min-height: 44px; }
  .plan-run { grid-template-columns: 48px 1fr auto; gap: 8px; }
  .plan-resource { grid-column: 2; }
  .plan-run .badge { grid-column: 3; grid-row: 1 / span 2; }
  .template-picker { grid-template-columns: 1fr 1fr; }
  .calendar-item { grid-template-columns: 46px 1fr; }
  .calendar-item .btn { grid-column: 1 / -1; }
  .billing-foot { align-items: stretch; flex-direction: column; }
  .orders-summary { grid-template-columns: 1fr; }
  .orders-summary > div { min-height: 64px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .orders-summary .orders-summary-note { grid-column: auto; border-bottom: 0; }
  .order-inbox { display: block; }
  .order-queue { border-top: 1px solid var(--line); border-left: 0; }
  .order-review-body,
  .order-scanning { grid-template-columns: 1fr; }
  .order-document { min-height: 370px; border-right: 0; border-bottom: 1px solid #34363d; }
  .order-paper { width: min(78%, 260px); min-height: 330px; }
  .extraction-grid { grid-template-columns: 1fr; }
  .extracted-field.full { grid-column: auto; }
  .order-review-actions { align-items: stretch; flex-direction: column-reverse; }
  .order-review-actions .btn { width: 100%; }
  .order-scanning { min-height: 0; }
  .scan-document { width: min(56%, 210px); margin-block: 30px; }
  .scan-copy { padding: 28px 20px 34px; }
  .fleet-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fleet-metrics .kpi:last-child { grid-column: 1 / -1; }
  .fleet-toolbar { align-items: stretch; flex-direction: column; }
  .fleet-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .fleet-filter { justify-content: space-between; }
  .fleet-row { grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
  .fleet-route { grid-column: 1 / -1; grid-row: 2; }
  .fleet-crew { grid-column: 1 / -1; grid-row: 3; }
  .fleet-status { grid-column: 1; grid-row: 4; }
  .fleet-row-action { grid-column: 2; grid-row: 4; }
  .fleet-row-action .btn { min-height: 42px; }
  .fleet-people { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-document::after { animation: none; transform: none; }
  .order-dropzone { transition: none; }
  .tracking-live i { animation: none; }
  .map-truck-marker { transition: none; }
  .live-map-marker { transition: none; }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .btn,
  .notice { display: none !important; }
  .app-shell,
  .main { display: block; }
  .content { width: 100%; padding: 0; }
  .panel,
  .pilot-hero { break-inside: avoid; box-shadow: none; }
}
