/* SME [2026-07-14] Live Map chrome — full futuristic red (keep map-marker semantics) */
/* SME [2026-07-14] Brand chrome red lock — remove leftover teal/green accents */
/* SME [2026-06-29] Add controlled ELD refresh */
/* SME [2026-06-29] Improve live map marker visibility */
/* SME [2026-06-29] Fix Samsara polling enablement */
/* SME [2026-06-29] Show Samsara vehicles on map */
/* SME [2026-06-26] Style shared company badges */
/* SME [2026-06-26] Upgrade Loads command header and card actions */
.company-badge {
    --company-color:#38bdf8;
    display:inline-flex;
    align-items:center;
    margin:0 6px 0 0;
    padding:2px 7px;
    border-radius:999px;
    border:1px solid var(--company-color);
    background:rgba(219,17,31,.14);
    background:color-mix(in srgb, var(--company-color) 22%, transparent);
    color:#bae6fd;
    font-size:10px;
    font-weight:900;
    letter-spacing:.06em;
    text-transform:uppercase;
    vertical-align:middle;
}
/* SME [2026-06-25] Add centered Route Trip map tab */
:root {
  --cp-accent: #db111f;
  --cp-accent-dark: #b50e19;
  --cp-accent-hover: #ff4d5a;
  --cp-accent-glow: rgba(219, 17, 31, 0.45);
  --cp-portal-bg: #04060c;
  --cp-text: #e8eef7;
  --cp-cyan: var(--cp-accent);
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #04060c;
  color: var(--cp-text, #e8eef7);
  font-family: var(--cp-font, "Outfit", "Inter", "Segoe UI", system-ui, sans-serif);
}

#map {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  z-index: 1 !important;
  background: #04060c;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(5, 10, 20, .96);
  color: #e2e8f0;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 28%, transparent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .48), 0 0 26px color-mix(in srgb, var(--cp-accent) 10%, transparent);
}

.leaflet-popup-content {
  margin: 14px;
}

.leaflet-tooltip {
  background: rgba(5, 10, 20, .94);
  color: #e2e8f0;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 26%, transparent);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.42);
  font-size: 11px;
  font-weight: 800;
}

.leaflet-tooltip-top:before {
  border-top-color: rgba(5, 10, 20, .94);
}

.checkpoint-popup {
  min-width: 245px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.checkpoint-popup .popup-kicker {
  color: var(--cp-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.checkpoint-popup strong {
  display: block;
  color: #f8fafc;
  font-size: 17px;
  letter-spacing: .02em;
  margin-bottom: 4px;
}

.checkpoint-popup > div:not(.popup-kicker):not(.popup-actions):not(.popup-status) {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.checkpoint-popup dl {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 11px 0 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(148, 163, 184, .16);
}

.checkpoint-popup dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.checkpoint-popup dd {
  margin: 0;
  color: #e2e8f0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.checkpoint-stop-popup,
.checkpoint-provider-popup {
  min-width: 230px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.checkpoint-stop-popup .popup-kicker,
.checkpoint-provider-popup .popup-kicker {
  color: var(--cp-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.checkpoint-stop-popup strong,
.checkpoint-provider-popup strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 9px;
}

.checkpoint-stop-popup dl,
.checkpoint-provider-popup dl {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(148, 163, 184, .16);
}

.checkpoint-stop-popup dt,
.checkpoint-provider-popup dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.checkpoint-stop-popup dd,
.checkpoint-provider-popup dd {
  margin: 0;
  color: #e2e8f0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.popup-actions button {
  border: 1px solid color-mix(in srgb, var(--cp-accent) 28%, transparent);
  border-radius: 10px;
  padding: 8px 9px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cp-accent) 20%, transparent), rgba(219,17,31,.12));
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.popup-actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 77, 90, .55);
  background: linear-gradient(135deg, rgba(219, 17, 31, .22), color-mix(in srgb, var(--cp-accent) 16%, transparent));
}

.popup-actions button.danger {
  border-color: rgba(248, 113, 113, .34);
  background: linear-gradient(135deg, rgba(239, 68, 68, .20), rgba(248, 113, 113, .08));
}

.popup-actions button.popup-action-primary {
  grid-column: 1 / -1;
  padding: 12px 14px;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #db111f, #ff3d4d);
  border-color: rgba(219, 17, 31, .45);
  color: #fff;
  box-shadow: 0 8px 24px rgba(219, 17, 31, .22);
}

.popup-status {
  min-height: 16px;
  margin-top: 9px;
  color: var(--cp-accent-hover, #ff4d5a);
  font-size: 11px;
  font-weight: 800;
}

.popup-status.is-error {
  color: #fca5a5;
}

/* SME [2026-07-14] Loads panel — Pipeline black glass + Manning red */
.sidebar,
.sidebar.loads-panel {
  width: 380px;
  height: calc(100vh - 80px);
  position: fixed !important;
  right: 20px !important;
  top: 80px !important;
  z-index: 1020 !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    linear-gradient(160deg, rgba(6,8,15,.97) 0%, rgba(10,14,24,.94) 55%, rgba(12,8,14,.96) 100%),
    radial-gradient(ellipse 90% 50% at 15% 0%, rgba(219,17,31,.22), transparent 55%);
  border: 1px solid rgba(219, 17, 31, .34);
  border-radius: 20px;
  padding: 14px;
  box-shadow:
    0 24px 64px rgba(0,0,0,.58),
    0 0 40px rgba(219,17,31,.14),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(18px) saturate(1.35);
  scrollbar-width: thin;
  scrollbar-color: rgba(219,17,31,.45) rgba(6,8,15,.5);
}

.loads-command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(219, 17, 31, .32);
  background:
    linear-gradient(135deg, rgba(219,17,31,.20), rgba(6,8,15,.75)),
    radial-gradient(circle at 8% 0%, rgba(255,77,90,.28), transparent 48%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.03),
    0 12px 28px rgba(0,0,0,.28),
    0 0 32px rgba(219,17,31,.14);
}

.loads-command-header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 0;
  color: #f8fafc;
  font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.loads-kicker {
  display: block;
  color: #ff4d5a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .20em;
  text-transform: uppercase;
}

.loads-orb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #db111f;
  box-shadow: 0 0 0 3px rgba(219,17,31,.22), 0 0 18px rgba(219,17,31,.95), 0 0 36px rgba(219,17,31,.45);
  animation: loadsOrbPulse 2.2s ease-in-out infinite;
}

@keyframes loadsOrbPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(219,17,31,.18), 0 0 14px rgba(219,17,31,.75), 0 0 28px rgba(219,17,31,.28); }
  50% { box-shadow: 0 0 0 4px rgba(219,17,31,.28), 0 0 22px rgba(219,17,31,.95), 0 0 14px rgba(255,77,90,.35); }
}

