/* Light theme default; dark via html[data-theme="dark"] */

:root {
  --bg: #f4f7f4;
  --panel: #ffffff;
  --text: #152018;
  --muted: #3f5241;
  --link: #17692a;
  --link-hover: #0f4a1c;
  --accent: #2a7d38;
  --accent2: #1f5d28;
  --danger: #b33030;
  --border: #c5d1c5;
  --max: 1080px;
  --header-bg: rgba(255, 255, 255, 0.96);
  --footer-bg: #e9eee9;
  --input-bg: #ffffff;
  --input-placeholder: #7a8a7a;
  --table-th-bg: #e4ebe4;
  --section-alt-bg: #eef3ee;
  --lede: #3d4d3d;
  --label-muted: #4a5c4a;
  --btn-secondary-bg: #dde6dd;
  --btn-secondary-hover: #cfd9cf;
  --hero-grad-1: rgba(42, 125, 56, 0.12);
  --hero-grad-2: rgba(30, 80, 120, 0.08);
  --banner-warn-bg: #faf6e8;
  --banner-warn-border: #d4c48a;
  --banner-err-bg: #fceeee;
  --banner-err-border: #e0a0a0;
  --banner-ok-bg: #e8f5ea;
  --banner-ok-border: #7cb88a;
  --code-bg: #e8ece8;
  --month-out-bg: #f0f3f0;
  --quote-err-bg: #fceeee;
  --quote-err-border: #e0a0a0;
  --toggle-track-bg: #c5d4c5;
  --toggle-knob-bg: #ffffff;
  --toggle-knob-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  --admin-nav-bg: #e4ebe4;
  /* Fluid type: slightly larger than default; scales with viewport */
  --font-root: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --line-body: 1.65;
  --line-relaxed: 1.72;
  --text-sm: clamp(0.9375rem, 0.88rem + 0.28vw, 1.0625rem);
  --text-nav: clamp(1rem, 0.94rem + 0.28vw, 1.125rem);
  --text-lede: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
  --text-h1: clamp(2rem, 1.45rem + 2.2vw, 2.875rem);
  --text-h2: clamp(1.4rem, 1.2rem + 0.95vw, 1.75rem);
  --text-btn: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-label: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Segoe UI', sans-serif;
}

html[data-theme='dark'] {
  --bg: #0f1410;
  --panel: #171d17;
  --text: #e8eee8;
  --muted: #b7c7b7;
  --link: #9fd4a8;
  --link-hover: #c8e8ce;
  --accent: #2d8a3e;
  --accent2: #1a5f2a;
  --danger: #b33a3a;
  --border: #2a332a;
  --header-bg: rgba(15, 20, 16, 0.95);
  --footer-bg: #0c100c;
  --input-bg: #0c100c;
  --input-placeholder: #8a9a8a;
  --table-th-bg: #121812;
  --section-alt-bg: #121712;
  --lede: #c5d4c5;
  --label-muted: #c0d2c0;
  --btn-secondary-bg: #243124;
  --btn-secondary-hover: #2c3c2c;
  --hero-grad-1: #1f3d28;
  --hero-grad-2: #1a2a44;
  --banner-warn-bg: #2a2610;
  --banner-warn-border: #6a5a20;
  --banner-err-bg: #2a1515;
  --banner-err-border: #6a3030;
  --banner-ok-bg: #152a18;
  --banner-ok-border: #2d6a38;
  --code-bg: #101810;
  --month-out-bg: #0a0c0a;
  --quote-err-bg: #221010;
  --quote-err-border: #6a3030;
  --toggle-track-bg: #3a4a3a;
  --toggle-knob-bg: #e8eee8;
  --toggle-knob-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  --admin-nav-bg: #141a14;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-root);
  line-height: var(--line-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

p,
li {
  line-height: var(--line-relaxed);
}

ul,
ol {
  padding-left: 1.35rem;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 0.6rem + 1.8vw, 1.5rem);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.header-tools {
  flex-shrink: 0;
  margin-left: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(42, 125, 56, 0.25);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle-ico {
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.15s ease, color 0.15s ease;
}

html[data-theme='light'] .theme-toggle-ico-sun {
  color: var(--accent);
  opacity: 1;
}
html[data-theme='light'] .theme-toggle-ico-moon {
  opacity: 0.35;
}

html[data-theme='dark'] .theme-toggle-ico-moon {
  color: #9fd4a8;
  opacity: 1;
}
html[data-theme='dark'] .theme-toggle-ico-sun {
  opacity: 0.35;
}

.theme-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--toggle-track-bg);
  position: relative;
  flex-shrink: 0;
}

.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--toggle-knob-bg);
  box-shadow: var(--toggle-knob-shadow);
  transition: transform 0.22s ease;
}

html[data-theme='dark'] .theme-toggle-knob {
  transform: translateX(20px);
}

