:root {
  --navy: #1e3a8a; --navy-2: #1e40af; --ink: #111827; --muted: #6b7280; --line: #e5e7eb;
  --bg: #f3f4f6; --card: #ffffff; --warn-bg: #fef3c7; --warn: #92400e; --bad: #b91c1c;
  --bad-bg: #fee2e2; --ok-bg: #dcfce7; --ok: #166534; --link: #1d4ed8; --row-hover: #f9fafb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e5e7eb; --muted: #9ca3af; --line: #2b3342; --bg: #0f141c; --card: #171d27;
    --warn-bg: #3a2c0b; --warn: #fcd34d; --bad: #f87171; --bad-bg: #3b1515; --ok-bg: #12301f;
    --ok: #86efac; --link: #93b4ff; --row-hover: #1c2330;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
       color: var(--ink); background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 22px; margin: 0; } h1 small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 6px; }
h2 { font-size: 16px; margin: 22px 0 10px; } h3 { font-size: 14px; margin: 0 0 10px; }

.topbar { display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 54px;
          background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 5; }
.topbar a { color: #dbe4ff; }
.brand { font-weight: 700; font-size: 16px; color: #fff !important; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { padding: 7px 11px; border-radius: 6px; white-space: nowrap; }
.topbar nav a.on, .topbar nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.pill { background: #f59e0b; color: #111; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
main { max-width: 1400px; margin: 0 auto; padding: 18px 20px 60px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
table.loads { min-width: 1080px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--navy); color: #fff; font-weight: 600; font-size: 12.5px; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: var(--row-hover); }
tr.flag td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
tr.inactive { opacity: .55; }
.r { text-align: right; } .nowrap { white-space: nowrap; }
.addr { font-size: 12.5px; }
.empty { padding: 26px; text-align: center; color: var(--muted); margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .bad { color: var(--bad); }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink);
       padding: 8px 14px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--navy); text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; margin-top: 16px; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
form.inline { display: inline; margin: 0; }

input, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
                border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0; }
input:focus, select:focus { outline: 2px solid #93c5fd; border-color: var(--navy); }
input[type=checkbox] { width: auto; }
/* v4.9.2: a dropdown turned into a picker (.combo-sel) is as wide as its longest choice, like the browser's own;
   page rules set its width next to their `select` rule */
.combo.combo-sel { display: inline-block; vertical-align: middle; width: 100%; min-width: min(var(--sel-w, 120px), 100%); max-width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { min-width: 150px; } .filters label.grow { flex: 1; min-width: 200px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; min-width: 0; padding-bottom: 9px; }

.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.statusbar form { margin-left: auto; }
.statusbar.warn { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 8px; }

.period-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.period-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-nav h2 { margin: 14px 4px; }
[hidden] { display: none !important; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; color: var(--ink); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi.flagged { background: var(--warn-bg); border-color: #f59e0b; }
.kpi.flagged:hover { text-decoration: none; }
td.r, .kpi strong { font-variant-numeric: tabular-nums; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
       background: var(--bg); color: var(--muted); margin: 1px 0; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad, .tag.s-failed { background: var(--bad-bg); color: var(--bad); }
.tag.s-done { background: var(--ok-bg); color: var(--ok); }
.tag.s-pending, .tag.s-processing { background: #dbeafe; color: #1e40af; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid2 .full { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.src { padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.note code { background: var(--bg); padding: 2px 6px; border-radius: 5px; user-select: all; }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.login h1 { color: var(--navy); text-align: center; }
@media (prefers-color-scheme: dark) { .login h1 { color: #c7d2fe; } }

@media (max-width: 760px) {
  main { padding: 12px 12px 40px; }
  .topbar { gap: 10px; padding: 0 12px; } .brand { display: none; }
  .split, .grid2 { grid-template-columns: 1fr; }
  .filters label { min-width: 0; flex: 1 1 45%; }
}

/* ---- v2: sorting, stops, load page, profiles ---- */
th a { color: #fff; text-decoration: none; white-space: nowrap; }
th a:hover { text-decoration: underline; color: #fff; }
th.sorted { background: var(--navy-2); }
.sort-hint { opacity: .55; font-weight: 400; }
.sort-links { font-weight: 400; opacity: .9; margin-left: 6px; }
.strong-link { font-weight: 700; color: var(--ink); }
.stops { display: flex; flex-direction: column; gap: 6px; min-width: 230px; }
.stop { display: flex; gap: 8px; align-items: baseline; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; flex: none; }
.badge.pickup { background: #dbeafe; color: #1e40af; }
.badge.drop { background: #ffedd5; color: #9a3412; }
@media (prefers-color-scheme: dark) {
  .badge.pickup { background: #1e3a8a; color: #dbeafe; }
  .badge.drop { background: #7c2d12; color: #ffedd5; }
}
.grid-detail { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700;
          display: flex; align-items: center; justify-content: center; flex: none; }
.tl-dot.pickup { background: #1e40af; } .tl-dot.drop { background: #c2410c; }
.tl-line { width: 2px; flex: 1; background: var(--line); min-height: 26px; }
.tl-body { padding-bottom: 16px; display: flex; flex-direction: column; gap: 2px; }
#map, .map-frame { width: 100%; height: 440px; border: 0; border-radius: 10px; display: block; }
.map-empty { height: 220px; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center;
             text-align: center; color: var(--muted); padding: 20px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.card h2, .card h3 { margin-top: 0; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.big { font-size: 22px; font-weight: 700; }
tr.current td { background: rgba(37, 99, 235, .07); }
.stop-edit td { padding: 6px 8px; vertical-align: middle; }
.stop-edit input { padding: 6px 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form label { min-width: 140px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 760px) { #map, .map-frame { height: 320px; } .grid-detail { grid-template-columns: 1fr; } .cards2 { grid-template-columns: 1fr; } }

/* v3.2 preloaded trailers */
.preload-form select, .preload-form .combo-sel { min-width: 0; width: auto; }
.preload-form select.preloaded { border-color: var(--warn); background-color: var(--warn-bg); color: var(--warn); font-weight: 600; }

/* v3.3 charges */
.charges-table { width: 100%; border-collapse: collapse; min-width: 0; }
.charges-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.charges-table tr.note td { color: var(--muted); }
.charges-table tr.note td strong { font-weight: 500; }
.charges-table tfoot td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; }
.charges-table tfoot tr.total td { border-top: 2px solid var(--line); font-weight: 700; padding-top: 8px; }
.add-charge { margin-top: 12px; }
.add-charge summary { cursor: pointer; font-weight: 600; }
.add-charge .inline-form { margin-top: 10px; }
.history { margin: 0; padding-left: 18px; }
.history li { margin: 3px 0; }
.extras-note { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* ======================================================================== v4.0 */
/* ---- menu: top bar on a computer, bottom tab bar on a phone ---- */
.mainnav a { display: inline-flex; align-items: center; gap: 7px; }
.mainnav .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.mainnav .settings-link { margin-left: auto; }
.pill.bad { background: #ef4444; color: #fff; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex: none; }
.live-dot.on { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
@media (max-width: 760px) {
  .topbar { height: 48px; } .brand { display: inline; font-size: 15px; }
  .topbar .live-dot { margin-left: auto; }
  .mainnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card);
             border-top: 1px solid var(--line); display: flex; gap: 0; padding-bottom: env(safe-area-inset-bottom);
             overflow: visible; }
  .mainnav a { flex: 1; flex-direction: column; gap: 2px; padding: 8px 0 9px; border-radius: 0; color: var(--muted);
               font-size: 11px; font-weight: 600; position: relative; min-height: 54px; justify-content: center; }
  .mainnav a .ico { width: 22px; height: 22px; }
  .mainnav a.on, .mainnav a:hover { background: transparent; color: var(--navy); }
  .mainnav .settings-link { margin-left: 0; }
  .mainnav .pill { position: absolute; top: 3px; left: 50%; margin-left: 6px; font-size: 10px; padding: 0 5px; }
  main { padding-bottom: 90px; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) { .mainnav a.on { color: #93b4ff; } }

/* ---- toasts ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ok-bg); color: var(--ok); border: 1px solid currentColor; padding: 10px 14px; border-radius: 8px;
         font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.12); transition: opacity .4s; max-width: 360px; }
.toast.error { background: var(--bad-bg); color: var(--bad); }
.toast.warn { background: var(--warn-bg); color: var(--warn); }
.toast.out { opacity: 0; }
@media (max-width: 760px) { .toasts { left: 12px; right: 12px; bottom: 76px; } }

/* ---- tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 10px 0 14px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); }
@media (prefers-color-scheme: dark) { .tabs a.on { color: #93b4ff; border-bottom-color: #93b4ff; } }
.tabs .count { font-weight: 500; color: var(--muted); margin-left: 4px; }
.tabs .count.warn { color: #b45309; font-weight: 700; }

/* ---- Today ---- */
.alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.alert { border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; }
.alert strong { font-size: 15px; } .alert span { font-size: 12.5px; }
.alert:hover { text-decoration: none; filter: brightness(.98); }
.alert.red { background: var(--bad-bg); color: var(--bad); }
.alert.orange { background: #ffedd5; color: #9a3412; }
.alert.blue { background: #dbeafe; color: #1e3a8a; }
.alert.amber { background: var(--warn-bg); color: var(--warn); }
.alert.calm { background: var(--card); color: var(--muted); border-color: var(--line); }
@media (prefers-color-scheme: dark) { .alert.orange { background: #43200b; color: #fdba74; } .alert.blue { background: #172554; color: #bfdbfe; } }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.today-grid.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1000px) { .today-grid { grid-template-columns: 1fr; } }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; }
.section-head h2 { margin: 0; font-size: 15.5px; }
/* v4.1.5: one load per line; click to open details */
details.ev { border-top: 1px solid var(--line); }
details.ev > summary { list-style: none; cursor: pointer; display: grid; align-items: center; gap: 12px; padding: 10px 16px; min-height: 48px;
  grid-template-columns: 78px 276px minmax(110px, 1fr) minmax(90px, .8fr) minmax(120px, .9fr) minmax(150px, 1.3fr) 210px 18px; }
/* v4.6.10: the day + time stay on one line, every row the same height */
details.ev .when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
details.ev > summary::-webkit-details-marker { display: none; }
details.ev > summary:hover { background: var(--row-hover); }
details.ev > summary:focus-visible { outline: 2px solid #93c5fd; outline-offset: -2px; }
details.ev .who, details.ev .place { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
details.ev .who strong, details.ev .equip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
details.ev .place strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
details.ev a.drv { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
details.ev a.drv:hover { color: var(--link); text-decoration: underline; }
.pre-trl { color: #a16207; font-weight: 700; background: var(--warn-bg); border-radius: 4px; padding: 0 4px; }
@media (prefers-color-scheme: dark) { .pre-trl { color: #fcd34d; } }
details.ev .equip { font-size: 13px; }
details.ev .nodriver { color: var(--warn); }
details.ev .tags { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
details.ev .late { font-size: 12px; font-weight: 700; color: var(--bad); white-space: nowrap; }
details.ev .chev { color: var(--muted); transition: transform .15s; }
details.ev[open] .chev { transform: rotate(180deg); }
details.ev[open] { background: var(--row-hover); box-shadow: inset 3px 0 0 var(--navy); }
details.ev.problem > summary { background: var(--bad-bg); }
details.ev.delivered > summary { color: var(--muted); }
.st.pre { background: var(--warn-bg); color: var(--warn); }
.ev-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 20px; padding: 6px 16px 16px 106px; align-items: start; }
.ev-col { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ev-h { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ev-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; }
.ev-act { align-items: flex-end; text-align: right; }
.ev .alert-text { font-size: 12.5px; font-weight: 700; color: var(--bad); }
.steps { display: inline-flex; gap: 3px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.steps .step { font: inherit; font-size: 13.5px; font-weight: 600; min-height: 40px; padding: 6px 16px; border: 0; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--muted); }
.steps .step:hover { color: var(--ink); background: var(--card); }
.steps .step.done { background: var(--card); color: var(--ok); }
.steps .step.on { color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.steps .step.on.booked { background: #374151; } .steps .step.on.loaded { background: #1d4ed8; } .steps .step.on.delivered { background: #047857; }
.assign { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.assign select, .assign .combo-sel { min-width: 240px; max-width: 360px; }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.chips-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px; border-radius: 999px; font-weight: 600;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-sizing: border-box; }
.chip:hover { border-color: var(--navy); text-decoration: none; }
.chip .n { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--bg); color: var(--muted); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on .n { background: #fff; color: var(--navy); }
.chips-note { font-size: 12.5px; color: var(--muted); margin-left: 6px; }
@media (max-width: 760px) {
  details.ev > summary { grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 10px 12px; }
  details.ev .when { grid-column: 2; } details.ev .chev { grid-column: 3; grid-row: 1; }
  details.ev .who, details.ev .equip, details.ev .place { grid-column: 1 / -1; } details.ev .tags { grid-column: 1 / -1; justify-content: flex-start; }
  .ev-panel { grid-template-columns: 1fr; padding: 6px 12px 14px; gap: 14px; }
  .ev-act { align-items: stretch; text-align: left; }
  .steps { display: flex; } .steps .step { flex: 1; justify-content: center; min-height: 46px; }
  .assign select, .assign .combo-sel { min-width: 0; flex: 1; }
}
.kind { justify-self: start; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.kind.pickup { background: #dbeafe; color: #1e40af; } .kind.drop { background: #ffedd5; color: #9a3412; }
@media (prefers-color-scheme: dark) { .kind.pickup { background: #1e3a8a; color: #dbeafe; } .kind.drop { background: #7c2d12; color: #ffedd5; } }
.st { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.st.booked { background: #f3f4f6; color: #374151; } .st.loaded { background: #dbeafe; color: #1e40af; }
.st.delivered { background: #d1fae5; color: #065f46; } .st.old { background: transparent; color: var(--muted); border: 1px dashed var(--line); } .st.unassigned { background: var(--warn-bg); color: var(--warn); }
@media (prefers-color-scheme: dark) { .st.booked { background: #273042; color: #d1d5db; } .st.loaded { background: #1e3a8a; color: #dbeafe; } .st.delivered { background: #064e3b; color: #a7f3d0; } }
.btn.big { min-height: 42px; font-size: 14px; }
.side-list .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); }
.side-list .row > div { display: flex; flex-direction: column; min-width: 0; }
.lvl { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lvl.red { background: var(--bad-bg); color: var(--bad); } .lvl.amber { background: var(--warn-bg); color: var(--warn); }
.lvl.ok { background: var(--ok-bg); color: var(--ok); }
.empty-small { padding: 12px 16px; color: var(--muted); font-size: 13px; margin: 0; }
.changed { animation: ftflash 2.4s ease-out; }
@keyframes ftflash { 0% { background: #fde68a; } 100% { background: transparent; } }

/* ---- week by day ---- */
.week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-block { margin-bottom: 12px; }
.day-head { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 10px 10px 0 0; background: #eef2ff; color: var(--navy); }
.day-head.today { background: var(--navy); color: #fff; }
.day-head.past { background: var(--row-hover); color: var(--muted); }
@media (prefers-color-scheme: dark) { .day-head { background: #1c2541; color: #c7d2fe; } .day-head.today { background: #1e40af; color: #fff; } }
.day-block .card { border-radius: 0 0 10px 10px; border-top: 0; padding: 0; overflow: hidden; }

/* ---- week by driver ---- */
.lanes { min-width: 980px; }
.lane { display: grid; grid-template-columns: 190px repeat(42, minmax(0, 1fr)); border-top: 1px solid var(--line); position: relative; }
.lane.head { background: var(--navy); color: #fff; font-weight: 600; font-size: 12.5px; border-top: 0; }
.lane.head > div { padding: 9px 10px; } .lane.head .today { background: var(--navy-2); }
.lane .cell { border-left: 1px solid var(--line); min-height: 78px; }
.lane .cell.today { background: rgba(30, 64, 175, .06); } .lane .cell.past { background: var(--row-hover); }
.lane .who { padding: 10px; grid-row: 1 / span 9; grid-column: 1; }
.bar { margin: 6px 4px; padding: 7px 9px; border-radius: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 3px;
       z-index: 1; border: 1px solid #9ca3af; background: var(--card); min-width: 0; }
.bar.loaded { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }
.bar.delivered { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.bar.problem { box-shadow: 0 0 0 2px #dc2626; }
@media (prefers-color-scheme: dark) { .bar.loaded { background: #1e3a8a; color: #dbeafe; } .bar.delivered { background: #064e3b; color: #a7f3d0; } }
.bar a { color: inherit; font-weight: 700; font-size: 12.5px; }
.bar .btn { font-size: 11.5px; padding: 3px 8px; min-height: 0; align-self: flex-start; }
.free { margin: 8px 4px; padding: 7px 9px; border-radius: 8px; border: 1px dashed currentColor; font-size: 12px; z-index: 1;
        display: flex; flex-direction: column; align-self: center; }
.free.red { background: var(--bad-bg); color: var(--bad); } .free.amber { background: var(--warn-bg); color: var(--warn); }
.free.ok { background: var(--ok-bg); color: var(--ok); }

/* ---- reports ---- */
.bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; align-items: end; height: 210px; border-bottom: 1px solid var(--line); }
.bars .b { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: 12px; }
.bars .b i { display: block; width: 70%; background: var(--navy); border-radius: 4px 4px 0 0; }
.bars .b.cur i { background: #93a4d6; }
.lane-table td.good { color: var(--ok); font-weight: 700; } .lane-table td.poor { color: var(--bad); font-weight: 700; }

/* ---- settings ---- */
.set-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
@media (max-width: 760px) { .set-row { grid-template-columns: 1fr; gap: 4px; } }
.ok-tag { background: var(--ok-bg); color: var(--ok); } .off-tag { background: var(--row-hover); color: var(--muted); }


/* v4.1.8: multi-stop tags, week-by-driver bars that open */
.more { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; margin-left: 6px; }
.more.pickup { background: #dbeafe; color: #1e40af; } .more.drop { background: #ffedd5; color: #9a3412; }
@media (prefers-color-scheme: dark) { .more.pickup { background: #1e3a8a; color: #dbeafe; } .more.drop { background: #7c2d12; color: #ffedd5; } }
details.ev .place { align-items: center; }
details.ev .equip { font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ev-stop .here { font-size: 11.5px; font-weight: 700; color: var(--navy); }
@media (prefers-color-scheme: dark) { .ev-stop .here { color: #93b4ff; } }
.lane .who { display: flex; flex-direction: column; gap: 2px; }
button.bar { font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; min-height: 44px; gap: 4px; }
button.bar:hover { border-color: var(--navy); }
button.bar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--navy); }
button.bar.problem[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px #dc2626; }
.bar-top { display: flex; align-items: center; min-width: 0; }
.bar-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-bottom { display: flex; align-items: center; gap: 6px; justify-content: space-between; flex-wrap: wrap; }
.bar-bottom .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar .late { font-size: 11.5px; font-weight: 700; color: var(--bad); }
.lane-panel { grid-column: 1 / -1; background: var(--row-hover); border-top: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--navy); z-index: 2; }
.lane-panel .ev-panel { padding: 12px 16px 16px 200px; }
@media (max-width: 760px) { .lane-panel .ev-panel { padding: 10px 12px 14px; } }

/* v4.1.9: preloaded waiting strip + pickup confirm */
.wait-strip { margin: 0 3px 6px; padding: 4px 8px; border-radius: 6px; border: 1px dashed #d97706; color: #92400e; font-size: 12px;
  background: repeating-linear-gradient(135deg, #fffbeb 0 8px, #fef3c7 8px 16px); display: flex; gap: 6px; align-items: center;
  white-space: nowrap; overflow: hidden; align-self: start; min-height: 30px; box-sizing: border-box; z-index: 1; }
@media (prefers-color-scheme: dark) { .wait-strip { color: #fcd34d; border-color: #b45309; background: repeating-linear-gradient(135deg, #2a1f08 0 8px, #3a2c0b 8px 16px); } }
.pickup-confirm { margin-top: 8px; width: 380px; max-width: 100%; box-sizing: border-box; background: var(--card); border: 1px solid #d97706;
  border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.pickup-confirm[hidden] { display: none; }
.pickup-confirm label { color: var(--muted); }
.pc-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* v4.2: split loads (relay legs), search pickers, smooth open / close */
.leg-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  background: #ede9fe; color: #5b21b6; margin-left: 6px; text-transform: none; letter-spacing: 0; }
@media (prefers-color-scheme: dark) { .leg-tag { background: #2e1065; color: #ddd6fe; } }
.bar-top .pre-trl { margin-left: 6px; font-size: 11px; }
.split-btn { min-height: 40px; border-radius: 999px; border: 1px dashed #7c3aed; color: #5b21b6; background: var(--card); margin-top: 4px; }
.split-btn:hover { background: #f5f3ff; }
@media (prefers-color-scheme: dark) { .split-btn { color: #c4b5fd; border-color: #8b5cf6; } .split-btn:hover { background: #2e1065; } }
.unsplit { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 4px; }
.unsplit .btn { border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.split-form { grid-column: 1 / -1; background: var(--card); border: 1px solid #a78bfa; border-radius: 10px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.08); text-align: left; }
.split-form[hidden] { display: none; }
.sf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.sf-head strong { font-size: 15px; }
.sf-grid { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(260px, 1.25fr) minmax(240px, 1.1fr) minmax(240px, 1.1fr); gap: 16px; align-items: start; }
.sf-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
.sf-field > input { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); min-height: 40px; }
.day-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pill input { position: absolute; opacity: 0; pointer-events: none; }
.day-pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.day-pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.day-pill input:focus-visible + span { outline: 2px solid #93c5fd; outline-offset: 2px; }
.sf-actions { display: flex; gap: 8px; justify-content: flex-end; }
.split-go { background: #5b21b6; border-color: #5b21b6; color: #fff; }
.split-go:hover { background: #4c1d95; }
@media (max-width: 1100px) { .sf-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .sf-grid { grid-template-columns: 1fr; } }
.wait-strip.relay { border-color: #7c3aed; color: #5b21b6; background: repeating-linear-gradient(135deg, #f5f3ff 0 8px, #ede9fe 8px 16px); }
@media (prefers-color-scheme: dark) { .wait-strip.relay { color: #ddd6fe; border-color: #8b5cf6; background: repeating-linear-gradient(135deg, #1e1336 0 8px, #2e1065 8px 16px); } }
.split-card .leg-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.split-card .section-head { padding: 0 0 10px; }

/* search picker */
.combo { position: relative; min-width: 240px; text-align: left; }
.assign .combo { flex: 1; max-width: 380px; }
.combo-btn { font: inherit; font-size: 14px; color: var(--ink); width: 100%; min-height: 40px; padding: 4px 10px; border: 1px solid #9ca3af;
  border-radius: 7px; background: var(--card); cursor: pointer; display: flex; gap: 8px; align-items: center; text-align: left; }
.combo-btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.combo-val { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-val .sub, .combo-opt .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.combo-pop { position: fixed; z-index: 60; border: 1px solid #c4b5fd; border-radius: 8px; background: var(--card);
  box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.combo-pop[hidden] { display: none; }
.combo-q { font: inherit; font-size: 14px; min-height: 38px; }
.combo-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.combo-opt { font: inherit; color: var(--ink); text-align: left; display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 6px 10px; flex-shrink: 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 4px; background: transparent; cursor: pointer; }
.combo-opt:hover, .combo-opt:focus-visible { background: var(--row-hover); outline: none; }
.combo-opt[aria-selected="true"] { background: #ede9fe; }
@media (prefers-color-scheme: dark) { .combo-opt[aria-selected="true"] { background: #2e1065; } }
.combo-opt .o-txt { display: flex; flex-direction: column; min-width: 0; }
.combo-opt .o-txt strong { font-variant-numeric: tabular-nums; }
.o-tag { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.o-tag.ok { background: var(--ok-bg); color: var(--ok); } .o-tag.amber { background: var(--warn-bg); color: var(--warn); }
.o-tag.gray { background: var(--bg); color: var(--muted); }
.o-tag.blue { background: #dbeafe; color: #1e40af; }
@media (prefers-color-scheme: dark) { .o-tag.blue { background: #172554; color: #93c5fd; } }
.combo-opt:has(.o-tag.gray) { opacity: .75; }
.combo-none { margin: 0; padding: 10px; font-size: 13px; color: var(--muted); }
.combo.invalid .combo-btn { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-bg); }

/* v4.2.1: empty trailer decided later */
.empty-line { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.tag-later { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.linkish { font: inherit; font-size: 13px; border: 0; background: none; color: var(--link); cursor: pointer; padding: 6px 4px; min-height: 32px; }
.linkish:hover { text-decoration: underline; }
.empty-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty-form[hidden] { display: none; }
.empty-form .combo { flex: 1; min-width: 220px; max-width: 340px; }
.drop-confirm { border-color: #7c3aed; }

/* v4.2.1: driver page - short history, all loads */
.hist-table { table-layout: fixed; min-width: 0; }
.hist-old[hidden] { display: none; }
.hist-more { display: flex; padding: 10px 16px; border-top: 1px solid var(--line); }
.pill-btn { border-radius: 999px; min-height: 40px; display: inline-flex; gap: 6px; align-items: center; }
.pill-btn .chev { transition: transform .2s; }
.pill-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.seg a { min-height: 38px; display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a.on { background: var(--navy); color: #fff; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.small { min-height: 36px; padding: 4px 12px; font-size: 13px; }
tr.month-row td { background: var(--row-hover); padding: 8px 12px; }

/* v4.2.5: overlapping loads on Week by driver */
.overlap-tag { margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #ffedd5; color: #9a3412; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .overlap-tag { background: #7c2d12; color: #ffedd5; } }

/* v4.2.5: drivers away */
.who-top { display: flex; align-items: center; gap: 4px; }
.dots { font: inherit; font-size: 16px; line-height: 1; min-width: 32px; min-height: 32px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.dots:hover { border-color: var(--line); color: var(--ink); background: var(--card); }
.lane .who { position: relative; }
.away-form { position: absolute; left: 8px; top: 44px; z-index: 30; width: 380px; background: var(--card); border: 1px solid #c7d2fe; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.16); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; font-weight: 400; }
.away-form[hidden] { display: none; }
.aw-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aw-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.away-form .aw-check { display: flex; flex-direction: row; gap: 8px; align-items: center; justify-content: flex-start; align-self: flex-start; font-size: 13.5px; text-align: left; margin: 0; }
.away-form .aw-check input { width: 18px; height: 18px; margin: 0; flex: none; }
.aw-reasons { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.aw-reasons > div { display: flex; gap: 6px; flex-wrap: wrap; }
.away-tag { font-size: 11.5px; font-weight: 700; color: var(--muted); border: 1px dashed #9ca3af; border-radius: 999px; padding: 1px 8px; align-self: flex-start; margin-top: 2px; }
.wait-strip.away-strip { border-color: #9ca3af; color: var(--muted); background: repeating-linear-gradient(135deg, #f9fafb 0 8px, #f3f4f6 8px 16px); }
@media (prefers-color-scheme: dark) { .wait-strip.away-strip { background: repeating-linear-gradient(135deg, #1c2330 0 8px, #222b3a 8px 16px); } }
.away-group { border-top: 1px solid var(--line); }
.away-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--row-hover); min-height: 44px; }
.away-group > summary::-webkit-details-marker { display: none; }
.away-group[open] > summary .chev { transform: rotate(90deg); }
.away-group .chev { transition: transform .2s; color: var(--muted); }
.away-lane { background: var(--row-hover); }
.away-block { grid-column: 2 / -1; margin: 8px 6px; padding: 8px 12px; border-radius: 8px; border: 1px dashed #9ca3af; color: var(--muted);
  background: repeating-linear-gradient(135deg, #f9fafb 0 8px, #f3f4f6 8px 16px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }
.away-block .btn:first-of-type { margin-left: auto; }
.away-block .away-form { left: auto; right: 8px; top: 46px; }
@media (prefers-color-scheme: dark) { .away-block { background: repeating-linear-gradient(135deg, #1c2330 0 8px, #222b3a 8px 16px); } }
.away-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; position: relative; }
.away-line .away-form { left: 0; top: 46px; }

/* v4.2.5: search pickers everywhere */
.picker-field { min-width: 260px; }
.pill-btn[disabled] { border-style: dashed; color: var(--muted); background: var(--bg); cursor: default; }
.combo.compact { min-width: 150px; }
.combo.compact .combo-btn { min-height: 36px; font-size: 13px; }
.field-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.combo.preloaded .combo-btn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); font-weight: 600; }

/* v4.2.5: calendar */
.cal-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin: 0 0 10px; }
.cal-drivers .chip { gap: 6px; }
.cal-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; display: inline-block; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head > div { background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600; padding: 8px 10px; }
.cal-day { font: inherit; color: var(--ink); text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 128px; min-width: 0; padding: 6px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); cursor: pointer; }
.cal-day:hover { background: var(--row-hover); }
.cal-day.past { background: var(--row-hover); }
.cal-day.out { opacity: .55; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--navy); background: #eef2ff; }
@media (prefers-color-scheme: dark) { .cal-day.sel { background: #1e2a4a; } }
.cal-day:focus-visible { outline: 2px solid #93c5fd; outline-offset: -2px; }
.cal-num-row { display: flex; justify-content: space-between; align-items: center; }
.cal-num { font-size: 13px; font-weight: 700; }
.cal-num.today { background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 8px; }
.cal-count { font-size: 11px; color: var(--muted); }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; min-width: 0; border: 1px solid var(--line); background: var(--card); }
.cal-ev.loaded { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }
.cal-ev.delivered { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.cal-ev.problem { border-color: #dc2626; box-shadow: inset 2px 0 0 #dc2626; }
@media (prefers-color-scheme: dark) { .cal-ev.loaded { background: #1e3a8a; color: #dbeafe; } .cal-ev.delivered { background: #064e3b; color: #a7f3d0; } }
.cal-ev-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11.5px; font-weight: 600; color: var(--link); padding-left: 4px; }
.cal-side { margin: 0; }

/* v4.2.6: clickable driver names in reports */
.name-link { color: inherit; text-decoration: none; }
.name-link:hover, .name-link:focus-visible { color: var(--link); text-decoration: underline; }

/* v4.3: Preloads tab */
.pre-bar { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; margin: 0 0 10px; }
.pre-scroll { overflow-x: auto; }
.pre-grid { display: grid; grid-template-columns: 200px repeat(7, minmax(130px, 1fr)); gap: 8px; min-width: 1150px; align-items: stretch; }
.pre-col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px; display: flex; flex-direction: column; gap: 7px; min-height: 220px; min-width: 0; }
.pre-col.yard { background: #fffbeb; border-color: #fde68a; }
.pre-col.today { box-shadow: inset 0 3px 0 var(--navy); }
.pre-col-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13px; }
.pre-col.yard .pre-col-h strong { color: #92400e; }
.pre-col-h .count { font-size: 11.5px; font-weight: 700; background: var(--bg); border-radius: 999px; padding: 0 7px; }
.pre-col-h .count.warn { background: #fde68a; color: #78350f; }
.pre-col-sub { font-size: 11.5px; color: var(--muted); margin-top: -5px; }
.pre-none { font-size: 12px; color: var(--muted); text-align: center; padding: 12px 0; margin: 0; }
.pre-card { font: inherit; color: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 7px 8px; border-radius: 8px;
            border: 1px solid var(--line); background: var(--card); cursor: pointer; min-width: 0; }
.pre-card:hover { border-color: #93c5fd; }
.pre-card.sel { border: 2px solid var(--navy); padding: 6px 7px; background: #eef2ff; }
.pre-card.hooked { opacity: .6; background: var(--row-hover); }
.pre-card:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.pre-top { display: flex; justify-content: space-between; align-items: center; gap: 2px 4px; flex-wrap: wrap; }
.pre-top .mono { font-size: 12px; white-space: nowrap; }
.pre-st { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: #374151; }
.pre-st.yard { background: #fef3c7; color: #92400e; }
.pre-st.hooked { background: #dbeafe; color: #1e40af; }
.pre-route { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pre-line { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-line.who { font-weight: 600; }
.pre-line.missing { color: #b45309; }
.pre-sub { font-size: 11px; color: var(--muted); }
.pre-panel { margin: 10px 0 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start;
             border-color: #c7d2fe; box-shadow: 0 6px 18px rgba(30,58,138,.08); }
@media (max-width: 1000px) { .pre-panel { grid-template-columns: 1fr; } }
.pp-info { display: flex; flex-direction: column; gap: 3px; }
.pp-title { font-size: 15px; }
.pp-links { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.pp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pp-label { font-size: 13px; font-weight: 600; }
.pp-seg { align-self: flex-start; }
.pp-seg form { display: contents; }
.pp-seg button { font: inherit; min-height: 36px; padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.pp-seg button.on { background: var(--navy); color: #fff; }
.pp-seg button:disabled { opacity: .45; cursor: not-allowed; }
.pre-suggest { margin-top: 14px; }
.sug-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }

/* v4.3: trailers, last known location */
.tp { margin-top: 18px; padding: 0; overflow: hidden; }
.tp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tp-head h2 { margin: 0; font-size: 17px; }
.tp-head .seg { margin-left: auto; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tp-col { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.tp-col-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; background: var(--row-hover); border-bottom: 1px solid var(--line); }
.tp-col.home .tp-col-h { box-shadow: inset 3px 0 0 #059669; }
.tp-col.shipper .tp-col-h { box-shadow: inset 3px 0 0 #d97706; }
.tp-col.road .tp-col-h { box-shadow: inset 3px 0 0 var(--navy); }
.tp-hint { margin: 8px 14px 0; }
.tp-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.tp-row:last-child { border-bottom: 0; }
.tp-num { font-size: 13.5px; }
.tp-mid { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.tp-how { font-size: 12px; color: var(--muted); }
.tp-how a { color: inherit; }
.tp-how a:hover { color: var(--link); }
.tp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tp-st { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: #374151; white-space: nowrap; }
.tp-st.loaded { background: #dbeafe; color: #1e40af; }
.tp-st.in-shop, .tp-st.out-of-service { background: var(--bad-bg); color: var(--bad); }
.tp-age { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tp-age.old { color: #c2410c; font-weight: 700; }
.tp-foot { margin: 0; padding: 10px 16px; }
.loc-form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 10px; border: 1px solid #c7d2fe; border-radius: 8px; background: var(--row-hover); }
.loc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.loc-form input { font: inherit; font-weight: 400; min-height: 34px; }
.loc-form .loc-note { flex: 1 1 160px; }
.loc-form .pc-actions { display: flex; gap: 6px; margin-left: auto; }
@media (prefers-color-scheme: dark) {
  .pre-col.yard { background: #2a2108; border-color: #5b4513; }
  .pre-card.sel { background: #1e2a4a; }
  .pre-st, .tp-st { color: var(--ink); }
  .pre-st.yard { background: #3a2c0b; color: #fcd34d; } .pre-st.hooked, .tp-st.loaded { background: #1e3a8a; color: #dbeafe; }
}
.yard-row { display: grid !important; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) 60px 150px; gap: 8px; align-items: end; margin-bottom: 8px; }
.yard-row label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.yard-row label input { width: 100% !important; }
.yard-row .yard-btns { display: flex; gap: 6px; }
.yard-row > .tag { align-self: center; margin-bottom: 8px; }
.yard-row.add { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) 60px 150px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }

/* v4.4: ELD settings */
.eld-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .eld-grid { grid-template-columns: 1fr; } }
.eld-cards { display: flex; flex-direction: column; gap: 12px; }
.eld-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.eld-card.add { border-style: dashed; }
.eld-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eld-name { font-size: 15px; }
.bad-tag { background: var(--bad-bg); color: var(--bad); }
.eld-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.eld-fields > div { display: flex; flex-direction: column; gap: 4px; }
.eld-fields .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.eld-fields .masked { min-height: 34px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--row-hover); }
.eld-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.eld-actions form { display: inline; }
.eld-remove summary { list-style: none; cursor: pointer; display: inline-flex; }
.eld-remove summary::-webkit-details-marker { display: none; }
.eld-remove[open] { display: flex; gap: 8px; align-items: center; flex-basis: 100%; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.eld-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 10px; border: 1px solid #c7d2fe; border-radius: 8px; background: var(--row-hover); }
.eld-card.add .eld-form { border: 0; padding: 0; background: none; }
.eld-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; flex: 1 1 200px; }
.eld-form input { font: inherit; font-weight: 400; min-height: 36px; }
.eld-form .pc-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.eld-side h3 { margin: 0 0 8px; }
.eld-safe { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.eld-tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #e0f2fe; color: #075985; vertical-align: 1px; }
.eld-tag.sharp { background: #f3e8ff; color: #6b21a8; }
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 1000px) { .link-grid { grid-template-columns: 1fr; } }
.link-grid > div { min-width: 0; }
.link-grid > div + div { border-left: 1px solid var(--line); }
.link-grid select, .link-grid .combo-sel { max-width: 220px; }
tr.muted td { color: var(--muted); }

/* v4.4: Fleet -> Map */
.fm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .fm-grid { grid-template-columns: 1fr; } }
.fm-mapcard { position: sticky; top: 64px; }
#fleet-map { height: 560px; }
.fm-table td, .fm-table th { padding: 8px 10px; }
.fm-row { cursor: pointer; }
.fm-row:hover td { background: var(--row-hover); }
.fm-row.sel td { background: #eef2ff; }
.fm-row.stale td { color: var(--muted); }
.fm-st { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: #374151; }
.fm-st.move { background: #dbeafe; color: #1e40af; }
.fm-st.grey { color: var(--muted); }
.park-row td { border: 0 !important; }
.park-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 10px 12px; margin: 0 10px 10px; border: 1px solid #c7d2fe; border-radius: 8px; background: var(--row-hover); }
.park-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.park-form input { font: inherit; font-weight: 400; min-height: 34px; }
.park-form .pc-actions { display: flex; gap: 6px; margin-left: auto; }
.fm-parked { border-top: 1px solid var(--line); background: var(--row-hover); }
.fm-parked > summary { padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.fm-prow { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.fm-prow.off { opacity: .75; }
.fm-pin { background: none; border: 0; }
.fm-pin span { display: block; width: 14px; height: 14px; border-radius: 999px; background: #6b7280; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.4); }
.fm-pin.move span { background: #1d4ed8; }
.fm-pin.grey span, .fm-pin.park span { background: #9ca3af; }
.fm-pin b { position: absolute; left: 17px; top: -2px; font: 700 11.5px/1.2 ui-monospace, Menlo, monospace; color: #111827; background: rgba(255,255,255,.85); padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.fm-pin.sel span { transform: scale(1.35); box-shadow: 0 0 0 3px #fff, 0 0 0 5px #1e3a8a; }

/* v4.4: load page - from the ELD */
.eld-trip .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.eld-suggest { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fef9c3; border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; font-size: 13px; }
.eld-suggest .btn { margin-left: auto; }
.eld-visits { width: 100%; margin-top: 10px; font-size: 13px; }
.eld-visits th, .eld-visits td { padding: 6px 8px; }
.eld-states { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.ifta-q { display: flex; gap: 6px; flex-wrap: wrap; }
.ifta-total td { border-top: 2px solid var(--navy); background: var(--row-hover); }
@media (prefers-color-scheme: dark) {
  .fm-row.sel td { background: #1e2a4a; } .eld-suggest { background: #3a2c0b; }
  .fm-st.move { background: #1e3a8a; color: #dbeafe; } .eld-tag { background: #0c4a6e; color: #e0f2fe; } .eld-tag.sharp { background: #3b0764; color: #f3e8ff; }
}
.eld-setup { overflow-wrap: anywhere; }
.eld-setup code { white-space: normal; word-break: break-all; }
.eld-form input:disabled { background: var(--row-hover); color: var(--muted); cursor: not-allowed; border-style: dashed; }
.eld-form button:disabled { opacity: .45; cursor: not-allowed; }

/* v4.4.1: Fleet -> Map, full page */
body.fm-full-page { overflow-x: hidden; }
body.fm-full-page main { padding-bottom: 0; }
.fm-page { position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: calc(100vh - 168px); min-height: 480px;
           border-top: 1px solid var(--line); background: #e8edf3; }
.fm-page:fullscreen, .fm-page.fm-fake-full { position: fixed; inset: 0; width: 100vw; height: 100vh; margin: 0; z-index: 50; }
.fm-page #fleet-map { position: absolute; inset: 0; height: auto; }
.fm-top { position: absolute; left: 16px; right: 16px; top: 14px; z-index: 500; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
.fm-top > * { pointer-events: auto; }
.fm-gap { flex: 1; pointer-events: none !important; }
.fm-search { position: relative; width: min(420px, 40vw); }
.fm-search input { width: 100%; font: inherit; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #d1d5db; background: #fff; color: #111827;
                   box-shadow: 0 4px 14px rgba(0,0,0,.12); box-sizing: border-box; }
.fm-results { position: absolute; left: 0; right: 0; top: 50px; background: #fff; color: #111827; border: 1px solid #d1d5db; border-radius: 10px;
              box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; max-height: 60vh; overflow-y: auto; }
.fm-res { width: 100%; font: inherit; text-align: left; display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; align-items: center;
          padding: 9px 12px; border: 0; border-top: 1px solid #f1f5f9; background: #fff; color: inherit; cursor: pointer; }
.fm-res:hover, .fm-res:focus-visible { background: #eef2ff; }
.fm-res > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.fm-res .d { font-weight: 600; }
.fm-filters { display: inline-flex; gap: 3px; padding: 3px; background: #fff; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.fm-filters button { font: inherit; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
                     background: transparent; color: #4b5563; }
.fm-filters button span { font-weight: 500; opacity: .75; margin-left: 2px; }
.fm-filters button.on { background: #1e3a8a; color: #fff; }
.fm-btn { font: inherit; font-weight: 600; min-height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid #d1d5db; background: #fff; color: #111827;
          box-shadow: 0 4px 14px rgba(0,0,0,.12); cursor: pointer; white-space: nowrap; }
.fm-card { position: absolute; left: 16px; bottom: 16px; z-index: 500; width: min(400px, calc(100vw - 32px)); background: #fff; color: #111827; border-radius: 12px;
           box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.fm-card[hidden] { display: none; }
.fm-card-top { display: flex; align-items: center; gap: 8px; }
.fm-c-unit { font-size: 18px; }
.fm-x { margin-left: auto; font: inherit; border: 0; background: none; font-size: 20px; color: #6b7280; cursor: pointer; line-height: 1; }
.fm-c-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; }
.fm-c-grid small { display: block; font-size: 11.5px; color: #6b7280; }
.fm-c-grid b { font-weight: 600; }
.fm-c-load { font-size: 13px; background: #f9fafb; border-radius: 8px; padding: 8px 10px; }
.fm-c-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fm-park { margin: 0; }
.fm-list { position: absolute; right: 16px; top: 68px; bottom: 16px; z-index: 500; width: min(440px, calc(100vw - 32px)); background: #fff; color: #111827;
           border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden; }
.fm-list[hidden] { display: none; }
.fm-list-head { padding: 10px 14px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fm-list-body { overflow-y: auto; flex: 1; }
.fm-item { width: 100%; font: inherit; color: inherit; text-align: left; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center;
           padding: 9px 14px; border: 0; border-bottom: 1px solid #f1f5f9; background: #fff; cursor: pointer; }
.fm-item[hidden] { display: none; }
.fm-item:hover { background: #f9fafb; }
.fm-item.sel { background: #eef2ff; }
.fm-item[data-tone="grey"], .fm-item.parked, .fm-item.off { color: #6b7280; }
.fm-item-mid { display: flex; flex-direction: column; min-width: 0; }
.fm-item-drv { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-list-sep { padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: #6b7280; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.fm-pin.off span { background: #d1d5db; }
@media (max-width: 760px) { .fm-filters { display: none; } .fm-search { width: auto; flex: 1; } }
.fm-page .leaflet-top.leaflet-left { top: 66px; }

/* v4.4.2: load page - Leaflet map with the live truck, ETAs */
.kpis-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis-2x2 .kpi strong { font-size: 20px; }
.lm-wrap { position: relative; }
.lm-wrap #map { border-radius: 0; height: 460px; }
.lm-box { position: absolute; top: 10px; left: 54px; z-index: 500; background: var(--card); color: var(--ink);
          border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.lm-tools { position: absolute; top: 10px; right: 10px; z-index: 500; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lm-tools .btn { box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.lm-wrap.full { position: fixed; inset: 0; z-index: 2000; background: var(--bg); }
.lm-wrap.full #map { height: 100vh; }
body.lm-noscroll { overflow: hidden; }
.lm-truck { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
            background: #15803d; color: #fff; font-size: 11px; font-weight: 700; border: 3px solid #fff;
            box-shadow: 0 0 0 4px rgba(21,128,61,.25), 0 1px 5px rgba(0,0,0,.4); }
.lm-truck.stopped { background: #b45309; box-shadow: 0 0 0 4px rgba(180,83,9,.25), 0 1px 5px rgba(0,0,0,.4); }
.eld-now { margin: 8px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.eld-now.stale { color: var(--muted); }
.eld-now .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; background: #9ca3af; }
.eld-now .dot.moving { background: #16a34a; } .eld-now .dot.stopped { background: #d97706; }
.eta-table tr.done td { color: var(--muted); }
.vs { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.vs.ok { background: var(--ok-bg); color: var(--ok); }
.vs.early { background: rgba(37,99,235,.12); color: var(--link); }
.vs.late { background: var(--bad-bg); color: var(--bad); }
.eta-badge { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px;
             background: var(--row-hover); border: 1px solid var(--line); color: var(--ink); }
.eta-badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.eta-badge.early { background: rgba(37,99,235,.12); color: var(--link); border-color: transparent; }
.eta-badge.late { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.eta-badge.done { color: var(--muted); }
.eta-badge.here { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.table-scroll { overflow-x: auto; }
.eta-form label { min-width: 0; }
.unit-in { display: flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .lm-wrap #map { height: 340px; } .lm-box { top: auto; bottom: 26px; left: 10px; } }
.grid-detail > .detail-left, .grid-detail > .detail-right { min-width: 0; }
@media (max-width: 760px) { .eta-table td.nowrap { white-space: normal; } }

/* v4.3.2: ETA from the ELD on Today rows */
details.ev .eta-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; }
.eta-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; max-width: 100%; line-height: 1.45; background: var(--row-hover); color: var(--ink); border: 1px solid var(--line); }
.eta-pill:hover { text-decoration: none; filter: brightness(.97); }
.eta-pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.eta-pill.early { background: rgba(37,99,235,.12); color: var(--link); border-color: transparent; }
.eta-pill.late { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.eta-pill.here { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.eta-pill.none { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; padding-left: 0; }
.eta-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
details.ev.eta-late:not(.problem) > summary { background: rgba(220, 38, 38, .05); }
@media (max-width: 760px) { details.ev .eta-cell { grid-column: 1 / -1; flex-direction: row; gap: 8px; align-items: center; } }

/* v4.3.3: hours of service (Sharp) */
.hos-mini { display: block; font-size: 11.5px; font-weight: 600; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hos-mini.low, .hos-mini.break { color: var(--warn); }
.hos-mini.out { color: var(--bad); }
.hos-line { font-size: 13px; }
.hos-line.low, .hos-line.break { color: var(--warn); }
.hos-line.out { color: var(--bad); }
.hos-line.old { color: var(--muted); }
.hos-box { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; margin-top: 10px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid #16a34a; border-radius: 10px; }
.hos-box.low, .hos-box.break { border-left-color: #d97706; } .hos-box.out { border-left-color: #dc2626; } .hos-box.old { border-left-color: var(--line); }
.hos-box > span { display: flex; flex-direction: column; gap: 1px; }
.hos-box small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.hos-box b { font-size: 18px; font-variant-numeric: tabular-nums; }
.hos-box .low b { color: var(--warn); }
.hos-box .hos-st { min-width: 160px; }
.fm-c-hos { font-size: 13px; }

/* v4.3.4: truck (GPS) vs driver's log (Sharp), warnings, pin labels */
.fm-line { font-size: 12.5px; color: var(--ink); }
.fm-line b, .hos-mini b.lbl { color: var(--muted); font-weight: 600; margin-right: 2px; }
.fm-st-t.move { color: #1d4ed8; font-weight: 600; } .fm-st-t.grey { color: var(--muted); }
.hos-warn { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 7px;
  background: var(--warn-bg); color: var(--warn); }
.hos-warn.red { background: var(--bad-bg); color: var(--bad); }
.hos-warn-in { color: var(--warn); } .hos-warn-in.red { color: var(--bad); }
.hos-mini { white-space: normal; }
.fm-c-log { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.fm-c-log-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.fm-c-log-st { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.fm-c-dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; display: inline-block; }
.fm-c-dot.driving { background: #16a34a; } .fm-c-dot.on-duty { background: #2563eb; } .fm-c-dot.sleeper { background: #7c3aed; }
.fm-c-clocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fm-c-clocks span { display: flex; flex-direction: column; } .fm-c-clocks small { font-size: 11px; color: var(--muted); }
.fm-c-clocks b { font-variant-numeric: tabular-nums; }
.fm-c-log.low .fm-c-hd, .fm-c-log.break .fm-c-hb { color: var(--warn); } .fm-c-log.out .fm-c-hd { color: var(--bad); }
.fm-pins { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border-radius: 999px; padding: 3px 3px 3px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: 12.5px; }
.fm-pins > span { font-weight: 600; color: var(--muted); margin-right: 4px; }
.fm-pins button { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 10px; cursor: pointer; min-height: 30px; }
.fm-pins button.on { background: var(--navy); color: #fff; }
.fm-pin b.nm { font-family: inherit; font-size: 12px; }
.hos-box .hos-st small { font-size: 11px; }
.hos-box .hos-warn { align-self: center; }
.fm-line.hos-mini { color: var(--ok); } .fm-line.hos-mini.low, .fm-line.hos-mini.break { color: var(--warn); } .fm-line.hos-mini.out { color: var(--bad); }

/* v4.3.5: shipper list */
.sl-pick { align-items: flex-end; margin-bottom: 14px; }
.sl-days a { white-space: nowrap; }
.sl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sl-table th { text-align: left; }
.sl-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sl-n { color: var(--muted); font-weight: 600; width: 28px; }
.sl-load a { font-weight: 600; }
.sl-drv { font-weight: 600; }
.sl-in { width: 100%; min-width: 90px; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; background: var(--card); }
.sl-ref { min-width: 120px; }
.sl-ref.saved { border-color: #16a34a; }
.sl-pe { max-width: 140px; font-weight: 700; }
.sl-pe.pre { color: #a16207; background: var(--warn-bg); }
.sl-pe.eta { color: var(--ok); } .sl-pe.late { color: var(--bad); } .sl-pe.yard { color: var(--warn); } .sl-pe.after { color: var(--link); }
.sl-pe.done { color: var(--muted); }
.sl-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.sl-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.sl-print-title { display: none; }
@media print {
  header, nav, .sl-noprint, .flash { display: none !important; }
  body { background: #fff; }
  .sl-card { border: 0; box-shadow: none; padding: 0; }
  .sl-print-title { display: block; font-size: 16px; margin: 0 0 8px; }
  .sl-in { border: 0; padding: 0; background: none !important; font-weight: 400; color: #000 !important; }
  .sl-sub { display: none; }
  .sl-table td, .sl-table th { border: 1px solid #999; padding: 4px 6px; font-size: 12px; }
}

/* ===================================================================== v4.4.0: TEST bar, BOLs, send to driver */
.test-bar { background: #b91c1c; color: #fff; text-align: center; font-size: 13px; padding: 5px 12px; }
.test-bar strong { letter-spacing: .12em; margin-right: 4px; }
.test-bar ~ .topbar { box-shadow: inset 0 -4px 0 #ef4444; }   /* the TEST copy keeps a red line under the menu */
[data-bol-pill][hidden] { display: none !important; }
.btn.ok { background: #047857; border-color: #047857; color: #fff; }
.btn.ok:hover { background: #065f46; }
.btn.ok[disabled] { opacity: .45; cursor: not-allowed; }
.btn.danger-outline { border-color: var(--bad); color: var(--bad); background: transparent; }
.bol-tools { display: flex; gap: 10px; align-items: center; }
.bol-tools label.check, .send-form label.check { display: flex; flex-direction: row; gap: 8px; align-items: baseline; font-weight: 500; color: var(--ink); }
.bol-tools label.check input, .send-form label.check input { width: auto; min-height: 0; margin: 0; }
.bol-tabs { margin: 0 0 12px; }
.bol-tabs .n { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 7px; margin-left: 6px; background: var(--bg); color: var(--muted); }
.bol-tabs a.on .n { background: #fff; color: var(--navy); }
.bol-list { padding: 0; overflow: hidden; }
.bol-list > p { padding: 14px 16px; }
.bol-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px;
           border-top: 1px solid var(--line); }
.bol-row:first-child { border-top: 0; }
.bol-row:target { background: #eef2ff; }
.bol-row.accepted, .bol-row.rejected { background: var(--row-hover); }
.bol-thumb { position: relative; width: 58px; height: 74px; display: block; }
.bol-thumb .pg { position: absolute; inset: 0; border: 1px solid #c7cdd6; border-radius: 6px;
                 background: repeating-linear-gradient(#fff 0 8px, #eef0f3 8px 10px); }
.bol-thumb .pg.two { transform: translate(5px, -5px); z-index: -1; }
.bol-thumb small { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.bol-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bol-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 15px; }
.bol-src { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #f3f4f6; color: #374151; }
.bol-src.telegram { background: #e0f2fe; color: #075985; }
.bol-src.email { background: #f3e8ff; color: #6b21a8; }
.bol-pick { margin-top: 6px; gap: 8px; }
.bol-pick select, .bol-pick .combo-sel { max-width: 360px; }
.bol-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bol-reject { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px;
              background: var(--bad-bg); border: 1px solid #fecaca; }
.bol-reject .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bol-reject .chip { min-height: 34px; padding: 4px 12px; font-size: 13px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.bol-reject .chip:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.bol-reject .chip input { position: absolute; opacity: 0; pointer-events: none; }
.bol-reject label.small { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.bol-reject .btn.danger { margin-top: 0; }
table.tight { width: 100%; border-collapse: collapse; }
table.tight th, table.tight td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); }
table.tight th { font-size: 12px; color: var(--muted); border-top: 0; }

.bol-send-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.bol-send-row > .card { margin: 0; }
.section-title { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.bol-stop { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bol-stop-name { min-width: 160px; font-weight: 600; }
.bol-stop-files { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.bol-chip { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--ink); }
.bol-chip.accepted { background: var(--ok-bg); color: var(--ok); }
.bol-chip.rejected { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.bol-chip.review, .bol-chip.asking { background: var(--warn-bg); color: var(--warn); }
.bol-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.bol-drop { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; border: 2px dashed #93c5fd; border-radius: 10px;
            padding: 10px 12px; background: #eff6ff; cursor: pointer; }
.bol-drop input { font-size: 13px; max-width: 100%; }
@media (prefers-color-scheme: dark) { .bol-drop { background: #13213a; border-color: #2c4a7a; } .bol-row:target { background: #1b2340; } }
.send-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 6px; }
.send-form .btn { margin-top: 4px; }
.warnline { color: var(--bad); margin: 6px 0 0; }
.msg-log { list-style: none; padding: 0; margin: 10px 0 0; border-top: 1px solid var(--line); }
.msg-log li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.msg-log li.bad { color: var(--bad); }
.tg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tg-grid p { margin: 4px 0 8px; }
.copy-line { display: flex; gap: 6px; margin-bottom: 6px; }
.copy-line input { flex: 1; min-width: 0; }
.bol-alert strong span { font: inherit; }
@media (max-width: 900px) {
  .bol-send-row, .tg-grid { grid-template-columns: 1fr; }
  .bol-row { grid-template-columns: auto minmax(0, 1fr); }
  .bol-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ===================================================================== v4.5.0: factoring + settlements */
.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
body.compact .hint { display: none !important; }
.fact-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; padding: 10px 14px; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav select, .week-nav .combo-sel { min-width: 300px; }
.small-seg a { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.fact-filters { gap: 8px; }
.fact-filters { flex-wrap: nowrap; }
.fact-filters select, .fact-filters .combo-sel { width: 190px; }
.fact-filters input[type=search] { width: 190px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi-row .kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.kpi-row .kpi span { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kpi-row .kpi strong { font-size: 20px; }
.kpi-row .kpi small { color: var(--muted); }
.kpi-row .kpi.ok strong, .kpi-row .kpi.ok span { color: var(--ok); }
.kpi-row .kpi.warn strong, .kpi-row .kpi.warn span { color: var(--warn); }
.kpi-row .kpi.bad strong, .kpi-row .kpi.bad span { color: var(--bad); }
a.kpi:hover { text-decoration: none; border-color: var(--navy); }
.fact-table-card { padding: 0; overflow: hidden; }
.fact-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--row-hover); }
.fact-actions label.check, .pay-form label.check { flex-direction: row; align-items: center; gap: 6px; }
.move-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #eef2ff; border-bottom: 1px solid #c7d2fe; }
@media (prefers-color-scheme: dark) { .move-box { background: #1b2340; border-color: #2c3a6b; } }
table.fact-table, table.sheet-table { width: 100%; border-collapse: collapse; }
.fact-table th, .fact-table td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.fact-table thead th { border-top: 0; }
.fact-table tr.sel td { background: #eef2ff; }
.fact-table tr.done td { color: var(--muted); }
.fact-table tr.done td a { color: inherit; }
.fact-table tfoot td { font-weight: 700; }
.r { text-align: right !important; }
.nowrap { white-space: nowrap; }
.tag.purple { background: #f3e8ff; color: #6b21a8; }
.tag.big-tag { font-size: 13px; padding: 5px 10px; }

.settle-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.settle-list { padding: 0; overflow: hidden; position: sticky; top: 12px; }
.settle-list .week-nav { justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.settle-list .week-nav .wk { flex: 1; }
.settle-list .wk { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 13px; }
.settle-list .this-week { display: block; text-align: center; padding: 4px 0 6px; }
.settle-drv { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--ink); }
.settle-drv span:first-child { display: flex; flex-direction: column; }
.settle-drv small { color: var(--muted); }
.settle-drv:hover { background: var(--row-hover); text-decoration: none; }
.settle-drv.on { background: #eef2ff; box-shadow: inset 3px 0 0 var(--navy); }
.settle-drv.empty { opacity: .6; }
@media (prefers-color-scheme: dark) { .settle-drv.on { background: #1b2340; } }
.settle-sum { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); }
.settle-sheet { display: flex; flex-direction: column; gap: 10px; }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.sheet-btns { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sheet-h { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.sheet-table th, .sheet-table td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: left; }
.sheet-table thead th { border-top: 0; font-size: 12px; }
.sheet-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.sheet-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.add-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.add-row input, .add-row select, .add-row .combo-sel { flex: 1 1 90px; min-width: 0; width: auto; }
.add-row input { min-height: 34px; }
.add-row input[type=date] { flex: 1 1 135px; }
.add-row input[name=reason] { flex: 2 1 150px; }
.add-row .btn { flex: none; }
.sheet-two > div { min-width: 0; }
.add-line summary, .amt-edit summary { cursor: pointer; color: var(--link); font-size: 13px; }
.amt-edit summary { color: inherit; text-decoration: underline dotted; list-style: none; }
.amt-edit[open] { background: var(--row-hover); padding: 6px; border-radius: 8px; }
.add-line form { margin-top: 8px; }
.sheet-totals { display: grid; grid-template-columns: 1fr 150px; gap: 6px 14px; max-width: 560px; margin-left: auto; border-top: 2px solid var(--line); padding-top: 10px; font-size: 14px; }
.sheet-totals .strong { font-weight: 700; }
.sheet-totals .check { font-weight: 800; font-size: 17px; border-top: 1px solid var(--line); padding-top: 8px; }
.escrow-form { display: inline-flex; gap: 4px; margin-left: 8px; }
.escrow-form input { min-height: 30px; padding: 2px 6px; }
.ytd summary { cursor: pointer; font-weight: 600; }
.ytd .kv { margin-top: 8px; max-width: 420px; }
@media (max-width: 1000px) {
  .settle-grid, .sheet-two { grid-template-columns: 1fr; }
  .settle-list { position: static; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .week-nav select, .week-nav .combo-sel { min-width: 0; max-width: 220px; }
}
@media print {
  .no-print, .topbar, .sidenav, .mainnav, .test-bar, .flash, .toasts { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .settle-grid { display: block; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .sheet-two { grid-template-columns: 1fr 1fr; }
  a { color: inherit; }
}

/* ===================================================================== v4.5.0: new look — slim top bar, left menu */
.topbar { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); height: 52px; gap: 14px; padding: 0 14px; }
.topbar a { color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink) !important; font-size: 15px; min-width: 190px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center;
               font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.gsearch { display: flex; align-items: center; gap: 8px; border: 1px solid #c7cdd6; border-radius: 10px; padding: 0 10px;
           width: min(460px, 100%); background: var(--card); color: var(--muted); }
.gsearch:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 138, .15); }
.gsearch .ico { width: 16px; height: 16px; flex: none; }
.gsearch input { border: 0; outline: 0; background: transparent; min-height: 36px; padding: 0; flex: 1; font: inherit; color: var(--ink); box-shadow: none; }
.gsearch kbd, kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--muted); }
.topbar .live-dot { margin-left: auto; }
.shell { display: grid; grid-template-columns: 64px minmax(0, 1fr); min-height: calc(100vh - 52px); }
html.side-open .shell { grid-template-columns: 212px minmax(0, 1fr); }
.sidenav { position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; background: var(--card); border-right: 1px solid var(--line);
           display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.sidenav a { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
             color: #374151; font-weight: 500; white-space: nowrap; }
.sidenav a .ico { width: 20px; height: 20px; flex: none; }
.sidenav a:hover { background: var(--bg); text-decoration: none; }
.sidenav a.on { background: #e0e7ff; color: var(--navy); font-weight: 600; }
.sidenav .lbl { display: none; }
.sidenav .pill { position: absolute; top: 1px; right: 1px; font-size: 10px; padding: 0 5px; line-height: 16px; }
.sidenav .sep { display: block; height: 1px; background: var(--line); margin: 7px 6px; font-size: 0; }
.sidenav .sep:first-child { display: none; }
.sidenav .grow { flex: 1; }
.side-toggle { margin-top: 6px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); padding: 8px 0 2px; cursor: pointer; font: inherit; font-size: 13px; }
.side-toggle .when-open { display: none; }
html.side-open .side-toggle .when-open { display: inline; }
html.side-open .side-toggle .when-closed { display: none; }
html.side-open .sidenav a { justify-content: flex-start; }
html.side-open .sidenav .lbl { display: inline; }
html.side-open .sidenav .pill { position: static; margin-left: auto; font-size: 11px; padding: 0 7px; }
html.side-open .sidenav .sep { height: auto; background: none; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
                               color: #9ca3af; margin: 10px 10px 2px; }
html.side-open .sidenav .sep:first-child { display: block; margin-top: 2px; }
.mainnav { display: none; }
main { max-width: 1480px; width: 100%; padding: 16px 22px 60px; }
@media (prefers-color-scheme: dark) {
  .sidenav a { color: #cbd5e1; }
  .sidenav a.on { background: #1e2a4f; color: #c7d2fe; }
  .gsearch { border-color: var(--line); }
}
@media (max-width: 760px) {
  .topbar { height: 50px; gap: 10px; padding: 0 10px; }
  .brand { min-width: 0; } .brand .brand-name { display: none; }
  .gsearch kbd { display: none; }
  .shell { display: block; min-height: 0; }
  .sidenav { display: none; }
  .mainnav { display: flex; }
  main { padding: 12px 12px 90px; }
}

/* v4.5.0: Today, lighter — one "Needs attention" bar, Show menu, one-line rows (Compact) */
.attn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
        border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.attn-h { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.attn-chip { display: inline-flex; flex-direction: column; padding: 4px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.3;
             background: var(--bg); color: var(--ink); max-width: 360px; }
.attn-chip:hover { text-decoration: none; filter: brightness(.97); }
.attn-chip strong { font-weight: 700; }
.attn-chip .attn-sub { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.compact .attn-chip .attn-sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.compact .attn-chip { border-radius: 999px; }
.attn-chip.red { background: #fee2e2; color: #991b1b; }
.attn-chip.orange { background: #ffedd5; color: #9a3412; }
.attn-chip.amber { background: #fef3c7; color: #92400e; }
.attn-chip.blue { background: #dbeafe; color: #1e40af; }
.attn-chip.calm { background: var(--ok-bg); color: var(--ok); }
@media (prefers-color-scheme: dark) {
  .attn-chip.red { background: #3b1515; color: #fca5a5; } .attn-chip.orange { background: #3a210f; color: #fdba74; }
  .attn-chip.amber { background: #3a2c0b; color: #fcd34d; } .attn-chip.blue { background: #172554; color: #93c5fd; }
}
.show-menu { margin-left: auto; position: relative; }
.show-menu summary { list-style: none; cursor: pointer; border: 1px solid #c7cdd6; border-radius: 8px; padding: 6px 10px; font-size: 13px; background: var(--card); }
.show-menu summary::-webkit-details-marker { display: none; }
.show-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line);
            border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 6px; min-width: 240px; display: flex; flex-direction: column; }
.show-pop a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.show-pop a:hover { background: var(--bg); text-decoration: none; }
.show-pop a.on { font-weight: 700; color: var(--navy); }
.show-pop .tick { width: 14px; color: var(--navy); }
.show-pop .n { margin-left: auto; font-size: 12px; color: var(--muted); }
.show-pop .hint { padding: 6px 10px 2px; }
body.compact details.ev .eta-cell .eta-sub, body.compact details.ev .eta-cell .hos-mini { display: none; }
.row-warn { display: none; font-weight: 700; color: #b45309; margin-left: 4px; }
.row-warn.red { color: var(--bad); }
body.compact .row-warn { display: inline; }
.ev-eld { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
@media (max-width: 760px) { .show-menu { margin-left: 0; } .attn-chip { max-width: 100%; } }

/* v4.5.0: load page, lighter — status in the header, ⋯ More, ELD details folded */
.head-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.head-steps { margin: 0; }
.head-meta { margin: -6px 0 12px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.head-meta:empty { display: none; }
.btn.ok-outline { border-color: #16a34a; background: var(--ok-bg); color: var(--ok); }
.btn.warn-outline { border-color: #b45309; border-style: dashed; background: var(--warn-bg); color: var(--warn); }
.more-menu { position: relative; }
.more-menu summary { list-style: none; cursor: pointer; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
            box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 6px; min-width: 250px; display: flex; flex-direction: column; }
.more-pop form { margin: 0; display: block; }
.more-pop button, .more-pop a { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px;
                                font: inherit; color: var(--ink); cursor: pointer; }
.more-pop button:hover, .more-pop a:hover { background: var(--bg); text-decoration: none; }
.eld-more { margin-top: 8px; }
.eld-more > summary { cursor: pointer; color: var(--link); font-size: 13px; font-weight: 600; }
.avg-line { font-size: 13.5px; }

/* v4.5.0: Fleet list, lighter — 2 lines per truck in Compact */
.fm-l1, .fm-l2 { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fm-warn-ico { display: none; font-weight: 700; color: #b45309; }
.fm-warn-ico.red { color: var(--bad); }
body.compact .fm-l1 { flex-direction: row; align-items: baseline; gap: 6px; }
body.compact .fm-l1 .fm-place { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.compact .fm-l2 { flex-direction: row; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
body.compact .fm-l2 .fm-line + .fm-line::before { content: "·"; color: #9ca3af; margin-right: 6px; }
body.compact .fm-l2 .fm-line b { display: none; }
body.compact .fm-item-mid > .hos-warn { display: none; }
body.compact .fm-warn-ico { display: inline; }

/* v4.5.0 fixes: the full-width fleet map stays right of the left menu; no sideways scroll on phones */
@media (min-width: 761px) {
  .fm-page:not(:fullscreen):not(.fm-fake-full) { width: auto; margin-left: -22px; margin-right: -22px; }
}
@media (max-width: 760px) {
  .fm-page:not(:fullscreen):not(.fm-fake-full) { width: auto; margin-left: -12px; margin-right: -12px; }
  .page-head { flex-wrap: wrap; }
  .fact-bar > * { max-width: 100%; }
  .small-seg { overflow-x: auto; max-width: 100%; }
  .fact-filters { flex-wrap: wrap; }
  .fact-filters select, .fact-filters input[type=search], .fact-filters .combo-sel { width: 100%; }
  .week-nav select, .week-nav .combo-sel { max-width: 230px; }
  .fact-actions .btn { font-size: 12.5px; }
}
.fm-top button, .fm-top a { white-space: nowrap; }
.sheet-two .sheet-table th, .sheet-two .sheet-table td { padding: 6px 5px; }

/* v4.5.1: the app name opens / closes the menu (names on a computer, a drawer on a phone); fleet tabs only on phones */
button.brand { border: 0; background: transparent; padding: 4px 8px 4px 0; cursor: pointer; font: inherit; font-weight: 700; border-radius: 8px; }
button.brand:hover .brand-name { color: var(--navy); }
.brand-caret { font-size: 14px; color: var(--muted); font-weight: 400; }
.side-backdrop { display: none; }
@media (min-width: 761px) { .fleet-tabs { display: none; } }
@media (max-width: 760px) {
  .brand .brand-name { display: inline; font-size: 15px; }
  .gsearch { flex: 1; min-width: 0; }
  html.side-drawer .sidenav { display: flex; position: fixed; top: 0; left: 0; bottom: 0; height: 100%; width: 250px; z-index: 60;
                              box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  html.side-drawer .sidenav a { justify-content: flex-start; }
  html.side-drawer .sidenav .lbl { display: inline; }
  html.side-drawer .sidenav .pill { position: static; margin-left: auto; font-size: 11px; padding: 0 7px; }
  html.side-drawer .sidenav .sep { height: auto; background: none; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
                                   text-transform: uppercase; color: #9ca3af; margin: 10px 10px 2px; }
  html.side-drawer .sidenav .sep:first-child { display: block; }
  html.side-drawer .side-toggle { display: none; }
  html.side-drawer .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 55; }
}
@media (max-width: 420px) { .brand .brand-name { display: none; } }
/* v4.5.1: load page — driver and trailer in one lane */
.assign-lane { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 14px; }
.lane-part { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lane-part + .lane-part { border-left: 1px solid var(--line); padding-left: 18px; }
.lane-h { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lane-now { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.lane-form { gap: 8px; align-items: center; flex-wrap: nowrap; }
.lane-form .combo { flex: 1; min-width: 0; }
@media (max-width: 760px) { .assign-lane { grid-template-columns: 1fr; } .lane-part + .lane-part { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } }
/* v4.5.1: trailers — who had it on a day, history, give to a driver from a past date */
.trl-day { margin-bottom: 12px; padding: 10px 14px; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.trl-table td { vertical-align: top; }
.trl-sub > td { background: var(--row-hover); padding: 12px 16px !important; }
.trl-hist { max-width: 760px; background: var(--card); }
.trl-hist tr.on-day td { background: #eef2ff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .trl-hist tr.on-day td { background: #1b2340; } }
/* v4.5.1: change connections in Settings */
.set-btns { display: flex; gap: 6px; justify-content: flex-end; }
.conn-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin: 0 0 8px; background: var(--row-hover);
             border: 1px solid var(--line); border-radius: 10px; }
.cf-field { display: flex; flex-direction: column; gap: 4px; }
.cf-field > label:first-child { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cf-field label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.cf-env { font-size: 13px; }
.cf-actions { display: flex; gap: 8px; }
.conn-form .hint { display: block !important; }
.report-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- v4.5.2: Telegram drivers, BOL copies, SMS */
.tgd .section-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tgd-switches { align-items: center; gap: 14px; padding: 8px 0 4px; border-bottom: 1px solid var(--line); }
.tgd-switches .check { flex-direction: row; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); }
.tgd-h { margin: 14px 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tgd-h.warn { color: #b45309; }
.tgd-h .count { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.tgd-wait { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fffbeb; border: 1px solid #fde68a;
            border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.tgd-acts { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tgd-acts .inline-form { gap: 6px; align-items: center; }
.tgd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tgd-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tgd-row .btn { margin-left: auto; }
@media (max-width: 760px) { .tgd-two { grid-template-columns: 1fr; } .tgd-acts { margin-left: 0; } }
.bdrive-steps { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.okline { color: #166534; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; }
.drv-tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; }
.drv-tag.copied { background: #dcfce7; color: #166534; }
.drv-tag.waiting { background: #f3f4f6; color: #4b5563; }
.drv-tag.failing { background: #fee2e2; color: #b91c1c; }
.drv-tag.still { background: #fef3c7; color: #92400e; }
.btn.tiny { padding: 1px 7px; font-size: 11.5px; margin-left: 4px; }
.tgd .section-title, .bdrive .section-title { justify-content: flex-start; }
.tgd .section-title > .small { margin-left: auto; }
.bdrive .section-title > .st { margin-left: 4px; }
.tgd-acts .inline-form { flex-wrap: nowrap; }
.tgd-acts select, .tgd-acts .combo-sel { width: auto; max-width: 220px; }
/* v4.5.3: BOL received without a file */
.bol-chip.manual { cursor: default; }
.bol-thumb.manual { cursor: default; opacity: .75; }
.bol-rcv { margin: 4px 0 8px; gap: 6px; align-items: center; flex-wrap: wrap; }
.bol-rcv input[name=note] { min-width: 240px; }

/* ---------------------------------------------------------------- v4.5.3: search suggestions */
.gsearch { position: relative; }
.gs-pop { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 70; background: var(--card); color: var(--ink);
          border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); padding: 6px;
          max-height: min(70vh, 520px); overflow-y: auto; transform-origin: top center; }
.gs-pop.gs-busy::after { content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: 2px; border-radius: 2px;
                         background: linear-gradient(90deg, transparent, var(--navy), transparent); background-size: 200% 100%;
                         animation: gsbar 1s linear infinite; }
@keyframes gsbar { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.gs-head { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 3px; }
.gs-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none;
           transition: background-color .12s ease; }
.gs-item:hover, .gs-item.on { background: #eef2ff; text-decoration: none; }
.gs-kind { flex: none; min-width: 52px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg);
           border-radius: 6px; padding: 2px 6px; }
.k-load .gs-kind { color: #1e3a8a; background: #e0e7ff; }
.k-driver .gs-kind { color: #166534; background: #dcfce7; }
.k-truck .gs-kind, .k-trailer .gs-kind { color: #92400e; background: #fef3c7; }
.gs-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gs-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-st { flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; text-transform: capitalize; }
.k-all .gs-label { font-weight: 500; color: var(--link); }
@media (max-width: 760px) { .gs-pop { position: fixed; left: 8px; right: 8px; top: 56px; max-height: calc(100vh - 160px); } }
@media (prefers-color-scheme: dark) { .gs-item:hover, .gs-item.on { background: #1e2a4f; } .gs-item mark { background: #854d0e; } }

/* ---------------------------------------------------------------- v4.5.3: smooth animations (off with "reduce motion") */
@media (prefers-reduced-motion: no-preference) {
  /* pages fade into each other instead of flashing white (Chrome, Edge, Safari 18+); top bar and menu stay put */
  @view-transition { navigation: auto; }
  .topbar { view-transition-name: ft-top; }
  .sidenav { view-transition-name: ft-side; }
  .mainnav { view-transition-name: ft-bottom; }
  ::view-transition-old(root) { animation: ftfade-out .14s ease-in both; }
  ::view-transition-new(root) { animation: ftfade-in .2s ease-out both; }

  /* buttons, links, chips, rows */
  .btn, button, a, .attn-chip, .chip, .tag, .pill, .seg a, input, select, textarea, .sidenav a, .gsearch, tr {
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, opacity .15s ease; }
  .btn:active, button:active { transform: translateY(1px); }

  /* left menu opens / closes smoothly (names fade in) */
  html.side-open .sidenav .lbl, html.side-open .sidenav .sep { animation: ftfade-in .22s ease-out both; }
  /* phone drawer slides in and out, the page behind dims */
  html.side-drawer .sidenav { animation: ftdrawer-in .24s cubic-bezier(.2, .8, .2, 1) backwards; }
  html.side-drawer .side-backdrop { animation: ftfade-in .2s ease-out both; }
  html.drawer-closing .sidenav { animation: ftdrawer-out .2s ease-in both; }
  html.drawer-closing .side-backdrop { animation: ftfade-out .2s ease-in both; }

  /* pop-up menus (⋯ More, Show, pickers) and the search suggestions */
  details[open] > .more-pop, details[open] > .show-pop, details[open] > .menu-pop, .combo-pop:not([hidden]), .gs-pop.gs-in {
    animation: ftpop .16s cubic-bezier(.2, .8, .2, 1) both; }
  .gs-pop.gs-out { animation: ftpop-out .14s ease-in both; }

  /* messages slide in */
  .toast { animation: fttoast .26s cubic-bezier(.2, .8, .2, 1) both; }
  .flash { animation: ftslide-down .26s ease-out both; }
  /* a row or card you jumped to (from search, #links) lights up once */
  tr:target, section:target, article:target { animation: ftflash 2.4s ease-out; }
}
@keyframes ftfade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ftfade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes ftpop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ftpop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes ftdrawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes ftdrawer-out { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes fttoast { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ftslide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* v4.5.3: the menu takes its own space (nothing covered); the page re-fits at once instead of sliding, the names fade in */
/* The page stays where it is: the wider menu uses the empty space left of the (centered) page. Only on a screen too
   narrow for that does the page move — just as far as needed. Nothing is covered.
   (closed: page centered right of the 64px rail; open: 212px rail, left margin = old margin - 148px = 50% - 814px) */
@media (min-width: 761px) {
  html.side-open main { margin-left: max(0px, calc(50% - 814px)); margin-right: auto; }
}

/* ---------------------------------------------------------------- v4.6.0: chat with drivers */
.chat-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr) 260px; min-height: calc(100vh - 190px); overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 190px); }
.chat-search { padding: 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.chat-search input { width: 100%; }
.chat-conv { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat-conv:hover { background: var(--bg); text-decoration: none; }
.chat-conv.on { background: #eef2ff; }
.chat-conv.unread strong { font-weight: 800; }
.chat-conv.urgent { box-shadow: inset 3px 0 0 #dc2626; }
.cc-top, .cc-bot { display: flex; align-items: center; gap: 6px; }
.cc-at { margin-left: auto; white-space: nowrap; }
.cc-prev { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.chat-conv.unread .cc-prev { color: var(--ink); }
.chat-main { display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 190px); }
.chat-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-loc { margin-left: auto; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.chat-msgs.small-chat { max-height: 320px; border-radius: 10px; margin: 8px 0; }
.cm { display: flex; }
.cm.out { justify-content: flex-end; }
.cm-b { max-width: min(560px, 78%); display: flex; flex-direction: column; gap: 4px; padding: 8px 11px; border-radius: 14px 14px 14px 4px;
        background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; }
.cm.out .cm-b { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 14px 14px 4px 14px; }
.cm.out .cm-b a { color: #c7d2fe; }
.cm.urgent .cm-b { background: #fef2f2; border: 2px solid #dc2626; }
.cm.failed .cm-b { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.cm-t { white-space: pre-wrap; }
.cm-meta { font-size: 11px; opacity: .7; align-self: flex-end; }
.cm-img { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; }
.cm audio { width: 240px; max-width: 100%; }
.cm-new { animation: ftpop .25s ease-out both; }
.chat-form { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.load-chat .chat-form { border-top: 0; padding: 0; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { font: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid #c7d2fe; background: #eef2ff; color: var(--navy); border-radius: 999px;
            padding: 4px 11px; cursor: pointer; }
.chip-btn:hover { background: #e0e7ff; }
.chip-btn:disabled { opacity: .5; cursor: default; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea { flex: 1; resize: none; min-height: 38px; max-height: 160px; font: inherit; padding: 8px 10px; border-radius: 10px; }
.chat-attach { cursor: pointer; font-size: 20px; padding: 4px; }
.chat-side { border-left: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: calc(100vh - 190px); }
.chat-load { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); }
.chat-load:hover { background: var(--bg); text-decoration: none; }
.bc-form { display: flex; flex-direction: column; gap: 10px; }
.bc-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bc-pick .check { flex-direction: row; align-items: center; gap: 6px; }
.bc-form textarea { font: inherit; padding: 8px 10px; border-radius: 10px; }
.chat-pops { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.chat-pop { background: var(--card); border: 2px solid #c7d2fe; border-radius: 12px; padding: 10px 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .22);
            display: flex; flex-direction: column; gap: 6px; animation: fttoast .26s cubic-bezier(.2, .8, .2, 1) both; }
.chat-pop.urgent { border-color: #dc2626; background: #fef2f2; }
.chat-pop.cp-out { animation: ftfade-out .18s ease-in both; }
.cp-head { display: flex; align-items: center; gap: 8px; }
.cp-x { margin-left: auto; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); }
.cp-text { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-reply { display: flex; gap: 6px; }
.cp-reply input { flex: 1; min-width: 0; }
@media (max-width: 1100px) { .chat-wrap { grid-template-columns: 260px minmax(0, 1fr); } .chat-side { display: none; } }
@media (max-width: 760px) {
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-main { max-height: none; }
  .chat-msgs { max-height: 55vh; }
  .chat-pops { bottom: 80px; }
}
@media (prefers-color-scheme: dark) { .chat-conv.on { background: #1e2a4f; } .chip-btn { background: #1e2a4f; border-color: #334155; color: #c7d2fe; } }
.fact-views { margin: 4px 0 10px; } .fact-views .n { font-size: 11px; background: var(--bg); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.send-note { display: flex; flex-direction: column; gap: 4px; font-size: 13px; width: 100%; } .send-note textarea { font: inherit; padding: 6px 8px; border-radius: 8px; resize: vertical; }

/* v4.6.3: printing uses the whole page (the left-menu column and its margins don't apply on paper) */
@media print {
  .shell, html.side-open .shell { display: block !important; }
  main, html.side-open main { margin: 0 !important; max-width: none !important; width: auto !important; padding: 0 !important; }
  .sidenav, .side-backdrop, .chat-pops, .gs-pop, #toasts { display: none !important; }
  .topbar, .sidenav, .mainnav { view-transition-name: none !important; }
  html { scroll-behavior: auto; }
}

/* v4.6.3: BOLs → Waiting for BOL: act right in the row */
.bw-h { margin: 0; padding: 14px 16px 10px; }
details.bw { border-top: 1px solid var(--line); }
details.bw > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) 120px 130px auto;
                       gap: 12px; align-items: center; padding: 12px 16px; min-height: 58px; }
details.bw > summary::-webkit-details-marker { display: none; }
details.bw > summary:hover { background: var(--row-hover, #f8fafc); }
details.bw[open] > summary { background: #f8fafc; }
.bw-load, .bw-drv, .bw-date { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bw-load .mono { font-weight: 700; font-size: 15px; }
.bw-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.bw-acts form, .bw-stop-acts form { margin: 0; }
.bw-acts label.btn, .bw-stop-acts label.btn { cursor: pointer; }
.bw-chev { color: var(--muted); transition: transform .2s; margin-left: 4px; }
details.bw[open] .bw-chev { transform: rotate(180deg); }
.bw-panel { padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.bw-stop { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.2fr) auto; gap: 10px; align-items: center;
           background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.bw-stop-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.bw-files { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bw-stop-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bw-rcv { gap: 6px; align-items: center; flex-wrap: nowrap; }
.bw-rcv input[name=note] { width: 230px; }
.bw-foot { padding-top: 2px; }
@media (max-width: 1100px) {
  details.bw > summary { grid-template-columns: 1fr 1fr; }
  .bw-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .bw-stop { grid-template-columns: 1fr; }
  .bw-stop-acts { justify-content: flex-start; }
}
@media (prefers-color-scheme: dark) { details.bw[open] > summary, .bw-panel { background: #111827; } }

/* ---- v4.6.6: send many loads in one click */
.sa-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sa-left { font-size: 12.5px; font-weight: 600; color: var(--warn); }
.sa-left.all { color: var(--ok); }
.sa-stop, .sa-bar, .sa-pick { display: none; }
.sa-on .sa-go { display: none; }
.sa-on .sa-stop { display: inline-flex; }
.sa-on details.ev > summary { grid-template-columns: 22px 78px 276px minmax(110px, 1fr) minmax(90px, .8fr) minmax(120px, .9fr) minmax(130px, 1.3fr) 210px 18px; }
.sa-on .sa-pick { display: flex; align-items: center; justify-content: center; align-self: stretch; margin: -10px -6px -10px -10px; padding: 0 6px 0 10px; cursor: pointer; }
.sa-pick input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--navy); }
.sa-why { color: var(--muted); }
details.ev.sa-picked > summary { background: #eef2ff; }
.sa-sent { font-size: 12px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.sa-sent.sa-chg { color: var(--warn); }
.sa-cant { display: none; font-size: 12px; color: var(--warn); white-space: nowrap; }
.sa-on .sa-cant { display: inline; }
.sa-on .sa-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 2px solid #c7d2fe;
                 background: #eef2ff; position: sticky; bottom: 0; z-index: 2; }
.sa-btns { margin-left: auto; display: flex; gap: 8px; }
@media (prefers-color-scheme: dark) { .sa-on .sa-bar, details.ev.sa-picked > summary { background: #1e1b4b; } }
@media (max-width: 760px) {
  .sa-on details.ev > summary { grid-template-columns: auto auto 1fr auto; }
  .sa-on details.ev .when { grid-column: 3; } .sa-on details.ev .chev { grid-column: 4; }
}
@media print { .sa-go, .sa-left, .sa-bar, .sa-pick { display: none !important; } }

/* ---- v4.6.6: email the shipper list */
.sl-sent { margin-left: auto; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 12px; background: var(--bg); color: var(--muted); align-self: center; }
.sl-sent.ok { background: var(--ok-bg, #dcfce7); color: var(--ok); }
.sl-sent.changed { background: var(--warn-bg); color: var(--warn); }
tr.sl-chg > td { background: #fffbeb; }
.sl-chg-t { font-size: 11.5px; font-weight: 700; color: var(--warn); margin-top: 3px; }
.sl-changed, .sl-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.sl-changed { background: var(--warn-bg); color: var(--warn); }
.sl-changed .sl-upd { margin-left: auto; }
.sl-done { background: #ecfdf5; color: #166534; font-weight: 600; }
.sl-mail { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: #eef2ff; border-top: 2px solid #c7d2fe; }
.sl-mail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 18px; }
.sl-mail-fields { display: flex; flex-direction: column; gap: 10px; }
.sl-mail-fields > label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.sl-mail-fields > label .muted { font-weight: 400; }
.sl-mail-fields input:not([type=checkbox]), .sl-mail-fields textarea { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.sl-mail-fields label.sl-save-to { flex-direction: row; align-items: center; font-weight: 400; }
.sl-mail-opts { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; align-items: center; }
.sl-mail-opts label { display: flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
.sl-mail-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sl-mail-prev { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 12px 14px; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; overflow: auto; max-height: 420px; }
.sl-prev-msg { white-space: pre-line; }
.sl-mail-prev table td, .sl-mail-prev table th { font-size: 11.5px !important; padding: 2px 5px !important; }
@media (max-width: 1000px) { .sl-mail-grid { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) { .sl-mail { background: #1e1b4b; } tr.sl-chg > td { background: #422006; } .sl-done { background: #052e16; color: #86efac; } }
.sl-ccbcc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-ccbcc[hidden] { display: none; }
.sl-ccbcc label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.sl-ccbcc label .muted { font-weight: 400; }
.sl-ccbcc input { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.sl-ccbcc-btn { align-self: flex-start; }
@media (max-width: 700px) { .sl-ccbcc { grid-template-columns: 1fr; } }
.sa-sent.sa-going { color: var(--link); animation: sa-pulse 1.2s ease-in-out infinite; }
@keyframes sa-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sa-sent.sa-going { animation: none; } }

/* ---- v4.6.9: view switch, days, send lists, week sheet */
.view-switch { display: inline-flex; gap: 3px; padding: 3px; margin: 10px 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.view-switch a { padding: 8px 16px; border-radius: 9px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.view-switch a:hover { background: var(--card); text-decoration: none; }
.view-switch a.on { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.view-switch .count { font-weight: 700; margin-left: 4px; color: #b45309; }
.view-switch a.on .count { color: #fde68a; }
.days-pick { display: inline-flex; align-items: center; gap: 3px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; margin-left: auto; }
.days-pick .days-l { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.days-pick a { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 8px; color: var(--ink); white-space: nowrap; }
.days-pick a:hover { background: var(--card); text-decoration: none; }
.days-pick a.on { background: var(--navy); color: #fff; }
.more-days { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 6px 0 4px; }
.more-days .sub { font-weight: 500; opacity: .8; }
section.next-week > .section-head { background: #f5f3ff; }
@media (prefers-color-scheme: dark) { section.next-week > .section-head { background: #2e1065; } }
.sa-listsec .sa-list { display: none; border-top: 1px solid var(--line); }
.sa-listsec.sa-on .sa-list { display: block; }
.sa-row { display: grid; grid-template-columns: 26px 190px minmax(140px, 1fr) minmax(200px, 2fr) 290px; gap: 12px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); }
.sa-row:first-child { border-top: 0; }
.sa-row .sa-pick { margin: 0; padding: 0; align-self: center; }
.sa-row.sa-picked { background: #eef2ff; }
.sa-row .sa-st { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.sa-row .sa-drv { font-weight: 700; color: var(--ink); }
@media (max-width: 760px) { .sa-row { grid-template-columns: 26px 1fr; } .sa-row > :not(.sa-pick) { grid-column: 2; } .sa-row .sa-st { justify-content: flex-start; } }
@media (prefers-color-scheme: dark) { .sa-row.sa-picked { background: #1e1b4b; } }

.ws-wrap { display: flex; flex-direction: column; gap: 12px; }
.ws-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.ws-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1250px) { .ws-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 950px) { .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ws-grid { grid-template-columns: 1fr; } }
.ws-card { background: var(--card); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.ws-card.away { opacity: .6; }
.ws-h { text-align: center; border-bottom: 2px solid var(--ink); padding: 6px 8px; min-height: 88px; box-sizing: border-box;
        display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ws-h > * { flex-shrink: 0; line-height: 1.3; }
.ws-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.ws-name { font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-eq { font-weight: 600; font-size: 14px; }
.ws-note { font-size: 12px; font-weight: 700; color: var(--warn); min-height: 16px; }
.ws-note.away { color: var(--muted); }
/* every line: [checkbox slot] PU | AMOUNT | DEL [sent mark] - same height, one line each, so the columns line up */
.ws-cols, .ws-row, .ws-total { display: grid; align-items: center; grid-template-columns: 0 minmax(0, 1fr) 0 72px minmax(0, 1fr); }
.sa-on .ws-cols, .sa-on .ws-row, .sa-on .ws-total { grid-template-columns: 24px minmax(0, 1fr) 0 72px minmax(0, 1fr); }
.ws-box { display: flex; justify-content: center; align-items: center; overflow: hidden; }
.ws-cols { font-size: 12px; font-weight: 700; border-bottom: 2px solid var(--ink); background: var(--bg); }
.ws-cols > span { padding: 6px 8px; } .ws-cols > span.ws-box { padding: 0; }
.ws-cols > span:nth-child(4) { text-align: right; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
/* every line the same height; a long city wraps to a 2nd line instead of being cut */
.ws-row { font-size: 13px; border-bottom: 1px solid var(--line); height: 42px; }
/* the day small on top, the place under it on one line (… when too long, full text in the tooltip) */
.ws-row > .ws-pu, .ws-row > .ws-del { padding: 0 8px; color: var(--ink); text-decoration: none; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.ws-c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; letter-spacing: -.01em; }
.ws-row > .ws-pu:hover, .ws-row > .ws-del:hover { color: var(--link); }
.ws-d { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.ws-row > .ws-amt { padding: 0 8px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; gap: 4px;
                    border-left: 1px solid var(--line); border-right: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }
.ws-blank > span:nth-child(4) { border-left: 1px solid var(--line); border-right: 1px solid var(--line); align-self: stretch; }
.ws-amt .ws-mark { margin-right: auto; }
.ws-mark .sa-sent { font-size: 12px; cursor: default; }
.sa-sent.sa-bad { color: var(--bad); }
.ws-row.loaded { background: #eff6ff; } .ws-row.delivered { background: #ecfdf5; }
.ws-row.sa-picked { background: #e0e7ff; }
.ws-row .sa-pick { margin: 0; padding: 0; align-self: center; }
.ws-row .pre-trl { font-size: 12px; }
.ws-total { border-top: 2px solid var(--ink); margin-top: auto; font-size: 14px; }
.ws-total > * { padding: 7px 8px; } .ws-total > .ws-box { padding: 0; }
.ws-total strong { text-align: right; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; } .ws-total .muted { font-size: 12px; }
@media (prefers-color-scheme: dark) { .ws-row.loaded { background: #172554; } .ws-row.delivered { background: #052e16; } .ws-row.sa-picked { background: #1e1b4b; } }
@media print {
  .view-switch, .days-pick, .more-days, .ws-top .sa-head, .ws-legend, .page-head .week-nav, .attn { display: none !important; }
  .ws-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px; }
  .ws-cols, .ws-row, .ws-total { grid-template-columns: 0 minmax(0, 1fr) 0 70px minmax(0, 1fr) !important; }
  .ws-mark { display: none; }
  .ws-card { break-inside: avoid; border-color: #000; }
  .ws-row.loaded, .ws-row.delivered { background: none !important; }
}
/* v4.6.12: factoring by day */
.fact-table tr.fact-day td { background: var(--bg); font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
a.kpi { color: inherit; text-decoration: none; } a.kpi:hover { border-color: var(--navy); }
/* v4.6.12: settlement checks - why a load is on it, not on it, move */
.why { border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.why.ok { background: var(--ok-bg, #dcfce7); color: var(--ok); }
.why.roll { background: var(--warn-bg); color: var(--warn); }
.why.up { background: #ede9fe; color: #5b21b6; }
.wait-bol { display: block; color: #b45309; font-weight: 700; }
.settle-due { margin: 10px 0 0; }
.not-on-check { border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; margin-top: 10px; }
.noc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; }
.noc-head .small { color: #92400e; }
.noc-head .btn { margin-left: auto; }
.noc-row { display: grid; grid-template-columns: 100px minmax(160px, 1fr) 120px 150px 100px auto; gap: 10px; align-items: center;
           padding: 8px 12px; border-top: 1px solid #fde68a; font-size: 13.5px; }
.noc-row form { margin: 0; justify-content: flex-end; }
.warn-text { color: #92400e; }
.add-load { padding: 8px 12px; border-top: 1px solid #fde68a; background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.add-load[hidden] { display: none; }
.add-load .noc-row { border-top-color: var(--line); padding-left: 0; padding-right: 0; }
details.move-load { position: relative; display: inline-block; }
details.move-load > summary { list-style: none; cursor: pointer; }
details.move-load > summary::-webkit-details-marker { display: none; }
.move-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--card); border: 1px solid var(--line);
            border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 12px; width: 320px; display: flex; flex-direction: column; gap: 6px; }
.move-pop input[name=note] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
@media (prefers-color-scheme: dark) { .not-on-check { background: #2a1f05; border-color: #78350f; } .noc-row { border-color: #78350f; } }
@media (max-width: 900px) { .noc-row { grid-template-columns: 1fr 1fr; } }
.fact-views a.on .n { background: #fff; color: var(--navy); }

/* ===================================================================== v4.6.13: settlement ⋮ menu, edit / extras / move panel */
.rev-table td { vertical-align: middle; }
.rev-table .row-tag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.rev-table .edited-tag { background: #e0f2fe; color: #075985; }
.rev-table tr.xrow td { background: #faf8ff; color: #5b21b6; font-size: 13px; padding-top: 4px; padding-bottom: 6px; }
.rev-table tr.xrow .muted { color: #7c6fb0; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu .dots { width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line);
  border-radius: 7px; background: var(--card); font-size: 18px; font-weight: 700; line-height: 1; color: var(--ink); }
.row-menu[open] .dots, tr.rp-open .dots { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.row-menu-pop { position: fixed; right: auto; top: 0; left: 0; z-index: 1000;   /* v4.6.14: over the page, not clipped by the table's scroll box */ background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; display: flex; flex-direction: column; min-width: 240px; text-align: left; }
.row-menu-pop button, .row-menu-pop a { font: inherit; font-size: 13.5px; text-align: left; border: 0; background: transparent; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; color: var(--ink); }
.row-menu-pop a { color: var(--accent, #1d4ed8); }
.row-menu-pop button:hover, .row-menu-pop a:hover { background: var(--bg, #f3f4f6); }
.row-menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
tr.rp-open > td { background: #eef2ff; }
tr.row-panel > td { background: #f8faff; border: 1px solid #c7d2fe; border-top: 0; padding: 12px 14px; }
.rp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rp-reset { margin-left: auto; }
.linkish { font: inherit; font-size: 12.5px; border: 0; background: none; color: var(--accent, #1d4ed8); cursor: pointer; padding: 0; }
.rp-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.rp-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rp-fields label small { font-weight: 400; }
.rp-fields input:not([type=checkbox]):not([type=radio]) { font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; width: 110px; background: var(--card); color: var(--ink); }
.rp-fields input.w-pct { width: 64px; }
.rp-fields .grow { flex: 1; min-width: 180px; }
.rp-fields .grow input:not([type=checkbox]):not([type=radio]) { width: 100%; box-sizing: border-box; }
.rp-fields input::placeholder { color: #9ca3af; }
.rp-fields label.rp-check { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; padding-bottom: 8px; }
.rp-fields label.day-pill { flex-direction: row; }
.rp-mv-t { width: 100%; }
.rp-extras { margin-top: 12px; border-top: 1px dashed #c7d2fe; padding-top: 10px; }
.rp-sub { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: #5b21b6; margin-bottom: 6px; }
.rp-x { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.rp-add { border-color: #5b21b6 !important; color: #5b21b6 !important; }
.paid-earlier { font-size: 13px; color: var(--muted); background: #f5f3ff; border-radius: 8px; padding: 7px 12px; margin: 8px 0 0; }
.btn.sent { color: var(--ok); }
@media (prefers-color-scheme: dark) {
  .rev-table tr.xrow td { background: #1e1a2e; color: #c4b5fd; }
  tr.rp-open > td { background: #1e2547; }
  tr.row-panel > td { background: #161b2e; border-color: #3730a3; }
  .paid-earlier { background: #1e1a2e; }
}

/* ===================================================================== v4.7.0: fuel report */
.head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.fuel-btn { font-weight: 700; border-color: #f97316 !important; color: #9a3412 !important; background: #fff7ed !important; }
.fuel-in { display: block; margin: 4px 10px 0; background: #ecfdf5; color: #166534; border-radius: 8px; padding: 4px 8px; text-align: center; }
.nastc-tag { background: #e0f2fe; color: #075985; }
.row-menu-pop form { display: contents; }
.row-menu-pop .bad-text, .bad-text { color: #b91c1c; }
.ok-text { color: var(--ok, #166534); }
.check-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-left: 6px; }
.fuel-head { display: flex; flex-direction: column; gap: 10px; }
.fuel-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fuel-title strong { font-size: 16px; }
.fuel-status { margin-left: auto; }
.fuel-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fuel-tiles > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.fuel-tiles small { font-size: 12px; color: var(--muted); }
.fuel-tiles b { font-size: 17px; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.fuel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; margin-top: 14px; }
.fuel-side { display: flex; flex-direction: column; gap: 10px; }
.fuel-side h3 { margin: 0; }
.fuel-need { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.fuel-need select, .fuel-need .combo-sel { max-width: 180px; }
.fuel-go { width: 100%; justify-content: center; }
@media (max-width: 1000px) { .fuel-grid { grid-template-columns: 1fr; } .fuel-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-color-scheme: dark) { .fuel-need { background: #2a1f05; border-color: #78350f; } .fuel-in { background: #052e1a; color: #86efac; } .fuel-btn { background: #2a1405 !important; color: #fdba74 !important; } }
/* v4.7.0: fuel and deductions one under the other - full width, nothing cut off (⋮ on every line) */
.settle-sheet .sheet-two { grid-template-columns: minmax(0, 1fr) !important; }
.sheet-table .row-tag { display: inline-block; margin-left: 4px; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.sheet-table .nastc-tag { background: #e0f2fe; color: #075985; }
.sheet-table .edited-tag { background: #fef3c7; color: #92400e; }

/* ===================================================================== v4.8.0: the new look (boards AZ–BL)
   Calm grey menu on the left with groups, white page, quiet tables (grey small-caps headers, color only in the
   status), outline status pills, underline tabs, grey segmented switches, number cards with trend lines. Navy accent. */
:root {
  --ink: #18181b; --muted: #71717a; --faint: #a1a1aa; --line: #ececef; --line-2: #f4f4f5; --bg: #ffffff; --card: #ffffff;
  --side: #f4f4f5; --side-2: #e9e9ec; --row-hover: #fafafa; --navy-soft: #eef2ff; --link: #1e3a8a;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e4e4e7; --muted: #a1a1aa; --faint: #71717a; --line: #27272a; --line-2: #202024; --bg: #0f0f12; --card: #16161a;
          --side: #121215; --side-2: #1c1c21; --row-hover: #1a1a1f; --navy-soft: #1e2547; --link: #a5b4fc; }
}
body { font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg);
       -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; } h3 { font-weight: 600; }

/* --- the menu ------------------------------------------------------------------------------------------------- */
.topbar { display: none; }
.shell, html.side-open .shell { grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidenav { top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line); padding: 14px 12px; gap: 1px; }
.sidenav a { justify-content: flex-start; padding: 7px 10px; color: #3f3f46; font-weight: 400; font-size: 14px; }
.sidenav a .ico { width: 18px; height: 18px; color: #71717a; }
.sidenav a:hover { background: var(--side-2); }
.sidenav a.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.sidenav a.on .ico { color: var(--navy); }
.sidenav .lbl { display: inline; }
.sidenav .pill { position: static; margin-left: auto; font-size: 11.5px; font-weight: 500; line-height: 18px; padding: 0 6px; border-radius: 6px;
                 background: var(--card); color: #52525b; border: 1px solid var(--line); }
.sidenav .pill.bad { background: var(--navy); border-color: var(--navy); color: #fff; }
.sidenav .sep, .sidenav .sep:first-child, html.side-open .sidenav .sep { display: block; height: auto; background: none; font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 16px 10px 4px; }
.side-toggle { display: none; }
.side-brand { display: flex !important; align-items: center; gap: 10px; padding: 4px 6px 12px !important; background: none !important; box-shadow: none !important; }
.side-brand:hover { text-decoration: none; }
.side-brand .logo, .topbar .logo { width: 36px; height: 36px; border-radius: 10px; background: #18181b; color: #fff; display: grid; place-items: center;
                                   font-weight: 700; font-size: 14px; flex: none; }
.side-brand strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.side-brand small { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sidenav .gsearch { width: auto; border: 0; background: var(--side-2); border-radius: 8px; padding: 0 10px; margin-bottom: 2px; }
.sidenav .gsearch input { min-height: 34px; font-size: 13.5px; }
.sidenav .gsearch kbd { background: var(--card); font-size: 11px; }
.gs-pop { min-width: 440px; }
main, html.side-open main { max-width: 1480px; margin: 0; padding: 20px 28px 60px; }
@media (prefers-color-scheme: dark) {
  .sidenav a { color: #d4d4d8; } .sidenav a.on { background: var(--side-2); }
  .side-brand .logo { background: #e4e4e7; color: #18181b; }
}

/* --- page parts ----------------------------------------------------------------------------------------------- */
.page-head { align-items: flex-start; margin-bottom: 16px; }
.page-head h1 + .hint, .page-head .hint { font-size: 13.5px; }
.card { border-color: #f0f0f2; border-radius: 12px; box-shadow: none; }
@media (prefers-color-scheme: dark) { .card { border-color: var(--line); } }
.flash { border-radius: 10px; border: 1px solid transparent; }
.btn { border-color: #e4e4e7; border-radius: 8px; font-weight: 500; color: #3f3f46; }
.btn:hover { border-color: #d4d4d8; background: var(--row-hover); }
.btn.primary { font-weight: 600; color: #fff; }
.btn.primary:hover { background: #172e6e; }
.btn.small { border-radius: 7px; }
input, select, textarea { border-color: #e4e4e7; border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30, 58, 138, .18); border-color: var(--navy); }

/* tables: quiet - grey small-caps headers, light lines, color only in the status */
th { background: transparent; color: var(--faint); font-weight: 500; font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
     border-bottom: 1px solid var(--line); position: static; }
td { border-bottom: 1px solid var(--line-2); }
tbody tr:hover { background: var(--row-hover); }
.sheet-table thead th, .sheet-table th { background: transparent !important; color: var(--faint) !important; }
.sheet-table th, .sheet-table td { border-top-color: var(--line-2); }
.sheet-table tfoot td { border-top: 1px solid var(--line); }
table.tight th { text-transform: uppercase; font-size: 10.5px; letter-spacing: .07em; color: var(--faint); font-weight: 500; }

/* status pills: outline, small caps */
.tag { background: transparent !important; border: 1px solid #d4d4d8; color: #52525b; border-radius: 5px; font-size: 10.5px; font-weight: 500;
       letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; }
.tag.warn, .tag.p-warn { border-color: rgba(180, 83, 9, .35); color: #b45309; }
.tag.bad, .tag.s-failed { border-color: rgba(185, 28, 28, .35); color: #b91c1c; }
.tag.s-done, .tag.ok { border-color: rgba(22, 101, 52, .35); color: #166534; }
.tag.s-pending, .tag.s-processing, .tag.blue { border-color: rgba(29, 78, 216, .35); color: #1d4ed8; }
.tag.purple { border-color: rgba(109, 40, 217, .35); color: #6d28d9; }
@media (prefers-color-scheme: dark) {
  .tag { border-color: #3f3f46; color: #d4d4d8; } .tag.warn { color: #fbbf24; } .tag.bad { color: #f87171; } .tag.s-done, .tag.ok { color: #86efac; }
  .tag.s-pending, .tag.blue { color: #93c5fd; } .tag.purple { color: #c4b5fd; }
}

/* tabs: underline; switches: grey segmented */
.tabs { gap: 26px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
.tabs a { padding: 12px 0; font-weight: 400; color: #52525b; border-bottom-width: 2px; margin-bottom: -1px; }
.tabs a.on { font-weight: 500; }
.tabs .count { font-size: 11.5px; color: var(--faint); }
.tabs a.on .count { color: var(--navy); }
.seg { background: var(--side); border: 0; border-radius: 9px; padding: 3px; }
.seg a { min-height: 32px; padding: 5px 12px; border-radius: 7px; font-weight: 400; color: #52525b; font-size: 13.5px; }
.seg a.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
@media (prefers-color-scheme: dark) { .seg a.on { background: var(--side-2); color: var(--ink); } }

/* number cards with a trend line */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 1px solid #f0f0f2; border-radius: 12px; margin: 0 0 16px;
        background: var(--card); overflow: hidden; }
.kpi { display: flex; align-items: flex-end; gap: 10px; padding: 12px 18px; border-right: 1px solid #f0f0f2; min-width: 0; color: inherit; }
.kpi:last-child { border-right: 0; }
a.kpi:hover { background: var(--row-hover); text-decoration: none; }
.kpi .k-l { font-size: 13px; color: #52525b; }
.kpi .k-v { font-size: 24px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; }
.kpi .k-d { font-size: 12.5px; font-weight: 500; margin-left: 4px; }
.kpi .k-d.up { color: #16a34a; } .kpi .k-d.dn { color: #b91c1c; } .kpi .k-d.mu { color: var(--faint); font-weight: 400; }
.kpi .k-s { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi svg { margin-left: auto; flex: none; }
@media (prefers-color-scheme: dark) { .kpis, .kpi { border-color: var(--line); } .kpi .k-l { color: var(--muted); } }

/* ⋮ and ＋ menus look the same everywhere */
.row-menu .dots, .plus-btn { width: 28px; height: 26px; border: 1px solid #e4e4e7; border-radius: 7px; background: var(--card); display: inline-grid;
                             place-items: center; font-weight: 700; color: #3f3f46; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.plus-btn { background: var(--navy-soft); color: var(--navy); border-color: rgba(30, 58, 138, .2); font-size: 16px; font-weight: 500; }
.plus-menu { position: relative; display: inline-block; }
.plus-menu > summary { list-style: none; }
.plus-menu > summary::-webkit-details-marker { display: none; }
.plus-menu[open] .plus-btn { background: var(--navy); color: #fff; }
.plus-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 380px; background: var(--card); border: 1px solid #e4e4e7;
            border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.plus-pop.right { left: auto; right: 0; }
.plus-pop label { font-size: 12px; }
.plus-pop .pp-row { display: flex; gap: 8px; } .plus-pop .pp-row > * { flex: 1; }
.plus-pop .pp-kind { display: flex; gap: 4px; background: var(--side); border-radius: 8px; padding: 3px; }
.plus-pop .pp-kind label { flex: 1; flex-direction: row; justify-content: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
                           font-weight: 400; color: #52525b; }
.plus-pop .pp-kind input { position: absolute; opacity: 0; pointer-events: none; }
.plus-pop .pp-kind label:has(input:checked) { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.plus-pop .pp-acts { display: flex; gap: 8px; margin-top: 4px; } .plus-pop .pp-acts .btn.primary { flex: 1; }
.sec-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.sec-head .cap, .cap { font-size: 11px; letter-spacing: .07em; color: var(--faint); font-weight: 500; text-transform: uppercase; }

/* the back link */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--navy); margin: -4px 0 10px; }
.back-link[hidden] { display: none; }

/* --- phone ---------------------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .topbar { display: flex; height: 52px; background: var(--card); border-bottom: 1px solid var(--line); padding: 0 12px; gap: 10px; position: sticky; top: 0; z-index: 30; }
  .topbar .brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
  .topbar .brand-name { display: inline; font-weight: 600; font-size: 16px; }
  .top-search { margin-left: auto; width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--side); display: grid; place-items: center; color: var(--ink); }
  .top-search .ico { width: 18px; height: 18px; }
  .shell, html.side-open .shell { display: block; }
  .sidenav { display: none; }
  html.side-drawer .sidenav { display: flex; position: fixed; inset: 0 auto 0 0; height: 100%; width: 280px; z-index: 60; }
  main, html.side-open main { padding: 12px 12px 96px; }
  .mainnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card);
             border-top: 1px solid var(--line); padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); }
  .mainnav a, .mainnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); border: 0;
                                background: none; font: inherit; font-size: 11px; position: relative; padding: 2px 0; cursor: pointer; }
  .mainnav a.on { color: var(--navy); font-weight: 600; }
  .mainnav .ico { width: 22px; height: 22px; }
  .mainnav .pill { position: absolute; top: -2px; left: calc(50% + 6px); font-size: 10px; padding: 0 5px; line-height: 15px; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpi { border-bottom: 1px solid #f0f0f2; } .kpi svg { display: none; }
  /* tables become cards on the phone where a page asks for it */
  table.cards-on-phone, table.cards-on-phone tbody, table.cards-on-phone tr, table.cards-on-phone td { display: block; width: 100%; min-width: 0; }
  table.cards-on-phone thead { display: none; }
  table.cards-on-phone tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
  table.cards-on-phone td { border: 0; padding: 2px 0; }
  .money-only { display: none !important; }
  .phone-note { display: block !important; }
}
.phone-note { display: none; }

/* v4.8: Today and the load rows in the new look */
.st, .kind { background: transparent !important; border: 1px solid #d4d4d8; color: #52525b; border-radius: 5px; font-size: 10.5px; font-weight: 500;
             letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; }
.st.loaded, .kind.pickup { border-color: rgba(29, 78, 216, .35); color: #1d4ed8; }
.st.delivered { border-color: rgba(22, 101, 52, .35); color: #166534; }
.st.unassigned, .st.pre, .kind.drop { border-color: rgba(180, 83, 9, .35); color: #b45309; }
.st.old { border-style: dashed; color: var(--faint); }
@media (prefers-color-scheme: dark) { .st, .kind { border-color: #3f3f46; color: #d4d4d8; } .st.loaded, .kind.pickup { color: #93c5fd; }
  .st.delivered { color: #86efac; } .st.unassigned, .st.pre, .kind.drop { color: #fbbf24; } }
.view-switch, .days-pick { background: var(--side); border: 0; border-radius: 9px; padding: 3px; }
.view-switch a, .days-pick a { font-weight: 400; color: #52525b; padding: 6px 12px; border-radius: 7px; font-size: 13.5px; }
.view-switch a.on, .days-pick a.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.view-switch a.on .count { color: #b45309; }
.days-pick .days-l { font-weight: 400; color: var(--faint); }
.attn { border: 0; padding: 0; background: transparent; gap: 8px; margin-bottom: 14px; }
.attn-h { display: none; }
.attn-chip { border: 1px solid #e4e4e7; background: var(--card) !important; color: #3f3f46 !important; border-radius: 8px !important; padding: 6px 11px;
             font-weight: 400; flex-direction: row; gap: 6px; align-items: center; }
.attn-chip strong { font-weight: 500; }
.attn-chip.red { border-color: #fecaca; color: #b91c1c !important; } .attn-chip.orange, .attn-chip.amber { border-color: #fde68a; color: #b45309 !important; }
.attn-chip.blue { border-color: #c7d2fe; color: #1e3a8a !important; } .attn-chip.calm { border-color: #bbf7d0; color: #166534 !important; }
@media (prefers-color-scheme: dark) { .attn-chip { border-color: var(--line); color: #d4d4d8 !important; } }
.section-head { padding: 12px 16px; }
.section-head h2 { font-size: 15px; font-weight: 600; }
details.ev > summary { font-weight: 400; }
details.ev a.drv, details.ev .who strong, details.ev .place strong { font-weight: 500; }
details.ev.problem > summary { background: transparent; box-shadow: inset 3px 0 0 #dc2626; }
details.ev.eta-late:not(.problem) > summary { background: transparent; box-shadow: inset 3px 0 0 #f59e0b; }
details.ev .late { font-weight: 500; }
details.ev[open] { background: var(--row-hover); }
.day-head { background: transparent; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: 0; }
.day-head.today { background: transparent; color: var(--navy); font-weight: 600; }
.day-head.past { background: transparent; color: var(--faint); }
.pre-trl { background: #fef3c7; color: #92400e; font-weight: 600; border-radius: 5px; padding: 0 6px; }
.chip { font-weight: 500; border-radius: 8px; min-height: 34px; }
.step { font-weight: 500; }

/* v4.8: page title row, trend line color, Settlements (board BD) */
.ph48 { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph48 h1 { margin: 0; }
.ph-sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.ph48 .head-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi svg { color: var(--navy); }
@media (prefers-color-scheme: dark) { .kpi svg { color: #818cf8; } }
.k-txt { min-width: 0; }
.wk-nav { display: inline-flex; align-items: center; gap: 2px; border: 1px solid #e4e4e7; border-radius: 8px; padding: 2px; background: var(--card); }
.wk-nav a { padding: 4px 10px; border-radius: 6px; color: #3f3f46; font-size: 13.5px; }
.wk-nav a:hover { background: var(--side); text-decoration: none; }
.wk-nav .wk-l { padding: 0 6px; font-size: 13px; color: var(--muted); }
.s48 { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.s48-list { padding: 8px; }
.s48-list .cap { display: block; padding: 6px 8px 8px; }
.s48-drv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; color: var(--ink); }
.s48-drv:hover { background: var(--row-hover); text-decoration: none; }
.s48-drv.on { background: var(--navy-soft); }
.s48-drv strong { font-weight: 500; display: block; }
.s48-drv small { display: block; color: var(--faint); font-size: 12px; }
.s48-drv .wait-bol { color: #b45309; }
.s48-drv.empty { opacity: .6; }
.s48-sum { border-top: 1px solid var(--line-2); margin-top: 6px; padding: 10px 10px 4px; font-size: 12.5px; color: var(--muted); }
.s48-sheet { padding: 18px 20px; }
.s48-sheet .sheet-head h2 { font-size: 19px; margin: 0; }
.s48-sheet .sheet-h { font-size: 11px; letter-spacing: .07em; color: var(--faint); font-weight: 500; text-transform: uppercase; margin: 18px 0 6px; }
.fuel-sum { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
            list-style: none; }
.fuel-sum::-webkit-details-marker { display: none; }
.fuel-sum .fs-arrow { color: var(--faint); transition: transform .15s; }
details.fuel48[open] .fs-arrow { transform: rotate(90deg); }
details.fuel48[open] .fuel-sum { border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--row-hover); }
.fuel-sum .fs-t { flex: 1; min-width: 0; }
.fuel-sum .fs-dh { color: #166534; font-weight: 500; white-space: nowrap; }
.fuel48 .fuel-days { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 4px 10px 10px; }
.fuel48 .fuel-days td.where { color: var(--muted); font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fuel-add-btn { margin-top: 8px; }
.dlist48 { display: flex; flex-direction: column; }
.dl-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line-2); }
.dl-row:first-child { border-top: 0; }
.dl-row .dl-t { flex: 1; min-width: 0; }
.dl-row .dl-t .cap { display: block; }
.dl-row .dl-t span { font-size: 13.5px; }
.dl-row .dl-a { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-row .dl-a.minus { color: #b91c1c; } .dl-row .dl-a.plus { color: #166534; }
.dl-row + .row-panel48 { padding: 4px 0 10px; }
.row-panel48 .rp-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.s48 .sheet-totals { margin-top: 18px; }
.pp-bonus-only, .pp-ded-only { display: contents; }
.plus-pop:has(input[value="deduction"]:checked) .pp-bonus-only { display: none; }
.plus-pop:has(input[value="revenue"]:checked) .pp-ded-only { display: none; }
@media (max-width: 1100px) { .s48 { grid-template-columns: 1fr; } }
.kpis { gap: 0; }
.kpi { flex-direction: row; border-width: 0 1px 0 0; border-style: solid; border-radius: 0; background: none; }
.kpi .k-l, .kpi span.k-d { text-transform: none; letter-spacing: 0; font-weight: 400; }
.kpi .k-d { font-weight: 500 !important; }
.s48 .not-on-check { background: transparent; border-color: var(--line); }
.s48 .noc-head .small { color: var(--muted); }
.s48 .noc-row { grid-template-columns: 90px minmax(140px, 1fr) 100px 120px 90px; background: transparent; border-color: var(--line-2); }
.s48 .noc-row form { grid-column: 1 / -1; display: flex; gap: 8px; }
.s48 .noc-row form input { flex: 1; max-width: 260px; }
@media (prefers-color-scheme: dark) { .s48 .not-on-check { background: transparent; border-color: var(--line); } }
.plus-pop label { font-weight: 500; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.plus-pop input, .plus-pop select { font-weight: 400; color: var(--ink); }
/* v4.8 Factoring (board BE) and tab rows with filters on the right */
.tabs-row { display: flex; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--line); margin: 4px 0 12px; flex-wrap: wrap; }
.tabs-row .tabs { border-bottom: 0; margin: 0; flex: 1; }
.tabs-row form { margin: 0 0 8px; }
.up-week { display: flex; gap: 12px; align-items: center; margin: 0 0 10px; }
table.f48 { width: 100%; border-collapse: collapse; }
table.f48 th, table.f48 td { padding: 10px; border-top: 0; text-align: left; vertical-align: middle; }
table.f48 th.r, table.f48 td.r { text-align: right; }
table.f48 .fact-day td { background: transparent; padding-top: 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.f48 tr.done td { color: var(--muted); }
.fuel-history { padding: 12px 16px; } .fuel-history summary { cursor: pointer; list-style: none; }
.fuel-checks { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 14px; }
.plus-pop strong { font-size: 14px; }
.gs-item.k-do .gs-kind { color: var(--navy); font-weight: 700; }
.back-link { margin: 0 0 8px; }
/* v4.8 Loads (board AZ) */
.filters48 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.filters48 .f-q { flex: 1; min-width: 180px; }
.filters48 select, .filters48 input[type=date], .filters48 .combo-sel { width: auto; }
.filters48 .f-sum { margin-left: auto; }
.filters48 [hidden] { display: none; }
table.loads48 { width: 100%; border-collapse: collapse; }
table.loads48 th, table.loads48 td { padding: 11px 10px; text-align: left; vertical-align: middle; }
table.loads48 th a { color: inherit; }
table.loads48 th.r, table.loads48 td.r { text-align: right; }
table.loads48 tbody tr { cursor: pointer; }
table.loads48 tr.peek-on td { background: var(--navy-soft); }
table.loads48 td.route { white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
table.loads48 a.drv { color: var(--ink); }
.peek { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; background: var(--card); border-left: 1px solid var(--line);
        box-shadow: -16px 0 40px rgba(0,0,0,.12); z-index: 50; overflow-y: auto; }
.peek-in { padding: 16px 20px 30px; }
.peek-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.peek-x { border: 0; background: var(--side); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--ink); }
.peek-kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13.5px; margin: 8px 0 14px; }
.peek-kv span { color: var(--muted); } .peek-kv b { font-weight: 500; }
.peek-stops { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.ps { display: flex; gap: 10px; font-size: 13.5px; }
.ps-dot { width: 10px; height: 10px; border-radius: 99px; border: 2px solid #1d4ed8; margin-top: 4px; flex: none; }
.ps.drop .ps-dot { border-color: #b45309; }
.peek-bols { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.peek-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 760px) { .peek { width: 100vw; } table.loads48 tbody tr { cursor: default; } }
th.sorted, th.sorted a { background: transparent !important; color: var(--navy) !important; }
.check-inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; font-weight: 400; font-size: 13.5px; }
.assign48 { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; margin: 0; }
.assign48 .combo { min-width: 180px; }
.load-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.load-head h1 .st, .load-head h1 .tag { font-size: 11px; }
.mono-h { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; letter-spacing: -.01em; }
.head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label { font-weight: 500; }
/* v4.8 driver page (board BB) */
.drv-id { display: flex; gap: 14px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 999px; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center;
          font-weight: 600; font-size: 16px; flex: none; }
.drv-head h1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drv-tabs { position: sticky; top: 0; background: var(--bg); z-index: 5; }
.drv-over { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.attn48, .now48 { padding: 14px 16px; }
.at-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.at-row:first-of-type { border-top: 0; }
.at-row .at-ic { width: 22px; text-align: center; }
.at-row .at-t { flex: 1; color: var(--ink); }
.at-row.bad .at-t { color: #b91c1c; }
.now48 .hos-box { margin: 8px 0; }
.now48 .away-line { margin-top: 8px; }
.doc-exp { font-size: 13px; white-space: nowrap; color: var(--muted); }
.doc-exp.expired { color: #b91c1c; font-weight: 500; } .doc-exp.soon { color: #b45309; font-weight: 500; }
.tabs .count.warn { color: #b45309; }
@media (max-width: 900px) { .drv-over { grid-template-columns: 1fr; } }
/* v4.8 BOLs (board BF): the list and the BOL next to it */
.bol48.with-pv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.bol-pv { position: sticky; top: 12px; padding: 10px; height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 8px; }
.bol-pv-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.bol-pv iframe { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--side); }
.bol-pv iframe[hidden] { display: none; }
article.bol-row { cursor: pointer; }
article.bol-row.pv-on { background: var(--navy-soft); box-shadow: inset 3px 0 0 var(--navy); }
@media (max-width: 1100px) { .bol48.with-pv { grid-template-columns: 1fr; } .bol-pv { display: none; } }
@media (max-width: 760px) {
  table.loads48.cards-on-phone tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; }
  table.loads48.cards-on-phone td { padding: 0; border: 0; text-align: left !important; }
  table.loads48.cards-on-phone td.route { grid-column: 1 / -1; white-space: normal; }
  table.loads48.cards-on-phone td:last-child { grid-row: 1; grid-column: 2; }
  table.loads48.cards-on-phone .fact-day td, table.f48.cards-on-phone .fact-day td { grid-column: 1 / -1; }
  .filters48 .f-sum { margin-left: 0; width: 100%; }
  .page-head.ph48 .head-right { width: 100%; }
}
@media (prefers-color-scheme: dark) {
  .btn { color: var(--ink); border-color: #3f3f46; background: var(--card); }
  .btn:hover { border-color: #52525b; background: var(--side-2); }
  .row-menu .dots { color: var(--ink); border-color: #3f3f46; }
  .wk-nav { border-color: #3f3f46; } .wk-nav a { color: var(--ink); }
  .plus-pop, .peek { border-color: #3f3f46; }
  .fs-dh, .dl-row .dl-a.plus { color: #86efac; } .dl-row .dl-a.minus, .at-row.bad .at-t, .doc-exp.expired { color: #f87171; }
  .tabs a, .seg a, .view-switch a, .days-pick a { color: var(--muted); }
}
@media (prefers-color-scheme: dark) { .fuel-sum .fs-dh { color: #86efac; } .btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); } }
/* v4.8.1: escrow on the driver page, Pay & info boxes */
.esc-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 10px; }
.esc-boxes > div { background: var(--side); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.esc-boxes small { color: var(--muted); font-size: 12px; } .esc-boxes b { font-size: 21px; font-weight: 500; }
.pay48 { display: flex; flex-direction: column; gap: 12px; }
.pay48-row { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)); gap: 12px; }
.pay48-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.pay48-box legend { padding: 0 4px; }
@media (max-width: 760px) { .esc-boxes, .pay48-box, .pay48-row { grid-template-columns: 1fr; } }
.fee-t { color: #b45309; }
@media (prefers-color-scheme: dark) { .fee-t { color: #fbbf24; } }
.plus-pop.wide { width: 640px; max-width: calc(100vw - 40px); }
.pp-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.pp-load { display: grid; grid-template-columns: 90px minmax(0, 1fr) 80px 90px 130px auto; gap: 8px; align-items: center; padding: 6px 2px;
           border-top: 1px solid var(--line-2); font-size: 13px; margin: 0; }
.pp-load small { display: block; color: var(--muted); font-size: 11.5px; }
.pp-load .mono { color: var(--navy); }
.pp-manual { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.pp-manual[hidden], .pp-list[hidden] { display: none; }
.plus-pop .pp-row label.w-date { flex: 0 0 150px; }
/* v4.8.1: search suggestions float over the page (the side menu would cut them), one clean focus ring */
.gs-pop { position: fixed; right: auto; min-width: 0; overflow-y: auto; box-shadow: 0 16px 44px rgba(0,0,0,.18); }
.gsearch input:focus, .gsearch input:focus-visible { outline: 0 !important; box-shadow: none !important; border: 0 !important; }
.sidenav .gsearch:focus-within { box-shadow: 0 0 0 2px rgba(30, 58, 138, .35); background: var(--card); }
.gs-item { min-width: 0; } .gs-main { min-width: 0; } .gs-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@media (max-width: 760px) { .gs-pop { left: 8px; right: 8px; width: auto; } }
/* v4.8.4: the side menu (and the search list that opens from it) stays above sticky boxes on the page (Settlements' driver list) */
@media (min-width: 761px) { .sidenav { z-index: 45; } }
/* v4.8.5: number cards written the older way (Reports, the load page's route box): label, number, note stacked */
.kpi:not(:has(> .k-txt)) { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; padding: 14px 18px; }
.kpi:not(:has(> .k-txt)) > span:first-child { font-size: 13px; color: #52525b; font-weight: 400; text-transform: none; letter-spacing: 0; }
.kpi:not(:has(> .k-txt)) > strong { font-size: 22px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.kpi:not(:has(> .k-txt)) > small { font-size: 12px; color: var(--faint); }
.kpis:not(:has(.k-txt)) { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi:not(:has(> .k-txt)) { padding: 14px 14px; } .kpi:not(:has(> .k-txt)) > strong { font-size: 20px; }
@media (prefers-color-scheme: dark) { .kpi:not(:has(> .k-txt)) > span:first-child { color: var(--muted); } }
/* v4.8.6: the menu items sit in their own box (it refreshes live) - laid out as before */
.side-items { display: contents; }

/* v4.9.0 settlement totals (board BQ) */
.tot-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px; }
.tot-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tot-form select, .tot-form .combo-sel { min-width: 190px; }
.tot-acts { margin-left: auto; display: flex; gap: 8px; }
.tot-card { padding: 0 0 12px; }
.tot-table th, .tot-table td { padding: 8px 10px; }
.tot-table tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: var(--soft, transparent); }
.tot-unpaid { margin: 8px 14px 0; }
.tot-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; padding: 14px 14px 0; }
.tot-two .cap { display: block; margin-bottom: 6px; }
.tot-kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.tot-kv span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tot-kv.strong { font-weight: 600; border-bottom: 0; }
.tot-print-head { display: none; }
@media (max-width: 700px) { .tot-two { grid-template-columns: 1fr; } .tot-acts { margin-left: 0; } .tot-form select, .tot-form .combo-sel { min-width: 0; width: 100%; } .tot-form label { flex: 1 1 100%; } }
@media print {
  .tot-print-head { display: block; margin-bottom: 10px; font-size: 13px; }
  .tot-card { box-shadow: none; border: 0; }
  .tot-table { font-size: 11px; }
}

/* v4.9.1 board BR: one dropdown on every page - 36px like the text boxes, 14px normal text, the app's own thin arrow.
   Pages set only the width of a dropdown; never its font, padding or height. */
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; font-family: inherit; font-size: 14px; font-weight: 400;
  line-height: 1.2; color: var(--ink); height: 36px; padding: 0 30px 0 10px; border: 1px solid #d4d4d8; border-radius: 8px;
  background-color: var(--card); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat;
  background-position: right 10px center; background-size: 12px; cursor: pointer; text-overflow: ellipsis; }
select:hover { border-color: #a1a1aa; }
select:focus, select:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 138, .18); }
select:disabled { background-color: #f4f4f5; color: #a1a1aa; border-color: #e4e4e7; cursor: default; }
select.preloaded { font-weight: 600; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
select::-ms-expand { display: none; }
@media (prefers-color-scheme: dark) {
  select { border-color: #3f3f46; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
  select:hover { border-color: #52525b; }
  select:focus, select:focus-visible { border-color: #93a5d8; box-shadow: 0 0 0 3px rgba(147, 165, 216, .25); }
  select:disabled { background-color: #1f2530; color: #6b7280; border-color: #2b3342; }
  select.preloaded { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fcd34d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
}
/* phones: 16px so the iPhone doesn't zoom in when a dropdown is tapped */
@media (max-width: 700px) { select { font-size: 16px; } }
@media print { select { background-image: none; border-color: #999; padding-right: 10px; } }

/* v4.9.2 board BS: every dropdown opens the picker list (app.js turns each <select> into a .combo-sel).
   The closed box of every picker - old Truck / Driver / Trailer ones too - is the 4.9.1 dropdown box. */
.combo-btn { min-height: 36px; padding: 0 10px; border: 1px solid #d4d4d8; border-radius: 8px; font-size: 14px; }
.combo-btn svg { width: 12px; height: 12px; flex: none; color: #6b7280; }
.combo-btn:hover { border-color: #a1a1aa; }
.combo-btn:focus-visible, .combo-btn[aria-expanded="true"] { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 138, .18); }
.combo-btn:disabled { background: #f4f4f5; color: #a1a1aa; border-color: #e4e4e7; cursor: default; }
.combo-sel .combo-btn { height: 36px; justify-content: space-between; }
.combo-sel .combo-val { font-weight: 400; }
.combo-sel.preloaded .combo-btn svg { color: var(--warn); }
.combo-sel .combo-opt:not(:has(.sub)) { min-height: 38px; }
.combo-opt:disabled { opacity: .45; cursor: default; }
.combo-sel[hidden] { display: none; }
.combo-sel .combo-opt .o-txt { flex: 1 1 auto; }
.combo-sel .combo-opt .o-txt strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt .o-tag { flex: none; }
/* the real <select> stays in the form, out of sight (it still holds the value and "fill this in" warnings) */
select.sel-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; min-width: 0 !important; height: 1px !important;
  padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
@media (prefers-color-scheme: dark) {
  .combo-btn { border-color: #3f3f46; }
  .combo-btn svg { color: #9ca3af; }
  .combo-btn:hover { border-color: #52525b; }
  .combo-btn:focus-visible, .combo-btn[aria-expanded="true"] { border-color: #93a5d8; box-shadow: 0 0 0 3px rgba(147, 165, 216, .25); }
  .combo-btn:disabled { background: #1f2530; color: #6b7280; border-color: #2b3342; }
}
@media (max-width: 700px) {
  .combo-sel .combo-btn { font-size: 16px; }
  .combo-q { font-size: 16px; }                  /* no iPhone zoom when the search box gets the focus */
}
@media print { .combo-btn svg { display: none; } .combo-btn { border-color: #999; } }

/* ===================================================================== v5.0 sign-in, 2FA, users and roles */
.auth-card { max-width: 400px; gap: 12px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-brand .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.auth-card h2 { font-size: 18px; margin: 4px 0 0; }
.auth-test { margin: -6px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--bad); letter-spacing: .05em; }
.auth-help { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input:not([type=checkbox]) { font-size: 16px; padding: 10px 12px; }      /* 16px: no zoom-in on iPhone */
.auth-form label.check, .acc-form label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px;
  font-weight: 500; color: var(--ink); }
.btn.big { padding: 12px 16px; font-size: 16px; font-weight: 700; text-align: center; }
.passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-err { margin: 0; color: var(--bad); font-size: 13px; }
.auth-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.qr { display: flex; justify-content: center; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }
.auth-key summary { cursor: pointer; font-size: 13px; color: var(--link); }
.auth-key .key { display: block; margin: 8px 0; font-size: 15px; letter-spacing: .06em; user-select: all; word-break: break-all;
  background: var(--bg); padding: 8px 10px; border-radius: 6px; }
.code-in { font-size: 22px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.rcodes { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rcodes code { display: block; text-align: center; background: var(--bg); padding: 6px; border-radius: 6px; font-size: 14px; user-select: all; }
.auth-row { display: flex; gap: 8px; }
.auth-links { margin: 0; font-size: 13px; text-align: center; color: var(--muted); }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.acc-row:first-of-type { border-top: 0; }
.acc-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.users-tbl, .roles-tbl, .log-tbl { width: 100%; border-collapse: collapse; }
.users-tbl tr.off-row td { color: var(--muted); }
.u-acts { text-align: right; width: 1%; white-space: nowrap; }
.u-more > summary { list-style: none; }
.u-more > summary::-webkit-details-marker { display: none; }
.u-panel { text-align: left; white-space: normal; display: flex; flex-direction: column; gap: 10px; padding: 12px 0 4px; min-width: min(560px, 80vw); }
.u-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.roles-tbl td:first-child { font-weight: 600; min-width: 220px; }
.roles-tbl th:not(:first-child), .roles-tbl td:not(:first-child) { text-align: center; }
.lv { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.lv-edit { background: var(--ok-bg); color: var(--ok); } .lv-none { background: var(--bg); color: var(--muted); }
.lv-sel { min-width: 90px; }
.lv-sel.lv-none { color: var(--muted); } .lv-sel.lv-edit { color: var(--ok); font-weight: 700; } .lv-sel.lv-view { font-weight: 600; }
.roles-save { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.log-tbl tr.bad-row td:nth-child(3) { color: var(--bad); font-weight: 600; }
.no-access { max-width: 560px; }
.no-access h1 { margin-bottom: 8px; }

/* --- v5.0.1 phone fixes (computers unchanged) -------------------------------------------------------------------- */
/* no double-tap zoom on touch screens (taps also react at once); pinch zoom still works */
html { touch-action: manipulation; }
@media (max-width: 760px) {
  /* the home-screen app runs under the iPhone status bar: the top bar, the menu drawer and the sign-in page leave room
     for it. The phone gives the size (0 in a browser tab and on computers, so nothing moves there). */
  .topbar { height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  /* the TEST copy: its red banner is the top line, so the room goes there instead */
  .test-bar { padding-top: calc(5px + env(safe-area-inset-top)); }
  .test-bar ~ .topbar { height: 52px; padding-top: 0; }
  html.side-drawer .sidenav { padding-top: calc(8px + env(safe-area-inset-top)); }
  .login-page { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* 16px text in every field: below 16px the iPhone zooms in when a field is tapped */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select { font-size: 16px; }
  /* search in the menu drawer: the list opens inside the drawer, as wide as the search box (Safari cut it off before) */
  .gs-pop { position: absolute; left: -1px; right: -1px; width: auto; top: calc(100% + 6px); }
}
/* pull down to refresh (home-screen app on a phone) */
.ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 58px); z-index: 80; display: flex; align-items: center; gap: 8px;
       transform: translate(-50%, -80px); opacity: 0; padding: 7px 14px 7px 9px; border-radius: 999px; background: var(--card); color: var(--ink);
       border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(15, 23, 42, .16); font-size: 13px; font-weight: 600; pointer-events: none; }
.ptr .ptr-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #e0e7ff; color: var(--navy);
                transition: transform .15s ease; }
.ptr.ptr-ready .ptr-ico { transform: rotate(180deg); }
.ptr.ptr-go .ptr-ico svg { animation: ptrspin .8s linear infinite; }
.ptr.ptr-back { transition: transform .2s ease, opacity .2s ease; }
@keyframes ptrspin { to { transform: rotate(360deg); } }
html.ptr-on, html.ptr-on body { overscroll-behavior-y: none; }   /* no rubber-band bounce at the top */
@media (prefers-color-scheme: dark) { .ptr .ptr-ico { background: #1e2a4f; color: #c7d2fe; } }
