/* Load windows, list / card details, copy chips, status markers, colour and corner systems */

/* ===== Add / Edit Load — Premium Minimal (Option 4): Load # + Team on top, label column per section, live summary + payment rail ===== */
#modalOverlay .modal { max-width: 1120px; }
#modalOverlay .modal-body { padding: 0; }

.alx-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.alx-num-input, .alx-num-input:read-only { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0; font: 700 22px/1.15 var(--font); letter-spacing: -0.02em; color: var(--text-main); width: 9ch; outline: none; cursor: default; }
.alx-team { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.alx-team > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* Add / Edit Load time: hh:mm field + AM / PM switch (same look as the team switch above) */
.t12 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.t12 .t12-in { flex: 1 1 auto; min-width: 0; letter-spacing: .02em; }
.t12-ap { display: inline-flex; flex: none; height: var(--control-h); box-sizing: border-box; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--bg-hover); }
.t12-ap button { border: 0; background: transparent; padding: 0 8px; border-radius: 12px; font: 600 11.5px var(--font); color: var(--text-muted); cursor: pointer; }
.t12-ap button:hover:not(:disabled) { color: var(--text-main); }
.t12-ap button[aria-checked="true"] { background: var(--bg-card); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--border); }
.t12-ap button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.t12-ap button:disabled { cursor: not-allowed; opacity: .5; }
.t12-ap button:disabled[aria-checked="true"] { opacity: .7; }
/* a narrow form (laptop widths): each stop uses the phone layout — City + State, then Date + Time — so the time and AM / PM switch fit */

.alx-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 20px; background: var(--bg-hover); }
.alx-seg button { border: 0; background: transparent; padding: 5px 13px; border-radius: 15px; font: 600 12.5px var(--font); color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.alx-seg button:hover:not(:disabled):not([aria-checked="true"]) { color: var(--text-main); }   /* the selected team keeps its bright color, like AM / PM */
.alx-seg button[aria-checked="true"] { background: var(--bg-card); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--border); }
.alx-seg button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.alx-seg button:disabled { cursor: not-allowed; }
.alx-seg button:disabled:not([aria-checked="true"]) { opacity: .5; }
.alx-team .team-move-hint { position: absolute; top: 100%; left: 2px; white-space: nowrap; }

.alx-f > label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; min-width: 0; margin: 0; }
.alx-f > label .optional-hint { margin-left: auto; font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; }
/* soft filled fields, no hard borders */
#loadForm.alx-form .form-control, #loadForm.alx-form .ss-selected { background-color: var(--bg-hover); border-color: transparent; box-shadow: none; }
#loadForm.alx-form .form-control:focus, #loadForm.alx-form .searchable-select:has(.ss-dropdown.active) .ss-selected, #loadForm.alx-form .ss-selected:focus-visible { border-color: var(--primary); box-shadow: var(--focus-ring); background-color: var(--input-bg); }
#loadForm.alx-form .form-control.error, #loadForm.alx-form .form-control.time-bad, #loadForm.alx-form .ss-selected.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(242,109,109,0.2); }
#loadForm.alx-form .ss-locked .ss-selected { background: transparent; border: 1px dashed var(--border-strong); }
#loadForm.alx-form .form-control:disabled { opacity: .7; }
#loadForm.alx-form textarea.form-control { min-height: 78px; }

.alx-status select { font-weight: 600; }

.alx-split { margin-top: 10px; }
.alx-bar { height: 8px; border-radius: 99px; overflow: hidden; display: flex; background: var(--bg-hover); margin-bottom: 7px; }
.alx-bar i { display: block; height: 100%; background: var(--primary-fill); transition: width .2s; }
.alx-bar i + i { background: color-mix(in srgb, var(--primary-fill) 45%, transparent) !important; }