.logo {
  font-weight: 700;
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.25;
}
.logo:hover {
  text-decoration: none;
  color: var(--link);
}

.nav {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
}
.nav-btn {
  color: var(--text);
  font-size: var(--text-nav);
  line-height: 1.25;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.nav-btn::after {
  content: '';
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.24rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  opacity: 0.95;
}
.nav-btn:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.nav-btn:hover::after {
  transform: scaleX(1);
}
.nav-btn.active,
.nav-btn.active-child {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
}
.nav-btn.active::after,
.nav-btn.active-child::after {
  transform: scaleX(1);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
}
.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.main {
  min-height: 55vh;
}

.hero {
  padding: 3.5rem 0 3rem;
  background: radial-gradient(1200px 400px at 20% -10%, var(--hero-grad-1) 0%, transparent 60%),
    radial-gradient(800px 300px at 90% 0%, var(--hero-grad-2) 0%, transparent 55%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 0.6rem + 1.8vw, 1.5rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(0.8125rem, 0.74rem + 0.3vw, 0.9375rem);
  color: var(--muted);
  line-height: 1.45;
}

h1 {
  font-size: var(--text-h1);
  line-height: 1.16;
  margin: 0.5rem 0 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin-top: 0;
  font-size: var(--text-h2);
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lede {
  font-size: var(--text-lede);
  line-height: var(--line-relaxed);
  color: var(--lede);
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  font-size: var(--text-btn);
  line-height: 1.4;
}
.btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: rgba(0, 0, 0, 0.12);
}
.btn-secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--btn-secondary-hover);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-danger {
  background: #5a2222;
  border-color: #7a3030;
  color: #fff;
}
html[data-theme='light'] .btn-danger {
  background: #8a2a2a;
  color: #fff;
}
button.link {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
button.link.danger:hover {
  text-decoration: underline;
}

.section {
  padding: 2.75rem 0;
}
.section.alt {
  background: var(--section-alt-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 880px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.split-admin {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 960px) {
  .split-admin {
    grid-template-columns: 1fr;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.narrow {
  max-width: 70ch;
}
.narrow-block {
  max-width: 640px;
  margin: 0 auto;
}

/* Order-confirmed hero */
.confirm-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .35rem;
}
.confirm-check {
  font-size: 3rem;
  line-height: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  line-height: var(--line-body);
}
.card p {
  line-height: var(--line-relaxed);
}
.muted-card {
  opacity: 0.95;
}

.check {
  padding-left: 1.1rem;
}
.check li {
  margin: 0.35rem 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: var(--text-label);
  color: var(--label-muted);
  line-height: 1.45;
}
input,
textarea,
select {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: inherit;
  line-height: 1.45;
  min-height: 2.75rem;
  max-width: 100%;
}
textarea {
  min-height: 6rem;
  line-height: var(--line-body);
}
input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
  }
}

.row.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.banner {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: var(--text-label);
  line-height: 1.55;
}
.banner.warn {
  background: var(--banner-warn-bg);
  border-color: var(--banner-warn-border);
}
.banner.error {
  background: var(--banner-err-bg);
  border-color: var(--banner-err-border);
}
.banner.ok {
  background: var(--banner-ok-bg);
  border-color: var(--banner-ok-border);
}

.small {
  font-size: var(--text-sm);
  line-height: 1.55;
}
.muted {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  margin-top: 2rem;
  background: var(--footer-bg);
}
.footer-nav {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.mobile-dock {
  display: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
}
@media (max-width: 800px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th {
  background: var(--table-th-bg);
}

.stat-number {
  font-size: clamp(1.875rem, 1.55rem + 1.1vw, 2.375rem);
  font-weight: 700;
  margin: 0.25rem 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat {
  margin-bottom: 1rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.admin-nav a {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--admin-nav-bg);
  font-size: var(--text-nav);
  line-height: 1.4;
}

code {
  font-size: 0.94em;
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  line-height: 1.45;
}

#quote-result.error {
  border-color: var(--quote-err-border);
  background: var(--quote-err-bg);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.25rem;
}

.month-grid {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.month-grid-head,
.month-grid-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-grid-head {
  background: var(--table-th-bg);
  font-size: clamp(0.8125rem, 0.76rem + 0.22vw, 0.9375rem);
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 0.5rem 0.3rem;
  line-height: 1.4;
}

.month-grid-body {
  border-top: 1px solid var(--border);
}

.month-cell {
  min-height: 88px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem;
  font-size: clamp(0.8125rem, 0.76rem + 0.22vw, 0.9375rem);
  line-height: 1.45;
  vertical-align: top;
}

.month-cell:nth-child(7n) {
  border-right: none;
}

.month-cell.out-month {
  background: var(--month-out-bg);
  opacity: 0.65;
}

.month-cell.is-today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.month-cell-day {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.month-cell-list {
  margin: 0;
  padding: 0 0 0 0.85rem;
  list-style: disc;
}

.month-cell-list li {
  margin: 0.1rem 0;
  word-break: break-word;
}

.pac-container {
  z-index: 10050 !important;
}

.address-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
  margin: 0;
}

.address-block legend {
  padding: 0 0.35rem;
  font-weight: 700;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  line-height: 1.35;
}

.load-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.load-photo-card {
  margin: 0;
}

.load-photo-card img {
  width: 100%;
  max-height: 220px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
  background: var(--input-bg);
}

.load-photo-card figcaption {
  margin-top: 0.35rem;
  word-break: break-word;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.settings-form h2 {
  margin-top: 1.4rem;
  margin-bottom: 0.55rem;
}
.settings-form h2:first-of-type {
  margin-top: 0.25rem;
}
.settings-form label {
  color: var(--text);
}

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav {
    display: none;
    width: 100%;
    justify-content: flex-start;
  }
  .nav.open {
    display: flex;
  }
  .nav-btn {
    width: 100%;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-dock a {
    padding: 0.5rem 0.35rem 0.6rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text);
    border-right: 1px solid var(--border);
    text-decoration: none;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
  }
  .mobile-dock a:last-child {
    border-right: none;
  }
  .mobile-dock a.active {
    color: #fff;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
  }
  .dock-ico {
    width: 1.15rem;
    height: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .dock-ico svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
  }
}

@media (max-width: 920px) {
  .nav-btn::after {
    display: none;
  }
}

/* DB / config error page (includes/db.php) */
body code {
  color: inherit;
}

/* Utility */
.mt-1        { margin-top: 1rem; }
.form-inline { display: inline; }
.code-hint {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--code-bg);
  border-radius: 4px;
}

/* =====================================================
   DISPATCH DESIGN SYSTEM — appended 2026-06-01
   ===================================================== */

/* ---------- Status badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  vertical-align: middle;
}
.status-badge--pending   { background: #fef3c7; color: #92400e; }
.status-badge--awaiting  { background: #dbeafe; color: #1e40af; }
.status-badge--assigned  { background: #ede9fe; color: #5b21b6; }
.status-badge--transit   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-badge--completed { background: #d1fae5; color: #065f46; }
.status-badge--declined  { background: #fee2e2; color: #991b1b; }
.status-badge--cancelled { background: #f1f5f9; color: #64748b; }

html[data-theme="dark"] .status-badge--pending   { background: #451a03; color: #fcd34d; }
html[data-theme="dark"] .status-badge--awaiting  { background: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .status-badge--assigned  { background: #2e1065; color: #c4b5fd; }
html[data-theme="dark"] .status-badge--transit   { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .status-badge--completed { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .status-badge--declined  { background: #450a0a; color: #fca5a5; }
html[data-theme="dark"] .status-badge--cancelled { background: #1e293b; color: #94a3b8; }

/* ---------- Load cards (list view) ---------- */
.load-cards { display: flex; flex-direction: column; gap: .55rem; }

.load-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow .15s, border-color .15s;
}
.load-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: var(--accent); }

.load-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}
.load-card-id { font-weight: 700; font-size: .9rem; }

.load-card-addresses {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.load-card-addresses .arrow { margin: 0 .35rem; }

.load-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--muted);
}
.load-card-price { font-weight: 800; font-size: .95rem; color: var(--accent); }
.load-card-driver { font-size: .8rem; }

/* ---------- Route map container ---------- */
.route-map {
  width: 100%;
  height: 260px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--section-alt-bg);
  margin: .9rem 0;
  position: relative;
}
.route-map--tall { height: 360px; }
.route-map > div, .route-map > iframe { width: 100% !important; height: 100% !important; }

