:root {
  --bg: #eceff2;          /* trailer aluminum */
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #5b6875;
  --line: #cfd6dd;
  --navy: #1d4a72;        /* freight navy */
  --navy-ink: #ffffff;
  --strap: #f2b705;       /* ratchet-strap yellow, used only for the booked load */
  --strap-ink: #2a2100;
  --ok: #2c7a4b;
  --warn: #9a5b00;
  --danger: #a3302a;
  --radius-sm: 4px;
  --radius-lg: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181e;
    --surface: #1b232b;
    --ink: #e6ebef;
    --muted: #9aa7b3;
    --line: #2f3a45;
    --navy: #5b9bd5;
    --navy-ink: #0d1b28;
    --strap: #f2b705;
    --strap-ink: #2a2100;
    --ok: #5cc28a;
    --warn: #e0a347;
    --danger: #ef7d74;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Top bar */
.top {
  background: var(--navy);
  color: var(--navy-ink);
  display: flex; align-items: center; gap: 24px;
  padding: 10px 20px;
  flex-wrap: wrap;
}
.top .brand { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .01em; color: inherit; text-decoration: none; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); opacity: .85; }
.top nav a[aria-current="page"], .top nav a:hover { opacity: 1; background: rgba(255,255,255,.14); }
.top form { margin-left: auto; }
.top .linkbtn { color: inherit; opacity: .85; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 34px; line-height: 1.1; margin: 0 0 18px; }
h2 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 600; font-size: 24px; margin: 32px 0 10px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* Lane: the load ticket is the one bold element */
.lane {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 600;
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.1;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.lane .road { flex: 1 1 40px; min-width: 40px; height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 18px, transparent 18px 30px); border-radius: 2px; opacity: .55; }
.lane-sm { font-weight: 600; }
.specs { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 14px; }
.specs div { display: flex; flex-direction: column; }
.specs b { font-size: 22px; font-weight: 600; }
.specs span { color: var(--muted); font-size: 15px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.panel + .panel { margin-top: 16px; }

/* Tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 15px; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.booked td { background: color-mix(in srgb, var(--strap) 22%, transparent); }
tr.inactive td { color: var(--muted); }

/* Status */
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid currentColor; }
.status.open { color: var(--navy); }
.status.booked { background: var(--strap); color: var(--strap-ink); border-color: var(--strap); }
.status.cancelled { color: var(--muted); }
.wait { color: var(--warn); }
.got { color: var(--ok); font-weight: 600; }

/* Forms */
form.stack { display: grid; gap: 16px; max-width: 640px; }
label { display: grid; gap: 4px; font-weight: 600; }
label small, .hint { font-weight: 400; color: var(--muted); font-size: 15px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 14px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { display: flex; align-items: center; gap: 8px; font-weight: 500; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); padding: 9px 16px;
  border: 1px solid var(--navy); background: var(--navy); color: var(--navy-ink);
  text-decoration: none; display: inline-block;
}
.btn.ghost, button.ghost { background: transparent; color: var(--navy); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.book { background: var(--strap); color: var(--strap-ink); border-color: var(--strap); }
button.small, .btn.small { padding: 5px 10px; font-size: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; font-weight: 500; }
.inline { display: inline; }

.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid var(--ok); color: var(--ok); background: var(--surface); }
.flash.err { border-color: var(--danger); color: var(--danger); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.copyfield { display: flex; gap: 6px; }
.copyfield input { font-size: 14px; }

/* Login + carrier pages */
.narrow { max-width: 460px; margin: 8vh auto; }
.carrier-head { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 22px; color: var(--navy); margin-bottom: 18px; }

/* Compact warehouse rows in Settings */
.whrow { display: grid; grid-template-columns: 90px 1.6fr 1fr 78px 82px 64px 70px 60px 60px; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.whrow:last-child { border-bottom: 0; }
.whrow input, .whrow select { padding: 6px 8px; font-size: 15px; }
.whrow form { margin: 0; }
.whrow.hidden input, .whrow.hidden select { color: var(--muted); }
.whhead { font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 10px; padding-bottom: 6px; }
.whadd { display: grid; grid-template-columns: 110px 1.6fr 1fr 104px 90px auto; gap: 10px; align-items: end; }
.whadd input, .whadd select { padding: 7px 9px; font-size: 15px; }
@media (max-width: 860px) {
  .whhead { display: none; }
  .whrow { grid-template-columns: 1fr 1fr; }
  .whrow input[name=address], .whadd label:nth-child(2) { grid-column: 1 / -1; }
  .whadd { grid-template-columns: 1fr 1fr; }
}
.err-text { color: var(--danger); font-weight: 600; }