.alx-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 0; font-size: 13px; font-weight: 500; color: var(--text-main); cursor: pointer; user-select: none; }
.alx-sw input { appearance: none; -webkit-appearance: none; width: 36px; height: 21px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; flex-shrink: 0; margin: 0; transition: background .15s; }
.alx-sw input::after { content: ''; position: absolute; left: 2.5px; top: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.alx-sw input:checked { background: var(--success); }
.alx-sw input:checked::after { transform: translateX(15px); }
.alx-sw input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.alx-sw input:disabled { opacity: .55; cursor: not-allowed; }

#modalOverlay #companyFinHint { margin-top: 10px; }
/* tablets & phones: one column; Live summary + Payment come right after Dispatch, before Notes & files */
@media (max-width: 899px) {

    .alx-team { flex: 1 1 100%; }
    .alx-seg { display: flex; width: 100%; }
    .alx-seg button { flex: 1; padding: 7px 6px; }
    .alx-team .team-move-hint { position: static; white-space: normal; }

}

/* ===== Concept 2 "Tinted Bands" — Add / Edit / View Load, built to the reference image =====
   Design tokens (light / dark) are scoped to the two windows; the app's own variables follow them inside. */
#modalOverlay .modal, #viewModalOverlay .modal {
    --tb-bg: #ffffff; --tb-sub: #f8f9fb; --tb-fill: #f3f4f7; --tb-hover: #eef0f3; --tb-line: #e7e9ee; --tb-line2: #d6dae1;
    --tb-text: #16181d; --tb-muted: #5f6672; --tb-faint: #8c929c; --tb-primary: #1f5fd1; --tb-psoft: rgba(31,95,209,.08); --tb-ring: rgba(31,95,209,.18); --tb-onp: #ffffff;
    --tb-success: #13803e; --tb-danger: #cf2e2e; --tb-amber: #a85d00; --tb-asoft: rgba(168,93,0,.09); --tb-violet: #6b42d1; --tb-teal: #0b7a70;
    --tb-shadow: 0 1px 1px rgba(16,24,40,.04), 0 8px 24px -4px rgba(16,24,40,.10), 0 24px 60px -12px rgba(16,24,40,.16);
    --bg-card: var(--tb-bg); --bg-secondary: var(--tb-sub); --bg-hover: var(--tb-fill); --input-bg: var(--tb-bg); --border: var(--tb-line); --border-strong: var(--tb-line2);
    --text-main: var(--tb-text); --text-muted: var(--tb-muted); --text-faint: var(--tb-faint); --primary: var(--tb-primary); --primary-fill: var(--tb-primary); --primary-fill-hover: var(--tb-primary);
    --success: var(--tb-success); --danger: var(--tb-danger); --warning: var(--tb-amber); --focus-ring: 0 0 0 3px var(--tb-ring);
    --control-h: 34px; --radius-sm: 17px;
    background: var(--tb-bg); color: var(--tb-text); border: 0; border-radius: 27px; box-shadow: var(--tb-shadow); font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] #modalOverlay .modal, :root[data-theme="dark"] #viewModalOverlay .modal {
    --tb-bg: #1c1d20; --tb-sub: #18191c; --tb-fill: #25272b; --tb-hover: #2b2d32; --tb-line: #2c2e33; --tb-line2: #3b3e45;
    --tb-text: #eceef1; --tb-muted: #a3a9b2; --tb-faint: #7c838d; --tb-primary: #7aa8ff; --tb-psoft: rgba(122,168,255,.13); --tb-ring: rgba(122,168,255,.28); --tb-onp: #0c1526;
    --tb-success: #4fd68a; --tb-danger: #f47e7e; --tb-amber: #f2b552; --tb-asoft: rgba(242,181,82,.12); --tb-violet: #b49cff; --tb-teal: #56d2c2;
    --tb-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 24px 60px -12px rgba(0,0,0,.7);
}
@media (pointer: coarse) { #modalOverlay .modal, #viewModalOverlay .modal { --control-h: 40px; } }
#modalOverlay .modal { max-width: 1040px; }
#viewModalOverlay .modal.view-modal { max-width: 1040px; }
#modalOverlay .modal-body, #viewModalOverlay .modal-body { padding: 0; background: var(--tb-bg); }

.alx-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* footer: 62px, ghost secondary actions on the left, Cancel / Save on the right */
#modalOverlay .modal-footer, #viewModalOverlay .modal-footer { min-height: 62px; box-sizing: border-box; padding: 0 20px; border-top: 1px solid var(--tb-line); background: var(--tb-bg); align-items: center; }
#modalOverlay .modal-footer .btn, #viewModalOverlay .modal-footer .btn { height: 34px; min-height: 34px; padding: 0 15px; border-radius: 17px; font-size: 13px; font-weight: 600; gap: 7px; box-shadow: none; }
#modalOverlay .modal-footer .btn:not(.btn-outline):not(.btn-danger), #viewModalOverlay .modal-footer .btn:not(.btn-outline):not(.btn-danger) { background: var(--tb-primary); color: var(--tb-onp); border-color: transparent; }
#modalOverlay .modal-footer .btn:not(.btn-outline):not(.btn-danger):hover, #viewModalOverlay .modal-footer .btn:not(.btn-outline):not(.btn-danger):hover { filter: brightness(1.06); }
#modalOverlay .modal-footer .btn-outline, #viewModalOverlay .modal-footer .btn-outline { background: transparent; color: var(--tb-text); border: 1px solid var(--tb-line2); }
#modalOverlay .modal-footer .btn-outline:hover, #viewModalOverlay .modal-footer .btn-outline:hover { background: var(--tb-fill); }

#modalOverlay .modal-footer .btn-danger, #viewModalOverlay .modal-footer .btn-danger { color: var(--tb-danger); }
#modalOverlay .modal-footer .btn .ic, #viewModalOverlay .modal-footer .btn .ic { font-size: 14px; opacity: .9; }
#modalOverlay .modal-footer .footer-left, #modalOverlay .modal-footer .footer-right, #viewModalOverlay .modal-footer .footer-left, #viewModalOverlay .modal-footer .footer-right { gap: 8px; align-items: center; }
.tb-meta { font-size: 12px; color: var(--tb-faint); margin-right: 6px; white-space: nowrap; }
.tb-meta:empty { display: none; }

/* ---- header: title, Load #, status, close ---- */

.tb-numnote { font-size: 12px; color: var(--tb-faint); white-space: nowrap; margin-left: -4px; }
.tb-numnote[hidden] { display: none; }

.tb-x { width: 30px; height: 30px; border-radius: 15px; color: var(--tb-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.tb-x:hover { background: var(--tb-fill); color: var(--tb-text); }

/* ---- bands ---- */

.tb .form-group { gap: 5px; }
.tb .alx-f > label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 11px; font-weight: 600; color: var(--tb-muted); white-space: nowrap; letter-spacing: 0; text-transform: none; }
.tb .alx-f > label .optional-hint { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--tb-faint); }

/* ---- controls: white with a hairline on the tinted band, soft fill on the plain band ---- */
#loadForm .tb .form-control, #loadForm .tb .ss-selected { height: var(--control-h); border-radius: 17px; font-size: 13px; font-weight: 500; color: var(--tb-text); background: var(--tb-bg); border: 1px solid var(--tb-line); box-shadow: none; padding: 0 10px; }

#loadForm .tb .form-control::placeholder { color: var(--tb-faint); font-weight: 400; }
#loadForm .tb .form-control:focus, #loadForm .tb .searchable-select:has(.ss-dropdown.active) .ss-selected, #loadForm .tb .ss-selected:focus-visible { background: var(--tb-bg); border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-ring); outline: none; }
#loadForm .tb .form-control.error, #loadForm .tb .form-control.time-bad, #loadForm .tb .ss-selected.error { border-color: var(--tb-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-danger) 18%, transparent); }
#loadForm .tb .form-control:disabled { background: var(--tb-sub); border-color: var(--tb-line); color: var(--tb-faint); opacity: 1; }
#loadForm .tb .ss-locked .ss-selected { background: transparent; border: 1px dashed var(--tb-line2); }
#loadForm .tb textarea.form-control { height: 64px; min-height: 64px; padding: 9px 10px; line-height: 1.45; resize: none; }
#loadForm .tb .ss-selected { gap: 8px; }
#loadForm .tb .ss-selected > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#loadForm .tb .ss-caret { color: var(--tb-faint); font-size: 14px; }
.tb .ss-dropdown { border-radius: 20px; border: 0; box-shadow: 0 0 0 1px var(--tb-line), 0 12px 32px -6px rgba(0,0,0,.28); padding: 0; }
.tb .ss-option { font-size: 13px; }
.tb .ss-option.highlighted, .tb .ss-option.selected { background: var(--tb-psoft); color: var(--tb-primary); }
.tb-si { color: var(--tb-faint); font-size: 14px; }
.tb-ctl { position: relative; min-width: 0; }
.tb-ctl > .form-control { width: 100%; }
.tb-fi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--tb-faint); pointer-events: none; z-index: 1; }
#loadForm .tb .tb-ctl:has(> .tb-fi) > .form-control { padding-left: 32px; }
#loadForm .tb .tb-num > .form-control { text-align: right; }
#loadForm .tb input[type="date"] { position: relative; }
#loadForm .tb input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; opacity: 0; cursor: pointer; }

/* segmented controls (Team) and the AM / PM switch */
.tb .alx-seg { display: inline-flex; height: var(--control-h); box-sizing: border-box; padding: 3px; gap: 2px; border-radius: 19px; background: var(--tb-fill); align-items: stretch; }