.loads-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(219, 17, 31, .55);
  background: linear-gradient(135deg, #db111f 0%, #c4101c 100%);
  color: #fff !important;
  font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .10em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(219,17,31,.40);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.loads-help-link::before {
  content: '?';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.loads-help-link:hover,
.loads-help-link:focus {
  color: #ffffff !important;
  border-color: transparent;
  background: linear-gradient(135deg, #b50e19 0%, #db111f 100%);
  box-shadow: 0 6px 22px rgba(219,17,31,.50);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.sidebar .status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(219, 17, 31, .22);
  background: rgba(2, 6, 23, .72);
  box-shadow: inset 0 0 20px rgba(219,17,31,.06);
}

.sidebar .status-tab,
.sidebar button.status-tab {
  flex: 1 1 auto;
  min-width: 70px;
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: none !important;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.sidebar .status-tab:hover {
  color: #f1f5f9 !important;
  background: rgba(255,255,255,.04) !important;
}

.sidebar .status-tab.active,
.sidebar button.status-tab.active {
  background: linear-gradient(135deg, #db111f 0%, #c4101c 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 4px 16px rgba(219,17,31,.45) !important;
}

.sidebar .load-list,
.sidebar #load-list {
  flex: 1 1 auto;
  min-height: 120px;
}

.sidebar .load-empty {
  margin: 8px 0 4px;
  padding: 28px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(219, 17, 31, .28);
  background:
    linear-gradient(160deg, rgba(219,17,31,.08), rgba(6,8,15,.55));
  color: #cbd5e1;
  text-align: center;
  font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.45;
}

.sidebar .clear-trail-btn,
.sidebar button.clear-trail-btn {
  margin-top: auto;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(219, 17, 31, .48) !important;
  background: linear-gradient(135deg, rgba(219,17,31,.18), rgba(6,8,15,.82)) !important;
  color: #fecaca !important;
  font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(219,17,31,.14);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.sidebar .clear-trail-btn:hover {
  border-color: rgba(255, 77, 90, .75) !important;
  background: linear-gradient(135deg, rgba(219,17,31,.32), rgba(6,8,15,.88)) !important;
  color: #fff !important;
  box-shadow: 0 0 28px rgba(219,17,31,.28);
  transform: translateY(-1px);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.card-action-btn {
  border: 1px solid color-mix(in srgb, var(--cp-accent) 24%, transparent);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(2,6,23,.55);
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.card-action-btn.danger {
  border-color: rgba(248,113,113,.34);
  color: #fecaca;
  background: rgba(127,29,29,.22);
}

.request-location-btn {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 13px 14px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #db111f, #ff3d4d);
  box-shadow: 0 10px 28px rgba(219, 17, 31, .24);
  transition: transform .15s ease, box-shadow .15s ease;
}

.request-location-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(219, 17, 31, .32);
}

.request-location-btn:disabled {
  opacity: .6;
  cursor: wait;
}

.request-location-btn--card {
  width: auto;
  flex: 1 1 100%;
  margin: 0;
  padding: 10px 12px;
  font-size: 11px;
}

.detail-request-wrap {
  padding: 0 16px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.detail-request-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}

.detail-request-hint.is-ok { color: var(--cp-accent-hover, #ff4d5a); }
.detail-request-hint.is-error { color: #fca5a5; }

/* SME [2026-07-02] Map chrome layout tokens */
:root {
  --map-chrome-left: 20px;
  --map-chrome-bottom: 20px;
  --marker-toggle-width: 210px;
  --map-chrome-gap: 14px;
  --drawer-width: 300px;
  --sidebar-offset: 408px;
}

/* SME [2026-07-02] Map-first layout: compact dock beside marker layers */
.trail-route-hud {
  display: none !important;
}

.map-route-dock {
  position: fixed;
  left: calc(var(--map-chrome-left) + var(--marker-toggle-width) + var(--map-chrome-gap));
  bottom: var(--map-chrome-bottom);
  z-index: 1015;
  min-width: 280px;
  max-width: min(620px, calc(100vw - var(--sidebar-offset) - var(--drawer-width) - 48px));
  padding: 11px 14px 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 28%, transparent);
  background:
    linear-gradient(145deg, rgba(5, 10, 20, 0.94), rgba(8, 18, 32, 0.90)),
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--cp-accent) 10%, transparent), transparent 52%);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.52), 0 0 28px color-mix(in srgb, var(--cp-accent) 10%, transparent);
  color: #dbeafe;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.map-route-dock.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 34px color-mix(in srgb, var(--cp-accent) 14%, transparent);
}

.map-route-dock-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.map-route-dock-kicker {
  color: #ff4d5a;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.map-route-dock-load {
  color: #f8fafc;
  font-family: "Orbitron", "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}

.map-route-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.map-route-btn {
  border: 1px solid rgba(148, 163, 184, .24);
  background: rgba(15, 23, 42, .78);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.map-route-btn:hover {
  border-color: rgba(255, 77, 90, .55);
  background: rgba(15, 23, 42, .94);
  transform: translateY(-1px);
}

.map-route-btn-primary {
  border-color: color-mix(in srgb, var(--cp-accent, #db111f) 55%, transparent);
  background: linear-gradient(135deg, rgba(219,17,31,.28), rgba(181,14,25,.16));
  color: #fecaca;
  box-shadow: 0 0 18px rgba(219,17,31,.22);
}

.map-route-btn-ghost {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, .16);
}

.map-route-dock-legend:empty {
  display: none;
}

.map-route-dock-note {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.45;
  color: #bfdbfe;
  text-align: left;
}

.map-route-dock-stats {
  margin: 0 0 7px;
  font-size: 10px;
  line-height: 1.35;
  color: #94a3b8;
  letter-spacing: .03em;
  text-align: left;
}

.map-route-dock-legend .trail-hud-legend {
  margin: 0;
  justify-content: flex-start;
  gap: 5px;
}

.map-route-dock-legend .trail-hud-legend span {
  font-size: 9px;
  padding: 3px 7px;
  white-space: nowrap;
}

.checkpoint-trail-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4d5a, #db111f);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(219, 17, 31, .55), 0 8px 20px rgba(0, 0, 0, .35), 0 0 18px rgba(219,17,31,.35);
  position: relative;
}

.checkpoint-trail-arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid #fff;
}

.checkpoint-trail-waypoint {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2563eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkpoint-trail-waypoint span {
  font-size: 8px;
  font-weight: 900;
  color: #1d4ed8;
  line-height: 1;
}

#map.trail-focus-active .checkpoint-location-icon {
  opacity: 0.15 !important;
}

.checkpoint-trail-gap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.92);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.trail-hud-planned {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #c4b5fd !important;
}

.trail-hud-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 8px 0;
}

.trail-hud-legend span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.legend-road { color: #93c5fd; background: rgba(37, 99, 235, 0.18); }
.legend-planned { color: #ddd6fe; background: rgba(139, 92, 246, 0.18); }
.legend-gap { color: #fecaca; background: rgba(239, 68, 68, 0.16); }
.legend-milestone { color: #fde68a; background: rgba(245, 158, 11, 0.14); }

.map-route-dock-retention {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.4;
  color: #fcd34d;
  text-align: left;
}

.map-route-dock-note.is-web-ping {
  color: #fcd34d;
  border-left: 3px solid rgba(245, 158, 11, 0.55);
  padding-left: 8px;
}

.checkpoint-header {
  position: relative !important;
  z-index: 1030 !important;
}

.modal {
  z-index: 1050 !important;
}

.modal-backdrop {
  z-index: 1040 !important;
}

.checkpoint-header img,
.logo-text img {
  max-height: 40px;
  width: auto;
}

.legend {
  position: fixed;
  bottom: calc(var(--map-chrome-bottom) + 58px);
  left: var(--map-chrome-left);
  background:
    linear-gradient(160deg, rgba(4,6,12,.96), rgba(8,10,18,.94)),
    radial-gradient(circle at 16% 0%, rgba(219,17,31,.16), transparent 48%);
  border: 1px solid rgba(219, 17, 31, .30);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: .85rem;
  z-index: 1014;
  box-shadow: 0 18px 48px rgba(0,0,0,.58), 0 0 28px rgba(219,17,31,.10);
  backdrop-filter: blur(16px) saturate(1.2);
  max-width: min(520px, calc(100vw - var(--sidebar-offset) - 40px));
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.98);
  transform-origin: left bottom;
  transition: opacity .18s ease, transform .18s ease;
}

.legend.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.map-layer-toggle {
  position: fixed;
  left: var(--map-chrome-left);
  bottom: var(--map-chrome-bottom);
  z-index: 1016;
  width: var(--marker-toggle-width);
  min-height: 50px;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 56%, transparent);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(219,17,31,.94), rgba(181,14,25,.90)),
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.22), transparent 48%);
  color: #fff5f5;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
  box-shadow: 0 18px 42px rgba(0,0,0,.52), 0 0 28px color-mix(in srgb, var(--cp-accent) 22%, transparent);
}

.map-layer-toggle::before {
  content: '▦';
  display: inline-block;
  margin-right: 8px;
  color: #ffffff;
}

.map-layer-toggle.is-open {
  background:
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(8,18,32,.92)),
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--cp-accent) 18%, transparent), transparent 42%);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.map-theme-control {
  margin: 0 0 12px;
  padding: 0 0 11px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.map-theme-title {
  color: #ff4d5a;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .15em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.map-theme-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 25%, transparent);
  border-radius: 999px;
  background: rgba(2,6,23,.62);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--cp-accent) 5%, transparent);
}

