/* DWA Fleet — Signal Red, Haul Black and Chrome Steel, light and dark themes */
:root, [data-theme="dark"] {
  --bg: #000000; --surface: #0E0F10; --surface-2: #1A1C1F; --ink: #F4F5F2; --muted: #A9B0B6; --line: #2C3035;
  --accent: #F41E2B; --accent-text: #F41E2B; --on-accent: #FFFFFF;
  --btn-bg: #D41926; --btn-ink: #FFFFFF;
  --ok-bg: #0F2A1C; --ok-ink: #86DCA8; --warn-bg: #33270A; --warn-ink: #F2B90C; --err-bg: #3A0D10; --err-ink: #FF8A92;
  --info-bg: #14243A; --info-ink: #9CC3F5;
  color-scheme: dark; /* the browser's own parts (date picker and its calendar icon, dropdowns, scrollbars) follow the theme */
}
[data-theme="light"] {
  --bg: #F4F5F2; --surface: #FFFFFF; --surface-2: #ECEEF1; --ink: #1D2125; --muted: #5A646D; --line: #D5D8D3;
  --accent: #F41E2B; --accent-text: #D41926; --on-accent: #FFFFFF;
  --btn-bg: #D41926; --btn-ink: #FFFFFF;
  --ok-bg: #E3F4EA; --ok-ink: #17603A; --warn-bg: #FBF0D5; --warn-ink: #6E4B05; --err-bg: #FBE4E1; --err-ink: #9B1A12;
  --info-bg: #E2EEFB; --info-ink: #1D4E89;
  color-scheme: light;
}