.tb .alx-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-radius: 14px; font: 600 12px var(--font); color: var(--tb-muted); background: transparent; border: 0; box-shadow: none; white-space: nowrap; }
.tb .alx-seg button[aria-checked="true"] { background: var(--tb-bg); color: var(--tb-primary); box-shadow: 0 0 0 1px var(--tb-line), 0 1px 2px rgba(0,0,0,.07); }
.tb .alx-seg button:hover:not(:disabled):not([aria-checked="true"]) { color: var(--tb-text); }
.tb .alx-seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-ring); }
.tb .alx-seg button .ic { font-size: 13px; }
.tb .t12-ap { height: var(--control-h); box-sizing: border-box; padding: 3px; gap: 2px; border-radius: 17px; background: var(--tb-fill); }
.tb .t12-ap button { padding: 0 8px; border-radius: 14px; font: 700 11px var(--font); color: var(--tb-faint); }
.tb .t12-ap button[aria-checked="true"] { background: var(--tb-bg); color: var(--tb-primary); box-shadow: 0 0 0 1px var(--tb-line), 0 1px 2px rgba(0,0,0,.06); }
.tb .t12-ap button:disabled, .tb .t12-ap button:disabled[aria-checked="true"] { opacity: .45; }
.tb .t12-ap:has(button:disabled) { opacity: 1; }
.tb-asap { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); box-sizing: border-box; padding: 0 12px; border-radius: 17px; box-shadow: inset 0 0 0 1px var(--tb-line2); background: transparent; font: 700 12px var(--font); letter-spacing: .02em; color: var(--tb-muted); cursor: pointer; user-select: none; white-space: nowrap; }
.tb-asap input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tb-asap .ic { font-size: 13px; }
.tb-asap:hover { color: var(--tb-text); }
.tb-asap:has(input:checked) { color: var(--tb-amber); background: var(--tb-asoft); box-shadow: inset 0 0 0 1.5px var(--tb-amber); }
.tb-asap:has(input:focus-visible) { box-shadow: inset 0 0 0 1px var(--tb-line2), 0 0 0 3px var(--tb-ring); }
.tb-asap:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.tb-asap:has(input:disabled) input { cursor: not-allowed; }

/* ---- Team & Broker ---- */

.tb-teamf { position: relative; }
.tb-teamf > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.alx-team.tb-teamf .team-move-hint { position: static; white-space: normal; max-width: 320px; }
/* ---- Route ---- */

.tb-sfx > .form-control { text-align: right; padding-right: 30px !important; }
.tb-sfx > span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--tb-faint); pointer-events: none; }

.tb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tb-dot-p { background: var(--tb-success, #13803e); }
.tb-dot-d { background: var(--tb-danger, #cf2e2e); }

.tb-t12 { display: contents; }
.tb-t12 > .tb-tctl { grid-column: 1; grid-row: 2; }
.tb-t12 > .t12-ap { grid-column: 2; grid-row: 2; }
.tb-t12 > .tb-asap { grid-column: 3; grid-row: 2; }

/* ---- Drivers / Dispatchers rows ---- */

.tb-rm { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: var(--control-h); color: var(--tb-faint); cursor: pointer; border-radius: 15px; font-size: 13px; }
.tb-rm:hover { color: var(--tb-danger); background: color-mix(in srgb, var(--tb-danger) 8%, transparent); }
.tb-rm:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-ring); }
.tb-add { display: inline-flex !important; align-items: center; gap: 7px; height: 32px; padding: 0 12px; margin-top: 10px; border-radius: 17px; border: 1px dashed var(--tb-line2); font-size: 12.5px; font-weight: 600; color: var(--tb-primary); cursor: pointer; width: max-content; }
.tb-add[style*="none"] { display: none !important; }
.tb-add:hover { background: var(--tb-psoft); }
.tb-add:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tb-ring); }
.tb-add .ic { font-size: 13px; }
.tb-oo { display: none !important; }   /* Owner Operator is filled from the Driver and shown in View Load only */

#dispatcherBox:not(.route-box-solo) .tb-solo { display: none !important; }
.tb-split { margin-top: 10px; }
.tb-split .alx-bar { display: flex; gap: 3px; height: 4px; border-radius: 3px; overflow: hidden; margin: 0; background: transparent; }
.tb-split .alx-bar i { flex: 0 1 auto; min-width: 4px; }
.tb-split .alx-bar i:first-child { background: var(--tb-violet) !important; }
.tb-split .alx-bar i:last-child { background: var(--tb-teal) !important; }

/* ---- Financial ---- */

.tb-ro { padding-left: 8px; }
.tb .tb-ro .auto-value { height: var(--control-h); display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--tb-text); }

.tb-solov small { font-size: 11px; font-weight: 500; color: var(--tb-faint); letter-spacing: 0; }
#modalOverlay .tb #companyFinHint { margin-top: 12px; }
/* ---- Notes, Attachments, Status ---- */

.tb-flist .attachment-row { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px; font-size: 13px; color: var(--tb-text); background: transparent; border: 0; border-bottom: 1px solid var(--tb-line); border-radius: 0; }
.tb-flist .attachment-row > .ic { color: var(--tb-muted); font-size: 15px; }
.tb-flist .att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tb-flist .att-size { font-size: 12px; color: var(--tb-faint); }
.tb-flist .attachment-remove { display: flex; padding: 4px; color: var(--tb-faint); cursor: pointer; border-radius: 14px; }
.tb-flist .attachment-remove:hover { color: var(--tb-danger); }
.tb-flist:empty::before { content: 'No files attached yet.'; display: flex; align-items: center; height: 36px; padding: 0 4px; font-size: 13px; color: var(--tb-faint); border-bottom: 1px solid var(--tb-line); }

.tb-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 10px; border-radius: 19px; border: 1.5px dashed var(--tb-line2); font-size: 12.5px; color: var(--tb-muted); text-align: center; cursor: pointer; margin: 0; }
.tb-drop > .ic { color: var(--tb-primary); font-size: 16px; }
.tb-drop b { color: var(--tb-text); font-weight: 600; }
.tb-drop u { text-decoration: none; color: var(--tb-primary); font-weight: 600; }
.tb-drop em { font-style: normal; font-size: 11.5px; color: var(--tb-faint); }
.tb-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.tb-drop:hover, .tb-drop:has(input:focus-visible) { border-color: var(--tb-primary); }
.tb-drop:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* status selects: the value is shown as a pill (Load Status as colored text with a dot) */
.tb-psel { position: relative; min-width: 0; }
#loadForm .tb .tb-psel select { color: transparent !important; text-shadow: none; appearance: none; -webkit-appearance: none; background-image: none !important; padding-right: 30px; cursor: pointer; }
#loadForm .tb .tb-psel select option { color: var(--tb-text); background: var(--tb-bg); }
.tb-pill { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); max-width: calc(100% - 44px); pointer-events: none; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tb-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tb-pchev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--tb-faint); pointer-events: none; }
.tb-psel:has(select:disabled) .tb-pill { opacity: .7; }
.tb-psel:has(select:disabled) .tb-pchev { display: none; }
.tb-lst { width: 164px; }
#loadForm .tb .tb-lst select { height: 32px; border: 1px solid var(--tb-line2); background: var(--tb-bg); }
.tb-lst .tb-pill { background: transparent; padding: 0; font-size: 13px; }
.tb-sw { display: inline-flex !important; align-items: center; gap: 9px; height: var(--control-h); padding: 0 !important; font-size: 12.5px; font-weight: 500; color: var(--tb-text); cursor: pointer; width: max-content; }
.tb .tb-sw input { width: 28px; height: 16px; border-radius: 19px; background: var(--tb-line2); }
.tb .tb-sw input::after { left: 2px; top: 2px; width: 12px; height: 12px; }
.tb .tb-sw input:checked { background: var(--tb-primary); }
.tb .tb-sw input:checked::after { transform: translateX(12px); }
.tb-sw-on, .tb-sw:has(input:checked) .tb-sw-off { display: none; }
.tb-sw:has(input:checked) .tb-sw-on { display: inline; }