/* ---------- Admin assignment panel ---------- */
.assign-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}
.assign-panel h3 { margin: 0 0 .65rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.assign-row { display: flex; gap: .55rem; align-items: flex-end; flex-wrap: wrap; }
.assign-row select { flex: 1; min-width: 180px; }
.assign-row .btn { white-space: nowrap; }

/* ---------- Order timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: .55rem;
  top: .4rem;
  bottom: .4rem;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 0 .9rem 2rem;
}
.timeline-dot {
  position: absolute;
  left: 0;
  top: .18rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  z-index: 1;
}
.timeline-dot--ok     { background: #16a34a; }
.timeline-dot--muted  { background: var(--muted); }
.timeline-dot--warn   { background: #d97706; }
.timeline-dot--danger { background: var(--danger); }
.timeline-time  { font-size: .75rem; color: var(--muted); display: block; margin-bottom: .1rem; }
.timeline-event { font-size: .88rem; font-weight: 600; }
.timeline-note  { font-size: .82rem; color: var(--muted); margin-top: .1rem; }

/* ---------- Driver dashboard hero strip ---------- */
.driver-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  padding: 1.25rem 1.1rem;
  border-radius: 16px;
  margin-bottom: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .75rem;
}
.driver-hero h2 { margin: 0; font-size: 1rem; color: rgba(255,255,255,.8); font-weight: 500; }
.driver-hero-earnings { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.1; }
.driver-hero-label { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: .1rem; }
.driver-hero-stat { text-align: right; }
.driver-hero-stat .driver-hero-earnings { font-size: 1.3rem; }