/* The logo comes in a steel version for dark and an ink version for light */
.logo { display: block; height: auto; }
.logo-on-light { display: none; }
[data-theme="light"] .logo-on-dark { display: none; }
[data-theme="light"] .logo-on-light { display: block; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: "Archivo", system-ui, sans-serif; letter-spacing: -0.01em; margin: 0; line-height: 1.12; }
h1, h2, .kpi .k-val, .big-status { font-stretch: 125%; font-weight: 800; }
h1 { font-size: 30px; font-weight: 600; }
h2 { font-size: 19px; font-weight: 600; margin-bottom: 14px; }
h3 { font-size: 16px; font-weight: 600; }
a { color: var(--accent-text); }
code { font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.amp { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 0 0 236px; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-menu { display: flex; flex-direction: column; gap: 18px; flex: 1 1 auto; }
.menu-btn { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; }
.menu-btn:hover { background: var(--surface-2); }
.menu-btn[aria-expanded="true"] { border-color: var(--accent); }
/* Desktop: the side menu stays put while the page scrolls */
@media (min-width: 861px) {
  .side { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
}
.brand { display: block; text-decoration: none; color: var(--ink); line-height: 0; }
.app-label { margin: -8px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.brand .rule { width: 2px; height: 26px; background: var(--accent); }
.brand .name, .bare-top .name { font-family: "Archivo", sans-serif; font-stretch: 125%; font-weight: 800; font-size: 17px; letter-spacing: 0; color: var(--ink); }
.side-company { margin: -10px 0 0; font-size: 13px; color: var(--muted); }
.side nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; }
.side nav a:hover { color: var(--ink); background: var(--surface-2); }
.side nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.who { margin: 0; font-size: 13px; color: var(--muted); }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 56px; }

.themes { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.themes button { font: 500 12px "Archivo", sans-serif; background: transparent; color: var(--muted); border: 0; padding: 0 10px; min-height: 32px; cursor: pointer; }
.themes button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Panels & grids */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; margin-bottom: 18px; min-width: 0; }
.panel > h2:first-child { margin-top: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.kpi .k-label { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.kpi .k-val { font-family: "Archivo", sans-serif; font-size: 30px; font-weight: 600; margin: 6px 0 0; line-height: 1.1; }
.kpi .k-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); font-weight: 500; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.badge.ok, .st-delivered, .tr-available, .t-active { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.badge.warn, .st-at_mine, .st-at_port, .tr-maintenance, .t-pending { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.badge.danger, .st-cancelled, .tr-inactive, .t-suspended { background: var(--err-bg); color: var(--err-ink); border-color: transparent; }
.st-to_load, .st-in_transit, .tr-on_load { background: var(--info-bg); color: var(--info-ink); border-color: transparent; }
.st-loading, .st-loaded, .st-offloading { background: var(--ink); color: var(--bg); border-color: transparent; }

/* Flash */
.flash { padding: 11px 14px; border-radius: 6px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.err { background: var(--err-bg); color: var(--err-ink); }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); }
.flash.info { background: var(--info-bg); color: var(--info-ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 6px; font: 500 14px "Archivo", sans-serif; text-decoration: none; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err-ink); border-color: var(--err-ink); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; cursor: pointer; font: inherit; }
form.inline { display: inline; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; }
.req { color: var(--err-ink); }
.hint { color: var(--muted); font-size: 12px; }
input, select, textarea { font: 15px "Archivo", sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; width: 100%; min-height: 40px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.check input { width: 18px; min-height: 18px; flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin-bottom: 0; min-width: 150px; }

/* Definition lists */
.dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* Live board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; min-height: 96px; }
.col h3 { font-size: 13px; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.col h3 .count { color: var(--muted); font-weight: 500; }
.lcard { display: block; text-decoration: none; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; margin-bottom: 8px; font-size: 13px; }
.lcard:hover { border-color: var(--accent); }
.lcard strong { display: block; font-size: 14px; }
.lcard span { color: var(--muted); display: block; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline .t-when { font-size: 12px; color: var(--muted); }
.timeline .t-note { margin: 2px 0 0; }

/* Progress steps */
.steps { display: flex; gap: 4px; margin: 4px 0 2px; }
.steps span { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--accent); }

/* Rate rows: excl | incl | calculate button */
.rate-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 210px; gap: 0 18px; align-items: start; }
.rate-calc { justify-content: flex-start; padding-top: 24px; }
.rate-calc .hint { min-height: 16px; }
@media (max-width: 640px) { .rate-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rate-calc { grid-column: 1 / -1; padding-top: 0; } }

/* Section tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 12px; }
.photo { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.photo > a { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .pdf { display: flex; align-items: center; justify-content: center; height: 100%; font-weight: 600; color: var(--muted); }
.photo figcaption { padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.photo figcaption strong { font-size: 13px; }
.photo figcaption span { color: var(--muted); }

/* Map */
.map { height: 460px; border-radius: 6px; border: 1px solid var(--line); z-index: 0; }
.map.small { height: 280px; }

/* Bare pages (login, driver) */
.bare { max-width: 520px; margin: 0 auto; padding: 22px 18px 48px; }
.bare-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.bare-top .spacer { flex: 1; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 28px 24px; }
.auth-card h1 { margin-bottom: 8px; }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox input { flex: 1; font-size: 13px; }

.big-status { font-family: "Archivo", sans-serif; font-size: 26px; font-weight: 600; margin: 4px 0 10px; }
.notice.warn { border-color: var(--warn-ink); background: var(--warn-bg); color: var(--warn-ink); }
.notice.warn h2 { color: var(--warn-ink); }
.notice.ok { border-color: var(--ok-ink); background: var(--ok-bg); color: var(--ok-ink); }
.panel.attention { border-color: var(--warn-ink); }
.panel.attention h2 .badge { vertical-align: middle; margin-left: 6px; }
/* Breakdown banner (top of every staff / transporter page) */
.bd-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; background: #C8101C; color: #fff; border-radius: 6px; padding: 16px 18px; margin-bottom: 12px; box-shadow: 0 0 0 3px rgba(244, 30, 43, 0.35); animation: bd-pulse 1.6s ease-in-out 3; }
.bd-banner a { color: #fff; }
.bd-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.bd-sub { font-size: 15px; font-weight: 500; opacity: 0.9; }
.bd-line { margin: 2px 0 0; }
.bd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-actions form { margin: 0; }
.bd-actions .btn { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
@keyframes bd-pulse { 50% { box-shadow: 0 0 0 9px rgba(244, 30, 43, 0.15); } }
@media (prefers-reduced-motion: reduce) { .bd-banner { animation: none; } }
.bd-slim { display: block; background: var(--err-bg); color: var(--err-ink); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; text-decoration: none; }
.bd-slim:hover { text-decoration: underline; }
.side nav li.sub a { padding-left: 26px; font-size: 14px; }
.nav-badge { display: inline-block; min-width: 20px; margin-left: 8px; padding: 1px 7px; border-radius: 10px; background: #E1141F; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.nav-badge[hidden] { display: none; }
tr.row-alert td:first-child { box-shadow: inset 3px 0 0 #E1141F; }
.bd-steps { list-style: none; padding: 0; margin: 0 0 14px; } .bd-steps li { padding: 7px 0; border-top: 1px solid var(--line); }
/* Driver page */
.bd-report { padding: 14px; } .bd-report > summary { list-style: none; text-align: center; cursor: pointer; font-size: 17px; }
.bd-report > summary::-webkit-details-marker { display: none; }
.bd-report[open] > summary { margin-bottom: 4px; }
.btn.danger.wide, .bd-report .btn.danger { background: #C8101C; color: #fff; border-color: #C8101C; }
.bd-driver { border-color: #E1141F; background: var(--err-bg); color: var(--ink); }
.bd-driver h2 { color: var(--err-ink); }
.pos-filter { max-width: 320px; width: 100%; }
.pos-table td { vertical-align: top; }
/* Phones: each truck as a card, location first in view */
@media (max-width: 700px) {
  .pos-table thead { display: none; }
  .pos-table, .pos-table tbody, .pos-table tr, .pos-table td { display: block; width: 100%; }
  .pos-table tr { position: relative; padding: 12px 0; border-top: 1px solid var(--line); }
  .pos-table td { border: 0; padding: 2px 0; }
  .pos-table td:last-child { position: absolute; top: 10px; right: 0; width: auto; }
  .pos-table tr[hidden] { display: none; }
}
.book-row { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px 4px; margin-bottom: 12px; }
[data-add-row] { margin: 2px 0 18px; }
.book-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mail-log { list-style: none; padding: 0; margin: 0; font-size: 13px; } .mail-log li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.small-head { font-size: 14px; margin: 18px 0 8px; }
.lock-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.codes { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codes code, .setup-key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; letter-spacing: 0.06em; }
.codes code { display: block; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; text-align: center; }
.setup-steps { padding-left: 20px; margin: 0; } .setup-steps li { margin-bottom: 14px; }
.qr { margin: 10px 0; } .qr svg { display: block; width: 220px; height: 220px; border-radius: 6px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 8px; } .inline-form .field { margin: 0; }
.diesel-stop { border-top: 1px solid var(--line); padding: 12px 0; }
.gps { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

@media (max-width: 860px) {
  /* Phones and small tablets: a slim bar with the logo and a menu button; the menu opens below it */
  .side { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; gap: 0; position: sticky; top: 0; z-index: 50; }
  .side-top .logo { width: 150px; }
  .menu-btn { display: inline-flex; }
  .side-menu { gap: 12px; padding: 14px 0 6px; }
  .js .side-menu { display: none; }
  .js .side.is-open .side-menu { display: flex; max-height: calc(100vh - 66px); max-height: calc(100dvh - 66px); overflow-y: auto; overscroll-behavior: contain; }
  .side nav a { padding: 12px 12px; font-size: 16px; }
  .side-foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
  /* 16px stops iPhones zooming in when a field is tapped */
  input, select, textarea, .copybox input { font-size: 16px; }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .map { height: 360px; }
}
/* Payment statement */
.st-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--accent); }
.st-title { text-align: right; }
.st-to { margin-bottom: 16px; }
.st-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 28px; max-width: 440px; margin: 18px 0 14px auto; }
.st-totals dt { color: var(--muted); }
.st-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table th, .st-table td { padding-left: 7px; padding-right: 7px; }
.st-table td.num { white-space: nowrap; }
[hidden] { display: none !important; } /* hidden always wins over a component's own display */
.badge.inv { background: var(--info-bg); color: var(--info-ink); text-decoration: none; }
.age-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 8px; margin: 16px 0 0; }
.age-cell { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.age-cell strong { display: block; font-size: 15px; color: var(--ink); margin-top: 2px; } .age-cell.due strong { color: var(--err-ink); }
.st-pickbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; }
.st-tick { width: 34px; } .st-tick input { width: 18px; height: 18px; }
tr.st-off td { opacity: 0.45; } tr.st-off td.st-tick { opacity: 1; }
.st-totals, .st-head { break-inside: avoid; page-break-inside: avoid; }
.st-totals .grand { color: var(--ink); font-weight: 800; font-size: 18px; border-top: 2px solid var(--ink); padding-top: 8px; }

/* Printing: black on white whatever the screen theme, no menus or filters */
@media print {
  :root, [data-theme="dark"], [data-theme="light"] { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --muted: #444; --line: #bbb; --accent-text: #000; }
  body { background: #fff; color: #000; font-size: 11px; }
  .side, .actions, .themes, .no-print, .tabs, .filters, .flash, .menu-btn { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  .panel { border: 0; padding: 0; }
  .logo-on-dark { display: none !important; } .logo-on-light { display: block !important; }
  a { color: #000; text-decoration: none; }
  .table-wrap { overflow: visible; }
  table { font-size: 10px; }
  .badge { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  tr.st-off { display: none; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* Communication notes on loads */
.note-list { list-style: none; margin: 0 0 14px; padding: 0; }
.note-list li { padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.note-list li:first-child { padding-top: 0; }
.note-list li:target { background: var(--warn-bg); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.note-ref { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.note-text { margin: 6px 0 4px; white-space: normal; overflow-wrap: anywhere; }
.note-list .t-when { font-size: 12px; color: var(--muted); }
.note-done { margin-top: 8px; }
.note-add > summary { list-style: none; display: inline-block; cursor: pointer; }
.note-add > summary::-webkit-details-marker { display: none; }
.note-add[open] > summary { display: none; }
.tabs.subtabs { margin-top: -6px; border-bottom: 0; }
.notes-table td { vertical-align: top; }

/* Notifications */
.bell { position: relative; display: none; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; margin-left: auto; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.bell:hover { background: var(--surface-2); }
.bell .bell-badge { position: absolute; top: -6px; right: -6px; margin: 0; min-width: 18px; padding: 1px 5px; font-size: 11px; }
@media (max-width: 860px) { .bell.bell-top { display: inline-flex; } }
.nav-ico { display: inline-flex; vertical-align: -3px; margin-right: 8px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px; color: inherit; text-decoration: none; border-radius: 8px; }
.notif-list a:hover { background: var(--surface-2); }
.notif-list li.unread a { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.notif-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.notif-ico { flex: 0 0 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; background: var(--surface-2); }
.notif-loaded { color: #2563eb; } .notif-delivered { color: #16a34a; font-weight: 700; } .notif-diesel { color: #d97706; }
.new-dot { color: var(--accent); font-weight: 700; }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 12px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.25); text-decoration: none; font-size: 14px; transition: opacity .4s, transform .4s; }
.toast span { color: var(--muted); font-size: 13px; }
.toast.out { opacity: 0; transform: translateY(8px); }
@media print { .bell, .toasts { display: none !important; } }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; }
.photo-actions form { margin: 0; }
.notif-list .t-when { font-size: 12px; color: var(--muted); }
.app-ver { margin: 0; font-size: 11px; color: var(--muted); }
.app-ver a { color: inherit; }

/* Driver: where to go */
.go-point { padding: 10px 0; border-top: 1px solid var(--line); }
.go-point:first-of-type { border-top: 0; padding-top: 0; }
.go-point.next strong { color: var(--ink); }

/* Date and time pickers: the calendar/clock icon in the theme's text colour, clearly clickable */
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"] { color-scheme: inherit; }
input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .85; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
@media print { :root { color-scheme: light; } }

/* Delete boxes */
.danger-zone { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.danger-zone h2 { color: var(--accent-text); }
.delete-form .field { max-width: 260px; }

#rate-history td .linkbtn + form, #rate-history td a.linkbtn { margin-right: 10px; }

/* Filter rows: a hint under one field no longer pushes its box up out of line with the others */
.filters .field { position: relative; }
.filters .field .hint { position: absolute; top: 100%; left: 0; margin-top: 3px; white-space: nowrap; }
.filters:has(.field .hint) { margin-bottom: 30px; }

/* Drag and drop onto file pickers (desktop) */
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; transition: border-color .15s, background .15s; }
.dropzone input[type="file"] { width: 100%; }
.dropzone .drop-hint { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.dropzone .drop-files { display: block; margin-top: 6px; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dropzone.over .drop-hint { color: var(--ink); font-weight: 600; }
@media (hover: none) { .dropzone .drop-hint .desk { display: none; } }

.tick-list { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.tick-list legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.tick-list .hint { flex-basis: 100%; }

/* WhatsApp share buttons */
.btn.wa { border-color: #25D366; }
.btn.wa::before, .wa-link::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #25D366; margin-right: 6px; vertical-align: 1px; }

/* Back button and period links */
.backbar { margin: -6px 0 12px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.backlink:hover { border-color: var(--accent); color: var(--accent-text); }
.period-links { margin: -6px 0 14px; }