.map-theme-btn {
  min-width: 96px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.map-theme-btn.active {
  background: linear-gradient(135deg, rgba(219,17,31,.55), rgba(181,14,25,.42));
  color: #fff;
  box-shadow: 0 0 22px rgba(219,17,31,.40), inset 0 0 0 1px rgba(255,255,255,.10);
}

.map-theme-btn:hover,
.map-theme-btn:focus {
  color: #ffffff;
  transform: translateY(-1px);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  color: #dbeafe;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
}

.legend-item input {
  width: 14px;
  height: 14px;
  accent-color: var(--cp-accent, #db111f);
  cursor: pointer;
}

.legend-item.is-pending {
  opacity: .52;
  cursor: help;
}

.legend-item.is-pending input {
  cursor: not-allowed;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px currentColor;
}

.legend-dot.pickup { color: #22c55e; background: #22c55e; }
.legend-dot.transit { color: #38bdf8; background: #38bdf8; }
.legend-dot.delivery { color: #ef4444; background: #ef4444; }
.legend-dot.provider { color: #22d3ee; background: #22d3ee; border-radius: 3px; transform: rotate(45deg); }
.legend-dot.location { color: var(--cp-accent); background: var(--cp-accent); }
.legend-dot.dot-camera { color: #facc15; background: #facc15; }
.legend-dot.dot-incident { color: #fb7185; background: #fb7185; }
.legend-dot.dot-condition { color: #38bdf8; background: #38bdf8; }
.legend-dot.dot-construction { color: #fb923c; background: #fb923c; }
.legend-dot.weather { color: #a78bfa; background: #a78bfa; }
.legend-dot.radar { color: #60a5fa; background: linear-gradient(135deg, #22d3ee, #8b5cf6); }

.weather-legend {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.legend-help {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
  max-width: 420px;
}

.provider-layer-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, .36);
  border-radius: 12px;
  background: rgba(120, 53, 15, .22);
  color: #fde68a;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.4;
  max-width: 420px;
}

.provider-refresh-control {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(219, 17, 31, .32);
  border-radius: 12px;
  background: rgba(219, 17, 31, .10);
  max-width: 420px;
  box-shadow: 0 0 18px rgba(219,17,31,.10);
}

.provider-refresh-btn {
  width: 100%;
  border: 1px solid rgba(219, 17, 31, .55);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(219,17,31,.28), rgba(181,14,25,.18));
  color: #fecaca;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(219,17,31,.18);
}

.provider-focus-control {
  margin: 10px 0 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, .28);
  background: rgba(127, 29, 29, .16);
}

.provider-focus-btn {
  width: 100%;
  border: 1px solid rgba(248, 113, 113, .55);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(185, 28, 28, .45), rgba(127, 29, 29, .35));
  color: #fecaca;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.provider-focus-btn:hover,
.provider-focus-btn.is-active {
  border-color: rgba(255, 77, 90, .75);
  background: linear-gradient(135deg, rgba(219, 17, 31, .55), rgba(181, 14, 25, .42));
  color: #fff;
  box-shadow: 0 0 20px rgba(219,17,31,.35);
}

.provider-focus-hint {
  margin-top: 7px;
  color: #fda4af;
  font-size: 11px;
  line-height: 1.4;
}

.provider-refresh-btn:hover:not(:disabled) {
  border-color: rgba(255, 77, 90, .85);
  background: linear-gradient(135deg, rgba(219,17,31,.42), rgba(181,14,25,.28));
  color: #fff;
}

.provider-refresh-btn:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.provider-refresh-status {
  margin-top: 7px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.provider-refresh-status.is-ok {
  color: #ff4d5a;
}

.provider-refresh-status.is-error {
  color: #fca5a5;
}

.company-color-legend {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.company-color-title {
  color: #f8fafc;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.company-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  max-width: 390px;
}

.company-color-key,
.company-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 850;
}

.company-color-key i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--company-color);
  box-shadow: 0 0 0 2px rgba(248,250,252,.9), 0 0 14px var(--company-color);
}

.company-color-chip {
  margin-left: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--company-color);
  background: rgba(15,23,42,.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.dot-legend {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.dot-legend-title {
  color: var(--cp-accent-hover, #ff4d5a);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.dot-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 8px 12px;
}

.history-filters {
  margin: -5px 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(219, 17, 31, .28);
}

.history-title {
  color: var(--cp-accent-hover, #ff4d5a);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
  margin-bottom: 8px;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.history-grid label {
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.history-grid input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(2, 6, 23, .76);
  color: #f8fafc;
  padding: 8px;
}

.history-apply {
  width: 100%;
  margin-top: 9px;
  border: 1px solid rgba(219, 17, 31, .45);
  border-radius: 10px;
  background: rgba(219, 17, 31, .14);
  color: #fecaca;
  padding: 8px;
  font-weight: 900;
  cursor: pointer;
}

/* clear-trail-btn chrome lives under .sidebar.loads-panel */

.route-trip-tab {
  display: none !important;
}

.route-trip-tab {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 120%);
  z-index: 1018;
  min-width: 260px;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 42%, transparent);
  border-radius: 18px 18px 8px 8px;
  padding: 10px 24px 12px;
  background:
    linear-gradient(145deg, rgba(5,10,20,.96), rgba(8,18,32,.92)),
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--cp-accent) 18%, transparent), transparent 42%);
  box-shadow: 0 18px 48px rgba(0,0,0,.52), 0 0 34px color-mix(in srgb, var(--cp-accent) 14%, transparent);
  color: #dbeafe;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: transform .2s ease, opacity .2s ease, border-color .2s ease;
  backdrop-filter: blur(16px);
  text-align: center;
}

.route-trip-tab.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.route-trip-tab:hover {
  border-color: rgba(134, 239, 172, .72);
  transform: translate(-50%, -3px);
}

.route-trip-tab .route-trip-kicker {
  display: block;
  color: var(--cp-accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
  line-height: 1;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.route-trip-tab strong {
  display: block;
  color: #f8fafc;
  font-family: "Orbitron", "Inter", system-ui, sans-serif;
  font-size: 17px;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.route-trip-tab em {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  margin-top: 4px;
}

.checkpoint-map-icon {
  --marker-color: #22c55e;
  --company-color: #22c55e;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.24), transparent 28%),
    linear-gradient(145deg, rgba(2, 6, 23, .98), rgba(15, 23, 42, .94));
  border: 3px solid #f8fafc;
  box-shadow: 0 0 0 5px var(--company-color), 0 12px 28px rgba(0,0,0,.62), 0 0 28px var(--company-color);
}

.checkpoint-dot-icon {
  --dot-color: #38bdf8;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #020617;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.86), transparent 32%),
    var(--dot-color);
  border: 2px solid rgba(248,250,252,.86);
  box-shadow: 0 0 0 4px rgba(15,23,42,.72), 0 0 24px rgba(56,189,248,.40);
  font-family: "Orbitron", "Inter", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .03em;
}

.checkpoint-dot-icon.camera { --dot-color: #facc15; }
.checkpoint-dot-icon.incident { --dot-color: #fb7185; }
.checkpoint-dot-icon.condition { --dot-color: #38bdf8; }
.checkpoint-dot-icon.construction { --dot-color: #fb923c; }

.checkpoint-weather-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(248,250,252,.92);
  background:
    radial-gradient(circle at 32% 20%, rgba(255,255,255,.88), transparent 28%),
    linear-gradient(135deg, rgba(167,139,250,.96), rgba(14,116,144,.92));
  color: #f8fafc;
  box-shadow: 0 0 0 4px rgba(15,23,42,.78), 0 10px 26px rgba(0,0,0,.52), 0 0 26px rgba(167,139,250,.38);
  font-size: 10px;
  font-weight: 950;
}

.checkpoint-weather-popup {
  min-width: 220px;
  color: #e5f7ff;
}

.checkpoint-weather-popup strong {
  display: block;
  color: #f8fafc;
  font-size: 1rem;
  margin: 3px 0 8px;
}

.checkpoint-weather-popup dl {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(148, 163, 184, .16);
}

.checkpoint-weather-popup dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.checkpoint-weather-popup dd {
  margin: 0;
  color: #e2e8f0;
  font-size: 11px;
}

.checkpoint-dot-popup {
  min-width: 240px;
  color: #e5f7ff;
}

.checkpoint-dot-popup strong {
  display: block;
  color: #f8fafc;
  font-size: 1rem;
  margin: 3px 0 6px;
}

.checkpoint-dot-popup p {
  margin: 0 0 8px;
  color: #cbd5e1;
  line-height: 1.45;
}

.dot-popup-image {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  margin: 6px 0 8px;
}

.dot-popup-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--cp-accent-hover, #ff4d5a);
  font-weight: 900;
  text-decoration: none;
}

.checkpoint-map-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--marker-color);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.65));
}

.checkpoint-map-icon span {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f8fafc;
  border: 2px solid #020617;
  color: #020617;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .02em;
  box-shadow: 0 4px 12px rgba(0,0,0,.50);
}

.checkpoint-map-icon.selected {
  transform: scale(1.18);
  border-color: #ffffff;
  box-shadow: 0 0 0 6px var(--company-color), 0 0 0 10px rgba(248,250,252,.30), 0 16px 34px rgba(0,0,0,.66), 0 0 36px var(--company-color);
}

.checkpoint-map-icon.truck,
.checkpoint-map-icon.pickup {
  --marker-color: #22c55e;
}

.checkpoint-map-icon.truck {
  width: 26px;
  height: 26px;
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--company-color), 0 8px 18px rgba(0,0,0,.56), 0 0 18px var(--company-color);
}

.checkpoint-map-icon.truck svg {
  width: 14px;
  height: 14px;
}

.checkpoint-map-icon.truck span {
  right: -5px;
  bottom: -5px;
  min-width: 16px;
  height: 12px;
  padding: 0 3px;
  border-width: 1px;
  font-size: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,.46);
}

.checkpoint-map-icon.truck.selected {
  box-shadow: 0 0 0 4px var(--company-color), 0 0 0 7px rgba(248,250,252,.26), 0 10px 24px rgba(0,0,0,.62), 0 0 24px var(--company-color);
}

.checkpoint-map-icon.transit {
  --marker-color: #38bdf8;
  box-shadow: 0 0 0 5px var(--company-color), 0 12px 28px rgba(0,0,0,.62), 0 0 28px var(--company-color);
}

.checkpoint-map-icon.delivery {
  --marker-color: #ef4444;
  box-shadow: 0 0 0 5px var(--company-color), 0 12px 28px rgba(0,0,0,.62), 0 0 28px var(--company-color);
}

.checkpoint-map-icon.provider {
  --marker-color: #22d3ee;
  width: 20px;
  height: 20px;
  border-width: 2px;
  border-radius: 5px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px var(--company-color), 0 6px 14px rgba(0,0,0,.50), 0 0 12px rgba(34,211,238,.34);
}

.checkpoint-map-icon.provider svg {
  width: 11px;
  height: 11px;
}

.checkpoint-map-icon.provider svg,
.checkpoint-map-icon.provider span {
  transform: rotate(-45deg);
}

.checkpoint-map-icon.provider span {
  display: none;
}

.checkpoint-map-icon.provider.selected {
  transform: rotate(45deg) scale(1.35);
  box-shadow: 0 0 0 3px var(--company-color), 0 0 0 6px rgba(248,250,252,.28), 0 8px 18px rgba(0,0,0,.56), 0 0 16px rgba(34,211,238,.42);
}

.checkpoint-provider-icon {
  --company-color: #22d3ee;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #f8fafc;
  border-radius: 5px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.70), transparent 30%),
    linear-gradient(135deg, rgba(34,211,238,.98), rgba(14,116,144,.95));
  color: #052f3f;
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px var(--company-color), 0 6px 14px rgba(0,0,0,.50), 0 0 12px rgba(34,211,238,.34);
}

.checkpoint-provider-icon span {
  transform: rotate(-45deg);
  font-size: 0;
  font-weight: 950;
  letter-spacing: .05em;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.checkpoint-provider-icon span::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #052f3f;
}

.checkpoint-provider-icon.is-dim {
  background: linear-gradient(135deg, rgba(148,163,184,.82), rgba(51,65,85,.88));
  color: #e2e8f0;
  opacity: .92;
}

.checkpoint-provider-icon.is-offline {
  border-color: rgba(254,202,202,.96);
  background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(127,29,29,.90));
  color: #fff;
  box-shadow: 0 0 0 2px var(--company-color), 0 6px 14px rgba(0,0,0,.50), 0 0 12px rgba(239,68,68,.34);
}

.checkpoint-stop-icon {
  --stop-color: #22c55e;
  --company-color: #22c55e;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, .96);
  border: 2px solid var(--stop-color);
  box-shadow: 0 0 0 4px var(--company-color), 0 10px 22px rgba(0,0,0,.56), 0 0 20px var(--company-color);
}

.checkpoint-stop-icon span {
  transform: rotate(45deg);
  color: var(--stop-color);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.checkpoint-stop-icon.pickup {
  --stop-color: #22c55e;
}

.checkpoint-stop-icon.transit {
  --stop-color: #38bdf8;
  box-shadow: 0 0 0 4px var(--company-color), 0 10px 22px rgba(0,0,0,.56), 0 0 20px var(--company-color);
}

.checkpoint-stop-icon.delivery {
  --stop-color: #ef4444;
  box-shadow: 0 0 0 4px var(--company-color), 0 10px 22px rgba(0,0,0,.56), 0 0 20px var(--company-color);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: color-mix(in srgb, var(--cp-accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--cp-accent) 34%, transparent);
  box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 24px color-mix(in srgb, var(--cp-accent) 16%, transparent);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: linear-gradient(145deg, rgba(2,6,23,.96), rgba(15,23,42,.90));
  color: #fecaca;
  border: 1px solid rgba(248,250,252,.12);
  font-weight: 900;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.card-audit {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(148, 163, 184, .16);
  color: #cbd5e1;
  font-size: 11px;
}

.card-audit span {
  font-weight: 900;
}

.card-audit em {
  color: #94a3b8;
  font-style: normal;
  white-space: nowrap;
}

.card-audit.sent,
.card-audit.driver,
.card-audit.active {
  border-color: rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .08);
  color: #bbf7d0;
}

.card-audit.picked,
.card-audit.at_pickup {
  border-color: rgba(249, 115, 22, .55);
  background: rgba(154, 52, 18, .28);
  color: #ffedd5;
}

.card-audit.picked_up,
.card-audit.in_transit {
  border-color: rgba(34, 197, 94, .50);
  background: rgba(20, 83, 45, .28);
  color: #bbf7d0;
}

.card-audit.stopoff,
.card-audit.at_stop {
  border-color: rgba(56, 189, 248, .50);
  background: rgba(14, 116, 144, .28);
  color: #bae6fd;
}

.card-audit.at_delivery {
  border-color: rgba(167, 139, 250, .55);
  background: rgba(91, 33, 182, .28);
  color: #ede9fe;
}

.card-audit.delivered,
.card-audit.completed {
  border-color: rgba(139, 92, 246, .50);
  background: rgba(76, 29, 149, .30);
  color: #ddd6fe;
}

.card-audit.failed,
.card-audit.cancelled {
  border-color: rgba(248, 113, 113, .45);
  background: rgba(127, 29, 29, .30);
  color: #fecaca;
}

.card-audit.system {
  border-color: rgba(56, 189, 248, .28);
  background: rgba(14, 116, 144, .12);
}

.card-audit.pending-assignment,
.card-audit.pending {
  border-color: rgba(245, 158, 11, .55);
  background: rgba(120, 53, 15, .30);
  color: #fde68a;
}

.card-audit.waiting {
  border-color: rgba(148, 163, 184, .40);
  background: rgba(51, 65, 85, .35);
  color: #e2e8f0;
}

.card-audit.muted {
  color: #64748b;
}

.checkpoint-location-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.55), transparent 26%),
    linear-gradient(135deg, var(--loc-color, var(--cp-accent)), #0f172a);
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 0 26px color-mix(in srgb, var(--cp-accent) 24%, transparent);
}

.checkpoint-location-icon span {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}

.checkpoint-location-icon svg {
  width: 18px;
  height: 18px;
  fill: #f8fafc;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}

.load-card {
  padding: 7px 8px 7px 12px;
  border-left: 4px solid var(--status-color, #666);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--status-color) 16%, transparent), transparent 42%),
    linear-gradient(135deg, rgba(15,23,42,.92), rgba(8,18,32,.78));
  border: 1px solid color-mix(in srgb, var(--status-color) 28%, rgba(148,163,184,.12));
  border-left-width: 4px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 7px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.load-card:hover {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--status-color) 22%, transparent), transparent 48%),
    linear-gradient(135deg, rgba(17,34,47,.96), rgba(10,30,42,.86));
  border-color: color-mix(in srgb, var(--status-color) 45%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--status-color) 14%, transparent);
}
.load-card.is-selected {
  border-color: color-mix(in srgb, var(--status-color) 70%, #f8fafc);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--status-color) 40%, transparent), 0 0 24px color-mix(in srgb, var(--status-color) 20%, transparent);
}
.card-line1 { display: flex; align-items: flex-start; gap: 6px; min-height: 18px; }
.card-dot { width:9px; height:9px; border-radius:50%; background: var(--status-color); flex-shrink:0; box-shadow:0 0 12px var(--status-color); margin-top: 4px; }
.card-load-wrap { display:flex; flex-direction:column; gap:4px; min-width:0; flex-shrink:1; max-width: 46%; }
.card-load { font-size:13px; font-weight:900; color:#f8fafc; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; letter-spacing:.02em; }
.card-carrier { font-size:12px; color:#ff4d5a; flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-trail-btn { background:rgba(219,17,31,.10); border:1px solid rgba(219,17,31,.30); color:#fecaca; font-size:13px; cursor:pointer; padding:1px 6px; flex-shrink:0; border-radius:8px; }
.card-line-route { font-size:11px; color:#e2e8f0; margin-top:4px; font-weight:700; letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-line2 { font-size:11px; color:#94a3b8; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Visit phase = left border + dot (operational). GPS age is a separate pill. */
.load-card.phase-pending { --status-color: #f59e0b; }
.load-card.phase-waiting { --status-color: #94a3b8; }
.load-card.phase-at_pickup { --status-color: #f97316; }
.load-card.phase-picked_up,
.load-card.phase-in_transit,
.load-card.phase-active { --status-color: #22c55e; }
.load-card.phase-at_stop { --status-color: #38bdf8; }
.load-card.phase-at_delivery { --status-color: #a78bfa; }
.load-card.phase-delivered,
.load-card.phase-completed { --status-color: #8b5cf6; }
.load-card.phase-cancelled { --status-color: #64748b; }

.card-phase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.card-phase-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--status-color) 55%, transparent);
  background: color-mix(in srgb, var(--status-color) 22%, rgba(15, 23, 42, .9));
  color: #f8fafc;
  box-shadow: 0 0 12px color-mix(in srgb, var(--status-color) 18%, transparent);
}
.card-freshness-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(15, 23, 42, .75);
  color: #cbd5e1;
}
.card-freshness-pill.freshness-live {
  border-color: rgba(34, 197, 94, .4);
  color: #86efac;
}
.card-freshness-pill.freshness-aging {
  border-color: rgba(249, 115, 22, .4);
  color: #fdba74;
}
.card-freshness-pill.freshness-stale {
  border-color: rgba(248, 113, 113, .4);
  color: #fca5a5;
}
.card-freshness-pill.freshness-done {
  border-color: rgba(148, 163, 184, .35);
  color: #94a3b8;
}

.status-green { --status-color: #00C853; }
.status-amber { --status-color: #FF6D00; }
.status-red { --status-color: #D50000; }
.status-gray { --status-color: #666666; }

/* Tracking mode chips — private link / web ping / driver app */
.tracking-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.tracking-chip-row--sm { margin-top: 1px; }
.tracking-chip-row--md { margin: 6px 0 4px; }
.tracking-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.chip-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.chip-icon-private {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  box-shadow: 0 0 8px rgba(139,92,246,.45);
}
.chip-icon-private::after {
  content: '';
  position: absolute;
  inset: 2px 3px 4px;
  border: 1.5px solid rgba(15,23,42,.85);
  border-radius: 2px;
}
.chip-icon-ping {
  background: linear-gradient(135deg, #ff4d5a, #db111f);
  box-shadow: 0 0 8px rgba(219,17,31,.45);
}
.chip-icon-ping::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #0f172a;
  top: 3px;
  left: 3px;
}
.chip-icon-app {
  background: linear-gradient(135deg, #ff4d5a, #b50e19);
  box-shadow: 0 0 8px rgba(219,17,31,.45);
}
.chip-icon-app::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 6px;
  border: 1.5px solid rgba(15,23,42,.75);
  border-radius: 1px;
  top: 2px;
  left: 2px;
}
.tracking-chip.chip-private {
  color: #ddd6fe;
  background: linear-gradient(135deg, rgba(88,28,135,.28), rgba(15,23,42,.72));
  border-color: rgba(139,92,246,.38);
}
.tracking-chip.chip-private.is-pending {
  color: #fde68a;
  background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(15,23,42,.72));
  border-color: rgba(245,158,11,.42);
  animation: chipPendingPulse 2.4s ease-in-out infinite;
}
.tracking-chip.chip-ping {
  color: #fecaca;
  background: linear-gradient(135deg, rgba(219,17,31,.18), rgba(15,23,42,.72));
  border-color: rgba(219,17,31,.40);
}
.tracking-chip.chip-app {
  color: #fecaca;
  background: linear-gradient(135deg, rgba(219,17,31,.16), rgba(15,23,42,.72));
  border-color: rgba(219,17,31,.38);
}
.tracking-chip.chip-app.is-live {
  box-shadow: 0 0 14px rgba(219,17,31,.32), inset 0 0 0 1px rgba(255,255,255,.06);
  animation: chipLivePulse 2s ease-in-out infinite;
}
@keyframes chipPendingPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(245,158,11,0); }
  50% { box-shadow: 0 0 12px rgba(245,158,11,.22); }
}
@keyframes chipLivePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(219,17,31,.18); }
  50% { box-shadow: 0 0 16px rgba(219,17,31,.42); }
}
.tracking-mode-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 14px;
  border-bottom: 1px solid rgba(148,163,184,.12);
}
.tracking-hero-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.55);
}
.tracking-hero-card strong {
  display: block;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.tracking-hero-card em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}
.hero-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  flex-shrink: 0;
  position: relative;
}
.hero-icon-private {
  background: linear-gradient(145deg, rgba(139,92,246,.35), rgba(88,28,135,.2));
  border: 1px solid rgba(167,139,250,.35);
}
.hero-icon-ping {
  background: linear-gradient(145deg, rgba(219,17,31,.32), rgba(181,14,25,.18));
  border: 1px solid rgba(219,17,31,.40);
}
.hero-icon-app {
  background: linear-gradient(145deg, rgba(219,17,31,.30), rgba(181,14,25,.16));
  border: 1px solid rgba(219,17,31,.38);
}
.tracking-hero-card.hero-private strong { color: #c4b5fd; }
.tracking-hero-card.hero-private.is-pending strong { color: #fcd34d; }
.tracking-hero-card.hero-private.is-pending {
  border-color: rgba(245,158,11,.35);
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(15,23,42,.55));
}
.tracking-hero-card.hero-ping strong { color: #fecaca; }
.tracking-hero-card.hero-ping {
  border-color: rgba(219,17,31,.32);
  background: linear-gradient(135deg, rgba(219,17,31,.10), rgba(15,23,42,.55));
}
.tracking-hero-card.hero-app strong { color: #fecaca; }
.tracking-hero-card.hero-app {
  border-color: rgba(219,17,31,.34);
  background: linear-gradient(135deg, rgba(219,17,31,.10), rgba(15,23,42,.55));
}
.tracking-hero-card.hero-app.is-live {
  box-shadow: 0 0 24px rgba(219,17,31,.16);
  animation: chipLivePulse 2s ease-in-out infinite;
}
.checkpoint-popup .tracking-chip-row--md .tracking-chip {
  font-size: 9px;
  padding: 3px 8px 3px 6px;
}

/* Generic map chrome buttons — keep slate, not icy teal */
button:not(.status-tab):not(.clear-trail-btn):not(.loads-help-link) {
  background: rgba(15,23,42,.82);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.22);
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .02em;
}

/* Fallback if status-tabs render outside .sidebar */
.status-tab {
  background: rgba(15,23,42,.82);
  color: #94a3b8;
  border: 1px solid rgba(219,17,31,.22);
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .02em;
}
.status-tab.active {
  background: linear-gradient(135deg, #db111f 0%, #c4101c 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(219,17,31,.45) !important;
}
.hidden { display: none !important; }

.load-detail-drawer {
  position: fixed;
  top: 80px;
  right: var(--sidebar-offset);
  width: var(--drawer-width);
  max-width: calc(100vw - var(--sidebar-offset) - 24px);
  height: calc(100vh - 96px);
  z-index: 1015;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(24px);
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(5,10,20,.98), rgba(8,18,32,.94)),
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--cp-accent) 12%, transparent), transparent 35%);
  border: 1px solid color-mix(in srgb, var(--cp-accent) 28%, transparent);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.58), 0 0 38px color-mix(in srgb, var(--cp-accent) 12%, transparent);
  color: #dbeafe;
  backdrop-filter: blur(18px);
  transition: opacity .2s ease, transform .2s ease;
  font-size: 12px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--cp-accent) 35%, transparent) rgba(15, 23, 42, 0.5);
  padding-bottom: 28px;
  box-sizing: border-box;
}

.load-detail-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.route-trip-loading {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 24px;
  text-align: center;
}

.route-trip-loading strong {
  color: #f8fafc;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.route-trip-loading em {
  max-width: 320px;
  color: #94a3b8;
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.route-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, .22);
  border-top-color: var(--cp-accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--cp-accent) 18%, transparent);
  animation: routeSpin .85s linear infinite;
}