/* ===== View Load ===== */

.tb-pillv { display: inline-flex; align-items: center; gap: 6px; height: 22px; max-width: 100%; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tb-pillv::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ---- smaller screens ---- */
@media (max-width: 899px) {

    .tb-teamf, .tb-brk { grid-column: 1 / -1; }
    .tb .tb-teamf .alx-seg { display: flex; width: 100%; }
    .tb .tb-teamf .alx-seg button { flex: 1; padding: 0 6px; }

    .tb-ro { padding-left: 0; }

    /* stacked stops: a vertical line joins each pickup to its delivery */

}
@media (max-width: 639px) {
    .tb-numnote { display: none !important; }

    .tb-lst { width: 150px; }

    #modalOverlay .modal-footer, #viewModalOverlay .modal-footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
    .tb-meta { display: none; }
}

/* ===== Load Details — Variant 3: main column + summary sidebar (View window) ===== */
.view-modal .modal-body { padding: 0; }
.lx { display: grid; grid-template-columns: minmax(0, 1fr) 262px; color: var(--text-main); }

/* Load # copy button — looks like the number itself; glows green for a moment after copying */

@media screen and (max-width: 680px) {
    .lx { grid-template-columns: 1fr; }

}

/* ===== Typography: Manrope, light by default; 600 only for headings, section titles and key figures ===== */
body { font-weight: 400; letter-spacing: -0.003em; text-rendering: optimizeLegibility; }
b, strong, th { font-weight: 600; }
h1, h2, h3, .modal-header h2, .page-title h1, .load-card-syl, .stats-who { font-weight: 600; }
.data-table th { font-weight: 500; }
.data-table td, .form-group label, .form-control, .btn, .dock-tab, .dock-team-select, .db-tab-btn, .view-toggle-btn { font-weight: 500; }
.data-table td { font-weight: 400; }
.data-table .db-name { font-weight: 500; }
/* List view: every row the same height — indicators sit on the load-number line as small icons (hover = name) */
.list-head { display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 20px; }

/* List view: thinner rows — Updated left-aligned under the Status */
.data-table .list-status-cell { text-align: left; }
.data-table .list-status-cell .card-status-select { height: 26px; display: block; }
.data-table .list-status-cell .badge { display: inline-flex; }
.data-table tbody tr:has(.list-head) > td { padding-top: 5px; padding-bottom: 5px; }
.data-table .list-head { height: 18px; }
.data-table .cell-when { line-height: 1.25; }
/* Favorites star */
.fav-star { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: 0 3px 0 -3px; border-radius: 12px; cursor: pointer; color: var(--text-faint); flex-shrink: 0; transition: color .12s, background .12s; }
.fav-star .ic { font-size: 14px; }
.fav-star:hover { color: #e0a100; background: var(--bg-hover); }
.fav-star.on { color: #f5b301; }
.fav-star:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fav-filter-opt { margin-bottom: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.fav-filter-ic { color: #f5b301; font-size: 12px; }
.load-card { position: relative; }

.data-table .cell-driver { line-height: 1.3; }
/* First dock row: team selector, date, theme button and avatar share one exact center line */
.dock-left, .dock-right { height: 32px; align-items: center; }
.dock-team, .dock-team-select { height: 32px; }
.dock-right .dock-date { line-height: 32px; height: 32px; display: inline-flex; align-items: center; }
.dock-right .dock-theme { height: 32px; width: 32px; }
.dock-right .dock-user, .dock-right .dock-user-btn { height: 32px; display: flex; align-items: center; }
.dock-tab { height: 32px; }
@media (pointer: coarse) { .dock-tab { height: 32px; } .dock-right .dock-theme { width: 32px; height: 32px; } }

/* Cards: one fixed template — every row has a set height, so the same field sits at the same spot on every card */
.cards-grid.load-grid { align-items: stretch; }
.load-grid .load-card { height: 100%; gap: 7px; }
.load-card > * { flex-shrink: 0; }

.load-card .load-card-header { height: 22px; justify-content: flex-start; padding-right: 26px; }

.load-card .load-card-people, .load-card .load-card-disp { gap: 2px; }
.load-card .load-card-row { height: 18px; line-height: 18px; }

.load-card .card-status-select { flex-shrink: 0; }
/* Top dock: team selector, date and profile centered vertically in the panel */
.dock { padding-bottom: 6px; }
@media (min-width: 1240px) {
    .dock-left, .dock-right { align-self: center; }
}
/* Date (line 1) + weekday (line 2), right-aligned, same 32px band as the other controls */
.dock-datebox { display: inline-flex; flex-direction: column; align-items: flex-end; justify-content: center; height: 32px; text-align: right; white-space: nowrap; }
.dock-right .dock-datebox .dock-date { height: auto; line-height: 1.2; display: block; min-width: 0; }
.dock-weekday { font-size: 11px; line-height: 1.2; color: var(--sb-muted); font-weight: 400; }
@media (max-width: 599px) { .dock-weekday { font-size: 10px; } }
/* List rows: Load # cell centered; star sits left of the status dropdown */
.data-table td.list-load-cell { vertical-align: middle; }
.data-table .list-disp { line-height: 1.3; }
/* List view: Load # | (Status) | Details | … — Details holds the indicator icons with Email / Phone below */
.data-table td.list-details-cell { vertical-align: middle; }

.data-table .list-head { gap: 4px; }
.data-table .list-head .fav-star { margin: 0 2px 0 -4px; }
/* Sticky column headers (desktop/laptop: the table scrolls inside its own box) */
:root { --th-bg: color-mix(in srgb, var(--primary) 9%, var(--bg-card)); }
.data-table thead th { position: sticky; top: 0; z-index: 3; background: var(--th-bg); color: var(--text-main); border-bottom: 1px solid var(--border-strong); box-shadow: 0 1px 0 var(--border-strong); }
@media (min-width: 900px) {
    #boardListContainer:not([style*="none"]):has(.table-responsive), #finishedContainer:has(> .table-responsive) { display: flex !important; flex-direction: column; overflow: hidden; }
    #boardListContainer > *:has(.table-responsive) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
    #boardListContainer .table-responsive, #finishedContainer .table-responsive { flex: 1 1 auto; min-height: 0; overflow: auto; }
}

/* Whole Company: compact team label on every load (Cards + List) */
.team-tag { display: inline-flex; align-items: center; gap: 4px; height: 16px; padding: 0 6px; border-radius: 10px; box-sizing: border-box; flex-shrink: 0;
    font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap; color: var(--text-muted); background: var(--bg-secondary); border: 1px solid var(--border); }
.team-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tt, var(--text-muted)); flex-shrink: 0; }
.load-card .lc-top { display: flex; align-items: center; gap: 6px; height: 20px; min-width: 0; padding-right: 26px; flex-shrink: 0; }

.list-load-cell .list-team { display: flex; margin-top: 3px; line-height: 0; }
/* List view: sortable column headers */
.data-table.load-list th { font-weight: 600; }   /* List view (Active + Finished Loads): column headers Semi-Bold */
/* One sort control on every sortable table (Load Board, Load History, Analytics):
   grey ▲▼ = can be sorted · blue ▲ = lowest → highest (A → Z) · blue ▼ = highest → lowest (Z → A) */
.data-table th.ls-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th.ls-sortable:hover { color: var(--primary); }
.data-table th.ls-sortable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ls-ind { display: inline-block; width: 9px; margin-left: 3px; vertical-align: 0; font-size: 8px; line-height: 1; color: var(--primary); text-indent: 0; }
.ls-ind::after { display: inline-block; text-indent: 0; }
th.ls-asc .ls-ind::after { content: '\25B2'; }
th.ls-desc .ls-ind::after { content: '\25BC'; }
th.ls-sortable:not(.ls-asc):not(.ls-desc) .ls-ind::after { content: '\25B2\25BC'; width: 7px; font-size: 6.5px; line-height: 5px; letter-spacing: -1px; white-space: normal; word-break: break-all; vertical-align: -1px; opacity: .35; color: var(--text-muted); }
th.ls-sortable:not(.ls-asc):not(.ls-desc):hover .ls-ind::after { opacity: .8; color: var(--primary); }
/* money / number headings are right-aligned: the arrow goes on the left of the label, so the label ends where the numbers end */
th.ls-sortable.align-right { direction: rtl; }
th.ls-sortable.align-right .ls-ind { margin-left: 0; margin-right: 3px; }
/* Add / Edit Load: Team first in the first row */
.team-move-hint { margin-top: 4px; font-size: 11px; color: var(--warning); line-height: 1.3; }
/* Multiple Stops, Notes, Comments and No Update 2h+ icons: the same 22 × 16 box as the ASAP chips (cards, list, finished) */
.load-list .list-icons .di.ms-mark, .load-list .list-icons .di.notes-badge, .load-list .list-icons .di.stale-badge {
    box-sizing: border-box; width: 22px; min-width: 22px; max-width: 22px; height: 16px; flex: 0 0 22px; padding: 0; margin: 0; gap: 0;
    justify-content: center; align-items: center; border-radius: 10px; font-size: 0 !important; line-height: 0; overflow: hidden; }
.load-list .list-icons .di.ms-mark .ic, .load-list .list-icons .di.notes-badge .ic, .load-list .list-icons .di.stale-badge .ic { font-size: 11px; }

/* Load lists: identical column widths, row height and alignment on Active and Finished */
.data-table.load-list td { vertical-align: middle; }
.data-table .list-fav-cell { padding-left: 8px; padding-right: 0; }
.data-table .list-fav-cell .fav-star { margin: 0; }
/* Load lists (List view): column widths come from the content and are fitted to the box by fitLoadList() */
.load-list .cell-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 17px; }
.load-list .list-icons { display: grid; grid-template-columns: repeat(4, 24px); grid-auto-rows: 16px; gap: 3px; width: 105px; align-content: center; justify-items: center; }
.load-list .list-icons .di { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; margin: 0; gap: 0; border-radius: 10px; font-size: 0; line-height: 0; position: relative; box-sizing: border-box; }
.load-list .list-icons .di .ic { font-size: 10px; }
@media (max-width: 899px) { .load-list .list-icons { justify-content: end; justify-self: end; } }
@media (min-width: 900px) {
    .data-table.load-list { table-layout: auto; width: 100%; min-width: 0; font-size: 12px; }
    .data-table.load-list th { padding: 8px 8px 7px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
    .data-table.load-list td { padding: 4px 8px; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; box-sizing: border-box; }
    .data-table.load-list tr > :first-child { padding-left: 14px; }
    .data-table.load-list tr > :last-child { padding-right: 14px; }
    .data-table.load-list tr > .list-fav-cell:first-child { padding: 0 2px 0 12px; text-align: left; }
    .data-table.load-list .list-rc .cell-name { display: block; }
    .data-table.load-list tbody tr { height: 52px; }
    .data-table.load-list tbody td { height: 52px; max-height: 52px; }
    .data-table.load-list.ll-fit { table-layout: fixed; }
    .data-table.load-list.ll-fit th { white-space: normal; text-overflow: clip; line-height: 1.25; vertical-align: middle; }   /* a squeezed header wraps to 2 lines instead of "…" */
    .data-table.load-list.ll-measure { table-layout: auto !important; width: max-content !important; }
    .data-table.load-list .cell-stop, .data-table.load-list .cell-when, .data-table.load-list .cell-name,
    .data-table.load-list .list-disp, .data-table.load-list .list-syl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
    .data-table.load-list .list-disp { line-height: 17px; }
    .data-table.load-list .cell-stop { display: block; position: relative; padding-left: 14px; line-height: 17px; }   /* block so long city names end in "…" */
    .data-table.load-list .cell-stop::before { position: absolute; left: 0; top: 5px; }
    .data-table.load-list .cell-when { font-size: 10.5px; padding-left: 13px; letter-spacing: -0.01em; }
    .data-table.load-list .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
    .data-table.load-list .card-status-select { min-width: 0; width: auto; max-width: 100%; height: 26px; font-size: 11.5px; padding: 0 22px 0 8px; background-position: right 6px center; }
    .data-table.load-list.ll-fit .card-status-select { width: 100%; }
    .data-table.load-list td.align-right, .data-table.load-list th.align-right { text-align: right; }
    .data-table.load-list td.align-right > span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
    .data-table.load-list .list-fav-cell .fav-star { width: 18px; height: 18px; }
    .data-table.load-list .list-details-cell { overflow: visible; }
}
@media (min-width: 900px) and (max-width: 1199px) {
    .data-table.load-list, .data-table.load-list td { font-size: 11.5px; }
    .data-table.load-list td, .data-table.load-list th { padding-left: 5px; padding-right: 5px; }
    .data-table.load-list tr > :first-child { padding-left: 10px; } .data-table.load-list tr > :last-child { padding-right: 10px; }
    .data-table.load-list .card-status-select { font-size: 11px; padding: 0 18px 0 6px; background-size: 11px; background-position: right 4px center; }
}

/* POD indicator: read-only checkbox (Cards, List, View) */
.pod-mark { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; box-sizing: border-box; flex-shrink: 0; border-radius: 7px;
    border: 1.5px solid var(--border-strong); background: var(--bg-card); vertical-align: middle; }
.pod-mark.on { border-color: var(--success); background: var(--success); color: #fff; }
:root[data-theme="dark"] .pod-mark.on { color: #04140b; }
:root[data-theme="dark"] .pod-mark:not(.on) { border-color: #6b7482; background: transparent; }
.pod-mark .ic { font-size: 10px; }
.lc-pod { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.data-table.load-list th.lh-pod, .data-table.load-list td.list-pod { text-align: center; }
.data-table.load-list td.list-pod .pod-mark { margin: 0 auto; }
/* Notes & Comments: quiet surface with a gradient outline (no gradient fill) */
@media (min-width: 1101px) { .dashboard-summary-container:not(.dsx):has(#notesBtn[hidden]) { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }

/* Phones: dialog action buttons wrap into an even grid instead of running off the screen */
@media (max-width: 639px) {
    #modalOverlay .modal-footer, #viewModalOverlay .modal-footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
    #modalOverlay .modal-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    #modalOverlay .modal-footer .footer-left, #modalOverlay .modal-footer .footer-right { display: contents; }
    #modalOverlay .modal-footer .btn { width: 100%; min-width: 0; padding: 0 8px; }
}
@media screen and (max-width: 560px) {
    #viewModalOverlay .modal-footer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    #viewModalOverlay .modal-footer .footer-left, #viewModalOverlay .modal-footer .footer-right { display: contents; }
    #viewModalOverlay .modal-footer .btn { width: 100%; min-width: 0; height: auto; min-height: 42px; padding: 4px 6px; white-space: normal; line-height: 1.15; text-align: center; font-size: 12px; gap: 5px; }
    #viewModalOverlay .modal-footer .btn[style*="display: none"], #viewModalOverlay .modal-footer .btn[style*="display:none"] { display: none !important; }
}
/* Finished Loads → Export to Excel */
.finished-export-btn { margin-left: auto; flex-shrink: 0; }
.export-modal { max-width: 460px; }
.export-modal .modal-body { display: flex; flex-direction: column; gap: 12px; }
.export-hint { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.export-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.export-preview { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; min-height: 18px; }
@media (max-width: 899px) { .finished-export-btn { margin-left: 0; width: 100%; } }
@media (max-width: 380px) { .export-dates { grid-template-columns: minmax(0, 1fr); } }
/* User avatars: each user's own color (dock, Users list, Activity Log) */
.ua { --ua-size: 22px; width: var(--ua-size); height: var(--ua-size); flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
      background: var(--ua, #64748b); color: #fff; font-size: calc(var(--ua-size) * 0.42); font-weight: 600; letter-spacing: .02em; line-height: 1; vertical-align: middle; }
.ua-system { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.ua-system .ic { font-size: calc(var(--ua-size) * 0.55); }
.ua-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

.dock-user .session-avatar { color: #fff; font-size: 11.5px; letter-spacing: .02em; }
/* ===== Active Loads dashboard (Option 2): Financial Summary panel + status panel; filters in their own bar ===== */
.dsx { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.dsx-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px 14px; min-width: 0; }
.dsx-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.dsx-head > b { font-size: 13px; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.dsx-head .total-pill { margin-left: 0; }
/* Notes & Comments button: outlined button + red-bordered count */
.dsx-notes { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 5px 0 10px; border: 1px solid var(--border-strong); border-radius: 17px;
             background: var(--bg-card); color: var(--text-main); font: 600 12.5px var(--font); white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: border-color .12s, background-color .12s; }
.dsx-notes:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--bg-card)); }
.dsx-notes:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dsx-notes[hidden] { display: none; }
.dsx-notes .ic { font-size: 15px; color: var(--violet); }
.dsx-notes-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
               color: var(--danger); border: 1.5px solid var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--bg-card)); }
.dsx-fin { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); gap: 16px; align-items: center; }
.dsx-lead small { display: block; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.dsx-lead b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dsx-lead .dsx-margin { font-size: 12px; font-weight: 600; white-space: nowrap; }
.dsx-rest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; border-left: 1px solid var(--border); padding-left: 16px; }
.dsx-rest small { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.dsx-rest b { font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dsx-na { color: var(--text-faint); font-weight: 600; }
/* status rows: fill the first column top → bottom, then the second column */
.dsx-rows { display: grid; grid-auto-flow: column; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 4), auto); gap: 2px 18px; }
.dsx-r { display: grid; grid-template-columns: 124px minmax(0, 1fr) 32px; align-items: center; gap: 8px; font-size: 12px; min-width: 0; padding: 1px 4px; cursor: default; }
.dsx-r-n { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.dsx-r-n i { width: 7px; height: 7px; border-radius: 50%; background: var(--st); flex-shrink: 0; }
.dsx-r-t { height: 6px; border-radius: 99px; background: var(--bg-hover); overflow: hidden; }
.dsx-r-t span { display: block; height: 100%; border-radius: 99px; background: var(--st); }
.dsx-r b { text-align: right; font-weight: 700; color: var(--text-main); }
.dsx-rows .summary-empty { grid-column: 1 / -1; }
#loadsView > .toolbar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; margin-bottom: 12px; }
@media (max-width: 1100px) { .dsx { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639px) {
    .dsx-fin { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .dsx-rest { border-left: 0; padding-left: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
    .dsx-head { flex-wrap: wrap; }
    .dsx-notes { margin-left: 0; }
    .dsx-rows { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .dsx-r { grid-template-columns: 132px minmax(0, 1fr) 32px; }
}
/* ===== Copy chip — the single design for every copyable value (light + dark, desktop + touch) ===== */
.cp { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 22px; padding: 1px 7px; margin: 0; box-sizing: border-box; vertical-align: middle;
      border: 1px solid var(--border-strong); border-radius: 14px; background: var(--bg-card); color: var(--text-main);
      font: 600 12px/1.25 var(--font); letter-spacing: 0; font-variant-numeric: tabular-nums; text-decoration: none; text-align: left; white-space: nowrap; cursor: pointer;
      transition: border-color .12s, background-color .12s, color .12s, box-shadow .12s; }
.cp > .ic { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

.cp:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg-card)); }
.cp:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.cp.copied, .cp.copied:hover { border-color: var(--success) !important; color: var(--success) !important; background: var(--success-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.cp.copied > .ic { color: var(--success) !important; }
@media (pointer: coarse) { .cp { min-height: 28px; padding: 3px 9px; } }

/* placement */

.load-card .load-card-syl { overflow: visible; }

.load-card .lc-driver-name { display: inline-flex; flex-wrap: wrap; align-items: center; row-gap: 3px; }
.data-table .list-head { height: auto; min-height: 22px; }
.list-rc { display: flex; margin-top: 3px; min-width: 0; max-width: 100%; }
.load-list .cell-name > .cp { max-width: 100%; }
.load-list .cell-driver { overflow: visible; }
.load-list .cell-driver > .cp { max-width: 100%; }
.load-list .cell-driver + .cell-driver { margin-top: 3px; }

/* Company Trucks: Gross-only finances */
.company-fin-hint { color: var(--text-muted); border-color: var(--border); background: var(--bg-secondary); }   
/* Dispatcher statistics: own profit per team + total */
.dt-head { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 22px auto 10px; font-size: 14px; font-weight: 600; text-align: center; }
.dt-head span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.dt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 220px)); justify-content: center; gap: 12px; }
.dt-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; text-align: center; min-width: 0; }
.dt-team { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.dt-value { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dt-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 899px) { .dt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* clickable team cards (Dispatcher Statistics); the row is as wide as the number of team cards, so it stays centred */
@media (min-width: 900px) { .dt-grid { grid-template-columns: repeat(var(--dt-n, 4), minmax(0, 220px)); } }
button.dt-pick { font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
button.dt-pick:hover { border-color: var(--border-hover); box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
button.dt-pick:focus-visible { outline: none; box-shadow: var(--focus-ring); }
button.dt-pick.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.dt-cue { margin-top: 8px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.dt-pick:hover .dt-cue, .dt-pick.is-selected .dt-cue { color: var(--primary); }
.dt-cue .ic { width: 12px; height: 12px; }
.ic-rot-r { transform: rotate(-90deg); }
.di-prompt { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 16px; }
.di-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; background: var(--bg-secondary); }
.di-crumb { font: inherit; background: none; border: none; padding: 2px 4px; border-radius: 10px; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.di-crumb:hover { text-decoration: underline; }
.di-crumb:focus-visible, .di-year-pick:focus-visible, .di-ytab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.di-crumb .ic { width: 13px; height: 13px; }
.di-sep { color: var(--text-faint); }
.di-crumb-now { font-weight: 600; }
.di-pick-label { padding: 12px 16px 4px; font-size: 12px; color: var(--text-muted); }
.di-years { padding: 0 8px 8px; }
.di-year-pick { font: inherit; color: inherit; width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 8px; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; border-radius: 14px; }
.di-year-pick:last-child { border-bottom: none; }
.di-year-pick:hover { background: var(--bg-hover-soft); }
.di-year-pick .di-y { font-weight: 600; font-size: 14px; }
.di-year-pick .di-count { margin-left: auto; }
.di-year-pick .di-total { margin-left: 18px; min-width: 110px; text-align: right; font-weight: 600; }
.di-year-pick .ic { width: 14px; height: 14px; color: var(--text-faint); }
.di-year-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 4px; }
.di-ytab { font: inherit; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); cursor: pointer; }
.di-ytab:hover { border-color: var(--border-hover); }
.di-ytab.is-selected { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--on-primary); }
.di-months.di-months-open { padding: 6px 16px 12px; }
.di-month.di-month-total { font-weight: 600; border-top: 1px solid var(--border); border-bottom: none; margin-top: 2px; }
@media (max-width: 600px) { .di-year-pick .di-total { min-width: 0; margin-left: 10px; } .di-months.di-months-open .di-month { grid-template-columns: 1fr 70px 100px; } }

/* the same green state for every copy element (Load #, Copy Info, driver names, phone, password …) */
.copied, .copied:hover { color: var(--success) !important; border-color: var(--success) !important; text-decoration-color: currentColor !important; }
.copied .ic, .copied::before { color: var(--success) !important; }
/* Cards: driver + Phone on one line (name wraps if long), POD beside the dispatcher(s), Updated under the status */

.load-card .lc-driver-name { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 18px; }

.load-card .card-status-select { margin-top: auto; }
.load-card .lc-updated { align-self: flex-end; margin-top: -3px; font-size: 11px; line-height: 14px; color: var(--text-muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Load status badge (Finished Loads list) — text + tint, readable in both themes */
.st-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
    color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); }
.st-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
/* Pickup / Delivery markers — ONE design everywhere (Cards, List, Add/Edit, View, Notes):
   Pickup = solid green dot, Delivery = red ring. Filled vs. hollow keeps them apart even in black-and-white print. */
.cell-stop::before, .stop-dot, .nd-meta .stop-dot {
    width: 10px !important; height: 10px !important; border-radius: 50% !important; box-sizing: border-box !important; box-shadow: none !important; flex-shrink: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cell-stop.pick::before, .stop-dot-pick { background: var(--stop-pick) !important; border: 0 !important; }
.cell-stop.drop::before, .stop-dot-drop { background: transparent !important; border: 2.5px solid var(--stop-drop) !important; }

.data-table.load-list .cell-stop::before { top: 3.5px; }

/* Delivery marker: solid red dot (same size as the green Pickup dot) */
.cell-stop.drop::before, .stop-dot-drop { background: var(--stop-drop) !important; border: 0 !important; }

/* Clickable driver / broker names (copy phone / open Gmail): subtle dotted underline, solid on hover */

.nm-plain { cursor: default; }
.load-list .cell-name > .nm-plain { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
/* "Copied" notice — follows the theme: light = dark border + dark text on white; dark = bright accent border on dark */
.copy-toast { position: fixed; left: 50%; bottom: 24px; z-index: 1600; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px 7px 12px; border-radius: 999px;
    background: #ffffff; color: #000000; border: 1.5px solid #1f2937; font-size: 13px; font-weight: 600; letter-spacing: .01em; box-shadow: 0 6px 18px -8px rgba(16, 24, 40, .35);
    opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .16s ease, transform .16s ease; }
.copy-toast .ic { font-size: 13px; color: currentColor; }
.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] .copy-toast { background: #14171b; color: #ffffff; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), 0 10px 24px -10px #000; }
:root[data-theme="dark"] .copy-toast .ic { color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .copy-toast { transition: none; } }
/* ===== Color system: Classic (light = white / light gray, dark = neutral charcoal) ===== */
:root { --bg-main: #f3f4f6;  --bg-card: #ffffff;  --bg-secondary: #f8f9fa;  --bg-hover: #f0f2f4;  --bg-hover-soft: #f8f9fa;  --bg-subtle: #f8f9fa;  --input-bg: #ffffff;  --lane-bg: #f8f9fa;  --tile-bg: #ffffff;  --well: #f8f9fa;  --text-main: #1f2328;  --text-muted: #59616b;  --text-faint: #8a9099;  --border: #e2e5e9;  --border-strong: #d0d4da;  --border-hover: #b4bac2;  --route-line: #d0d4da;  --primary: #1f5fd1;  --primary-hover: #184eb0;  --primary-fill: #2563eb;  --primary-fill-hover: #1d4fd8;  --primary-soft: rgba(31, 95, 209, 0.09);  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);  --on-primary: #ffffff;  --success: #15803d;  --success-bg: rgba(21, 128, 61, 0.09);  --warning: #a75b00;  --danger: #d22c2c;  --danger-bg: rgba(210, 44, 44, 0.07);  --info: #0369a1;  --violet: #7a33db;  --rank-bar: rgba(37, 99, 235, 0.1);  --scroll: #d0d4da;  --overlay: rgba(17, 20, 24, 0.45);  --sb-bg: #1f2328;  --sb-text: #f1f3f5;  --sb-muted: #a4abb4;  --sb-border: rgba(255, 255, 255, 0.08);  --sb-hover: rgba(255, 255, 255, 0.08);  --sb-active: rgba(255, 255, 255, 0.14);  --sb-accent: #93b4f5;  --sb-input: #2c3137;  --stop-pick: #16a34a;  --stop-drop: #dc2626;  --st-new: #5b6676;  --st-tomorrow: #0a74b4;  --st-today: #2156d9;  --st-rolling: #0b7f74;  --st-onp: #a35c00;  --st-transit: #7a33db;  --st-ond: #c42572;  --st-delivered: #15803d;  --st-canceled: #cf2a2a; }
:root:not([data-theme="dark"]) .dock { background: #1f2328; }
:root:not([data-theme="dark"]) .modal-header { background: #f6f7f9; border-bottom-color: #e2e5e9; }
:root:not([data-theme="dark"]) .data-table th { background: #f6f7f9; border-bottom-color: #e2e5e9; color: #3d444d; }
:root:not([data-theme="dark"]) #viewModalOverlay .modal-body, :root:not([data-theme="dark"]) #viewModalOverlay .modal-footer { background: #ffffff; }
:root:not([data-theme="dark"]) .copy-toast { background: #ffffff; }
:root:not([data-theme="dark"]) .card-status-select, :root:not([data-theme="dark"]) .card-status-select:hover { background-color: var(--input-bg); }
:root[data-theme="dark"] { --bg-main: #18191b;  --bg-card: #212225;  --bg-secondary: #27282c;  --bg-hover: #2e3034;  --bg-hover-soft: #1c1d20;  --bg-subtle: #1c1d20;  --input-bg: #1c1d20;  --lane-bg: #27282c;  --tile-bg: #212225;  --well: #1c1d20;  --text-main: #ececee;  --text-muted: #a9adb4;  --text-faint: #7d828a;  --border: #33353a;  --border-strong: #404248;  --border-hover: #5a5d64;  --route-line: #404248;  --primary: #78a9ff;  --primary-hover: #9cc0ff;  --primary-fill: #2f6be0;  --primary-fill-hover: #3b78ec;  --primary-soft: rgba(120, 169, 255, 0.16);  --focus-ring: 0 0 0 3px rgba(47, 107, 224, 0.35);  --on-primary: #ffffff;  --success: #4ade80;  --success-bg: rgba(74, 222, 128, 0.14);  --warning: #fbbf24;  --danger: #f87171;  --danger-bg: rgba(248, 113, 113, 0.13);  --info: #38bdf8;  --violet: #b393ff;  --rank-bar: rgba(47, 107, 224, 0.22);  --scroll: #404248;  --overlay: rgba(0, 0, 0, 0.6);  --sb-bg: #111214;  --sb-text: #ececee;  --sb-muted: #9a9fa7;  --sb-border: rgba(255, 255, 255, 0.07);  --sb-hover: rgba(255, 255, 255, 0.06);  --sb-active: rgba(255, 255, 255, 0.11);  --sb-accent: #8fb6ff;  --sb-input: #212225;  --stop-pick: #22c55e;  --stop-drop: #ef4444;  --st-new: #a7b0bd;  --st-tomorrow: #38bdf8;  --st-today: #6aa2ff;  --st-rolling: #2dd4bf;  --st-onp: #fbbf24;  --st-transit: #b393ff;  --st-ond: #f472b6;  --st-delivered: #4ade80;  --st-canceled: #f87171; }
:root[data-theme="dark"] .dock { background: #111214; }
:root[data-theme="dark"] .modal-header { background: #27282c; border-bottom-color: #33353a; }
:root[data-theme="dark"] .data-table th { background: #27282c; border-bottom-color: #33353a; color: #c4c8ce; }
:root[data-theme="dark"] #viewModalOverlay .modal-body, :root[data-theme="dark"] #viewModalOverlay .modal-footer { background: #212225; }
:root[data-theme="dark"] .copy-toast { background: #212225; }
:root[data-theme="dark"] .card-status-select, :root[data-theme="dark"] .card-status-select:hover { background-color: var(--input-bg); }
.btn:not(.btn-outline):not(.btn-danger):not(.icon-btn) { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--on-primary); }
.btn:not(.btn-outline):not(.btn-danger):not(.icon-btn):hover { background: var(--primary-fill-hover); border-color: var(--primary-fill-hover); }
/* clearer icons in cards, filters and headers */
.load-card-row > .ic, .date-range-filter > .ic, .current-date .ic { color: var(--text-muted); }

/* ===== Corner rounding system =====
   4px  tiny tags & icon chips · 6px  small buttons, chips, list items · 8px  buttons & form controls
   10px menus, dropdowns, toasts · 12px cards & panels · 16px windows & dialogs · pills stay round */
:root { --radius-xs: 10px; --radius-sm: 17px; --radius-md: 20px; --radius-lg: 24px; --radius-xl: 27px; }
.btn,.back-btn,.icon-btn,.dock-tab,.dock-user-btn,.dock-theme,.view-toggle,.search-clear,.form-control,select.form-control,textarea.form-control,.ss-selected,.card-status-select,.dock-team-select,.date-range-filter,.wc-toggle,.search-input { border-radius: var(--radius-sm); }
.btn-sm, .view-toggle-btn, .ss-search, .ss-option, .ss-add-row, .user-menu button, .user-menu-signout, .notes-badge, .stale-badge, .asap-badge:not(.asap-chip), .fav-star, .attachment-row { border-radius: 14px; }
.ss-dropdown, .user-menu, .status-filter-panel, .app-toast { border-radius: var(--radius-md); }
.load-card,.load-card-route,.folder-card,.month-status-tab,.table-responsive { border-radius: var(--radius-lg); }
.modal { border-radius: var(--radius-xl); }
/* nested bars follow their window's rounded shape (no square corners poking out) */
.modal > .modal-header:first-child, .modal > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.modal > .modal-footer:last-child, .modal > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.ss-dropdown > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.ss-dropdown > :last-child, .ss-dropdown > .ss-footer { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.table-responsive > table { border-radius: inherit; }
.data-table thead tr:first-child th:first-child { border-top-left-radius: inherit; }
.data-table thead tr:first-child th:last-child { border-top-right-radius: inherit; }
/* dangerous confirmations (Delete Permanently, delete team / user, sign out): red button and red icon.
   Before, later general button / icon rules painted them blue and orange, so they looked like normal confirmations. */
.confirm-icon.confirm-icon-danger { color: var(--danger); background: var(--danger-bg); }
.confirm-icon.confirm-icon-info { color: var(--primary); background: var(--primary-soft); }
.btn.btn-signout-yes:not(.btn-outline):not(.btn-danger):not(.icon-btn), .btn.btn-signout-yes:not(.btn-outline):not(.btn-danger):not(.icon-btn):hover { color: #fff; }
.btn.btn-signout-yes:not(.btn-outline):not(.btn-danger):not(.icon-btn) { background: #d23f3f; border-color: #d23f3f; }
.btn.btn-signout-yes:not(.btn-outline):not(.btn-danger):not(.icon-btn):hover { background: #b83232; border-color: #b83232; }
