:root {
  font-family: "DM Sans", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17272a;
  background: #f4f6f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #17272a;
  --muted: #788486;
  --line: #e7ece8;
  --paper: #ffffff;
  --canvas: #f4f6f4;
  --nav: #162729;
  --nav-soft: #213638;
  --green: #2f8068;
  --green-bright: #94d1a8;
  --green-soft: #e9f4ee;
  --orange: #df8755;
  --orange-soft: #fff2e9;
  --blue: #538cb5;
  --blue-soft: #ebf4fa;
  --red: #c25d51;
  --shadow: 0 8px 30px rgba(30, 52, 48, 0.06);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 128, 104, 0.24);
  outline-offset: 2px;
}

.boot-screen {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 100vh;
  padding: 32px;
  color: var(--ink);
}
.boot-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--green);
  color: white;
  font-size: 20px;
  font-weight: 700;
}
.boot-screen strong, .boot-screen span { display: block; }
.boot-screen span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  display: flex;
  width: 238px;
  flex-direction: column;
  padding: 24px 15px 16px;
  background: var(--nav);
  color: #eaf1ef;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 27px;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #94d1a8;
  color: #17332c;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(148, 209, 168, 0.16);
}
.brand-copy { min-width: 0; }
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.brand-subtitle {
  margin-top: 2px;
  color: #92a9a4;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-caption {
  padding: 12px 11px 8px;
  color: #728783;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.nav-list { display: grid; gap: 4px; }
.nav-item {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  padding: 0 11px;
  background: transparent;
  color: #a6b7b4;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--nav-soft); color: #fff; }
.nav-item.active .nav-icon { color: var(--green-bright); }
.nav-icon { width: 18px; height: 18px; color: #829894; }
.nav-label { flex: 1; font-size: 13px; font-weight: 500; }
.nav-count {
  min-width: 22px;
  border-radius: 10px;
  padding: 3px 6px;
  background: #314747;
  color: #c8d8d2;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-align: center;
}
.sidebar-spacer { flex: 1; }
.sidebar-status {
  margin: 10px 2px 14px;
  border: 1px solid rgba(216, 235, 227, 0.1);
  border-radius: 12px;
  padding: 13px 12px;
  background: rgba(255,255,255,.035);
}
.status-overline { color: #87a09a; font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .1em; }
.status-main { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; font-weight: 600; }
.status-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7bc69d;
}
.status-pulse::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(123,198,157,.45);
  border-radius: inherit;
  content: "";
  animation: pulse 2s infinite;
}
@keyframes pulse { 0% { transform: scale(.65); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(216,235,227,.1);
  padding: 15px 7px 3px;
}
.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  background: #314748;
  color: #d8e5e0;
  font-size: 12px;
  font-weight: 700;
}
.user-copy { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; }
.user-role { margin-top: 3px; color: #89a09b; font-size: 10px; }
.more-button { border: 0; background: transparent; color: #8ca09b; font-size: 20px; }

.main-column { width: calc(100% - 238px); min-height: 100vh; margin-left: 238px; }
.topbar {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}
.crumb { color: #929e9f; font-size: 12px; }
.crumb strong { color: #344648; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 13px; }
.role-switcher { display: flex; align-items: center; gap: 2px; border: 1px solid #e8eeeb; border-radius: 9px; padding: 3px; background: #f7f9f7; }
.role-tab { min-height: 28px; border: 0; border-radius: 6px; padding: 0 9px; background: transparent; color: #788783; font-size: 10px; white-space: nowrap; }
.role-tab:hover { color: #426b58; }
.role-tab.active { background: white; color: #356e55; box-shadow: 0 1px 4px rgba(25,50,40,.11); font-weight: 600; }
.search-box {
  display: flex;
  width: 226px;
  height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e8eeeb;
  border-radius: 8px;
  padding: 0 10px;
  background: #fafcfb;
}
.search-box svg { width: 15px; height: 15px; color: #91a09c; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #aab4b2; }
.icon-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #687b79;
}
.icon-button:hover { border-color: var(--line); background: #fafcfb; }
.icon-button svg { width: 17px; height: 17px; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1px solid white; border-radius: 50%; background: var(--orange); }
.mobile-menu { display: none; }

.content { max-width: 1600px; margin: 0 auto; padding: 29px 34px 36px; }
.demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 21px;
  border: 1px solid #e9dfc9;
  border-radius: 9px;
  padding: 10px 13px;
  background: #fffaf0;
  color: #786849;
  font-size: 11px;
  line-height: 1.5;
}
.demo-notice svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: #b38a45; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 23px; }
.eyebrow { color: var(--green); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 6px 0 0; color: #17292a; font-size: 25px; font-weight: 600; letter-spacing: -.035em; }
.page-subtitle { margin-top: 6px; color: #7d8a89; font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.date-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--paper);
  color: #627371;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.date-chip svg { width: 14px; height: 14px; }
.primary-button, .secondary-button, .quiet-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; box-shadow: 0 4px 10px rgba(47,128,104,.12); }
.primary-button:hover { transform: translateY(-1px); background: #256d58; }
.primary-button svg, .secondary-button svg, .quiet-button svg { width: 15px; height: 15px; }
.secondary-button { border: 1px solid #dfe8e3; background: white; color: #4c615d; }
.secondary-button:hover { border-color: #b9d2c5; background: #f8fbf9; }
.quiet-button { min-height: 32px; border: 1px solid transparent; background: transparent; color: #738481; }
.quiet-button:hover { background: #f2f6f3; color: var(--ink); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 16px 17px;
  background: var(--paper);
  box-shadow: 0 2px 7px rgba(30,52,48,.015);
}
.metric-card::after {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--metric-tint, var(--green-soft));
  color: var(--metric-ink, var(--green));
  content: attr(data-symbol);
  font-size: 14px;
  line-height: 31px;
  text-align: center;
}
.metric-label { color: #788785; font-size: 11px; }
.metric-value { margin-top: 12px; color: #17292a; font-family: "DM Mono", monospace; font-size: 28px; letter-spacing: -.06em; line-height: 1; }
.metric-foot { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: #82908f; font-size: 10px; }
.metric-delta { color: var(--green); font-family: "DM Mono", monospace; font-weight: 500; }
.metric-card.orange { --metric-tint: #fff1e8; --metric-ink: #c5784c; }
.metric-card.blue { --metric-tint: #ecf4fa; --metric-ink: #578bac; }
.metric-card.neutral { --metric-tint: #f0f2ee; --metric-ink: #78877f; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(330px, .88fr); gap: 15px; align-items: stretch; }
.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: 0 2px 7px rgba(30,52,48,.015);
}
.panel-header {
  display: flex;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #edf1ee;
  padding: 0 17px;
}
.panel-title { color: #273b3b; font-size: 12px; font-weight: 600; }
.panel-caption { margin-top: 4px; color: #9aa6a3; font-size: 10px; }
.panel-tools { display: flex; align-items: center; gap: 8px; }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; color: #4c8871; font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #61ad83; box-shadow: 0 0 0 3px #e7f4eb; }
.map-frame { position: relative; min-height: 390px; height: min(43vw, 470px); background: #e8efea; }
.map-frame.compact { min-height: 290px; height: 380px; }
.map-canvas { position: absolute; inset: 0; }
.map-footer {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #edf1ee;
  padding: 8px 15px;
}
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: #879492; font-size: 9px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #2f8068; }
.legend-dot.available { background: #7caa92; }
.legend-dot.current { background: #518db6; }
.map-footnote { color: #a0aaa8; font-size: 9px; }
.truck-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid white;
  border-radius: 12px;
  background: var(--marker-color, #317f68);
  color: white;
  box-shadow: 0 3px 9px rgba(28,55,49,.26);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  transform: rotate(-4deg);
}
.truck-marker.available { --marker-color: #78a68c; }
.truck-marker.selected { outline: 3px solid rgba(53, 143, 111, .23); }
.truck-marker.current {
  position: relative;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  background: #508db8;
  box-shadow: 0 0 0 7px rgba(80,141,184,.2), 0 3px 7px rgba(21,50,72,.2);
}
.maplibregl-popup-content { border-radius: 9px !important; padding: 11px 13px !important; box-shadow: 0 5px 20px rgba(20,40,37,.13) !important; font: 12px/1.5 "DM Sans", "Noto Sans TC", sans-serif !important; }
.maplibregl-popup-close-button { color: #72817d; font-size: 17px; }
.maplibregl-ctrl-group { overflow: hidden; border-radius: 9px !important; box-shadow: 0 2px 8px rgba(28,52,47,.12) !important; }
.maplibregl-ctrl button { width: 29px !important; height: 29px !important; }
.maplibregl-ctrl-attrib { font-size: 9px !important; }
.map-fallback { display: grid; height: 100%; place-items: center; padding: 25px; color: #748783; text-align: center; }
.map-fallback strong { display: block; margin-bottom: 5px; color: #435d57; font-size: 12px; }
.map-fallback span { font-size: 10px; line-height: 1.6; }

.dispatch-list { display: flex; min-height: 390px; flex-direction: column; }
.dispatch-list .panel-header { flex: 0 0 auto; }
.dispatch-items { flex: 1; }
.dispatch-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-bottom: 1px solid #eff2ef;
  padding: 15px 16px;
  transition: background 130ms ease;
}
.dispatch-item:last-child { border-bottom: 0; }
.dispatch-item:hover { background: #fbfcfb; }
.route-bullet { position: relative; display: flex; width: 13px; flex: 0 0 auto; flex-direction: column; align-items: center; padding-top: 3px; }
.route-bullet::after { width: 1px; height: 33px; border-left: 1px dashed #bdd0c6; content: ""; }
.route-bullet span { z-index: 1; width: 8px; height: 8px; border: 2px solid #4b9a78; border-radius: 50%; background: white; }
.dispatch-copy { flex: 1; min-width: 0; }
.dispatch-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dispatch-id { color: #526360; font-family: "DM Mono", monospace; font-size: 9px; }
.dispatch-customer { overflow: hidden; margin-top: 5px; color: #283a3a; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-route { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: #7e8d89; font-size: 10px; }
.route-arrow { color: #9aaa9f; font-size: 12px; }
.dispatch-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.driver-chip { display: flex; align-items: center; gap: 6px; color: #74827f; font-size: 9px; }
.driver-chip .tiny-avatar { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: #e8f0eb; color: #477963; font-size: 8px; font-weight: 700; }
.eta { color: #788783; font-family: "DM Mono", monospace; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 12px; padding: 4px 7px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.pending { background: var(--orange-soft); color: #be714a; }
.status-pill.assigned { background: #f0f2ef; color: #6d7d75; }
.status-pill.transit { background: var(--green-soft); color: #35805f; }
.status-pill.done { background: #eff2f0; color: #8b9892; }
.empty-state { padding: 32px 15px; color: #8b9995; font-size: 11px; text-align: center; }
.list-link {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #edf1ee;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
}
.list-link:hover { background: #f8fbf9; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .8fr); gap: 15px; margin-top: 15px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 38px; padding: 0 15px; background: #fafcfb; color: #98a4a1; font-family: "DM Mono", monospace; font-size: 9px; font-weight: 400; letter-spacing: .03em; text-align: left; }
td { height: 53px; border-top: 1px solid #eff2ef; padding: 0 15px; color: #53635f; font-size: 10px; }
tbody tr { transition: background 130ms ease; }
tbody tr:hover { background: #fbfcfb; }
.table-order { color: #395e51; font-family: "DM Mono", monospace; font-size: 10px; font-weight: 500; }
.customer-cell strong { display: block; color: #334442; font-size: 10px; font-weight: 600; }
.customer-cell span { display: block; margin-top: 3px; color: #a0aaa7; font-size: 9px; }
.load-cell { font-family: "DM Mono", monospace; font-size: 10px; }
.row-action { border: 0; border-radius: 6px; padding: 6px 8px; background: #f2f7f4; color: #4b8069; font-size: 9px; font-weight: 600; }
.row-action:hover { background: #e6f2e9; }
.timeline { padding: 2px 15px 8px; }
.timeline-item { position: relative; display: flex; gap: 11px; padding: 12px 0; }
.timeline-item:not(:last-child)::after { position: absolute; top: 26px; bottom: -7px; left: 4px; width: 1px; background: #e4ece7; content: ""; }
.timeline-dot { z-index: 1; width: 9px; height: 9px; flex: 0 0 auto; margin-top: 3px; border: 2px solid #75ad8c; border-radius: 50%; background: white; }
.timeline-dot.orange { border-color: #d89768; }
.timeline-dot.blue { border-color: #78a8c8; }
.timeline-copy { flex: 1; color: #71807d; font-size: 10px; line-height: 1.5; }
.timeline-copy strong { color: #40534f; font-weight: 600; }
.timeline-time { color: #a0aaa8; font-family: "DM Mono", monospace; font-size: 9px; }

.section-tabs { display: flex; align-items: center; gap: 4px; margin: 2px 0 14px; border-bottom: 1px solid #e6ece8; }
.tab-button { position: relative; border: 0; padding: 10px 12px 11px; background: transparent; color: #84918d; font-size: 10px; }
.tab-button.active { color: var(--green); font-weight: 600; }
.tab-button.active::after { position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; background: var(--green); content: ""; }
.orders-panel .panel-header { min-height: 55px; }
.orders-panel td { height: 58px; }
.order-actions { display: flex; justify-content: flex-end; gap: 3px; }
.table-secondary { border: 0; border-radius: 6px; padding: 6px 8px; background: transparent; color: #70827b; font-size: 9px; }
.table-secondary:hover { background: #f1f6f3; color: #3e715d; }
.filters { display: flex; align-items: center; gap: 7px; }
.filter-select { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: white; color: #687975; font-size: 10px; }
.content-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.result-count { color: #95a19e; font-size: 10px; }
.fleet-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.vehicle-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px; background: white; }
.vehicle-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vehicle-code { color: #6f807a; font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .04em; }
.vehicle-plate { margin-top: 5px; color: #243a38; font-family: "DM Mono", monospace; font-size: 17px; font-weight: 500; letter-spacing: .02em; }
.vehicle-type { margin-top: 4px; color: #95a19e; font-size: 10px; }
.vehicle-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: #edf4ef; color: #3f8068; }
.vehicle-icon svg { width: 21px; height: 21px; }
.vehicle-details { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 18px; border-top: 1px solid #edf1ee; padding-top: 13px; }
.vehicle-detail-label { color: #a0aaa8; font-size: 9px; }
.vehicle-detail-value { margin-top: 4px; color: #52645f; font-size: 10px; font-weight: 500; }
.vehicle-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; }
.vehicle-location { overflow: hidden; color: #899692; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.view-map { border: 0; background: transparent; color: var(--green); font-size: 9px; font-weight: 600; }
.fleet-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.summary-chip { border: 1px solid var(--line); border-radius: 20px; padding: 7px 10px; background: white; color: #74827e; font-size: 9px; }
.summary-chip b { margin-left: 3px; color: #375f50; font-family: "DM Mono", monospace; font-weight: 500; }
.tracking-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(295px,.78fr); gap: 15px; }
.tracking-card { padding: 16px; }
.tracking-order-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf1ee; padding-bottom: 13px; }
.tracking-order-id { color: #608274; font-family: "DM Mono", monospace; font-size: 10px; }
.tracking-customer { margin-top: 6px; color: #263a38; font-size: 14px; font-weight: 600; }
.tracking-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 17px 0 13px; }
.route-point span { display: block; color: #99a5a2; font-size: 9px; }
.route-point strong { display: block; margin-top: 5px; color: #425651; font-size: 11px; font-weight: 600; }
.route-divider { width: 35px; height: 1px; background: #c5d7cb; }
.tracking-progress { display: flex; align-items: center; gap: 0; margin-top: 17px; }
.progress-step { position: relative; flex: 1; color: #a0aaa7; font-size: 9px; text-align: center; }
.progress-step::before { position: relative; z-index: 1; display: block; width: 9px; height: 9px; margin: 0 auto 7px; border: 2px solid #d8e3dc; border-radius: 50%; background: white; content: ""; }
.progress-step:not(:last-child)::after { position: absolute; top: 4px; left: 52%; width: 96%; height: 1px; background: #e3eae5; content: ""; }
.progress-step.done { color: #58836e; }
.progress-step.done::before { border-color: #5a9c78; background: #5a9c78; }
.tracking-driver { display: flex; align-items: center; gap: 10px; margin-top: 17px; border-radius: 9px; padding: 11px; background: #f7faf8; }
.tracking-driver .avatar { border: 0; background: #e5f0e8; color: #40735c; }
.tracking-driver strong { display: block; color: #4c5d58; font-size: 10px; }
.tracking-driver span { display: block; margin-top: 3px; color: #8e9b96; font-size: 9px; }
.tracking-driver .eta-large { margin-left: auto; color: #53856d; font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; }
.gps-box { margin-top: 13px; border: 1px solid #e6ece8; border-radius: 9px; padding: 13px; }
.gps-box-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gps-box-title { color: #536560; font-size: 10px; font-weight: 600; }
.gps-small-copy { margin-top: 6px; color: #96a29e; font-size: 9px; line-height: 1.5; }
.gps-location { margin-top: 8px; color: #5b8371; font-family: "DM Mono", monospace; font-size: 9px; }
.gps-button { min-height: 30px; padding: 0 9px; font-size: 9px; }
.customer-track-shell { min-height: 100vh; background: var(--canvas); }
.customer-track-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 16px max(22px, calc((100vw - 1180px)/2)); background: white; }
.customer-track-content { max-width: 1180px; margin: 0 auto; padding: 28px 22px 40px; }
.customer-track-brand { display: flex; align-items: center; gap: 9px; color: #314844; font-size: 12px; font-weight: 700; }
.customer-track-brand .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 14px; }
.customer-track-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(300px,.8fr); gap: 15px; margin-top: 20px; }
.customer-track-map { min-height: 390px; border: 1px solid var(--line); border-radius: 11px; background: #e8efea; }
.customer-track-summary { border: 1px solid var(--line); border-radius: 11px; padding: 18px; background: white; }
.track-ref { color: #6e8d7e; font-family: "DM Mono", monospace; font-size: 10px; }
.track-headline { margin-top: 7px; color: #233836; font-size: 18px; font-weight: 600; }
.track-delivery-note { margin-top: 6px; color: #899693; font-size: 10px; }
.track-stops { display: grid; gap: 0; margin-top: 24px; }
.track-stop { display: grid; grid-template-columns: 14px 1fr; gap: 11px; min-height: 54px; }
.track-stop-symbol { position: relative; display: flex; justify-content: center; }
.track-stop-symbol::after { position: absolute; top: 14px; bottom: -4px; border-left: 1px dashed #cad9cf; content: ""; }
.track-stop:last-child .track-stop-symbol::after { display: none; }
.track-stop-symbol i { z-index: 1; width: 9px; height: 9px; margin-top: 2px; border: 2px solid #67a17e; border-radius: 50%; background: white; }
.track-stop:last-child .track-stop-symbol i { border-color: #d59068; }
.track-stop small { display: block; color: #9ba7a3; font-size: 9px; }
.track-stop strong { display: block; margin-top: 4px; color: #54645f; font-size: 10px; font-weight: 500; }
.track-eta-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; border-radius: 9px; padding: 12px; background: #eef6f0; }
.track-eta-card span { color: #688175; font-size: 9px; }
.track-eta-card strong { color: #3b795b; font-family: "DM Mono", monospace; font-size: 15px; font-weight: 500; }
.track-footnote { margin-top: 15px; color: #9ca7a3; font-size: 9px; line-height: 1.5; }

.customer-role .sidebar { display: none; }
.customer-role .main-column { width: 100%; margin-left: 0; }
.customer-role .content { max-width: 1340px; }
.customer-role .topbar { padding-right: max(23px, calc((100vw - 1340px)/2)); padding-left: max(23px, calc((100vw - 1340px)/2)); }
.driver-profile { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 13px 16px; }
.driver-profile-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: #e7f1e9; color: #3d775c; font-size: 15px; font-weight: 700; }
.driver-profile-copy { display: grid; gap: 4px; flex: 1; }
.driver-profile-copy strong { color: #38514a; font-size: 12px; }
.driver-profile-copy span, .driver-select-label { color: #91a09a; font-size: 9px; }
.driver-profile .filter-select { min-width: 210px; }
.driver-layout, .customer-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 14px; }
.driver-map-panel, .customer-map-panel { overflow: hidden; }
.driver-map-panel .map-frame.compact, .customer-map-panel .map-frame.compact { height: 440px; min-height: 340px; }
.driver-map-panel .map-footer, .customer-map-panel .map-footer { min-height: 39px; }
.driver-map-empty, .customer-map-empty { display: grid; min-height: 330px; place-items: center; padding: 24px; color: #8b9995; font-size: 11px; text-align: center; }
.driver-task-panel { min-height: 390px; }
.driver-task { padding: 17px; }
.driver-task-head, .customer-shipment-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.driver-task-head h2, .customer-shipment-header h2 { margin: 6px 0 7px; color: #2b413d; font-size: 17px; font-weight: 600; }
.driver-load { color: #3e775c; font-family: "DM Mono", monospace; font-size: 25px; font-weight: 500; }
.driver-load small { margin-left: 4px; color: #91a099; font-family: inherit; font-size: 10px; }
.driver-route { position: relative; display: grid; gap: 0; margin-top: 23px; border-top: 1px solid #edf1ee; border-bottom: 1px solid #edf1ee; padding: 15px 0 6px; }
.driver-route-point, .customer-stop { position: relative; display: grid; grid-template-columns: 13px 1fr; gap: 10px; min-height: 59px; }
.driver-route-point:not(:last-child)::after, .customer-stop:not(:last-child)::after { position: absolute; top: 12px; bottom: -2px; left: 5px; border-left: 1px dashed #c8d9ce; content: ""; }
.pickup-dot, .dropoff-dot { z-index: 1; width: 10px; height: 10px; margin-top: 2px; border: 2px solid #5f9a78; border-radius: 50%; background: white; }
.dropoff-dot { border-color: #dc9569; }
.driver-route-point span, .customer-stop small { display: block; color: #9ba7a3; font-size: 9px; }
.driver-route-point strong, .customer-stop strong { display: block; margin-top: 5px; color: #53645e; font-size: 11px; font-weight: 600; }
.driver-vehicle-strip { display: flex; align-items: center; gap: 10px; margin-top: 15px; border-radius: 9px; padding: 11px; background: #f7faf8; }
.driver-vehicle-strip .vehicle-icon { width: 36px; height: 36px; }
.driver-vehicle-strip strong, .driver-vehicle-strip span { display: block; }
.driver-vehicle-strip strong { color: #475c54; font-size: 10px; }
.driver-vehicle-strip div > span { margin-top: 4px; color: #96a29e; font-size: 9px; }
.driver-task-actions { display: grid; gap: 8px; margin-top: 15px; }
.driver-task-actions .primary-button, .driver-task-actions .secondary-button { justify-content: center; }
.driver-empty { display: grid; justify-items: center; gap: 8px; padding: 57px 22px; text-align: center; }
.empty-truck { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 4px; border-radius: 15px; background: #eff5f0; color: #679079; }
.empty-truck svg { width: 23px; height: 23px; }
.driver-empty strong, .customer-no-order strong { color: #52645e; font-size: 12px; }
.driver-empty span, .customer-no-order span { max-width: 250px; color: #99a5a1; font-size: 10px; line-height: 1.5; }
.gps-inline-note { margin-top: 11px; color: #9aa6a2; font-size: 9px; }
.customer-content { padding-top: 29px; }
.customer-account { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 13px 16px; }
.customer-account > div { display: grid; flex: 1; gap: 4px; }
.customer-account .eyebrow { font-size: 8px; }
.customer-account strong { color: #38554a; font-size: 13px; }
.customer-account span { color: #96a39e; font-size: 9px; }
.customer-account label { color: #93a09b; font-size: 9px; }
.customer-account .filter-select { min-width: 180px; }
.customer-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 13px; }
.customer-metrics article { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; background: white; }
.customer-metrics span { color: #82908b; font-size: 10px; }
.customer-metrics strong { color: #386e55; font-family: "DM Mono", monospace; font-size: 21px; font-weight: 500; }
.customer-layout { grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); }
.customer-selected-panel { min-height: 390px; }
.customer-shipment-card { padding: 16px; }
.customer-cargo-line { color: #93a09b; font-size: 9px; }
.customer-stops { margin-top: 20px; border-top: 1px solid #edf1ee; padding-top: 15px; }
.customer-stop { min-height: 56px; }
.customer-shipment-card .tracking-progress { margin-top: 4px; }
.customer-shipment-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 17px; border-radius: 8px; padding: 11px; background: #f7faf8; }
.customer-shipment-footer div { display: grid; gap: 5px; }
.customer-shipment-footer span { color: #9aa6a1; font-size: 9px; }
.customer-shipment-footer strong { color: #60736a; font-size: 10px; font-weight: 500; }
.customer-share-button { width: 100%; justify-content: center; margin-top: 11px; }
.customer-no-order { display: grid; justify-items: center; gap: 9px; padding: 62px 17px; text-align: center; }
.customer-no-order .primary-button { margin-top: 7px; }
.customer-orders-panel { margin-top: 14px; }
.customer-order-list { padding: 0 16px 5px; }
.customer-order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 15px; border-top: 1px solid #eff2ef; padding: 13px 2px; }
.customer-order-row.selected { background: #f8fbf9; }
.customer-order-main { display: grid; gap: 4px; min-width: 0; }
.customer-order-main strong { overflow: hidden; color: #596b64; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.customer-order-main strong span { color: #9eaaa5; }
.customer-order-main small { color: #a0aba7; font-size: 9px; }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(15,32,31,.42); backdrop-filter: blur(3px); }
.modal {
  overflow: auto;
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  background: white;
  box-shadow: 0 22px 70px rgba(17,36,33,.24);
  animation: modal-in 170ms ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid #edf1ee; padding: 18px 20px 15px; }
.modal-header h2 { margin: 0; color: #273b38; font-size: 15px; font-weight: 600; }
.modal-header p { margin: 5px 0 0; color: #8b9995; font-size: 10px; }
.modal-close { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #84918d; font-size: 20px; line-height: 1; }
.modal-close:hover { background: #f2f6f3; }
.modal-body { padding: 18px 20px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 12px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #677773; font-size: 10px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 37px;
  border: 1px solid #e1e9e4;
  border-radius: 7px;
  padding: 0 10px;
  background: #fcfdfc;
  color: #3f514c;
  font-size: 11px;
}
.form-field textarea { min-height: 68px; resize: vertical; padding-top: 9px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #b2bcb8; }
.form-hint { color: #9aa6a2; font-size: 9px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; border-top: 1px solid #edf1ee; padding-top: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-block { border-radius: 8px; padding: 11px; background: #f7faf8; }
.detail-block span { display: block; color: #98a39f; font-size: 9px; }
.detail-block strong { display: block; margin-top: 5px; color: #50635b; font-size: 11px; font-weight: 500; }
.toast-region { position: fixed; z-index: 50; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 230px; border: 1px solid #dfe9e2; border-radius: 9px; padding: 11px 13px; background: #fff; color: #4e655a; box-shadow: var(--shadow); font-size: 10px; animation: modal-in 140ms ease-out; }
.toast-mark { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #e7f4eb; color: #3a8a60; font-size: 10px; font-weight: 700; }
.muted { color: #94a09c; }
.mono { font-family: "DM Mono", monospace; }

@media (max-width: 1220px) {
  .content { padding-right: 23px; padding-left: 23px; }
  .topbar { padding-right: 23px; padding-left: 23px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.2fr) minmax(300px,.85fr); }
  .fleet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .sidebar { width: 205px; }
  .main-column { width: calc(100% - 205px); margin-left: 205px; }
  .dashboard-grid, .lower-grid, .tracking-layout, .customer-track-grid, .driver-layout, .customer-layout { grid-template-columns: 1fr; }
  .dispatch-list { min-height: initial; }
  .dispatch-items { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dispatch-item:nth-child(odd) { border-right: 1px solid #eff2ef; }
  .dispatch-item:nth-last-child(-n+2) { border-bottom: 0; }
  .tracking-layout > .panel:first-child { min-height: 380px; }
}
@media (max-width: 700px) {
  .sidebar { width: 64px; align-items: center; padding: 15px 7px; }
  .brand { justify-content: center; padding: 0 0 22px; }
  .brand-copy, .nav-caption, .nav-label, .nav-count, .sidebar-status, .sidebar-foot .user-copy, .sidebar-foot .more-button { display: none; }
  .nav-list { width: 100%; }
  .nav-item { width: 48px; height: 43px; justify-content: center; padding: 0; }
  .nav-icon { width: 19px; height: 19px; }
  .sidebar-foot { justify-content: center; width: 100%; margin-top: 12px; padding: 13px 0 0; }
  .sidebar-foot .avatar { width: 32px; height: 32px; }
  .main-column { width: calc(100% - 64px); margin-left: 64px; }
  .topbar { height: 60px; padding: 0 14px; }
  .topbar .crumb { display: none; }
  .topbar-right { width: 100%; justify-content: flex-end; gap: 4px; }
  .topbar-right > .search-box, .topbar-right > .icon-button, .topbar-right > .avatar { display: none; }
  .role-switcher { gap: 1px; padding: 2px; }
  .role-tab { min-height: 27px; padding: 0 10px; font-size: 9px; }
  .customer-role .topbar { padding: 0 14px; }
  .search-box { width: min(34vw, 170px); height: 33px; }
  .search-box input { font-size: 10px; }
  .content { padding: 19px 13px 26px; }
  .demo-notice { font-size: 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
  .heading-actions { width: 100%; }
  .heading-actions .date-chip { display: none; }
  .heading-actions .primary-button { flex: 1; }
  h1 { font-size: 21px; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .metric-card { min-height: 101px; padding: 13px; }
  .metric-card::after { top: 12px; right: 12px; width: 26px; height: 26px; line-height: 26px; }
  .metric-value { margin-top: 12px; font-size: 25px; }
  .metric-label { font-size: 10px; }
  .dashboard-grid, .lower-grid { gap: 10px; }
  .map-frame { min-height: 305px; height: 74vw; }
  .map-frame.compact { min-height: 290px; height: 350px; }
  .dispatch-items { grid-template-columns: 1fr; }
  .dispatch-item:nth-child(odd) { border-right: 0; }
  .dispatch-item:nth-last-child(2) { border-bottom: 1px solid #eff2ef; }
  .panel-header { padding: 0 13px; }
  .map-footer { align-items: flex-start; flex-direction: column; padding: 9px 12px; }
  .map-legend { gap: 10px; }
  .fleet-grid { grid-template-columns: 1fr; }
  .content-toolbar { align-items: flex-start; flex-direction: column; }
  .orders-panel .panel-header { align-items: flex-start; flex-direction: column; padding-top: 12px; padding-bottom: 12px; }
  .orders-panel .filters { width: 100%; }
  .filter-select { flex: 1; }
  .table-wrap { margin: 0 -2px; }
  th, td { padding-right: 10px; padding-left: 10px; }
  .customer-track-content { padding: 19px 13px 28px; }
  .customer-track-header { padding: 12px 13px; }
  .customer-track-grid { gap: 10px; }
  .customer-track-map { min-height: 310px; }
  .driver-profile { flex-wrap: wrap; gap: 9px; padding: 11px; }
  .driver-profile-copy { min-width: calc(100% - 60px); }
  .driver-select-label { margin-left: 2px; }
  .driver-profile .filter-select { min-width: 0; flex: 1; }
  .driver-layout, .customer-layout { gap: 10px; }
  .driver-map-panel .map-frame.compact, .customer-map-panel .map-frame.compact { height: 330px; min-height: 290px; }
  .customer-account { flex-wrap: wrap; gap: 8px 12px; padding: 12px; }
  .customer-account > div { min-width: calc(100% - 4px); }
  .customer-account label { margin-left: 2px; }
  .customer-account .filter-select { min-width: 0; flex: 1; }
  .customer-metrics { gap: 6px; }
  .customer-metrics article { gap: 4px; align-items: flex-start; flex-direction: column; padding: 10px; }
  .customer-metrics strong { font-size: 19px; }
  .customer-order-list { padding-right: 11px; padding-left: 11px; }
  .customer-order-row { grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
  .customer-order-row .status-pill { grid-column: 2; grid-row: 1; }
  .customer-order-row .table-secondary { grid-column: 2; grid-row: 2; justify-self: end; }
  .customer-order-main { grid-column: 1; grid-row: 1 / span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .modal-body { padding: 15px; }
}
