/* Design tokens and shared component classes copied verbatim from the real
   mockup Artifact's project/styles.css (claude.ai/artifact/5RHZRNeBbq8rKhXp8Ljje5,
   read directly from Login.dc.html/Dashboard.dc.html this run) — MOCKUP.md's
   own "Branding" section only lists the three headline brand colors, not
   the full design-system token set (text/border/status colors, fonts) the
   real artboards actually use, so pulling from the artboards' own
   stylesheet gets every page pixel-matched instead of approximated.
   Layout classes below the tokens (.app-shell, .sidebar, .stat-grid, etc.)
   are new: the mockup's artboards lay each screen out with one-off inline
   styles since every artboard is a single static frame, but a real
   multi-page app reuses the same shell across pages, so that layout is
   real, reusable CSS here instead. */

:root {
  --ink: #0F1A2A;
  --paper: #F3F5F8;
  --surface: #FFFFFF;
  --border: #E2E7EE;
  --border-strong: #CBD3DE;
  --text-primary: #0F1A2A;
  --text-secondary: #556173;
  --text-tertiary: #8791A1;
  --accent: #177A3C;
  --accent-dark: #14693A;
  --accent-soft: #E6F4EA;
  --accent-bright: #22A447;
  --good: #1F7A4D;
  --good-soft: #E3F3EA;
  --warn: #9A6700;
  --warn-soft: #FCF1D6;
  --bad: #B42318;
  --bad-soft: #FDE8E6;
  --info: #2B5E8C;
  --info-soft: #E3EEF8;
  --transit: #7A5AB5;
  --sidebar-bg: #0D1626;
  --sidebar-text: #9FACBF;
  --sidebar-hover: rgba(255,255,255,0.07);
  --font-sans: 'Inter', system-ui, 'Segoe UI', sans-serif;
  /* Numbers, tickets and registrations used to be set in a typewriter face. They are now the same face as everything else, with
     figures of equal width (see .mono), so columns still line up. The name is kept: many screens refer to it. */
  --font-mono: 'Inter', system-ui, 'Segoe UI', sans-serif;
  --shadow-card: 0 1px 2px rgba(15,26,42,0.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 1.45; background: var(--paper); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-card); }

/* --- Buttons, inputs, tables: copied verbatim from the real mockup
   Artifact's project/styles.css (read this run for the Rates screen),
   same provenance note as the header above --- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 7px; font-size: 13.5px; font-weight: 600; line-height: 1.35; border: 1px solid transparent; white-space: nowrap; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary:hover { background: #F8FAFC; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #fff; color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-disabled { opacity: 0.4; cursor: default; }
a.btn, a.nav-item { display: inline-flex; }

table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); padding: 0 16px 10px 16px; }
td { padding: 13px 16px; font-size: 13.5px; border-top: 1px solid var(--border); vertical-align: middle; }
tr.row-hover:hover td { background: rgba(28,27,24,0.02); }
tr.row-selected td { background: var(--accent-soft); }
tr[id]:target td { background: var(--accent-soft); }

.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text-primary); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.currency-input { display: flex; align-items: center; gap: 6px; }
.currency-input span { font-family: var(--font-mono); color: var(--text-secondary); }
.section-title { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 12px; }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.form-success { background: var(--good-soft); color: var(--good); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: rgba(28,27,24,0.06); color: var(--text-secondary); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.section-heading { font-size: 15.5px; font-weight: 650; letter-spacing: -0.005em; color: var(--text-primary); margin-bottom: 14px; }

/* --- Shared brand logo, sidebar --- */
.sidebar-logo-img { width: 100%; height: auto; display: block; }

/* --- App shell: sidebar + main content, used by every signed-in page --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar { width: 228px; min-width: 228px; background: var(--sidebar-bg); display: flex; flex-direction: column; padding: 18px 12px; box-sizing: border-box; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 8px; }
.sidebar-brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-bright); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-brand-name { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: #fff; line-height: 1.15; }
.sidebar-brand-sub { display: block; font-size: 11.5px; color: #7E8CA3; }
.nav-section-label { padding: 11px 10px 4px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #5F6C82; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group svg { flex-shrink: 0; width: 17px; height: 17px; opacity: 0.85; }

.nav-item { display: flex; align-items: center; gap: 10px; padding: 5.5px 10px; border-radius: 7px; color: var(--sidebar-text); font-size: 13.5px; font-weight: 500; }
.nav-item:not(.nav-item--soon):hover { background: var(--sidebar-hover); color: #fff; cursor: pointer; }
.nav-item.active { background: rgba(255,255,255,0.08); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent-bright); }
.nav-item--soon { opacity: 0.45; cursor: default; }

/* the links, wrapped so a phone can fold them away; on a wider screen the wrapper is simply part of the column */
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-toggle { display: none; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.16); background: transparent; color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.sidebar--open .sidebar-toggle { background: rgba(255,255,255,0.10); }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.avatar { width: 28px; height: 28px; border-radius: 100px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.sidebar-user-info { flex-grow: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 11.5px; color: var(--sidebar-text); }
.sidebar-signout { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: none; border: none; color: var(--sidebar-text); cursor: pointer; padding: 0; }
.sidebar-signout:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-signout[disabled] { opacity: 0.5; cursor: default; }

/* The sidebar stays in view while a long page scrolls (Omar, 2026-10-16: on the Dashboard the user menu was at the very bottom of
   the page). Its own content scrolls if the window is shorter than the menu, and the user block stays pinned at the bottom. */
@media (min-width: 721px) {
  .sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; padding-bottom: 0; }
  .sidebar-user { position: sticky; bottom: 0; background: var(--sidebar-bg); padding-bottom: 16px; }
}

.main-content { flex-grow: 1; padding: 28px 32px 40px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 3px; }