.route-trip-warning {
  margin: 14px 18px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, .34);
  background: rgba(245, 158, 11, .12);
  color: #fde68a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

@keyframes routeSpin {
  to { transform: rotate(360deg); }
}

.load-detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 12px 10px;
  background: linear-gradient(135deg, rgba(15,23,42,.98), rgba(21,31,46,.98));
  border-bottom: 1px solid color-mix(in srgb, var(--cp-accent) 20%, transparent);
}

.load-detail-header h3 {
  margin: 2px 28px 3px 0;
  color: #f8fafc;
  font-size: 16px;
  letter-spacing: .02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.load-detail-header p {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.drawer-kicker {
  color: var(--cp-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: rgba(15,23,42,.9);
  border: 1px solid rgba(148,163,184,.28);
  color: #e2e8f0;
  font-size: 20px;
  line-height: 1;
}

.load-detail-drawer .detail-section {
  padding: 11px 14px 4px;
}

.load-detail-drawer .detail-section h4 {
  font-size: 11px;
  margin-bottom: 8px;
}

.load-detail-drawer .detail-grid {
  grid-template-columns: 1fr;
  gap: 7px;
}

.load-detail-drawer .detail-grid div {
  padding: 8px 10px;
  border-radius: 10px;
}

.load-detail-drawer .detail-grid strong {
  font-size: 12px;
  line-height: 1.35;
}

.load-detail-drawer .detail-request-wrap {
  padding: 0 14px 14px;
}

.load-detail-drawer .detail-stop {
  padding: 10px;
  gap: 8px;
}

.load-detail-drawer .detail-stop-name,
.load-detail-drawer .detail-stop-city,
.load-detail-drawer .event-message,
.load-detail-drawer .event-note,
.load-detail-drawer .detail-note {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.load-detail-drawer .tracking-mode-hero {
  margin: 0 14px 10px;
  padding: 10px;
}

.load-detail-drawer .card-action-btn,
.load-detail-drawer .request-location-btn {
  font-size: 10px;
  padding: 7px 11px;
}

/* SME [2026-07-03] Chip-only trail legend + compact retention badge */
/* SME [2026-07-03] Load detail — stops first, collapsible More Details */
.detail-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-action-chips {
  flex: 1 1 auto;
  min-width: 0;
}

.detail-action-chips .tracking-chip-row {
  margin: 0;
}

.detail-action-request {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.detail-action-request .request-location-btn {
  font-size: 10px;
  padding: 7px 11px;
  white-space: nowrap;
}

.detail-action-request .detail-request-hint {
  font-size: 10px;
  color: #94a3b8;
  text-align: right;
  max-width: 180px;
  line-height: 1.3;
}

.detail-stops-section {
  padding: 12px 14px 8px;
}

.detail-stops-section h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cp-accent);
}

.detail-more-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 28px);
  margin: 4px 14px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 22%, transparent);
  background: color-mix(in srgb, var(--cp-accent) 6%, transparent);
  color: #5eead4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.detail-more-toggle:hover,
.detail-more-toggle:focus-visible {
  background: color-mix(in srgb, var(--cp-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--cp-accent) 35%, transparent);
}

.detail-more-chevron {
  font-size: 14px;
  line-height: 1;
  transition: transform .18s ease;
}

.detail-more-toggle.is-open .detail-more-chevron {
  transform: rotate(180deg);
}

.detail-more-panel {
  padding: 0 0 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.detail-more-panel.is-open {
  display: block;
}

.detail-section--nested {
  padding: 10px 14px 6px;
}

.detail-section--nested h4 {
  margin-bottom: 8px;
}

.detail-quick-actions {
  margin-bottom: 10px;
}

.detail-retention-chip--panel {
  margin: 10px 14px 0;
}

.load-detail-drawer .detail-stops-section .detail-stop-list {
  max-height: none;
}

.load-detail-drawer .event-list {
  max-height: 280px;
  overflow-y: auto;
}

.legend-stats { color: #cbd5e1; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.22); }

.detail-retention-chip {
  margin: 0 14px 10px;
  display: flex;
}

.detail-retention-chip span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  cursor: default;
}

.detail-retention-note {
  margin: 0 14px 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
  color: #fcd34d;
  font-size: 11px;
  line-height: 1.45;
}

.load-detail-drawer .event-list {
  padding-bottom: 8px;
}

.load-detail-drawer .dispatcher-note-box textarea {
  min-height: 56px;
  font-size: 11px;
}

.detail-section {
  padding: 16px 18px 4px;
}

.detail-section h4 {
  color: var(--cp-accent-hover, #ff4d5a);
  font-size: 13px;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid div {
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 12px;
  padding: 10px 11px;
}

.detail-grid span {
  display: block;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}

.detail-grid strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-stop-list,
.event-list {
  display: grid;
  gap: 10px;
}

.detail-stop {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(15,23,42,.70);
  border: 1px solid rgba(148,163,184,.16);
}

.detail-stop.is-complete {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.08);
}

.detail-stop.is-complete.milestone-pickup {
  border-color: rgba(245, 158, 11, .42);
  background: rgba(245, 158, 11, .10);
}

.detail-stop.is-complete.milestone-transit {
  border-color: rgba(56, 189, 248, .40);
  background: rgba(14, 116, 144, .16);
}

.detail-stop.is-complete.milestone-delivery {
  border-color: rgba(139, 92, 246, .42);
  background: rgba(88, 28, 135, .18);
}

.detail-stop-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  border: 1px solid rgba(148,163,184,.35);
  color: #052e16;
  font-weight: 900;
}

.detail-stop.is-complete .detail-stop-dot {
  background: #22c55e;
}

.detail-stop.is-complete.milestone-pickup .detail-stop-dot {
  background: #f59e0b;
  color: #241405;
}

.detail-stop.is-complete.milestone-transit .detail-stop-dot {
  background: #38bdf8;
  color: #082f49;
}

.detail-stop.is-complete.milestone-delivery .detail-stop-dot {
  background: #8b5cf6;
  color: #f5f3ff;
}

.detail-stop-status {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 4px;
}

.detail-stop.is-complete .detail-stop-status {
  color: #86efac;
}

.detail-stop.is-complete.milestone-pickup .detail-stop-status {
  color: #fbbf24;
}

.detail-stop.is-complete.milestone-transit .detail-stop-status {
  color: #fecaca;
}

.detail-stop.is-complete.milestone-delivery .detail-stop-status {
  color: #c4b5fd;
}

.detail-stop-name {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.detail-stop-city,
.detail-time,
.event-meta,
.event-top span,
.detail-muted {
  color: #94a3b8;
  font-size: 12px;
}

.detail-note,
.event-note {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(2,6,23,.45);
  border: 1px solid rgba(255,255,255,.08);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
}

.dispatcher-note-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(2, 6, 23, .42);
  border: 1px solid color-mix(in srgb, var(--cp-accent) 16%, transparent);
}

.dispatcher-note-box textarea {
  width: 100%;
  min-height: 62px;
  box-sizing: border-box;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .26);
  background: rgba(15, 23, 42, .82);
  color: #f8fafc;
  padding: 9px 10px;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.dispatcher-note-box textarea:focus {
  border-color: color-mix(in srgb, var(--cp-accent) 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cp-accent) 8%, transparent);
}

.send-driver-note-btn {
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--cp-accent) 30%, transparent);
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cp-accent) 18%, transparent), rgba(219,17,31,.12));
  color: #fecaca;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.send-driver-note-btn:disabled {
  opacity: .58;
  cursor: wait;
}

