:root {
  --bg: #f4f6f4;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #647169;
  --line: #d9e1dc;
  --dark: #141615;
  --dark-2: #202422;
  --orange: #e85c2b;
  --orange-2: #f07a4e;
  --green: #1f9d62;
  --blue: #2f6fc2;
  --red: #bd4b4b;
  --amber: #c98621;
  --shadow: 0 18px 45px rgba(20, 25, 22, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }

.top-nav {
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(20, 22, 21, .97);
  border-bottom: 1px solid #303532;
  color: #fff;
}

.nav-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { font-size: 21px; font-weight: 900; letter-spacing: 0; }
.logo span { color: var(--orange); }
.logo sup { color: #aeb7b1; font-size: 9px; margin-left: 3px; }

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 9px 13px;
  border-radius: 8px;
  color: #b7c1bb;
  font-size: 14px;
  font-weight: 800;
}
.nav-links a.active, .nav-links a:hover { color: #fff; background: #2b302d; }
.auth-status { color: #b7c1bb; font-size: 12px; font-weight: 800; text-align: right; }

.page-header {
  background: var(--dark);
  color: #fff;
  padding: 34px 24px;
}
.page-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}
.eyebrow { color: var(--orange-2); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.page-header h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1; margin-bottom: 12px; }
.page-header p { color: #b7c1bb; max-width: 680px; line-height: 1.65; margin-bottom: 0; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn, .btn-secondary, .btn-danger {
  border: 0;
  border-radius: 9px;
  min-height: 42px;
  padding: 0 15px;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}
.btn { background: var(--orange); color: #fff; }
.btn:hover { background: var(--orange-2); }
.btn:hover, .btn-secondary:hover, .btn-danger:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(20,25,22,.12); }
.btn:active, .btn-secondary:active, .btn-danger:active { transform: translateY(0); }
.btn-secondary { background: #eef3ef; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #fff0f0; color: #a83232; border: 1px solid #e0b9b9; }

.stats-strip {
  background: var(--orange);
  color: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1280px;
  margin: 0 auto;
}
.stat { padding: 18px; text-align: center; border-right: 1px solid rgba(255,255,255,.24); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: 28px; line-height: 1; }
.stat span { display: block; margin-top: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: rgba(255,255,255,.82); font-weight: 800; }

.main-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}
.single-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.panel.pad { padding: 18px; }
.panel h2 { font-size: 22px; margin-bottom: 14px; }
.panel h3 { font-size: 17px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }

.form-stack { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 92, 43, .12); }
.address-guidance { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; }

.map-shell {
  min-height: 620px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}
.map {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.map-hud {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 450;
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 10px;
  pointer-events: none;
}
.map-hud div {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  backdrop-filter: blur(8px);
}
.map-hud span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.map-hud strong { display: block; margin-top: 3px; font-size: 17px; }

.truck-marker {
  width: 42px !important;
  height: 42px !important;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 3px solid #fff;
  background: var(--green);
  box-shadow: 0 8px 22px rgba(20, 25, 22, .3);
  font-size: 23px;
  animation: truck-live 2.4s ease-in-out infinite;
}
.truck-marker.idle { background: var(--amber); }
.truck-marker.delayed { background: var(--red); }
.truck-marker.offline { background: #69736d; }
.pin-label {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(20, 25, 22, .14);
}

.quote-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfdfb;
  display: grid;
  gap: 4px;
}
.quote-card span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.quote-card strong { font-size: 32px; line-height: 1; }
.quote-card small { color: var(--muted); }
.quote-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.quote-card-head > small { font-size: 9px; text-align: right; }
.quote-breakdown { margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--line); display: grid; gap: 5px; }
.quote-breakdown div { display: flex; justify-content: space-between; gap: 12px; }
.quote-breakdown span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: none; }
.quote-breakdown strong { font-size: 11px; }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.record-list { display: grid; gap: 10px; }
.record {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 13px;
  display: grid;
  gap: 8px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.record:hover { transform: translateY(-2px); border-color: #c4d0c8; box-shadow: 0 10px 24px rgba(20,25,22,.08); }
.record-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.record strong { font-size: 15px; }
.record small { color: var(--muted); line-height: 1.4; }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.status.requested { background: #fff2df; color: #9a5814; }
.status.assigned, .status.acknowledged, .status.active { background: #e1f4ea; color: #11643d; }
.status.arrived_pickup, .status.arrived_destination { background: #fff2df; color: #925112; }
.status.picked_up { background: #e9f0ff; color: #184b9c; }
.status.delivered { background: #e2f6e9; color: #145c38; }
.status.delayed { background: #ffe7e7; color: #9c3030; }
.status.idle { background: #fff4df; color: #9a5814; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 10px; text-align: left; font-size: 13px; }
th { color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 16px;
}
.metric span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.metric strong { display: block; margin: 8px 0 5px; font-size: 30px; line-height: 1; }
.metric small { color: var(--muted); }

.split-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.route-bars, .leaderboard { display: grid; gap: 11px; }
.route-bars div { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.route-bars i { height: 9px; border-radius: 999px; background: linear-gradient(90deg, var(--orange) var(--bar), #e6ede8 var(--bar)); }
.route-bars b { text-align: right; color: var(--ink); }
.leaderboard div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.leaderboard div:last-child { border-bottom: 0; padding-bottom: 0; }
.leaderboard span { font-weight: 900; }
.leaderboard strong { color: var(--muted); font-size: 13px; text-align: right; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 90px);
  z-index: 3000;
  background: var(--dark);
  color: #fff;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 800;
  transition: transform .25s;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast.show { transform: translate(-50%, 0); }

.locked .page-header,
.locked .stats-strip,
.locked .main-grid,
.locked .single-grid {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.auth-gate {
  position: fixed;
  inset: 68px 0 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 22, 21, .72);
  backdrop-filter: blur(10px);
}
.auth-gate-arriving {
  animation: auth-backdrop-arrive .32s ease-out both;
}
.auth-gate-arriving .auth-card {
  animation: auth-card-arrive .4s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes auth-backdrop-arrive {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(10px); }
}
@keyframes auth-card-arrive {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card {
  width: min(480px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 24px;
}
.auth-card h2 { font-size: 26px; margin-bottom: 8px; }
.auth-card p { color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.auth-card small { display: block; color: var(--muted); margin-top: 12px; }
.auth-switch {
  margin: 14px 0 0 !important;
  text-align: center;
}
.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}
.password-input {
  position: relative;
  display: block;
}
.password-input input {
  padding-right: 64px;
}
.password-input button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-width: 46px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: #eef2ef;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.password-input button:hover,
.password-input button:focus-visible {
  background: #dfe6e1;
  outline: 2px solid rgba(239, 87, 40, .3);
}
.auth-success-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2700;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 22, 21, .66);
  backdrop-filter: blur(8px);
  animation: auth-backdrop-arrive .25s ease-out both;
}
.auth-success-dialog {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
  animation: auth-card-arrive .35s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-success-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e7f5ed;
  color: #168552;
  font-size: 28px;
  font-weight: 900;
}
.auth-success-dialog h2 {
  margin: 6px 0 10px;
  font-size: 25px;
}
.auth-success-dialog p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}
.auth-success-dialog .btn {
  width: 100%;
}

.driver-portal-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.driver-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #303532;
  border-radius: 10px;
  background: var(--dark);
  box-shadow: var(--shadow);
}
.driver-identity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 5px 5px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid #303532;
}
.driver-identity > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.driver-identity div { min-width: 0; display: grid; gap: 2px; }
.driver-identity strong,
.driver-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-identity strong { color: #fff; }
.driver-identity small { color: #8f9b94; }
.driver-sidebar button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: #b7c1bb;
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  text-align: left;
  font-weight: 800;
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.driver-sidebar button > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.05);
  color: #8f9b94;
  font-size: 13px;
}
.driver-sidebar button.active > span,
.driver-sidebar button:hover > span { background: rgba(232,92,43,.16); color: var(--orange-2); }
.driver-sidebar button:hover,
.driver-sidebar button.active {
  background: #2b302d;
  color: #fff;
}
.driver-sidebar button.active { box-shadow: inset 3px 0 0 var(--orange); }
.driver-sidebar button:hover { transform: translateX(2px); }
.driver-mobile-nav { display: none; }
.driver-live-status {
  margin-top: 7px;
  padding: 12px;
  border-top: 1px solid #303532;
  color: #b7c1bb;
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.driver-live-status span { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.driver-live-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(31,157,98,.5);
  animation: live-pulse 1.8s infinite;
}
.driver-live-status strong { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.driver-portal-content { min-width: 0; }
.driver-view-header {
  min-height: 92px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 28px rgba(20,25,22,.07);
}
.driver-view-header .eyebrow { margin-bottom: 3px; }
.driver-view-header h2 { margin: 0; font-size: 25px; }
.driver-view-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.driver-view-badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #bce1cd;
  border-radius: 999px;
  background: #edf9f2;
  color: #11643d;
  font-size: 12px;
  font-weight: 900;
}
.driver-view-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 1.8s infinite;
}
.driver-portal-content .main-grid,
.driver-portal-content .single-grid {
  max-width: none;
  padding: 0;
}
.driver-portal-content [data-driver-panel] { display: none !important; }
.driver-portal-content .main-grid[data-driver-panel].active { display: grid !important; }
.driver-portal-content .single-grid[data-driver-panel].active { display: grid !important; }
.driver-portal-content [data-driver-panel].active { animation: panel-enter .24s ease both; }
.driver-tools {
  max-width: none;
  padding: 0;
  margin: 0;
  display: block;
}
.driver-tools > [data-driver-panel].active { display: block !important; }
.driver-tools > [data-driver-panel] { border-top: 4px solid var(--orange); }
.driver-tools > [data-driver-panel="issues"] { border-top-color: var(--red); }
.driver-tools > [data-driver-panel="fuel"] { border-top-color: var(--amber); }
.driver-tools > [data-driver-panel="documents"] { border-top-color: var(--blue); }
.driver-tools > [data-driver-panel="performance"] { border-top-color: var(--green); }
.driver-tools > [data-driver-panel="communications"] { border-top-color: #7357a8; }
.driver-operations-strip {
  display: grid;
  grid-template-columns: .7fr .9fr 1.4fr;
  gap: 8px;
  margin-bottom: 14px;
}
.driver-operations-strip div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
  position: relative;
  overflow: hidden;
}
.driver-operations-strip div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--orange);
}
.driver-operations-strip div:nth-child(2)::before { background: var(--green); }
.driver-operations-strip div:nth-child(3)::before { background: var(--blue); }
.driver-operations-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.driver-operations-strip strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.driver-account-card {
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.driver-account-card > span {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.driver-account-card div { min-width: 0; display: grid; gap: 2px; }
.driver-account-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.driver-account-card strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.driver-account-card em { overflow: hidden; color: var(--muted); font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.location-state {
  padding: 11px 12px;
  border: 1px solid #bce1cd;
  border-radius: 8px;
  background: #edf9f2;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.location-state-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
}
.location-state div { display: grid; gap: 2px; }
.location-state strong { font-size: 12px; }
.location-state small { color: #2c6c4c; font-size: 10px; }
.section-heading-row {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.section-heading-row h2 { margin: 2px 0 0; }
.driver-job-card { padding: 18px; gap: 14px; }
.job-route-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.job-route-summary span {
  padding: 5px 8px;
  border-radius: 5px;
  background: #f0f3f1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.job-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(65px, 1fr));
  overflow-x: auto;
  padding: 5px 0 2px;
}
.job-progress div {
  position: relative;
  min-width: 65px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #99a39d;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
.job-progress div::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 2px;
  background: #dce2de;
}
.job-progress div:first-child::before { left: 50%; }
.job-progress div:last-child::before { right: 50%; }
.job-progress i {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 3px solid #dce2de;
  border-radius: 50%;
  background: #fff;
}
.job-progress div.complete { color: #247048; }
.job-progress div.complete::before { background: var(--green); }
.job-progress div.complete i { border-color: var(--green); background: var(--green); }
.job-progress div.current { color: var(--dark); }
.job-progress div.current i {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(232,92,43,.13);
}
.job-actions-primary { padding-top: 2px; }
.job-primary-action { min-width: 210px; }
.job-actions-secondary {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.job-actions-secondary .btn-secondary,
.job-actions-secondary .btn-danger { min-height: 34px; font-size: 11px; }
.issue-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.issue-presets button {
  min-height: 42px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9f7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.issue-presets button:hover,
.issue-presets button.active {
  border-color: var(--red);
  background: #fff1f1;
  color: #9f3030;
}
.driver-tools label:has(input[type="checkbox"]) {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
}
.driver-tools input[type="checkbox"] { width: auto; }
.signature-pad {
  display: block;
  width: 100%;
  height: 180px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.upload-field {
  display: grid;
  gap: 7px;
  cursor: pointer;
}
.upload-field > span:first-child {
  color: var(--dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.upload-field > span:first-child small {
  color: var(--muted);
  font-weight: 700;
  text-transform: none;
}
.upload-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-control {
  min-height: 78px;
  padding: 12px 14px;
  border: 1px dashed #b9c3bd;
  border-radius: 8px;
  background: #f8faf8;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.upload-field:hover .upload-control,
.upload-field:focus-within .upload-control {
  border-color: var(--orange);
  background: #fff9f6;
  box-shadow: 0 8px 22px rgba(45,52,48,.08);
  transform: translateY(-1px);
}
.upload-field.has-file .upload-control {
  border-style: solid;
  border-color: #9cd0b3;
  background: #f1faf5;
}
.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 400;
}
.upload-field.has-file .upload-icon { background: var(--green); }
.upload-field.has-file .upload-icon::after { content: "✓"; }
.upload-field.has-file .upload-icon { font-size: 0; }
.upload-field.has-file .upload-icon::after { font-size: 18px; }
.upload-copy { min-width: 0; display: grid; gap: 3px; }
.upload-copy strong {
  overflow: hidden;
  color: var(--dark);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-action {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--dark);
  font-size: 11px;
  font-weight: 900;
}
.communications-layout {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(360px, 1.4fr);
  min-height: 560px;
  margin: -20px;
}
.communications-side {
  min-width: 0;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #f7f9f7;
  display: flex;
  flex-direction: column;
}
.communications-side-head,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.communications-side-head h2 { margin: 2px 0 0; font-size: 18px; }
.icon-button,
.chat-attach,
.chat-send {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--dark);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}
.icon-button:hover,
.chat-attach:hover { border-color: var(--orange); color: var(--orange); }
.notification-feed {
  margin: 18px 0;
  display: grid;
  gap: 7px;
}
.notification-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
}
.notification-item i {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #aeb8b2;
}
.notification-item.unread i { background: var(--orange); box-shadow: 0 0 0 4px rgba(232,92,43,.12); }
.notification-item strong { display: block; font-size: 12px; line-height: 1.4; }
.notification-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.communications-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.communications-actions a { text-align: center; }
.chat-window {
  min-width: 0;
  background: #eef2ef;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.chat-header {
  min-height: 70px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  justify-content: flex-start;
}
.chat-header > div:nth-child(2) { min-width: 0; flex: 1; }
.chat-header strong { display: block; font-size: 14px; }
.chat-header span { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.chat-header span i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.chat-thread {
  max-height: 430px;
  min-height: 390px;
  padding: 22px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chat-day {
  align-self: center;
  margin: 2px 0 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.chat-message { max-width: min(76%, 520px); display: grid; gap: 3px; }
.chat-message.incoming { align-self: flex-start; }
.chat-message.outgoing { align-self: flex-end; justify-items: end; }
.chat-bubble {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30,38,33,.06);
  color: var(--dark);
  font-size: 13px;
  line-height: 1.45;
}
.chat-message.incoming .chat-bubble { border-bottom-left-radius: 2px; }
.chat-message.outgoing .chat-bubble {
  border-bottom-right-radius: 2px;
  background: var(--dark);
  color: #fff;
}
.chat-meta { padding: 0 3px; color: var(--muted); font-size: 9px; }
.chat-empty { margin: auto; color: var(--muted); text-align: center; font-size: 12px; }
.chat-composer {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.chat-composer label { margin: 0; }
.chat-composer textarea {
  min-height: 40px;
  max-height: 100px;
  padding: 10px 12px;
  border-radius: 7px;
  resize: none;
}
.chat-send {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}
.chat-send:hover { background: #c94a20; }
.locked .driver-portal-shell {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.company-portal-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px 20px 32px;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 18px;
}
.company-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  overflow: hidden;
  border: 1px solid #303532;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  display: grid;
  padding: 8px;
}
.company-identity {
  margin: -8px -8px 8px;
  padding: 16px 14px;
  border-bottom: 1px solid #303532;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
}
.company-identity > span {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: var(--orange);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.company-identity div { min-width: 0; display: grid; gap: 2px; }
.company-identity strong { font-size: 13px; }
.company-identity small { color: #9aa59f; font-size: 10px; }
.company-sidebar button {
  min-height: 42px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c3cbc6;
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.company-sidebar button > span {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  background: rgba(255,255,255,.05);
  color: #8f9b94;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.company-sidebar button:hover,
.company-sidebar button.active { background: #2b302d; color: #fff; }
.company-sidebar button.active { box-shadow: inset 3px 0 0 var(--orange); }
.company-sidebar button.active > span,
.company-sidebar button:hover > span { background: rgba(232,92,43,.16); color: var(--orange-2); }
.company-live-status {
  margin: 8px -8px -8px;
  padding: 13px;
  border-top: 1px solid #303532;
  color: #b7c1bb;
  display: grid;
  gap: 5px;
  font-size: 10px;
}
.company-live-status span { display: flex; align-items: center; gap: 7px; font-weight: 900; text-transform: uppercase; }
.company-live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 1.8s infinite;
}
.company-live-status strong { color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.company-live-status b,
.driver-live-status b { font: inherit; }
body[data-sync-state="syncing"] .company-live-status i,
body[data-sync-state="syncing"] .driver-live-status i { background: var(--amber); }
body[data-sync-state="offline"] .company-live-status i,
body[data-sync-state="offline"] .driver-live-status i,
body[data-sync-state="error"] .company-live-status i,
body[data-sync-state="error"] .driver-live-status i { background: var(--red); }
.company-portal-content { min-width: 0; }
.company-view-header {
  min-height: 92px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 28px rgba(20,25,22,.07);
}
.company-view-header h2 { margin: 0; font-size: 25px; }
.company-view-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.company-stats {
  max-width: none;
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
}
.company-portal-content > [data-company-panel] { display: none !important; }
.company-portal-content > [data-company-panel].active { animation: panel-enter .24s ease both; }
.company-portal-content > .main-grid[data-company-panel].active { display: grid !important; }
.company-portal-content > .single-grid[data-company-panel].active { display: grid !important; }
.company-portal-content .main-grid,
.company-portal-content .single-grid {
  max-width: none;
  padding: 0;
}
.company-portal-content .main-grid { grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr); }
.company-live-job .job-progress { margin-top: 3px; }
.table-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f6f8f6;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}
.table-action:hover { border-color: var(--orange); color: var(--orange); }
.company-driver-detail select { width: min(280px, 100%); }
.driver-account-management { border-top: 4px solid var(--blue); }
.fleet-registry { border-top: 4px solid var(--orange); }
.fleet-registry-forms,
.fleet-registry-lists {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.fleet-registry-lists { margin-top: 18px; }
.fleet-registry-lists h3 { margin: 0 0 9px; font-size: 14px; }
.fleet-registry-form {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}
.form-title-row,
.fleet-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.form-title-row strong { display: block; font-size: 15px; }
.form-title-row small,
.fleet-record small { display: block; margin-top: 3px; color: var(--muted); }
.fleet-record-list { max-height: 430px; overflow-y: auto; padding-right: 4px; display: grid; gap: 8px; align-content: start; }
.gps-health { display: block; font-size: 11px; font-weight: 900; }
.gps-health.live { color: #1d9b62; }
.gps-health.stale { color: #c43d32; }
#fleet-table td small { display: block; margin-top: 3px; color: var(--muted); white-space: nowrap; }
.document-actions { margin-top: 10px; }
.settings-form { max-width: 900px; }
.evidence-thumb.evidence-loading { min-height: 92px; cursor: progress; }
.fleet-record {
  min-height: 66px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.fleet-record.inactive { opacity: .62; background: #f2f4f2; }
.fleet-record .record-actions { flex-wrap: nowrap; }
.driver-account-management form {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}
.driver-account-list { max-height: 480px; overflow-y: auto; padding-right: 4px; }
#company-accounts-panel .driver-account-management,
#company-registry-panel .fleet-registry { margin: 0; }
[data-company-panel="fleet"] .table-wrap { max-height: 440px; overflow: auto; }
[data-company-panel="fleet"] .table-wrap thead { position: sticky; top: 0; z-index: 2; background: #fff; }
[data-company-panel="fleet"] .company-driver-detail { max-height: 620px; overflow-y: auto; }
#company-live-jobs { max-height: 520px; overflow-y: auto; padding-right: 4px; }
.driver-account-list { display: grid; gap: 8px; }
.driver-account-record {
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}
.driver-account-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(31,157,98,.12);
}
.driver-account-status.suspended {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(181,56,56,.1);
}
.driver-account-record > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.driver-account-record strong,
.driver-account-record small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-account-record strong { font-size: 13px; }
.driver-account-record small { color: var(--muted); font-size: 10px; }
.driver-account-record .record-actions { justify-content: flex-end; }
#password-setup-gate { z-index: 3000; }
.company-driver-metrics {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.company-driver-metrics > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf8;
  display: grid;
  gap: 5px;
}
.company-driver-metrics span,
.driver-detail-note span { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.company-driver-metrics strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.driver-detail-note {
  margin: 12px 0;
  padding: 11px;
  border-left: 3px solid var(--blue);
  background: #f5f8fc;
  display: grid;
  gap: 4px;
}
.driver-detail-note strong { font-size: 12px; line-height: 1.4; }
.incident-record { border-left: 4px solid var(--amber); }
.incident-record.critical { border-left-color: var(--red); background: #fffafa; }
.company-chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) minmax(380px, 1.35fr);
  min-height: 590px;
  margin: -20px;
}
.company-chat-drivers {
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: #f7f9f7;
}
.company-chat-drivers h2 { margin: 3px 6px 14px; font-size: 18px; }
.company-chat-drivers .eyebrow { margin-left: 6px; }
#company-chat-driver-list { display: grid; gap: 5px; }
.company-chat-driver {
  width: 100%;
  min-height: 58px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.company-chat-driver:hover,
.company-chat-driver.active { border-color: var(--line); background: #fff; }
.company-chat-driver > span {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
}
.company-chat-driver div { min-width: 0; display: grid; gap: 2px; }
.company-chat-driver strong,
.company-chat-driver small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-chat-driver strong { font-size: 12px; }
.company-chat-driver small { color: var(--muted); font-size: 9px; }
.company-chat-driver > i { width: 7px; height: 7px; border-radius: 50%; background: #9ba49f; }
.company-chat-driver > i.active { background: var(--green); }
.company-chat-driver > i.delayed { background: var(--red); }
.company-chat-driver > i.idle { background: var(--amber); }
.activity-record { grid-template-columns: 60px minmax(0, 1fr); align-items: start; }
.activity-record strong { color: var(--orange); font-size: 12px; }

.client-portal-shell {
  max-width: 1440px;
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}
.client-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  min-height: calc(100vh - 104px);
  padding: 12px 8px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.client-identity {
  margin: 0 4px 10px;
  padding: 5px 5px 15px;
  border-bottom: 1px solid #303532;
  display: flex;
  align-items: center;
  gap: 10px;
}
.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: var(--orange);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}
.client-identity div { min-width: 0; display: grid; gap: 2px; }
.client-identity strong, .client-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-identity strong { font-size: 12px; }
.client-identity small { color: #9da7a1; font-size: 9px; }
.client-sidebar > button {
  width: 100%;
  min-height: 43px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b8c0bb;
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}
.client-sidebar > button span {
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: #232725;
  display: grid;
  place-items: center;
  color: #cbd2ce;
}
.client-sidebar > button:hover, .client-sidebar > button.active { background: #2b302d; color: #fff; }
.client-sidebar > button.active { box-shadow: inset 3px 0 0 var(--orange); }
.client-sidebar > button.active span { background: rgba(232,92,43,.16); color: var(--orange-2); }
.client-sidebar-footer {
  margin-top: auto;
  padding: 13px 6px 2px;
  border-top: 1px solid #303532;
  display: grid;
  gap: 10px;
}
.client-sidebar-footer > span { color: #aeb7b1; font-size: 9px; font-weight: 800; }
.client-sidebar-footer i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.client-signout { min-height: 34px; border: 1px solid #363c38; border-radius: 6px; background: #202422; color: #fff; font-size: 10px; font-weight: 900; }
.client-portal-content { min-width: 0; }
.client-view-header {
  min-height: 94px;
  margin-bottom: 16px;
  padding: 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.client-view-header h1 { margin-bottom: 5px; font-size: 28px; }
.client-view-header p { margin: 0; color: var(--muted); font-size: 13px; }
.client-mobile-nav { display: none; }
.client-panel { display: none; gap: 16px; animation: panel-enter .22s ease; }
.client-panel.active { display: grid; }
.client-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.client-metrics > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20,25,22,.06);
  display: grid;
  gap: 3px;
}
.client-metrics span { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.client-metrics strong { font-size: 25px; }
.client-metrics small { color: var(--muted); font-size: 10px; }
.section-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.section-heading-row h2 { margin-bottom: 0; }
.client-map-shell { min-height: 500px; }
.map-recentre {
  position: absolute;
  z-index: 500;
  top: 15px;
  right: 15px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--dark);
  box-shadow: 0 8px 22px rgba(20,25,22,.16);
  font-size: 23px;
  font-weight: 900;
}
.client-active-summary { display: grid; gap: 16px; }
.client-truck-identity { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.client-truck-identity > span:first-child { width: 54px; height: 54px; border-radius: 8px; background: #eef8f3; display: grid; place-items: center; font-size: 30px; }
.client-truck-identity div { min-width: 0; }
.client-truck-identity small { display: block; color: var(--muted); font-size: 10px; font-weight: 900; }
.client-truck-identity strong { display: block; margin-top: 2px; font-size: 18px; }
.client-truck-identity p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.client-driver-rating {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.client-driver-rating > div { display: flex; align-items: center; gap: 9px; }
.client-driver-rating > div > div { display: grid; gap: 2px; }
.client-driver-rating small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.client-driver-rating strong { font-size: 13px; }
.client-driver-rating > div:last-child > span { color: #e4a62b; font-size: 22px; }
.client-driver-rating > div:last-child { display: grid; grid-template-columns: auto auto; column-gap: 5px; }
.client-driver-rating > div:last-child small { grid-column: 1 / -1; }
.driver-rating-avatar { width: 36px; height: 36px; border-radius: 7px; background: var(--dark); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 900; }
.rating-availability-note { margin: -4px 0 0; color: var(--muted); font-size: 10px; }
.client-route-line { padding: 12px; border-left: 3px solid var(--orange); background: #fff8f5; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12px; }
.client-route-line span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.client-job-progress { margin-top: 2px; grid-template-columns: repeat(6, minmax(65px, 1fr)); }
.client-delivery-list { display: grid; gap: 14px; }
.client-delivery-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfb; display: grid; gap: 14px; }
.client-delivery-card > .record { padding: 0; border: 0; background: transparent; }
.client-delivery-actions { display: flex; justify-content: flex-start; }
.client-delivery-actions .btn-secondary { min-height: 36px; font-size: 11px; }
.delivery-proof-note { padding: 10px 12px; border-left: 3px solid var(--green); background: #f1faf5; display: grid; gap: 3px; }
.delivery-proof-note strong { font-size: 12px; }
.delivery-proof-note small { color: var(--muted); font-size: 10px; }
.client-rating-card { padding: 14px; border: 1px solid #ead9a7; border-radius: 8px; background: #fffdf5; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.client-rating-card > div:first-child strong { display: block; font-size: 14px; }
.client-rating-card > div:first-child small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.client-rating-pending { border-left: 4px solid #e4a62b; box-shadow: 0 8px 24px rgba(173,126,30,.08); }
.client-rating-card > label { grid-column: 1 / -1; }
.client-rating-card > button { justify-self: start; }
.star-rating { display: flex; justify-content: flex-start; }
.star-rating button { width: 36px; height: 38px; padding: 0; border: 0; background: transparent; color: #c8ccc9; font-size: 29px; line-height: 1; transition: color .15s ease, transform .15s ease; }
.star-rating button.selected { color: #e4a62b; }
.star-rating button:hover { transform: translateY(-2px); }
.client-rating-complete { padding: 11px; border-radius: 7px; background: #fff8e5; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; }
.client-rating-complete > span { color: #e4a62b; letter-spacing: 1px; }
.client-rating-complete strong { font-size: 12px; }
.client-rating-complete small { color: var(--muted); font-size: 10px; }
.client-booking-panel { max-width: 760px; }
.client-support-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(380px, 1.2fr); gap: 16px; }
.client-support-chat { overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; }
.client-support-chat .chat-thread { max-height: 560px; min-height: 510px; }
.compact-records { margin-top: 18px; }

.driver-map-link { padding: 0; border: 0; background: none; color: var(--blue); font-weight: 900; text-align: left; text-decoration: underline; text-decoration-color: transparent; }
.driver-map-link:hover { text-decoration-color: currentColor; }
.evidence-record { gap: 10px; }
.compliance-workspace .section-heading-row { align-items: end; }
.compact-select { min-width: 250px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.compact-select select { margin-top: 5px; min-height: 40px; color: var(--ink); font-size: 12px; text-transform: none; }
.compliance-tabs { margin: 18px 0 14px; display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.compliance-tabs button { min-height: 42px; padding: 0 13px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 900; white-space: nowrap; cursor: pointer; }
.compliance-tabs button.active { border-bottom-color: var(--orange); color: var(--ink); }
.compliance-tabs button span { margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: #eef2ef; font-size: 9px; }
.compliance-view { display: none; }
.compliance-view.active { display: block; }
.compliance-record-list { max-height: 560px; overflow-y: auto; padding: 2px 6px 2px 2px; }
.compliance-record-list .record,
.compliance-record-list .record:hover,
.evidence-record,
.evidence-record:hover { transform: none; }
.compliance-record-list .record:hover,
.evidence-record:hover { border-color: #c4d0c8; box-shadow: 0 6px 18px rgba(20,25,22,.06); }
.evidence-thumb { max-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; display: grid; gap: 5px; text-align: left; }
.evidence-thumb,
.evidence-thumb:hover,
.evidence-thumb:focus-visible { transform: none; }
.evidence-thumb:hover,
.evidence-thumb:focus-visible { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239,87,40,.1); outline: none; }
.evidence-thumb img { width: 100%; height: 105px; border-radius: 5px; object-fit: cover; background: #eef1ef; }
.evidence-thumb span { color: var(--blue); font-size: 10px; font-weight: 900; }
.evidence-missing { color: var(--muted); font-size: 10px; font-style: italic; }
.evidence-pair { display: flex; flex-wrap: wrap; gap: 8px; }
.evidence-viewer { position: fixed; inset: 0; z-index: 4000; padding: 24px; background: rgba(10,12,11,.82); display: grid; place-items: center; }
.evidence-dialog { width: min(920px, 96vw); max-height: 92vh; border-radius: 8px; background: #fff; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.evidence-dialog header { min-height: 52px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.evidence-dialog header button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: #eef2ef; font-size: 22px; }
.evidence-dialog > img { max-width: 100%; max-height: calc(92vh - 52px); margin: auto; object-fit: contain; }
.company-client-support { display: grid; gap: 12px; }
.support-thread { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.support-thread > header { padding: 12px; border-bottom: 1px solid var(--line); background: #f7f9f7; display: flex; justify-content: space-between; gap: 12px; }
.support-thread > header div { display: grid; gap: 2px; }
.support-thread > header small { color: var(--muted); font-size: 10px; }
.support-thread > header > span { color: var(--orange); font-size: 10px; font-weight: 900; }
.support-messages { max-height: 310px; padding: 12px; overflow-y: auto; display: grid; gap: 8px; background: #eef2ef; }
.support-message { max-width: 76%; padding: 9px 11px; border-radius: 7px; background: #fff; justify-self: start; }
.support-message.dispatch { justify-self: end; background: var(--dark); color: #fff; }
.support-message strong, .support-message small { font-size: 9px; }
.support-message p { margin: 3px 0; font-size: 12px; line-height: 1.4; }
.support-message small { color: var(--muted); }
.support-message.dispatch small { color: #aeb7b1; }
.support-complaint { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.support-complaint div { display: grid; gap: 3px; }
.support-complaint small { color: var(--muted); font-size: 10px; }
.support-reply { padding: 10px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.support-reply textarea { min-height: 42px; }
.locked .company-portal-shell {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(31,157,98,.48); }
  70% { box-shadow: 0 0 0 8px rgba(31,157,98,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,157,98,0); }
}
@keyframes truck-live {
  0%, 100% { filter: brightness(1); box-shadow: 0 8px 22px rgba(20,25,22,.3); }
  50% { filter: brightness(1.12); box-shadow: 0 8px 28px rgba(31,157,98,.45); }
}
@keyframes panel-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-page { background: var(--dark); }
.landing-nav { position: absolute; width: 100%; background: rgba(16,18,17,.72); backdrop-filter: blur(12px); }
.landing-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  border-bottom: 2px solid var(--orange);
}
.landing-nav-cta span { color: var(--orange-2); font-size: 18px; }
.landing-hero {
  position: relative;
  min-height: min(820px, 88vh);
  background: #171a18;
  color: #fff;
  overflow: hidden;
}
.landing-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.landing-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9,11,10,.1) 0%, rgba(9,11,10,.2) 38%, rgba(9,11,10,.72) 67%, rgba(9,11,10,.92) 100%);
}
.landing-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 48px));
  min-height: min(820px, 88vh);
  margin: 0 auto;
  padding: 140px 0 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 72px;
}
.landing-hero-copy { width: min(620px, 52%); margin-left: auto; }
.landing-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: #d3dad6;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.landing-kicker i,
.landing-availability i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(31,157,98,.15);
}
.landing-hero h1 {
  max-width: 670px;
  margin-bottom: 22px;
  font-size: clamp(48px, 7vw, 88px);
  line-height: .94;
  letter-spacing: 0;
}
.landing-hero-copy > p {
  max-width: 610px;
  margin-bottom: 30px;
  color: #d2d9d5;
  font-size: 18px;
  line-height: 1.65;
}
.landing-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.landing-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-width: 230px;
  min-height: 54px;
  padding: 0 18px;
  background: var(--orange);
  color: #fff;
  border-radius: 6px;
  font-weight: 900;
  transition: background-color .18s ease, transform .18s ease;
}
.landing-primary-action:hover { background: var(--orange-2); transform: translateY(-2px); }
.landing-primary-action span { font-size: 21px; }
.landing-availability { display: inline-flex; align-items: center; gap: 10px; color: #d2d9d5; font-size: 12px; font-weight: 900; }
.landing-route-readout {
  max-width: 830px;
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,.34);
}
.landing-route-readout div { position: relative; padding: 22px 30px 0 0; }
.landing-route-readout div::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(232,92,43,.18);
}
.landing-route-readout span { display: block; margin-bottom: 10px; color: var(--orange-2); font-size: 10px; font-weight: 900; }
.landing-route-readout strong { display: block; margin-bottom: 5px; font-size: 15px; }
.landing-route-readout small { display: block; max-width: 210px; color: #bcc5c0; line-height: 1.45; }
.landing-service-band { background: #f2f5f2; color: var(--ink); }
.landing-service-inner {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 70px;
  display: grid;
  grid-template-columns: .9fr 1.6fr;
  gap: 72px;
  align-items: start;
}
.landing-service-heading > span { color: var(--orange); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.landing-service-heading h2 { margin: 12px 0 0; font-size: 32px; line-height: 1.12; }
.landing-service-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.landing-service-points > div { display: flex; gap: 14px; padding: 2px 24px; border-left: 1px solid var(--line); }
.landing-service-points i { color: var(--orange); font-size: 10px; font-style: normal; font-weight: 900; }
.landing-service-points span,
.landing-service-points strong,
.landing-service-points small { display: block; }
.landing-service-points strong { margin-bottom: 8px; font-size: 14px; }
.landing-service-points small { color: var(--muted); line-height: 1.5; }
.landing-photo-credit {
  display: block;
  width: min(1280px, calc(100% - 48px));
  margin: -32px auto 0;
  padding-bottom: 18px;
  color: #89958e;
  font-size: 9px;
  text-align: right;
}
.landing-photo-credit:hover { color: var(--orange); }

@media (max-width: 980px) {
  .main-grid, .split-panels { grid-template-columns: 1fr; }
  .landing-service-inner { grid-template-columns: 1fr; gap: 34px; }
  .cards-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
  .map-shell { min-height: 520px; }
  .driver-portal-shell { grid-template-columns: 1fr; }
  .driver-sidebar {
    position: sticky;
    top: 68px;
    z-index: 700;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: visible;
    padding: 9px;
  }
  .driver-identity {
    border-bottom: 0;
    margin: 0;
    padding: 2px;
  }
  .driver-mobile-nav {
    display: grid;
    min-width: 210px;
    gap: 3px;
  }
  .driver-mobile-nav > span { color: #9fa9a3; font-size: 8px; font-weight: 900; text-transform: uppercase; }
  .driver-mobile-nav select { min-height: 40px; padding: 8px 34px 8px 10px; border-color: #3b423e; background: #252a27; color: #fff; font-size: 12px; font-weight: 800; }
  .driver-sidebar > button { display: none; }
  .driver-live-status {
    grid-column: 1 / -1;
    margin: 5px 0 0;
    padding: 7px 3px 2px;
    border-top: 1px solid #303532;
    display: flex;
    justify-content: space-between;
  }
  .driver-view-header { align-items: flex-start; }
  .company-portal-shell { grid-template-columns: 1fr; }
  .client-portal-shell { grid-template-columns: 1fr; }
  .client-sidebar {
    position: sticky;
    top: 68px;
    z-index: 700;
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: visible;
    padding: 9px;
  }
  .client-identity { margin: 0; padding: 2px; border-bottom: 0; }
  .client-mobile-nav { display: grid; min-width: 210px; gap: 3px; }
  .client-mobile-nav > span { color: #9fa9a3; font-size: 8px; font-weight: 900; text-transform: uppercase; }
  .client-mobile-nav select { min-height: 40px; padding: 8px 34px 8px 10px; border-color: #3b423e; background: #252a27; color: #fff; font-size: 12px; font-weight: 800; }
  .client-sidebar > button { display: none; }
  .client-sidebar-footer { grid-column: 1 / -1; margin: 5px 0 0; padding: 7px 3px 2px; border-top: 1px solid #303532; display: flex; justify-content: space-between; }
  .client-metrics { grid-template-columns: 1fr 1fr; }
  .client-support-grid { grid-template-columns: 1fr; }
  .company-sidebar {
    position: sticky;
    top: 68px;
    z-index: 700;
    display: flex;
    overflow-x: auto;
    padding: 8px;
  }
  .company-identity { flex: 0 0 190px; margin: 0; padding: 2px 12px 2px 2px; border-bottom: 0; border-right: 1px solid #303532; }
  .company-sidebar button { flex: 0 0 auto; white-space: nowrap; }
  .company-sidebar button.active { box-shadow: inset 0 -3px 0 var(--orange); }
  .company-live-status { flex: 0 0 auto; min-width: 150px; margin: 0; border-top: 0; border-left: 1px solid #303532; }
  .company-portal-content .main-grid { grid-template-columns: 1fr; }
  .company-driver-metrics { grid-template-columns: 1fr 1fr; }
  .company-chat-layout { grid-template-columns: 1fr; }
  .fleet-registry-forms,
  .fleet-registry-lists { grid-template-columns: 1fr; }
  .company-chat-drivers { border-right: 0; border-bottom: 1px solid var(--line); }
  #company-chat-driver-list { grid-template-columns: 1fr 1fr; }
  .communications-layout { grid-template-columns: 1fr; }
  .communications-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .notification-feed { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 14px; }
  .landing-nav-cta { font-size: 11px; gap: 7px; }
  .landing-hero { min-height: 780px; }
  .landing-hero-image { object-position: 46% center; }
  .landing-hero-shade { background: rgba(9,11,10,.67); }
  .landing-hero-inner {
    width: calc(100% - 28px);
    min-height: 780px;
    padding: 118px 0 26px;
    gap: 46px;
  }
  .landing-kicker { font-size: 9px; margin-bottom: 17px; }
  .landing-hero-copy { width: 100%; margin-left: 0; }
  .landing-hero h1 { font-size: 48px; max-width: 340px; }
  .landing-hero-copy > p { max-width: 360px; font-size: 15px; line-height: 1.55; }
  .landing-primary-action { width: 100%; min-width: 0; }
  .landing-route-readout { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid rgba(255,255,255,.34); }
  .landing-route-readout div { padding: 0 0 18px 22px; }
  .landing-route-readout div::before { top: 2px; left: -5px; }
  .landing-route-readout span { margin-bottom: 4px; }
  .landing-route-readout small { max-width: none; }
  .landing-service-inner { width: calc(100% - 28px); padding: 44px 0 50px; }
  .landing-service-heading h2 { font-size: 27px; }
  .landing-service-points { grid-template-columns: 1fr; }
  .landing-service-points > div { padding: 16px 0; border-left: 0; border-top: 1px solid var(--line); }
  .landing-photo-credit { width: calc(100% - 28px); margin-top: -24px; }
  .nav-links { gap: 2px; }
  .nav-links a { font-size: 12px; padding: 8px 7px; }
  .page-header-inner { align-items: flex-start; flex-direction: column; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .main-grid, .single-grid { padding: 14px; }
  .form-row, .cards-grid, .metric-grid, .map-hud { grid-template-columns: 1fr; }
  .driver-operations-strip { grid-template-columns: 1fr; }
  .driver-view-header { display: grid; }
  .driver-sidebar { grid-template-columns: 1fr; }
  .driver-mobile-nav { min-width: 0; }
  .driver-view-badge { justify-self: start; }
  .company-portal-shell { padding: 12px; }
  .client-portal-shell { padding: 10px; }
  .client-view-header { align-items: flex-start; }
  .client-mobile-nav { min-width: 0; }
  .client-metrics { grid-template-columns: 1fr 1fr; }
  .client-truck-identity { grid-template-columns: 48px minmax(0, 1fr); }
  .client-truck-identity > .status { grid-column: 1 / -1; justify-self: start; }
  .client-route-line { grid-template-columns: 1fr; }
  .client-rating-card { grid-template-columns: 1fr; }
  .client-rating-card > label { grid-column: auto; }
  .client-rating-complete { grid-template-columns: 1fr; }
  .company-view-header { display: grid; }
  .company-driver-metrics,
  #company-chat-driver-list { grid-template-columns: 1fr; }
  .company-chat-layout { margin: -14px; }
  .company-stats { grid-template-columns: 1fr 1fr; }
  .company-driver-detail .section-heading-row { align-items: flex-start; flex-direction: column; }
  .compliance-workspace .section-heading-row { align-items: stretch; flex-direction: column; }
  .compact-select { min-width: 0; width: 100%; }
  .compliance-tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .compliance-record-list { max-height: 520px; }
  .evidence-thumb { width: 100%; max-width: none; }
  .evidence-thumb img { height: 160px; }
  .evidence-viewer { padding: 10px; }
  .evidence-dialog { width: 100%; max-height: 96vh; }
  .evidence-dialog > img { max-height: calc(96vh - 52px); }
  .driver-account-record {
    grid-template-columns: 10px minmax(0, 1fr);
  }
  .fleet-record { align-items: flex-start; flex-direction: column; }
  .driver-account-record .record-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .driver-account-record .record-actions button { flex: 1; }
  .issue-presets { grid-template-columns: 1fr 1fr; }
  .communications-layout { margin: -14px; }
  .notification-feed,
  .communications-actions { grid-template-columns: 1fr; }
  .chat-message { max-width: 88%; }
  .upload-control { grid-template-columns: 38px minmax(0, 1fr); }
  .upload-icon { width: 38px; height: 38px; }
  .upload-action { display: none; }
  .route-bars div { grid-template-columns: 1fr auto; }
  .route-bars i { grid-column: 1 / -1; order: 3; }
}

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