/* --- Dashboard --- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { padding: 18px 20px; }
.stat-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-value.stat-warn { color: var(--warn); }
.stat-value.stat-bad { color: var(--bad); }
.stat-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
a.stat-card:hover { box-shadow: 0 2px 8px rgba(28,27,24,0.12); }

.stat-ok { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-dark); }
.stat-dot { width: 7px; height: 7px; border-radius: 100px; background: var(--accent-bright); display: inline-block; flex-shrink: 0; }

/* Dashboard, second row: the two money cards stacked in a narrow column, today's route postings as a table beside them. */
.mid-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.mid-grid--single { grid-template-columns: minmax(0, 1fr); }
/* a wide table inside one of these cards slides sideways within the card, instead of widening the whole row past the screen */
.mid-grid > *, .bottom-grid > * { min-width: 0; }
.mid-stack { display: grid; gap: 16px; }
.mid-card { padding: 16px 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mid-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.mid-value { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.mid-card .stat-sub { white-space: nowrap; margin: 0 0 4px; }
a.mid-card:hover { box-shadow: 0 2px 8px rgba(15,26,42,0.10); }

.postings-card { padding: 16px 0 4px; }
.postings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 12px; }
.postings-all { font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.postings-all:hover { text-decoration: underline; }
.postings-card .empty-note { padding: 4px 20px 16px; }
.postings-table-wrap { overflow-x: auto; }
.postings-table th { padding: 9px 12px; background: #F8FAFC; border-top: 1px solid var(--border); white-space: nowrap; }
.postings-table td { padding: 11px 12px; }
.postings-table th:first-child, .postings-table td:first-child { padding-left: 20px; }
.postings-table th:last-child, .postings-table td:last-child { padding-right: 20px; }
.postings-table .num { text-align: right; white-space: nowrap; }
.postings-route { font-weight: 600; }
.postings-order { font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; }
.postings-bar { display: flex; width: 160px; max-width: 100%; height: 6px; border-radius: 100px; background: #E7EBF1; overflow: hidden; margin-top: 3px; }
.postings-bar i { display: block; height: 100%; }
.postings-bar-done { background: var(--accent-bright); }
.postings-bar-moving { background: var(--accent-bright); opacity: 0.45; }
.postings-bar-planned { background: #B9C3D0; }
@media (max-width: 1100px) { .mid-grid { grid-template-columns: minmax(0, 1fr); } .mid-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mid-stack { grid-template-columns: minmax(0, 1fr); } }
a.badge:hover { filter: brightness(0.94); }

.topbar-search { display: flex; justify-content: flex-end; margin-bottom: -8px; }
.topbar-search .input { width: 100%; max-width: 340px; padding: 8px 12px; font-size: 13px; }
.topbar-search--inline { margin: 0 12px 0 auto; }
.topbar-search--inline .input { width: 190px; }
.portal-main .topbar-search { margin-bottom: 0; }
.portal-main .topbar-search .input { max-width: none; }
.search-page { display: flex; flex-direction: column; gap: 16px; }
.search-hero { position: relative; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px 6px 6px 14px; box-shadow: 0 1px 2px rgba(28,27,24,0.04); transition: border-color 0.15s, box-shadow 0.15s; }
.search-hero:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-hero-icon { color: var(--text-tertiary); flex-shrink: 0; }
.search-hero input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 15px; padding: 10px 0; color: var(--text-primary); }
.search-hero .btn { padding: 10px 20px; }
.search-hero-route { flex: 0 1 260px; min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; padding: 9px 10px; color: var(--text-primary); }
.search-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 10px 2px 0; font-size: 13px; color: var(--text-secondary); }
.search-options label { display: inline-flex; align-items: center; gap: 8px; }
.search-options select { border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; padding: 5px 8px; color: var(--text-primary); }
.search-options-exact { cursor: pointer; }
.search-options-exact input { margin: 0; }
.search-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-summary { font-size: 13px; color: var(--text-secondary); }
.search-summary strong { color: var(--text-primary); font-weight: 600; }
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search-chips--center { justify-content: center; }
.search-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 100px; background: #fff; border: 1px solid var(--border); font-size: 12.5px; color: var(--text-secondary); text-decoration: none; }
.search-chip span { background: rgba(28,27,24,0.07); border-radius: 100px; padding: 0 7px; font-size: 12px; font-weight: 600; color: var(--text-primary); }
a.search-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.search-chip--static { background: transparent; }
.search-group { padding: 6px 0 4px; overflow: hidden; }
.search-group-header { display: flex; align-items: center; gap: 8px; padding: 12px 20px 8px; }
.search-group-header h2 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.search-count { font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-dark); border-radius: 100px; padding: 1px 8px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 16px; padding: 11px 20px; border-top: 1px solid var(--border); text-decoration: none; color: inherit; }
.search-group-header + .search-row { border-top-color: transparent; }
a.search-row--link { cursor: pointer; transition: background 0.12s; }
a.search-row--link:hover { background: rgba(28,27,24,0.035); }
a.search-row--link:hover .search-row-chevron { color: var(--accent-dark); transform: translateX(2px); }
/* Wide screens: title | detail | status | chevron as real columns, so the
   width is used instead of one long line per result. */
@media (min-width: 900px) {
  .search-row { grid-template-columns: minmax(220px, 400px) minmax(0, 1fr) auto 18px; }
  .search-row-main { display: contents; }
  .search-row-detail { margin-top: 0; }
  .search-row-status { min-width: 96px; display: flex; justify-content: flex-end; }
}
.search-row-title { font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.search-row-detail { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row-chevron { color: var(--text-tertiary); display: flex; transition: transform 0.12s, color 0.12s; }
.search-page mark { background: #FFF1A8; color: inherit; border-radius: 3px; padding: 0 1px; }
a.search-row--selected, a.search-row--selected:hover { background: var(--accent-soft); }
.search-detail { padding: 0; overflow: hidden; scroll-margin-top: 16px; }
.search-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.search-detail-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.search-detail-title { margin: 2px 0 0; font-family: var(--font-mono); font-size: 19px; font-weight: 600; }
.search-detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.search-detail-note { margin: 14px 20px 0; padding: 9px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.search-detail-subhead { font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-tertiary); padding: 16px 20px 0; }
.search-detail-subhead--divider { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 16px; }
.search-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 10px 20px 18px; }
.search-detail-grid .search-fact--wide { grid-column: span 2; }
.search-fact dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 4px; }
.search-fact dd { margin: 0; font-size: 13.5px; color: var(--text-primary); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.search-detail-customer { padding: 14px 20px 18px; border-top: 1px solid var(--border); background: rgba(28,27,24,0.02); }
.search-detail-customer .search-detail-subhead { padding: 0 0 8px; }
.search-detail-customer-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
a.search-detail-link { color: var(--accent-dark); font-weight: 500; text-decoration: none; }
a.search-detail-link:hover { text-decoration: underline; }
@media (max-width: 1100px) { .search-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .search-detail-head { flex-direction: column; align-items: flex-start; }
  .search-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .search-detail-grid .search-fact--wide { grid-column: auto; }
  .search-detail-customer-facts { grid-template-columns: minmax(0, 1fr); }
}
.search-more { padding: 10px 20px 12px; font-size: 12.5px; color: var(--text-tertiary); border-top: 1px solid var(--border); }
.search-empty { text-align: center; padding: 40px 24px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.search-empty h2 { margin: 14px 0 6px; font-size: 17px; font-weight: 600; }
.search-empty p { margin: 0 0 16px; color: var(--text-secondary); font-size: 13.5px; }
.search-empty-icon { width: 52px; height: 52px; border-radius: 100px; background: var(--accent-soft); color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
@media (max-width: 640px) {
  .search-row { grid-template-columns: minmax(0, 1fr) 18px; }
  .search-row-status { grid-column: 1; grid-row: 2; }
  .search-row-detail { white-space: normal; }
  .search-toolbar { flex-direction: column; align-items: flex-start; }
}
.form-warning { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-top: 6px; }
.dialog-overlay { display: none; position: fixed; inset: 0; background: rgba(28,27,24,0.55); align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.dialog-overlay.open { display: flex; }
.dialog-card { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
/* The "Send back to supplier" box and the "Use <value>" button beside a Photo check difference (2026-11-19). */
.send-back-card { max-width: 560px; padding: 22px 24px; gap: 16px; }
.send-back-title { font-size: 17px; font-weight: 700; }
.send-back-rules { padding: 11px 13px; background: var(--paper); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.use-value { display: inline; margin-left: 6px; }
.use-value .btn { font-size: 12px; padding: 2px 9px; }

.photo-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(28,27,24,0.75); align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.photo-modal-overlay.open { display: flex; }
.photo-modal-content { position: relative; max-width: min(90vw, 900px); max-height: 90vh; }
.photo-modal-content img { display: block; max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.photo-modal-close { position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 100px; background: #fff; border: none; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.photo-modal-turn { position: absolute; top: -14px; right: 28px; height: 32px; padding: 0 14px; border-radius: 100px; background: #fff; color: #0F1A2A; border: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; line-height: 1; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); white-space: nowrap; }
.photo-modal-turn:hover, .photo-modal-close:hover { background: #EEF1F5; }

.bottom-grid { flex-grow: 1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; min-height: 0; }
.attention-card, .activity-card { padding: 20px; display: flex; flex-direction: column; min-height: 0; }
.attention-list { display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.attention-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 8px; }
.attention-row:hover { background: rgba(28,27,24,0.02); }
.attention-body { flex-grow: 1; min-width: 0; }
.attention-title { font-size: 13.5px; font-weight: 500; }
.attention-detail { font-size: 12.5px; color: var(--text-secondary); }

.activity-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.activity-all { font-size: 12.5px; color: var(--text-tertiary); text-decoration: none; white-space: nowrap; }
.activity-all:hover { color: var(--text-primary); }
.activity-list { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; overflow: auto; }
.activity-row { display: flex; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; color: inherit; text-decoration: none; }
.activity-row--link:hover { background: rgba(28,27,24,0.04); }
.activity-time { width: 56px; flex-shrink: 0; padding-top: 1px; }
.activity-day { display: block; font-family: inherit; font-size: 11px; line-height: 1.2; }
.activity-body { min-width: 0; }
.activity-text { line-height: 1.4; }
.activity-tag { font-size: 10.5px; padding: 1px 6px; margin-right: 8px; vertical-align: 1px; }
.activity-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }

.empty-note { font-size: 13px; color: var(--text-tertiary); padding: 8px; }

/* --- Rates --- */
.rates-grid { flex-grow: 1; display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; min-height: 0; align-items: start; }
/* Read-only variant: a list page whose edit panel doesn't apply to this viewer (Ops on Rates). */
.rates-grid--single { grid-template-columns: minmax(0, 1fr); }
.rates-list-card { overflow: hidden; display: flex; flex-direction: column; }
.rates-table-scroll { overflow-x: auto; }
.users-group-row td { background: rgba(28,27,24,0.03); padding-top: 10px; padding-bottom: 10px; }
.rates-list-footer { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.rate-form-card { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.rate-form-title { font-size: 16px; font-weight: 600; }

/* --- Post Routes: the form runs across the top, the day's postings get the full width below --- */
.posting-form-card { padding: 20px 24px 22px; margin-bottom: 16px; }
.posting-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.posting-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 16px; align-items: start; }
.pf-route { grid-column: span 5; }
.pf-date { grid-column: span 2; }
.pf-tons { grid-column: span 2; }
.pf-product { grid-column: span 3; }
.pf-po { grid-column: span 3; }
.pf-order-number { grid-column: span 3; }
.pf-suppliers { grid-column: span 3; }
.pf-submit { grid-column: span 3; align-self: end; }
.pf-submit-row { display: flex; gap: 8px; }
.pf-locked { padding: 9px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; background: rgba(28,27,24,0.03); font-size: 13.5px; color: var(--text-secondary); min-height: 40px; display: flex; align-items: center; }
.posting-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 4px 0 0 -8px; }
tr.row-editing td { background: var(--accent-soft); }
/* Generic 12-column form grid for the "form across the top" screens (Suppliers, Customers, Blacklist).
   Children pick a span with .fg-N; .fg-wide is a full row once the screen narrows; .fg-end sits on the
   row's bottom edge (buttons); .fg-center centres a hint against the inputs beside it. */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 16px; align-items: start; }
.fg-2 { grid-column: span 2; } .fg-3 { grid-column: span 3; } .fg-4 { grid-column: span 4; } .fg-5 { grid-column: span 5; }
.fg-6 { grid-column: span 6; } .fg-7 { grid-column: span 7; } .fg-8 { grid-column: span 8; } .fg-9 { grid-column: span 9; }
.fg-12 { grid-column: 1 / -1; }
.fg-end { align-self: end; }
.fg-center { align-self: center; }
.fg-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.form-grid .form-hint { margin-top: 0; }
@media (max-width: 1100px) {
  .form-grid > * { grid-column: span 6; }
  .form-grid > .fg-wide, .form-grid > .fg-12 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .form-grid > * { grid-column: 1 / -1; }
}

/* Customers: the recon-method explanation as one column per option, and the selected customer's detail as two
   columns (upload + history | recon-vs-loads results) once it has the page's full width. */
.recon-hint { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.recon-hint-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.customer-detail-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.customer-detail-cols--single { grid-template-columns: minmax(0, 1fr); }
.customer-detail-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1100px) {
  .recon-hint-cols { grid-template-columns: 1fr; gap: 8px; }
  .customer-detail-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Loads "+ New load": same idea as the Post Routes form -- one wide row across the top. */
.load-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 16px; align-items: start; }
.lf-posting { grid-column: span 5; }
.lf-vehicle { grid-column: span 3; }
.lf-ticket { grid-column: span 2; }
.lf-tons { grid-column: span 2; }
.lf-hint { grid-column: span 7; align-self: end; margin: 0; padding-bottom: 11px; }
.lf-submit { grid-column: span 3; align-self: end; }
.pf-scope { display: flex; flex-wrap: wrap; gap: 6px 22px; padding-top: 9px; }
.pf-scope label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
/* Post to > Select suppliers (2026-11-20): the list has a row of its own across the form, every supplier in view, a ticked one in green.
   The Post route button drops under it, on the right, so it is the last thing after the ticks. */
.pf-picker { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 16px; background: var(--paper); }
.pf-picker[hidden], .sp-item[hidden], .sp-nomatch[hidden] { display: none; }
.pf-picker:not([hidden]) + .pf-submit { grid-column: 10 / -1; }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.sp-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sp-count { font-size: 12px; font-weight: 500; color: var(--text-secondary); background: rgba(28,27,24,0.06); border-radius: 999px; padding: 2px 10px; }
.sp-count--some { background: var(--accent-soft); color: var(--accent); }
.sp-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-find { width: 220px; height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; background: #fff; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.sp-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13.5px; cursor: pointer; min-width: 0; transition: border-color .12s, background .12s; }
.sp-item:hover { border-color: var(--border-strong); }
.sp-item input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.sp-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.sp-item:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-nomatch { font-size: 13px; color: var(--text-secondary); padding: 6px 2px 0; }
.posting-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
/* Twelve columns: tighter side padding than the global 16px so the full-width table fits a 1440px laptop
   without a horizontal scroll; the first/last cells keep the card's 20px edge so they line up with its header. */
.posting-table > thead > tr > th, .posting-table > tbody > tr > td,
.compact-table > thead > tr > th, .compact-table > tbody > tr > td { padding-left: 11px; padding-right: 11px; }
/* Post Routes has the most columns of any table: a little tighter still, so its Status column stays on a 1440px screen. */
.posting-table > thead > tr > th, .posting-table > tbody > tr > td { padding-left: 8px; padding-right: 8px; }
.posting-table > thead > tr > th:first-child, .posting-table > tbody > tr > td:first-child,
.compact-table > thead > tr > th:first-child, .compact-table > tbody > tr > td:first-child { padding-left: 20px; }
/* A long name in a narrow column: one line, cut with "...", the full name in its tooltip (the Customer column on Rates). */
.cell-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Order numbers and rand figures are single tokens: never break "R 450.00" or "TSLS-ORD-20260923-01" across lines. */
.posting-table > tbody > tr > td.mono, .compact-table > tbody > tr > td.mono { white-space: nowrap; }
.posting-table > thead > tr > th:last-child, .posting-table > tbody > tr > td:last-child,
.compact-table > thead > tr > th:last-child, .compact-table > tbody > tr > td:last-child { padding-right: 20px; }
@media (max-width: 1100px) {
  .posting-form > *, .load-form > * { grid-column: span 6; }
  .pf-route, .pf-suppliers, .pf-picker, .lf-posting, .lf-hint { grid-column: 1 / -1; }
  .pf-picker:not([hidden]) + .pf-submit { grid-column: 1 / -1; }
  .sp-find { width: 100%; }
  .lf-hint { padding-bottom: 0; }
}
@media (max-width: 640px) {
  .posting-form > *, .load-form > * { grid-column: 1 / -1; }
}
.rate-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; padding-top: 4px; }
.map-placeholder { position: relative; height: 200px; border-radius: 10px; border: 1px solid var(--border); background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--text-tertiary); overflow: hidden; }

/* --- Error pages (no mockup counterpart — plain, on-brand fallback for
   the not-permitted / account-pending / sign-in-not-configured cases) --- */
.error-page { max-width: 480px; width: 100%; margin: 80px auto; text-align: center; align-self: center; }
.error-page h1 { color: var(--accent-dark); }

/* --- Supplier top-nav shell (SupplierDashboard.dc.html and its sibling
   tabs) — a different app shell from .app-shell/.sidebar entirely, since
   a supplier login's screens use a horizontal top bar, not a sidebar --- */
.supplier-shell { display: flex; flex-direction: column; min-height: 100vh; }
.supplier-topbar { height: 64px; min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 32px; gap: 28px; box-sizing: border-box; }
.supplier-topbar-brand { display: flex; align-items: center; gap: 10px; }
.supplier-topbar-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.supplier-topbar-name { font-weight: 600; font-size: 14.5px; }
.supplier-topbar-nav { display: flex; gap: 4px; flex-grow: 1; }
.nav-tab { padding: 8px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-secondary); }
.nav-tab:not(.nav-tab--soon):hover { background: rgba(28,27,24,0.04); color: var(--text-primary); cursor: pointer; }
.nav-tab.active { background: var(--accent-soft); color: var(--accent-dark); }
.nav-tab--soon { opacity: 0.4; cursor: default; }
.supplier-topbar-user { display: flex; align-items: center; gap: 10px; }
.supplier-topbar-user-name { font-size: 13px; font-weight: 500; }
.supplier-topbar-user-role { font-size: 11.5px; color: var(--text-secondary); }
.topbar-signout { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0; }
.topbar-signout:hover { background: var(--border); color: var(--text-primary); }
.topbar-signout[disabled] { opacity: 0.5; cursor: default; }
.supplier-main { flex-grow: 1; padding: 28px 40px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.route-progress-track { height: 6px; border-radius: 100px; background: var(--border); overflow: hidden; margin-bottom: 8px; }
.route-progress-fill { height: 100%; background: var(--accent); }
.route-progress-fill.route-progress-warn { background: var(--warn); }
.route-progress-track--delivered { margin-bottom: 6px; }
.route-progress-fill.route-progress-delivered { background: var(--info); }
.route-progress-legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-tertiary); margin-bottom: 10px; }
.route-progress-legend span { display: inline-flex; align-items: center; gap: 5px; }
.route-progress-legend strong { color: var(--info); font-weight: 600; }
.route-legend-dot { width: 8px; height: 8px; border-radius: 100px; background: var(--accent); display: inline-block; }
.route-legend-dot--delivered { background: var(--info); }
.route-offloaded-text { color: var(--info); font-weight: 500; }
.route-progress-fill.route-progress-transit { background: var(--transit); }
.route-legend-dot--warn { background: var(--warn); }
.route-legend-dot--transit { background: var(--transit); }
.route-progress-legend .route-legend-transit { color: var(--transit); font-weight: 600; }   /* beats ".route-progress-legend strong" (blue), which made the In transit figure the wrong colour */
.route-transit-text { color: var(--transit); font-weight: 500; }
.fleet-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fleet-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 100px; padding: 2px 9px; white-space: nowrap; }
.fleet-flag i { width: 7px; height: 7px; border-radius: 100px; background: var(--accent-dark); }
.fleet-flag--new { background: var(--accent-soft); color: var(--good); }
.fleet-flag--changed { background: var(--warn-soft); color: var(--warn); }
.fleet-flag--removed { background: var(--bad-soft); color: var(--bad); }
.fleet-flag--idle { background: transparent; color: var(--text-tertiary); font-weight: 400; padding-left: 2px; }

/* --- Supplier Portal — mobile shell (SupplierPortal.dc.html). A real
   responsive mobile page (fluid width), not a fixed 390px desktop-frame
   recreation of the mockup's own single-device preview canvas — this is
   meant to actually be used on a phone in the field. --- */
.portal-shell { display: flex; flex-direction: column; min-height: 100vh; max-width: 480px; margin: 0 auto; background: var(--paper); }
.portal-topbar { background: var(--sidebar-bg); padding: 18px 18px 14px 18px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.portal-topbar-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.portal-topbar-name { font-size: 13.5px; font-weight: 600; color: #fff; }
.portal-topbar-sub { font-size: 11.5px; color: var(--sidebar-text); }
.portal-topbar-sub:hover { color: #fff; text-decoration: underline; }
.portal-tabbar { display: flex; padding: 0 18px; gap: 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.tab-btn { padding: 12px 0; font-size: 13.5px; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }
.portal-main { flex-grow: 1; padding: 16px 18px; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; }

.load-card { padding: 14px; }
.load-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.load-card-title { font-size: 13.5px; font-weight: 500; }
.load-card-sub { font-size: 12.5px; color: var(--text-secondary); }
.load-card-figures { display: flex; gap: 14px; margin-top: 8px; font-size: 12.5px; }

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mid-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}

/* --- The staff screens on a phone (2026-11-17). The sidebar becomes a bar across the top: the name and a Menu button; the links
   and the signed-in user fold behind the button (the whole list used to sit above every screen, half a phone screen tall). The
   page gets less padding, side-by-side layouts become one column, and the Dashboard's five figures sit two to a row. --- */
@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; }
  .sidebar-brand { flex: 1 1 0; min-width: 0; padding: 0; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-nav, .sidebar-user { display: none; flex: 1 0 100%; }
  .sidebar--open .sidebar-nav { display: flex; padding-top: 6px; }
  .sidebar--open .sidebar-user { display: flex; margin-top: 8px; }
  .main-content { padding: 16px; gap: 16px; }
  .main-content .page-title { font-size: 21px; }
  .topbar-search { margin-bottom: 0; }
  .topbar-search .input { max-width: none; }
  .main-content [style*="grid-template-columns"], .main-content .rates-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .main-content .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mid-stack { grid-template-columns: minmax(0, 1fr); }
  .postings-table, .main-content .rates-table-scroll > table { min-width: 560px; }
}

/* A field the viewer can see but not change (e.g. a captured vehicle registration). */
.input[readonly] { background: var(--paper); color: var(--text-secondary); cursor: not-allowed; }
.input[readonly]:focus { border-color: var(--border); box-shadow: none; outline: none; }

/* Management dashboard (Superadmin): KPI tiles and reconciliation checks. */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-card--lead { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi-card--lead .kpi-label, .kpi-card--lead .kpi-sub, .kpi-card--lead .kpi-month { color: rgba(255,255,255,0.65); }
.kpi-label { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.kpi-value { font-size: 22px; font-weight: 600; }
.kpi-sub { font-size: 12.5px; color: var(--text-tertiary); }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 8px; }
.kpi-spark { width: 96px; height: 30px; flex-shrink: 0; overflow: visible; }
.kpi-spark-line { fill: none; stroke: var(--accent-dark); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.kpi-spark-area { fill: var(--accent-soft); opacity: 0.7; stroke: none; }
.kpi-card--lead .kpi-spark-line { stroke: var(--accent); }
.kpi-card--lead .kpi-spark-area { fill: rgba(141,198,63,0.25); }
.kpi-latest { text-align: right; }
.kpi-latest-value { font-size: 15px; font-weight: 600; }
.kpi-change { font-size: 11.5px; font-weight: 600; }
.kpi-change--up { color: var(--good); }
.kpi-change--down { color: var(--bad); }
.kpi-change--flat { color: var(--text-tertiary); }
.kpi-card--lead .kpi-change--up { color: #9BE37A; }
.kpi-month { font-size: 11px; color: var(--text-tertiary); }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check-cell { padding: 16px 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.check-cell:last-child { border-right: none; }
.check-cell:hover { background: var(--paper); }
.check-label { font-size: 11.5px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-secondary); min-height: 30px; }
.check-note { font-size: 11.5px; line-height: 1.4; color: var(--text-tertiary); margin-top: -4px; }
.check-count { font-size: 24px; font-weight: 600; }
.check-count--open { color: var(--warn); }
.check-count--clear { color: var(--good); }
.check-link { font-size: 12.5px; font-weight: 600; color: var(--accent-dark); }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Management dashboard: analysis sections --- */
.mg-card { padding: 0; overflow: hidden; margin-top: 16px; }
.mg-head { padding: 16px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.mg-note { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; max-width: 640px; }
.mg-scroll { overflow-x: auto; }
.mg-table td { white-space: nowrap; }
.mg-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.mg-table th, .mg-table td { padding-left: 10px; padding-right: 10px; }
.mg-table th:first-child, .mg-table td:first-child { padding-left: 20px; }
.mg-table th:last-child, .mg-table td:last-child { padding-right: 20px; }
.mg-table thead th { padding-top: 12px; }
.mg-table th.num, .mg-table td.num { text-align: right; }
.mg-table td { padding-top: 11px; padding-bottom: 11px; }
.mg-table tfoot td { border-top: 1px solid var(--border-strong); font-weight: 600; background: var(--paper); }
.mg-name { font-weight: 600; }
.mg-sub { font-size: 12.5px; color: var(--text-tertiary); }
.mg-table tr.mg-subhead td { background: rgba(28,27,24,0.035); border-top: 1px solid var(--border); }
.mg-table td:first-child .mg-sub { white-space: normal; max-width: 360px; }
.mg-neg { color: var(--bad); }
.mg-big { font-size: 28px; font-weight: 600; line-height: 1.15; }
.mg-summary { display: flex; gap: 40px; padding: 16px 20px; flex-wrap: wrap; align-items: flex-start; border-bottom: 1px solid var(--border); }
.mg-aging { flex: 1; min-width: min(280px, 100%); display: flex; flex-direction: column; gap: 8px; }
.mg-aging-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(28,27,24,0.06); margin-top: 6px; }
.mg-aging-seg { display: block; height: 100%; }
.mg-aging-seg--0 { background: var(--accent-dark); }
.mg-aging-seg--1 { background: #D9A23A; }
.mg-aging-seg--2 { background: var(--bad); }
.mg-aging-legend { display: flex; gap: 6px 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); }
.mg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.mg-bar-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.mg-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: rgba(28,27,24,0.07); overflow: hidden; }
.mg-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mg-pct { color: var(--text-tertiary); font-size: 12px; display: inline-block; min-width: 34px; margin-left: 4px; }
.mg-group th { padding: 10px 16px 6px; }
.mg-group-cell { text-align: center; border-bottom: 1px solid var(--border); }
.mg-group-cell--owed { color: var(--warn); border-bottom-color: var(--warn); }
.mg-owed-cell { background: rgba(166,116,10,0.05); }
.mg-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); }
.mg-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.mg-chart { width: 100%; max-width: 920px; height: auto; display: block; }
.mg-bar--spacer { background: none; }
.mg-axis { font-size: 11.5px; fill: var(--text-tertiary); font-family: var(--font-mono); }
.mg-grid { stroke: var(--border); stroke-width: 1; }
.mg-grid--zero { stroke: var(--border-strong); }
.mg-hit { fill: transparent; }
.mg-col:hover .mg-hit { fill: rgba(28,27,24,0.04); }
.mg-seg-cost { fill: #9B978E; background: #9B978E; }
.mg-seg-fees { fill: var(--info); background: var(--info); }
.mg-seg-net { fill: var(--accent-dark); background: var(--accent-dark); }
.mg-seg-loss { fill: var(--bad); }
@media (max-width: 720px) { .mg-summary { gap: 20px; } .mg-bar { width: 56px; } }

/* --- Auto-refresh note (Operations dashboard, Loads list) --- */
.auto-refresh-note { position: fixed; right: 16px; bottom: 14px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 100px; box-shadow: var(--shadow-card); font-size: 12px; color: var(--text-secondary); }
.auto-refresh-note::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-dark); }
.auto-refresh-note--paused::before { background: var(--text-tertiary); }
.auto-refresh-note button { border: none; background: rgba(28,27,24,0.06); color: var(--text-primary); font: inherit; font-weight: 600; padding: 3px 10px; border-radius: 100px; cursor: pointer; }
.auto-refresh-note button:hover { background: rgba(28,27,24,0.12); }
@media print { .auto-refresh-note { display: none; } }

/* --- Revise rates / Rate adjustments --- */
.rv-dates { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.rv-dates > div { min-width: 200px; }
.rv-input { width: 92px; text-align: right; padding: 6px 8px; font-family: var(--font-mono); font-size: 13px; }
.rv-input--changed { border-color: var(--accent-dark); background: var(--accent-soft); }
.rv-changed td { background: rgba(141,198,63,0.07); }
.rv-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.rv-adjust { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-secondary); flex-wrap: wrap; }
.rv-adjust .rv-input { width: 72px; }
.rv-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--border); }
.rv-tile { padding: 14px 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.rv-tile:last-child { border-right: none; }
.rv-big { font-size: 22px; font-weight: 600; }
.rv-special { font-size: 13px; padding: 3px 0; color: var(--text-secondary); }
.rv-publish { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--paper); }
.rv-group td { background: var(--paper); border-top: 1px solid var(--border-strong); }
@media (max-width: 900px) { .rv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rv-tile:nth-child(2) { border-right: none; } }
.rv-dates input[type="date"] { max-width: 220px; }

/* Recon "Needs investigation": show which value disagrees with the load (2026-10-07) */
.recon-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 20px 10px; }
.recon-issues { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.recon-diff { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 1px 6px; font-weight: 600; }
.recon-note { border-bottom: 1px dashed var(--warn); color: var(--warn); }
.recon-ours { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.recon-row td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.recon-row--no_load td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.recon-row--not_yet_offloaded td:first-child { box-shadow: inset 3px 0 0 var(--border); }
.recon-row--now_agrees td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.recon-kinds { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 12px; }
.recon-kind { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--text-secondary); text-decoration: none; }
.recon-kind:hover { border-color: var(--text-secondary); }
.recon-kind--on { background: var(--text-primary); border-color: var(--text-primary); color: #fff; }
/* Rate history (2026-10-07) */
.rh-was { white-space: nowrap; font-size: 12px; color: var(--text-tertiary); margin-top: 2px; font-weight: 400; }
.rh-changed { font-weight: 600; color: var(--text-primary); }


/* Rate calculator and rate sheets (Superadmin). */
.rc-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.rc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.rc-fields .rc-wide { grid-column: 1 / -1; }
.rc-route { font-size: 17px; font-weight: 600; }
.rc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.rc-kpi { background: var(--paper); border-radius: 10px; padding: 12px 14px; }
.rc-kpi-label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.rc-kpi-value { font-size: 21px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.rc-amend { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.rc-amend-title { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.rc-amend-fields { display: grid; grid-template-columns: minmax(130px, 200px) minmax(130px, 200px) auto; gap: 12px; align-items: end; }
.rc-amend-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-torates { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; margin-bottom: 4px; }
@media (max-width: 640px) { .rc-amend-fields { grid-template-columns: 1fr 1fr; } .rc-amend-actions { grid-column: 1 / -1; } }
.rc-kpi-cpk { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-top: 6px; white-space: nowrap; }
.rc-kpi-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.rc-sum { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rc-sum td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.rc-sum td:last-child { text-align: right; font-family: var(--font-mono); }
.rc-sum tr.rc-total td { font-weight: 600; border-bottom: 2px solid var(--border-strong); }
.rc-note { font-size: 12.5px; color: var(--text-secondary); margin-top: 10px; line-height: 1.5; }
.rc-up { color: var(--bad); }
.rc-down { color: var(--good); }
.rc-matrix th, .rc-matrix td { white-space: nowrap; }
.rc-matrix td.num, .rc-matrix th.num { text-align: right; }
@media (max-width: 1250px) { .rc-grid { grid-template-columns: 1fr; } }

.tc-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 20px 12px; padding: 10px 14px; background: var(--paper); border-radius: 10px; }
.tc-group-text { font-size: 13px; flex: 1 1 280px; }

/* the tick-box vehicle list on a route tile (Supplier Dashboard): opens in place so the card never clips it */
.vsel-btn { width: 100%; text-align: left; cursor: pointer; background: var(--surface); }
.vsel-btn::after { content: "\25BE"; float: right; color: var(--text-tertiary); }
.vsel-panel { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 10px; padding: 8px; background: var(--surface); }
.vsel-filter { margin-bottom: 6px; }
.vsel-list { max-height: 260px; overflow-y: auto; }
.vsel-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.vsel-item:hover { background: var(--paper); }
.vsel-item input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent-dark); }
.vsel-item--off { color: var(--text-tertiary); cursor: not-allowed; }
.vsel-item[hidden] { display: none; }
.vsel-hint { margin: 0 0 12px; }
.dup-warning { margin: 12px 0; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; background: var(--warn-soft); color: var(--warn); }
.dup-warning strong { display: block; }
.switch-portal { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 100px; background: var(--info); color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(28,27,24,0.18); }
.switch-portal:hover { background: #3D5873; color: #fff; }
.date-words { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-tertiary); min-height: 16px; }
.date-words--today { color: var(--warn); }
.date-words--tomorrow { color: var(--good); }
.date-words--past { color: var(--bad); }
.post-today-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Ticket Inbox (Omar, 2026-10-22) */
.inbox-drop { padding: 18px 20px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.inbox-drop-title { font-size: 15px; font-weight: 600; }
.inbox-drop-zone { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 2px dashed var(--border-strong); border-radius: 12px; color: var(--text-secondary); font-size: 14px; cursor: pointer; background: var(--paper); text-align: center; padding: 12px; }
.inbox-drop-zone:hover, .inbox-zone--over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.inbox-progress-bar { height: 8px; border-radius: 100px; background: rgba(28,27,24,0.08); overflow: hidden; }
.inbox-progress-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.inbox-section { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.inbox-count { font-size: 12px; font-weight: 600; background: rgba(28,27,24,0.07); color: var(--text-secondary); border-radius: 100px; padding: 1px 8px; }
.inbox-card { display: flex; gap: 16px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.inbox-thumb { flex: 0 0 150px; height: 150px; border-radius: 8px; overflow: hidden; background: var(--paper); border: 1px solid var(--border); display: block; }
.inbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inbox-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.inbox-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inbox-reg { font-size: 15px; font-weight: 600; }
.inbox-meta { font-size: 12.5px; margin-left: auto; }
.inbox-problem { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45; }
.inbox-none { font-size: 13px; color: var(--bad); padding: 8px 0; }
.inbox-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.inbox-field { min-width: 120px; }
.inbox-field--wide { flex: 1 0 100%; }
.inbox-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
.inbox-group-title { flex: 1 0 100%; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.inbox-group .inbox-field { min-width: 110px; flex: 1; }
.inbox-actions { display: flex; gap: 8px; flex: 1 0 100%; align-items: center; }
@media (max-width: 720px) { .inbox-card { flex-direction: column; } .inbox-thumb { flex-basis: auto; height: 200px; } }
.inbox-supplier { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.search-row-photo { font-family: var(--font-sans, inherit); font-size: 12.5px; font-weight: 500; margin-left: 10px; white-space: nowrap; }
.inbox-checks { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.inbox-check { color: var(--text-secondary); }
.inbox-check--ok { color: var(--good); font-weight: 600; }
.inbox-check--bad { color: var(--bad); font-weight: 600; }
.inbox-auto { padding: 16px 20px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.inbox-newkey { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.inbox-newkey strong { flex: 1 0 100%; font-size: 13px; }
.inbox-newkey code { font-family: var(--font-mono); font-size: 12.5px; background: #fff; border-radius: 6px; padding: 5px 8px; word-break: break-all; }
.inbox-keys { width: 100%; font-size: 13px; }
.inbox-keys th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); padding: 4px 10px 4px 0; }
.inbox-keys td { padding: 6px 10px 6px 0; border-top: 1px solid var(--border); }
.inbox-keyform { display: flex; gap: 8px; align-items: center; }
.inbox-keyform .input { max-width: 340px; }
.inbox-not-tickets > summary { cursor: pointer; list-style: none; }
.inbox-not-tickets > summary::-webkit-details-marker { display: none; }

.inbox-stale { flex: 0 0 auto; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.inbox-stale-title { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.inbox-stale-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inbox-stale-trip { flex: 1 0 100%; font-size: 13px; }
.inbox-stale-detail { color: var(--text-tertiary); }
.inbox-stale-form .input { flex: 1; min-width: 220px; max-width: 380px; }
.inbox-stale-help { font-size: 12.5px; color: var(--text-tertiary); }
.inbox-missing { padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.inbox-missing-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.inbox-missing-title { font-size: 14px; font-weight: 600; }
.inbox-missing-help { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; max-width: 760px; }
.inbox-missing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.inbox-missing-truck { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.inbox-missing-reg { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.inbox-missing-truck ul { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.inbox-missing-what { font-weight: 600; }
.inbox-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inbox-chip { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-secondary); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.inbox-chip:hover { border-color: var(--text-tertiary); }
.inbox-chip.is-on { background: var(--text-primary, #1f2a1f); border-color: var(--text-primary, #1f2a1f); color: #fff; }
.inbox-chip.is-on .inbox-count { background: rgba(255, 255, 255, 0.2); color: #fff; }
.inbox-card[hidden] { display: none; }
.inbox-truck { flex: 1 0 auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.inbox-fixes { display: flex; flex-wrap: wrap; gap: 0 28px; align-items: center; }       /* the truck box and the Delivery No box side by side */
.inbox-fixes .inbox-truck { flex: 0 0 auto; }
.inbox-truck .field-label { margin: 0; font-size: 12px; color: var(--text-secondary); }
.inbox-truck .input { width: 170px; }
.inbox-autoconfirm { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; }
.inbox-auto { margin-bottom: 14px; }
.inbox-card:target, tr:target { outline: 2px solid var(--accent, #8cc63f); outline-offset: 2px; border-radius: 10px; }
.rates-list-footer .withdrawn-note { margin-left: auto; }
.rates-list-footer .withdrawn-note a { color: var(--text-primary); text-decoration: underline; }

/* --- A row's actions: one plain button, the rest behind "More" (Loads, 2026-11-17) --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions-inner { display: inline-flex; align-items: center; gap: 4px; }
/* more buttons than fit on one line (Photo check): two short lines, right-aligned, instead of a cell wider than the screen */
.row-actions--wrap .row-actions-inner { flex-wrap: wrap; justify-content: flex-end; max-width: 300px; row-gap: 6px; }
.row-menu { display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary::after { content: ""; width: 6px; height: 6px; margin-left: 1px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.row-menu[open] > summary { background: #EEF1F5; color: var(--text-primary); }
.row-menu-list { position: fixed; z-index: 50; min-width: 180px; padding: 5px; background: #fff; border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 10px 28px rgba(15,26,42,0.16); display: flex; flex-direction: column; text-align: left; white-space: nowrap; }
.row-menu-list form { margin: 0; }
.row-menu-list a, .row-menu-list button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
.row-menu-list a:hover, .row-menu-list button:hover { background: var(--paper); }

/* --- Supplier Capture: which trip, 1 Loading, 2 Offloading as three cards; the photo box is one clear target (2026-11-17) --- */
.capture-form { display: flex; flex-direction: column; gap: 12px; }
.capture-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.capture-step { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 700; }
.capture-step-no { width: 22px; height: 22px; border-radius: 100px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.capture-step-no--done { background: var(--accent-soft); color: var(--accent-dark); }
.capture-done { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: var(--paper); }
.capture-photo { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 9px; background: var(--paper); cursor: pointer; }
.capture-photo:hover, .capture-photo:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.capture-photo--chosen { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.capture-photo-icon { width: 40px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.capture-photo-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.capture-photo-text strong { font-size: 14px; font-weight: 600; }
.capture-photo-file { font-size: 12.5px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capture-photo--chosen .capture-photo-file { color: var(--accent-dark); font-weight: 600; }
/* The real file field covers the whole box: a tap anywhere opens the camera or gallery, and the browser's own "please choose a file"
   message still has something to point at (a hidden field would make the form fail without saying why). */
.capture-photo input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
/* "Fix this load" (the supplier's screen for a load Treadstone sent back, 2026-11-19) and "Loads to fix" on their dashboard. */
.fix-note { padding: 13px 15px; background: var(--warn-soft); border: 1px solid #E9C46A; border-radius: 10px; }
.fix-note-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--warn); }
.fix-note-text { font-size: 14px; font-weight: 500; margin-top: 4px; color: var(--ink, #0F1A2A); overflow-wrap: anywhere; }
.fix-note-when { font-size: 12.5px; margin-top: 4px; color: var(--text-secondary); }
.input--check { border-color: #D99A1C; box-shadow: 0 0 0 3px rgba(217,154,28,0.18); }
.fix-photo { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.fix-photo-thumb { flex-shrink: 0; display: block; width: 74px; height: 96px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--paper); }
.fix-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fix-photo-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.fix-photo-text strong { font-size: 13.5px; font-weight: 600; }
.fix-photo-file { font-size: 12.5px; color: var(--text-tertiary); overflow-wrap: anywhere; }
.fix-photo-file--new { color: var(--accent-dark); font-weight: 600; }
.fix-photo-pick { position: relative; margin-top: 8px; overflow: hidden; cursor: pointer; }
.fix-photo-pick input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.to-fix-card { border-color: #E9C46A; }

/* --- Something useful but rarely needed, folded behind its own heading (2026-11-17): <details class="fold"> --- */
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; width: 7px; height: 7px; margin: 0 3px 0 2px; border-right: 1.8px solid var(--text-tertiary); border-bottom: 1.8px solid var(--text-tertiary); transform: rotate(-45deg); transition: transform 0.12s; flex-shrink: 0; }
.fold[open] > summary::before { transform: rotate(45deg) translate(-2px, -2px); }
.fold > summary:hover::before { border-color: var(--text-primary); }
.fold-title { font-size: 14.5px; font-weight: 600; }
.fold-hint { font-size: 12.5px; color: var(--text-tertiary); margin-left: auto; text-align: right; }
.fold-body { margin-top: 12px; }
.fold--flush > summary + * { margin-top: 0; }
/* a one-line "how it works" under a control: small, quiet, the text itself only when opened */
.fold--note > summary { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); gap: 6px; width: fit-content; }
.fold--note > summary:hover { color: var(--text-primary); }
.fold--note > .fold-body { margin-top: 6px; }

/* --- The supplier screens on a phone (2026-11-17). Dashboard, Vehicles and Drivers were laid out for a desk: on a phone the menu ran
   off the screen and two columns were squeezed into one screen's width. Below 720px: the menu is its own row that slides sideways,
   every side-by-side layout becomes one column, and a wide table slides sideways instead of crushing its text. The inline layouts
   on those screens are set in the templates themselves, hence the !important. --- */
@media (max-width: 720px) {
  .supplier-topbar { height: auto; min-height: 0; flex-wrap: wrap; padding: 10px 16px 0; gap: 8px 10px; }
  .supplier-topbar-brand { flex: 1 1 0; min-width: 0; }
  .supplier-topbar-brand .badge { display: none; }
  .supplier-topbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .supplier-topbar .topbar-search--inline, .supplier-topbar-user > .avatar, .supplier-topbar-user > div { display: none; }
  .supplier-topbar-nav { order: 3; flex: 1 0 100%; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .supplier-topbar-nav::-webkit-scrollbar { display: none; }
  .supplier-topbar-nav .nav-tab { flex-shrink: 0; white-space: nowrap; }
  .supplier-main { padding: 16px; gap: 16px; }
  .supplier-main .rates-grid, .supplier-main [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .supplier-main .rates-table-scroll > table { min-width: 560px; }
  .supplier-main .rates-table-scroll > table th, .supplier-main .rates-table-scroll > table td { padding-left: 10px; padding-right: 10px; }
  .supplier-main .page-title { font-size: 21px; }
}

/* Loads: the profit line under a load's customer. Green once final, grey while only expected, red for a loss. */
.load-profit { font-size: 11.5px; margin-top: 2px; font-weight: 600; color: var(--good); }
.load-profit--expected { color: var(--text-secondary); font-weight: 500; }
.load-profit--loss { color: var(--bad); }
.load-profit span { white-space: nowrap; }      /* an amount never breaks from its R */

/* Monthly statistics (2026-11-20) */
.stat-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stat-month { display: flex; gap: 6px; align-items: center; margin: 0; }
.stat-month-pick { width: auto; min-width: 170px; height: 32px; padding-top: 0; padding-bottom: 0; }
.stat-off { opacity: 0.35; pointer-events: none; }
.stat-warning { padding: 14px 18px; margin-top: 16px; border-left: 3px solid var(--warn); }
.stat-warning-title { font-weight: 600; }
.stat-warning-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.stat-warning-list { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 3px; }
.stat-warning-list a { font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.stat-notes { padding: 14px 20px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-tertiary); display: grid; gap: 4px; }
.stat-notes strong { color: var(--text-secondary); }

/* Saved quotes: where an agreed quote stands on the Rates screen (2026-11-20) */
.rq-rates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; }
.rq-rates-done { color: var(--good); font-weight: 500; }
.rq-rates a { color: var(--text-secondary); text-decoration: underline; }