/* ---------- Available load card (driver) ---------- */
.avail-load {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: .65rem;
}
.avail-load-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .45rem;
}
.avail-load-id { font-weight: 700; font-size: .88rem; color: var(--muted); }
.avail-load-price { font-weight: 800; font-size: 1.2rem; color: var(--accent); }
.avail-load-route { margin-bottom: .5rem; }
.avail-load-from, .avail-load-to {
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avail-load-from::before { content: '📍 '; }
.avail-load-to::before   { content: '🏁 '; }
.avail-load-meta {
  display: flex;
  gap: .65rem;
  font-size: .8rem;
  color: var(--muted);
  flex-wrap: wrap;
  margin-bottom: .7rem;
}
.avail-load-actions { display: flex; gap: .55rem; }
.avail-load-actions .btn { flex: 1; text-align: center; }

/* ---------- Active load card (driver) ---------- */
.active-load-card {
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.active-load-card .active-load-tag {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: .4rem;
}
.active-load-card h3 { margin: 0 0 .4rem; font-size: 1rem; }

/* ---------- Load detail 2-col info grid ---------- */
.load-detail-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
  margin: .9rem 0;
}
.load-detail-info > * { min-width: 0; }
.load-detail-label {
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 .15rem;
}
.load-detail-value { font-size: .95rem; font-weight: 500; word-break: break-word; }
.load-detail-full  { grid-column: 1 / -1; }

.address-block { margin-bottom: .5rem; }
.address-block + .address-block { padding-top: .5rem; border-top: 1px dashed var(--border); }
.address-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .15rem; }
.address-text { font-size: .92rem; line-height: 1.4; }

/* ---------- Sticky action dock (load detail) ---------- */
.action-dock {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom));
  margin-top: 1rem;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.action-dock .btn { flex: 1; min-width: 120px; text-align: center; padding-top: .75rem; padding-bottom: .75rem; }

/* ---------- Stats grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .65rem;
  margin: 1rem 0;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1rem;
}
.stat-card-label {
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 .3rem;
}
.stat-card-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.stat-card-sub { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.stat-card--accent .stat-card-value  { color: var(--accent); }
.stat-card--warn   .stat-card-value  { color: #d97706; }
.stat-card--danger .stat-card-value  { color: var(--danger); }
.stat-card--info   .stat-card-value  { color: #1e40af; }

/* ---------- Section header with actions ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .85rem;
}
.section-head h1, .section-head h2 { margin: 0; }

/* ---------- Filter tabs ---------- */
.filter-tabs {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .3rem;
  margin-bottom: .9rem;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  flex-shrink: 0;
  padding: .3rem .85rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: .84rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.filter-tab:hover, .filter-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.8rem; margin-bottom: .6rem; }
.empty-state h3 { margin: 0 0 .4rem; color: var(--text); }

/* ---------- Wizard steps (book.php) ---------- */
.wizard-steps {
  display: flex;
  margin-bottom: 1.5rem;
  position: relative;
}
.wizard-steps::before {
  content: '';
  position: absolute;
  top: .75rem;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.wizard-step-item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}
.wizard-step-num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .25rem;
  border: 2px solid var(--bg);
}
.wizard-step-item.active .wizard-step-num  { background: var(--accent); color: #fff; }
.wizard-step-item.done   .wizard-step-num  { background: var(--accent2); color: #fff; }
.wizard-step-label {
  display: block;
  font-size: .7rem;
  color: var(--muted);
}
.wizard-step-item.active .wizard-step-label { color: var(--text); font-weight: 600; }

/* ---------- Quote result card ---------- */
.quote-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  margin: .85rem 0;
}
.quote-price { font-size: 2.2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.quote-details { font-size: .85rem; color: var(--muted); margin-top: .35rem; }

/* ---------- Mobile enhancements ---------- */
@media (max-width: 640px) {
  .load-detail-info { grid-template-columns: 1fr; }
  .assign-row { flex-direction: column; }
  .assign-row select, .assign-row .btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card-value { font-size: 1.5rem; }
}

/* ---------- Print (driver reports) ---------- */
@media print {
  .site-header, .mobile-dock, .action-dock, .filter-tabs { display: none !important; }
  .load-card { break-inside: avoid; }
}