.driver-note-status {
  min-height: 15px;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.driver-note-status.is-ok {
  color: var(--cp-accent-hover, #ff4d5a);
}

.driver-note-status.is-error {
  color: #fca5a5;
}

.event-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15,23,42,.70);
  border: 1px solid rgba(148,163,184,.16);
}

.event-item.failed {
  border-color: rgba(248, 113, 113, .42);
  background: rgba(127, 29, 29, .20);
}

.event-item.sent,
.event-item.driver {
  border-color: rgba(34, 197, 94, .28);
}

.event-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 7px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(15, 23, 42, .86);
  border: 1px solid rgba(148, 163, 184, .22);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.event-chip.sent,
.event-chip.driver,
.event-chip.actor-driver {
  border-color: rgba(34, 197, 94, .34);
  color: #bbf7d0;
  background: rgba(34, 197, 94, .10);
}

.event-chip.failed {
  border-color: rgba(248, 113, 113, .44);
  color: #fecaca;
  background: rgba(127, 29, 29, .28);
}

.event-chip.system,
.event-chip.actor-system {
  border-color: rgba(56, 189, 248, .32);
  color: #bae6fd;
  background: rgba(14, 116, 144, .14);
}

.event-chip.actor-dispatcher {
  border-color: color-mix(in srgb, var(--cp-accent, #db111f) 35%, transparent);
  color: #fecaca;
  background: rgba(219, 17, 31, .14);
}

.event-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.event-top strong {
  color: #e0f2fe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.event-message {
  margin-top: 6px;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.4;
}

.load-detail-loading,
.load-detail-empty {
  padding: 18px;
  color: #94a3b8;
}

@media (max-width: 1180px) {
  :root {
    --drawer-width: 280px;
    --sidebar-offset: 20px;
  }

  .load-detail-drawer {
    right: 20px;
    left: auto;
    top: 95px;
    width: min(var(--drawer-width), calc(100vw - 420px));
    max-width: none;
    height: calc(100vh - 120px);
  }

  .map-route-dock {
    left: var(--map-chrome-left);
    right: var(--map-chrome-left);
    bottom: calc(var(--map-chrome-bottom) + 58px);
    min-width: 0;
    max-width: calc(100vw - 40px);
  }

  .legend {
    max-width: calc(100vw - 40px);
  }
}

#addLoadModal .modal-content,
#settingsHubModal .modal-content {
  background: rgba(16, 22, 32, 0.96) !important;
  border: 1px solid var(--cp-accent) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  box-shadow: 0 0 30px color-mix(in srgb, var(--cp-accent) 25%, transparent) !important;
  color: #e2e8f0 !important;
}

#addLoadModal .modal-header,
#settingsHubModal .modal-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--cp-accent) 30%, transparent) !important;
  background: rgba(21, 31, 46, 0.9) !important;
}

#addLoadModal .modal-header::before,
#settingsHubModal .modal-header::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -42%;
  width: 24%;
  height: 160%;
  transform: skewX(-24deg);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.7), rgba(255,255,255,0));
  animation: modalSweep 6s linear infinite;
}

@keyframes modalSweep {
  from { left: -42%; }
  to { left: 142%; }
}

.manual-panel label { display:block; font-size:12px; margin-bottom:8px; }
.manual-panel input, .manual-panel select, .stop-row input, .stop-row select {
  width:100%; background: rgba(255,255,255,.08); border: 1px solid color-mix(in srgb, var(--cp-accent) 25%, transparent); color:#eafaf6; border-radius:6px; padding:8px; margin-top:4px;
}
.stop-row { border: 1px solid #2f4a2f; border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.manual-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
.manual-error { color:#fca5a5; min-height:18px; margin-top:6px; }
.carrier-results { display:grid; gap:6px; margin:8px 0; }
.carrier-result { width:100%; text-align:left; }
.console-hub-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
