/* Smart Dispatch board chrome. Loaded from App.razor (this app does not include
   ICOS.TMS.Web.styles.css, so .razor.css isolation never reaches the browser).
   Appointment backgrounds use !important: Syncfusion's CDN tailwind-lite.css is
   CORS-opaque and otherwise wins the cascade. */

.smart-dispatch-shell {
    background: #f8fafc;
}

.smart-dispatch-header {
    background-color: #1a1f2e;
    min-height: 52px;
}

/* Shown only where the company's saving is off. Plain, always-visible text, not a control. */
/* "Legacy" next to the title on an ICOS LIVE company. Slate-100 on 15% white over the dark header bar. */
.smart-dispatch-legacy-badge {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 1px 8px;
    cursor: default;
}

.smart-dispatch-nav-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.smart-dispatch-view-toggle {
    display: inline-flex;
    align-items: stretch;
    height: 28px;
    border: 1px solid #3a4155;
    border-radius: 0.5rem;
    overflow: hidden;
    background: transparent;
}

.smart-dispatch-view-toggle > button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: 0;
    background: transparent;
    color: #888888;
    padding: 0 0.75rem;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    height: 28px;
}

.smart-dispatch-view-toggle > button.is-active {
    background-color: #0073CF;
    color: #ffffff;
}

.smart-dispatch-jobs-pane {
    width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e0e4e8;
    font-family: Inter, system-ui, sans-serif;
    transition: width 0.2s ease;
    overflow: hidden;
}

.smart-dispatch-jobs-pane.is-collapsed {
    width: 36px;
}

.smart-dispatch-detail-pane {
    width: 300px;
    flex-shrink: 0;
    background: #ffffff;
    border-left: 1px solid #e0e4e8;
    transition: width 0.2s ease;
    overflow: hidden;
}

.smart-dispatch-detail-pane.is-collapsed {
    width: 36px;
}

.smart-dispatch-pane-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.smart-dispatch-pane-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
}

.smart-dispatch-pane-collapse:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.smart-dispatch-pane-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    padding: 0.65rem 0.2rem;
    border: 0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
}

.smart-dispatch-pane-rail:hover {
    background: #eff6ff;
    color: #0073CF;
}

.smart-dispatch-pane-rail-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.smart-dispatch-pane-rail-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #FCA841;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
}

.smart-dispatch-legs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 0.75rem;
    border-bottom: 1px solid #e0e4e8;
    flex-shrink: 0;
}

.smart-dispatch-legs-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.smart-dispatch-legs-zap {
    width: 0.85rem;
    height: 0.85rem;
    color: #FCA841;
}

.smart-dispatch-legs-title h2 {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1f2e;
}

.smart-dispatch-legs-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.2rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #e8ecf0;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 600;
}

.smart-dispatch-legs-filters {
    padding: 0.55rem 0.65rem 0.6rem;
    border-bottom: 1px solid #e0e4e8;
    flex-shrink: 0;
}

.smart-dispatch-search-wrap {
    position: relative;
}

.smart-dispatch-search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.85rem;
    height: 0.85rem;
    color: #94a3b8;
    pointer-events: none;
}

.smart-dispatch-search {
    width: 100%;
    height: 1.85rem;
    padding: 0 0.5rem 0 1.7rem;
    border: 1px solid #e0e4e8;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #0f172a;
    background: #fff;
}

.smart-dispatch-leg-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* One line high also while empty, so a note that comes and goes does not shift the list. */
.smart-dispatch-legs-notice {
    min-height: 1rem;
    line-height: 1rem;
}

.smart-dispatch-legs-empty {
    margin: auto;
    padding: 1.5rem 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* flex-shrink: 0 keeps each card its full height in the column list, so a short window scrolls the list
   instead of squashing the cards (overflow: hidden lets a flex item shrink below its content). */
.smart-dispatch-job-card {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: 100%;
    text-align: left;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    overflow: hidden;
}

.smart-dispatch-job-card:hover {
    background: #fafbfc;
}

.smart-dispatch-job-card:hover .smart-dispatch-job-drag {
    opacity: 0.7;
}

.smart-dispatch-job-card.is-selected {
    border-color: #0073CF;
    background: #F0F7FF;
    box-shadow: 0 0 0 1px rgba(0, 115, 207, 0.35);
}

.smart-dispatch-job-card-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.smart-dispatch-job-card[data-job-type="Freight"] .smart-dispatch-job-card-accent { background: #0073CF; }
.smart-dispatch-job-card[data-job-type="Container"] .smart-dispatch-job-card-accent { background: #7B3FBF; }
.smart-dispatch-job-card[data-job-type="Hiab"] .smart-dispatch-job-card-accent { background: #B36A00; }
.smart-dispatch-job-card[data-job-type="Bulk"] .smart-dispatch-job-card-accent { background: #3A7D1C; }

.smart-dispatch-job-drag {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    opacity: 0.35;
    pointer-events: none;
}

.smart-dispatch-job-card-body {
    padding: 0.625rem 1.75rem 0.625rem 0.75rem;
}

.smart-dispatch-job-row-id {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.smart-dispatch-job-ref {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1a1f2e;
    white-space: nowrap;
}

.smart-dispatch-linehaul-icon {
    width: 0.75rem;
    height: 0.75rem;
    color: #FCA841;
    flex-shrink: 0;
}

.smart-dispatch-job-row-route {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.35rem;
    min-width: 0;
    font-size: 11px;
    color: #1a1f2e;
}

.smart-dispatch-pin {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
}

.smart-dispatch-pin.is-pickup { color: #0073CF; }
.smart-dispatch-pin.is-delivery { color: #e06b5c; }

.smart-dispatch-route-arrow {
    color: #cbd5e1;
    flex-shrink: 0;
    margin: 0 0.1rem;
}

.smart-dispatch-job-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.3rem;
    font-size: 10px;
    color: #94a3b8;
    min-width: 0;
}

/* "Booking N" opens the booking page. Blue-700 on white is 6.70:1; the underline marks it as a link without colour alone. */
.smart-dispatch-booking-link {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.smart-dispatch-booking-link:hover { color: #1e3a8a; }

/* An old-way card ICOS LIVE will refuse (Story 25102): every truck refuses its drop, so no grab cursor and no grip. */
.smart-dispatch-job-card[data-drop-blocked] {
    cursor: default;
}

.smart-dispatch-job-card[data-drop-blocked] .smart-dispatch-job-drag {
    display: none;
}

.smart-dispatch-icoslive-warning {
    display: inline-flex;
    margin-left: auto;
}

/* #b45309 on white is 5.0:1. */
.smart-dispatch-icoslive-warning-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4px;
    color: #b45309;
    cursor: pointer;
}

.smart-dispatch-icoslive-warning-button:hover,
.smart-dispatch-icoslive-warning-button[aria-expanded="true"] {
    background: #fef3c7;
}

.smart-dispatch-icoslive-warning-button:focus-visible,
.smart-dispatch-icoslive-warning-panel:focus-visible {
    outline: 2px solid #0073CF;
    outline-offset: 1px;
}

/* Opens inside the card (the card clips anything outside it), on its own line under the reference. */
.smart-dispatch-icoslive-warning-panel {
    flex-basis: 100%;
    margin-top: 0.35rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    background: #fffbeb;
    color: #1a1f2e;
    font-size: 11px;
    line-height: 1.4;
    cursor: default;
}

/* On a timeline block ICOS LIVE locks (Story 25141): the block is one line high, so the button is smaller and the
   panel opens below it, out of the block (opened below while the panel shows) and over the rows under it. */
.smart-dispatch-job-block .smart-dispatch-icoslive-warning {
    flex-shrink: 0;
}

.smart-dispatch-job-block .smart-dispatch-icoslive-warning-button {
    width: 1.1rem;
    height: 1.1rem;
}

.smart-dispatch-job-block:has(.smart-dispatch-icoslive-warning-panel) {
    overflow: visible;
    z-index: 30;
}

.smart-dispatch-icoslive-warning-panel.is-on-block {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 18rem;
    margin-top: 0;
    z-index: 40;
    white-space: normal;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.smart-dispatch-icoslive-warning-list {
    margin-top: 0.2rem;
    padding-left: 1rem;
    list-style: disc;
}

.smart-dispatch-job-window {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.smart-dispatch-job-row-vehicle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    font-size: 10px;
    color: #94a3b8;
}

.smart-dispatch-job-vehicle-id {
    font-weight: 500;
    color: #555555;
}

.smart-dispatch-job-driver {
    color: #999999;
}

.smart-dispatch-job-note {
    margin: 0.3rem 0 0;
    font-size: 9px;
    font-style: italic;
    color: #aaaaaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Allocation Detail panel header */
.smart-dispatch-detail-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 38px;
    padding: 0 0.75rem;
    border-bottom: 1px solid #e0e4e8;
    flex-shrink: 0;
}

.smart-dispatch-detail-header h2 {
    margin: 0;
    flex: 1;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1f2e;
}

.smart-dispatch-detail-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.smart-dispatch-detail-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.smart-dispatch-detail-idle {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    text-align: center;
}

.smart-dispatch-idle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
}

.smart-dispatch-detail-idle p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #64748b;
    max-width: 14rem;
}

.smart-dispatch-detail-section {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f3f6;
}

.smart-dispatch-section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.5rem;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #aaaaaa;
}

.smart-dispatch-detail-ref {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1f2e;
    line-height: 1.2;
}

.smart-dispatch-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.7rem;
    color: #64748b;
}

.smart-dispatch-route-card {
    display: flex;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    background: #f8f9fb;
    border: 1px solid #e8ecf0;
    border-radius: 0.4rem;
}

.smart-dispatch-route-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.15rem;
}

.smart-dispatch-route-rail .is-pickup,
.smart-dispatch-route-rail .is-delivery {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.smart-dispatch-route-rail .is-pickup { background: #0073CF; }
.smart-dispatch-route-rail .is-delivery { background: #e06b5c; }
.smart-dispatch-route-rail .is-line {
    width: 1px;
    flex: 1;
    min-height: 0.85rem;
    margin: 0.15rem 0;
    background: #cbd5e1;
}

.smart-dispatch-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.3rem;
    background: #1a1f2e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.smart-dispatch-status-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.smart-dispatch-status-dot.is-available { background: #22c55e; }
.smart-dispatch-status-dot.is-allocated { background: #0073CF; }

.smart-dispatch-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.35;
    background: #e8eef5;
    color: #334155;
}

.smart-dispatch-pill.is-manual {
    background: #dbe4f0;
    color: #3b5b8a;
}

.smart-dispatch-pill.is-linehaul {
    background: #fef3c7;
    color: #b45309;
}

.smart-dispatch-pill.is-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.smart-dispatch-pill[data-vbs-status="Booked"] {
    background: #dbeafe;
    color: #1e40af;
}

.smart-dispatch-pill[data-vbs-status="Manifested"] {
    background: #fef3c7;
    color: #92400e;
}

.smart-dispatch-pill[data-vbs-status="Cancelled"] {
    background: #fee2e2;
    color: #b91c1c;
}

.smart-dispatch-linked-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid #e8ecf0;
    border-radius: 0.4rem;
    background: #fff;
}

/* The job's Changes list (ADO 24916): newest first, one plain line each. */
.smart-dispatch-change-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.smart-dispatch-change-list > li {
    padding-left: 0.5rem;
    border-left: 2px solid #e8ecf0;
    line-height: 1.35;
}

.smart-dispatch-detail-actions {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid #f0f3f6;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.smart-dispatch-primary-btn {
    height: 36px;
    width: 100%;
    border: 0;
    border-radius: 0.375rem;
    background: #0073CF;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.smart-dispatch-primary-btn:hover {
    background: #0060b0;
}

.smart-dispatch-danger-btn {
    height: 36px;
    width: 100%;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
}

.smart-dispatch-danger-btn {
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.smart-dispatch-danger-btn:hover {
    background: #fef2f2;
}

.smart-dispatch-ghost-link {
    border: 0;
    background: transparent;
    color: #0073CF;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

.smart-dispatch-ghost-link.is-unlink:hover {
    color: #b91c1c;
}

.smart-dispatch-board-pane {
    background: #edf0f3;
    font-family: Inter, system-ui, sans-serif;
    /* Each hour of the timeline is at least this wide: on a narrow board (or with the detail panel open) the
       15-minute grid and the blocks keep their size and the board scrolls sideways instead of squeezing them. */
    --sd-hour-min-width: 80px;
    /* The truck column (and the hour header's label cell above it). */
    --sd-label-col-width: 200px;
    /* The sticky hour header's height. */
    --sd-hour-header-height: 38px;
}

/* The board's one scroller, both ways. It is only as tall as its rows (capped by the pane), so the sideways
   scrollbar sits right under the last truck. --sd-hour-count is set inline (TimelineGeometry.HourCount), so the
   track is at least hours × --sd-hour-min-width; a wider board still stretches the hours (positions are
   percentages of the track). scroll-padding keeps a focused cell clear of the sticky hour header and truck column. */
.smart-dispatch-board-body {
    flex: 0 1 auto;
    min-height: 0;
    overflow: auto;
    --sd-board-min-width: calc(var(--sd-label-col-width) + var(--sd-hour-count) * var(--sd-hour-min-width));
    scroll-padding: var(--sd-hour-header-height) 0 0 var(--sd-label-col-width);
    /* Keeps the board's own layers (sticky hour header 27, truck column 26, blocks) inside this box, so the app
       header's menus (AppShell header, z-10) still open over the board. */
    isolation: isolate;
}

/* Each scrollbar spans only what it scrolls: the sideways one starts after the sticky truck column, the up-down one
   below the sticky hour header (track margins). Chromium and Safari only; Firefox keeps its full-length bars.
   app.tailwind.css sets scrollbar-width/-color on every element, and Chromium ignores ::-webkit-scrollbar wherever
   either is not auto, so this box resets both (Firefox, which has no ::-webkit-scrollbar, keeps the thin bar). */
.smart-dispatch-board-body {
    scrollbar-width: auto;
    scrollbar-color: auto;
}

@supports not selector(::-webkit-scrollbar) {
    .smart-dispatch-board-body {
        scrollbar-width: thin;
        scrollbar-color: #b4bcc6 transparent;
    }
}

.smart-dispatch-board-body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.smart-dispatch-board-body::-webkit-scrollbar-track {
    background: transparent;
}

.smart-dispatch-board-body::-webkit-scrollbar-track:horizontal {
    margin-left: var(--sd-label-col-width);
}

.smart-dispatch-board-body::-webkit-scrollbar-track:vertical {
    margin-top: var(--sd-hour-header-height);
}

.smart-dispatch-board-body::-webkit-scrollbar-thumb {
    background: #b4bcc6;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.smart-dispatch-board-body::-webkit-scrollbar-thumb:hover {
    background-color: #8d97a3;
}

.smart-dispatch-board-body::-webkit-scrollbar-corner {
    background: transparent;
}

/* Sticky top inside the board body, so it scrolls sideways with the grid. Above the sticky truck column (26). */
.smart-dispatch-board-header {
    display: flex;
    height: var(--sd-hour-header-height);
    min-width: var(--sd-board-min-width);
    flex-shrink: 0;
    background: #f5f6f8;
    border-bottom: 1px solid #d8dce2;
    position: sticky;
    top: 0;
    z-index: 27;
}

.smart-dispatch-board-label-col {
    width: var(--sd-label-col-width);
    flex-shrink: 0;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    padding: 0 0.65rem;
    border-right: 1px solid #d8dce2;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #888888;
}

.smart-dispatch-board-timeline-header {
    position: relative;
    flex: 1;
    min-width: 0;
    /* Hour labels thin out by the width of this track (container queries below). */
    container-type: inline-size;
}

/*
 * Hour labels never overlap. The widest label (the highlighted "is-now" pill) measured 38 px in
 * Chromium; with a 4 px gap one label needs 42 px. W = track width, 15 hours across:
 *   W >= 630 (42 × 15)   every hour
 *   W >= 315 (42 × 7.5)  every 2 h
 *   W >= 210 (42 × 5)    every 3 h (05, 08, 11, 14, 17, 20)
 *   below                every 5 h (05, 10, 15, 20)
 * Grid lines are not affected.
 */
@container (max-width: 629.98px) {
    .smart-dispatch-hour-label.is-off-2h { display: none; }
}

@container (max-width: 314.98px) {
    .smart-dispatch-hour-label.is-off-2h { display: inline; }
    .smart-dispatch-hour-label.is-off-3h { display: none; }
}

@container (max-width: 209.98px) {
    .smart-dispatch-hour-label.is-off-3h { display: inline; }
    .smart-dispatch-hour-label.is-off-5h { display: none; }
}

.smart-dispatch-hour-labels {
    position: absolute;
    inset: 0;
}

.smart-dispatch-hour-label {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
    color: #a0a6ae;
    white-space: nowrap;
}

/* 05:00 and 20:00 sit on the track's edges: centred, half of each would hide under the sticky truck column or past
   the scroller's edge, so they hang inside the track instead. */
.smart-dispatch-hour-label:first-child {
    transform: translate(4px, -50%);
}

.smart-dispatch-hour-label:last-child {
    transform: translate(calc(-100% - 4px), -50%);
}

/* The last label (20:00) sits on the track's right edge; right-align it so it stays inside the header. */
.smart-dispatch-hour-label:last-child {
    transform: translate(-100%, -50%);
}

.smart-dispatch-hour-label.is-now {
    color: #0073CF;
    background: #E8F3FC;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

.smart-dispatch-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #0073CF;
    opacity: 0.6;
    z-index: 10;
    pointer-events: none;
}

.smart-dispatch-now-line.is-header {
    opacity: 0.5;
}

.smart-dispatch-division-header {
    display: flex;
    align-items: center;
    height: 26px;
    background: #e4e8ec;
    border-bottom: 1px solid #d8dce2;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #888888;
}

.smart-dispatch-division-header.has-top {
    border-top: 1px solid #d0d5dd;
}

/* The fleet name, count and tick box: sticky left, so they stay in view when the board scrolls sideways. */
.smart-dispatch-division-label {
    position: sticky;
    left: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.65rem;
}

.smart-dispatch-division-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #cfd5db;
    color: #555;
    font-size: 0.55rem;
    text-transform: none; /* "4 of 11" */
}

/* "Only trucks with a run" / "Only trucks with jobs" on the fleet header. #475569 on #e4e8ec is 6.2:1. */
.smart-dispatch-run-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 24px; /* WCAG 2.2 target size; the header is 26px */
    margin-left: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}

.smart-dispatch-run-filter input {
    width: 0.75rem;
    height: 0.75rem;
    margin: 0;
    accent-color: #0073CF;
    cursor: pointer;
}

/* Height is set inline: TimelineGeometry.TruckRowHeight, as tall as the row's overlapping jobs. */
.smart-dispatch-vehicle-row {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
}

.smart-dispatch-vehicle-row.is-alt {
    background: #f9fafb;
}

.smart-dispatch-vehicle-row.is-drop-target {
    outline: 2px solid #0073CF;
    outline-offset: -2px;
    z-index: 2;
}

/* Sticky left, with its row's background, over the blocks scrolled under it: above blocks (3), the now line (10),
   the drop hint (15), VBS pills (20) and a hovered block (25); below the sticky hour header (27). */
.smart-dispatch-vehicle-info {
    width: var(--sd-label-col-width);
    flex-shrink: 0;
    position: sticky;
    left: 0;
    z-index: 26;
    background: inherit;
    padding: 0.35rem 0.55rem;
    border-right: 1px solid #e0e4e8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
}

.smart-dispatch-vehicle-id-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.smart-dispatch-vehicle-id {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1a1f2e;
}

.smart-dispatch-vehicle-name {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* The vehicle type (Cab, Truck): outlined, so it reads apart from the filled status pill. */
.smart-dispatch-vehicle-type {
    flex-shrink: 0;
    padding: 0 0.3rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 600;
    color: #475569;
}

/* The driver, after the type badge on the registration line: it gives way first when the column is narrow. */
.smart-dispatch-vehicle-driver {
    min-width: 0;
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-dispatch-vehicle-runs {
    margin: 0;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The routes of the truck's runs. #0055a5 is 7.1:1 on the alternate row (#f9fafb). */
.smart-dispatch-vehicle-run {
    font-weight: 600;
    color: #0055a5;
}

.smart-dispatch-vehicle-location {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 10px;
    color: #64748b;
    min-width: 0;
}

.smart-dispatch-location-dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    flex-shrink: 0;
}

.smart-dispatch-location-dot.is-moving,
.smart-dispatch-vehicle-location .is-moving { color: #7BBA34; }
.smart-dispatch-location-dot.is-moving { background: #7BBA34; }

.smart-dispatch-location-dot.is-onsite,
.smart-dispatch-vehicle-location .is-onsite { color: #FCA841; }
.smart-dispatch-location-dot.is-onsite { background: #FCA841; }

.smart-dispatch-location-dot.is-yard,
.smart-dispatch-vehicle-location .is-yard { color: #BDBDBD; }
.smart-dispatch-location-dot.is-yard { background: #BDBDBD; }

.smart-dispatch-timeline-track {
    position: relative;
    flex: 1;
    min-width: 0;
    /* Clip blocks sideways only, so tooltips can rise out of the row. */
    overflow-x: clip;
    overflow-y: visible;
    /* 15-minute cells: 60 across 05:00–20:00. Hour lines sit on top as spans. */
    background-image: linear-gradient(to right, #f0f2f5 1px, transparent 1px);
    background-size: calc(100% / 60) 100%;
}

.smart-dispatch-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
}

.smart-dispatch-grid-line.is-even { background: #dde0e5; }
.smart-dispatch-grid-line.is-odd { background: #eaecef; }

.smart-dispatch-drop-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #0073CF;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
}

/* A new job over a truck with no run: the save would refuse it. White on #b91c1c is 6.5:1. */
.smart-dispatch-drop-hint.is-refused {
    background: #b91c1c;
}

.smart-dispatch-job-block {
    position: absolute;
    top: 4px; /* lane offset is set inline */
    height: 26px; /* TimelineGeometry.BlockHeight */
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.35rem 0 0.45rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    background: #E8F3FC;
    color: #0055a5;
    cursor: grab;
    overflow: hidden;
    z-index: 3;
    text-align: left;
    min-width: 0;
}

.smart-dispatch-job-block:active { cursor: grabbing; }

.smart-dispatch-job-block-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    /* Own corners, so the accent stays rounded while the block's overflow is opened for a tooltip. */
    border-radius: 0.3rem 0 0 0.3rem;
}

/* The block clips its content, which would also clip the VBS tooltip. While the badge is hovered, open the
   block and lift it above the VBS pills (z-index 20) so the tooltip is fully visible. */
.smart-dispatch-job-block:has(.smart-dispatch-job-vbs-badge:hover) {
    overflow: visible;
    z-index: 25;
}

.smart-dispatch-job-block[data-job-type="Freight"] .smart-dispatch-job-block-accent { background: #0073CF; }
.smart-dispatch-job-block[data-job-type="Container"] .smart-dispatch-job-block-accent { background: #7B3FBF; }
.smart-dispatch-job-block[data-job-type="Hiab"] .smart-dispatch-job-block-accent { background: #B36A00; }
.smart-dispatch-job-block[data-job-type="Bulk"] .smart-dispatch-job-block-accent { background: #3A7D1C; }

.smart-dispatch-job-block[data-status="Confirmed"] {
    background: #E8F3FC;
    border-color: #B1D4F5;
    color: #0055a5;
}

.smart-dispatch-job-block[data-status="Dispatched"] {
    background: #FFF8E1;
    border-color: #FFE082;
    color: #7a5200;
}

.smart-dispatch-job-block[data-status="OnSite"] {
    background: #EDF6E5;
    border-color: #C7DBAF;
    color: #2d6b14;
}

.smart-dispatch-job-block[data-status="Complete"] {
    background: #eceff1;
    border-color: #cfd8dc;
    color: #607d8b;
}

/* Fade the children, not the block: opacity on the block would also fade the VBS tooltip inside it. */
.smart-dispatch-job-block.is-past {
    background: #e8eaed !important;
    border-color: #d0d5dd !important;
    color: #90a4ae !important;
}

.smart-dispatch-job-block.is-past > :not(.smart-dispatch-job-vbs-badge) {
    opacity: 0.72;
}

.smart-dispatch-job-block.is-selected {
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(0, 115, 207, 0.25);
    z-index: 6;
}

.smart-dispatch-job-block[data-job-type="Container"].is-selected {
    box-shadow: 0 0 0 2px rgba(123, 63, 191, 0.25);
}

.smart-dispatch-job-block-content {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    overflow: hidden;
}

.smart-dispatch-job-block-ref {
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.smart-dispatch-job-block-route {
    font-size: 8px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-dispatch-job-vbs-badge {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.05rem 0.3rem;
    border-radius: 999px;
    background: #0073CF;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.smart-dispatch-job-vbs-badge.is-cancelled {
    background: #eceff1;
    color: #78909c;
    outline: 1px solid #e06b5c;
}

.smart-dispatch-vbs-pill {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    height: 20px;
    min-width: 44px;
    padding: 0 0.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 9px;
    font-weight: 700;
    cursor: grab;
    background: #FFF8E1;
    color: #B36A00;
    border-color: #FFE082;
}

.smart-dispatch-vbs-pill:active { cursor: grabbing; }

.smart-dispatch-vbs-pill[data-vbs-status="Manifested"] {
    background: #EDF6E5;
    color: #3A7D1C;
    border-color: #C7DBAF;
}

.smart-dispatch-vbs-pill[data-vbs-status="Cancelled"] {
    background: #eceff1;
    color: #78909c;
    border-color: #cfd8dc;
    cursor: not-allowed;
}

/* Fade the pill's content, not the pill: opacity on the pill would also fade its tooltip. */
.smart-dispatch-vbs-pill[data-vbs-status="Cancelled"] > :not(.smart-dispatch-board-tooltip) {
    opacity: 0.45;
}

.smart-dispatch-vbs-pill.is-manual {
    border-color: #7b8fa8;
    color: #3b5b8a;
    background: #e8eef5;
}

.smart-dispatch-vbs-pill.is-selected {
    box-shadow: 0 0 0 2px rgba(0, 115, 207, 0.3);
}

.smart-dispatch-vbs-manual-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #3b5b8a;
}

.smart-dispatch-vbs-linked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background: #0073CF;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
}

.smart-dispatch-board-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    z-index: 40;
    min-width: 10rem;
    max-width: 14rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.4rem;
    background: #1a1f2e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    flex-direction: column;
    gap: 0.2rem;
    pointer-events: none;
    text-align: left;
}

.smart-dispatch-board-tooltip strong {
    font-size: 0.7rem;
}

/* The tooltip is a column flexbox; keep the status pill its own width instead of a full-width bar. */
.smart-dispatch-board-tooltip .smart-dispatch-pill {
    align-self: flex-start;
}

.smart-dispatch-board-tooltip em {
    font-style: italic;
    color: #fca5a5;
}

.smart-dispatch-vbs-pill:hover .smart-dispatch-board-tooltip,
.smart-dispatch-job-vbs-badge:hover .smart-dispatch-board-tooltip {
    display: flex;
}

/* —— Centre map panel —— */
.smart-dispatch-map-panel {
    position: relative;
    background: #e8ecf1;
}

.smart-dispatch-map-canvas {
    width: 100%;
    height: 100%;
}

.smart-dispatch-map-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #888888;
    font-size: 0.875rem;
    background: #e8ecf1;
}

.smart-dispatch-map-legend {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 400;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    padding: 8px 10px;
    min-width: 140px;
}

.smart-dispatch-map-legend-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #888888;
    margin-bottom: 6px;
}

.smart-dispatch-map-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #334155;
    margin-bottom: 4px;
}

/* Why some legs are not drawn (no map position). Bottom-left, clear of the legend and zone panel. */
.smart-dispatch-map-notice-region {
    position: absolute;
    left: 12px;
    bottom: 32px;
    z-index: 400;
    max-width: min(360px, calc(100% - 24px));
    pointer-events: none;
}

.smart-dispatch-map-notice {
    margin: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    padding: 8px 10px;
    font-size: 12px;
    color: #334155;
}

.smart-dispatch-map-legend-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
}

.sd-swatch {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.sd-swatch.is-circle { border-radius: 999px; }
.sd-swatch.is-square { border-radius: 2px; }

/* A route on the map: a short line with the white casing the map draws under it. */
.sd-swatch.is-line {
    width: 16px;
    height: 5px;
    border-radius: 999px;
}

/* A dashed route (truck to pickup); the colour comes in as --sd-swatch-color. */
.sd-swatch.is-line.is-dashed {
    background: repeating-linear-gradient(90deg, var(--sd-swatch-color) 0 3px, #fff 3px 5px);
}

.smart-dispatch-zone-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 400;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    transition: width 0.2s ease;
}

.smart-dispatch-zone-panel.is-open { width: 220px; }
.smart-dispatch-zone-panel.is-collapsed { width: 32px; }

.smart-dispatch-zone-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.smart-dispatch-zone-panel.is-collapsed .smart-dispatch-zone-toggle {
    justify-content: center;
    padding: 0;
}

.smart-dispatch-zone-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 0 4px 6px;
}

.smart-dispatch-zone-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.smart-dispatch-zone-row:hover {
    background: #eff6ff;
}

.sd-zone-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 3px;
    flex-shrink: 0;
}

.smart-dispatch-zone-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.smart-dispatch-zone-name {
    font-size: 10px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-dispatch-zone-meta {
    font-size: 9px;
    color: #94a3b8;
}

.smart-dispatch-zone-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background: #e2e8f0;
    margin-top: 2px;
}

.smart-dispatch-zone-bar .is-empty { flex: 1; background: #e2e8f0; }
.smart-dispatch-zone-bar .is-auto { background: #1D9E75; }
.smart-dispatch-zone-bar .is-suggested { background: #BA7517; }
.smart-dispatch-zone-bar .is-manual { background: #888780; }

.sd-zone-label {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    padding: 4px 6px;
    pointer-events: none;
    white-space: nowrap;
}

.sd-zone-label-name {
    font-size: 9px;
    font-weight: 700;
    color: #1e293b;
}

.sd-zone-label-meta {
    font-size: 8px;
    color: #94a3b8;
}

.sd-marker-depot {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    background: #0073CF;
    border: 2px solid #fff;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}

.sd-marker-port-wrap {
    position: relative;
    width: 22px;
    height: 22px;
}

.sd-marker-port {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #FA9678;
    border: 2px solid #fff;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}

.sd-marker-port-exception {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #F59E0B;
    color: #fff;
    font-size: 7px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sd-cluster {
    border-radius: 999px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

/* ---------- Timeline grid: lanes, resize, keyboard focus, last action ---------- */

/* Virtualisation spacers: exact heights from TimelineRowLayout; never give them borders or margins. */
.smart-dispatch-row-spacer {
    flex-shrink: 0;
}

.smart-dispatch-timeline-grid {
    position: relative;
    min-width: var(--sd-board-min-width);
}

.smart-dispatch-job-block-time {
    font-size: 8px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.85;
}

.smart-dispatch-job-block-resize {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    /* A 15-minute block is ~15 px with a handle at each end: each keeps at most a fifth, the middle moves the block. */
    width: min(6px, 20%);
    cursor: ew-resize;
    z-index: 2;
}

.smart-dispatch-job-block-resize:hover {
    background: rgba(0, 115, 207, 0.25);
}

/* Picked up with the keyboard (Space): a dashed outline while it shows its preview place. The
   :focus-visible form outranks the solid focus outline below, since a picked-up block has focus. */
.smart-dispatch-job-block.is-picked-up,
.smart-dispatch-job-block.is-picked-up:focus-visible {
    outline: 2px dashed #0073CF;
    outline-offset: 2px;
    z-index: 6;
}

/* The job the "Remove … from this truck?" question names: a red dashed outline, so the user sees which block it
   means. #dc2626 on the past-block grey (#e8eaed) is 4.0:1 (at least 3:1 needed for a non-text mark). */
.smart-dispatch-job-block.is-pending-removal,
.smart-dispatch-job-block.is-pending-removal:focus-visible {
    outline: 2px dashed #dc2626;
    outline-offset: 2px;
    z-index: 6;
}

/* Start-edge handle: same size rule as the end handle, on the left (over the 3 px accent). */
.smart-dispatch-job-block-resize.is-start {
    right: auto;
    left: 0;
}

/* A job cut at the 05:00 or 20:00 edge: square, dashed edge plus a chevron on the cut side. */
.smart-dispatch-job-block.is-cut-start {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 2px dashed currentColor;
}

.smart-dispatch-job-block.is-cut-end {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 2px dashed currentColor;
    padding-right: 0.7rem;
}

.smart-dispatch-job-continues {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.smart-dispatch-job-continues.is-start { left: 2px; }
.smart-dispatch-job-continues.is-end { right: 2px; }

.smart-dispatch-focus-cell {
    position: absolute;
    top: 2px;
    bottom: 2px;
    z-index: 4;
    border-radius: 0.25rem;
    outline: none;
}

.smart-dispatch-focus-cell:focus-visible,
.smart-dispatch-job-block:focus-visible {
    outline: 2px solid #0073CF;
    outline-offset: 1px;
}

.smart-dispatch-focus-cell:focus-visible {
    background: rgba(0, 115, 207, 0.12);
}

/* The toast's Remove (the "Remove … from this truck?" question): the toast's text button, filled red so it reads as
   the one that takes the job off. Not in Tailwind's layers, so it wins over the button's transparent fill.
   White on #dc2626 is 4.8:1. */
.smart-dispatch-toast-remove {
    background: #dc2626;
    color: #fff;
}

.smart-dispatch-toast-remove:hover {
    background: #b91c1c;
}

/* A wrapper that adds no box (it only carries inert while the hand-over picker asks). */
.smart-dispatch-contents {
    display: contents;
}

/* Hand-over place picker: a loaded job moving to another truck (old way). */
.smart-dispatch-handover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 450;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
}

.smart-dispatch-handover {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(32rem, 100%);
    max-height: min(36rem, calc(100vh - 2rem));
    padding: 1rem 1.1rem;
    border-radius: 0.6rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    color: #1f2937;
}

.smart-dispatch-handover-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.smart-dispatch-handover-help,
.smart-dispatch-handover-empty,
.smart-dispatch-handover-more {
    font-size: 0.75rem;
    color: #4b5563;
}

.smart-dispatch-handover-notice {
    padding: 0.4rem 0.6rem;
    border: 1px solid #f5c2c0;
    border-radius: 0.35rem;
    background: #fdf1f0;
    color: #7f1d1d;
    font-size: 0.75rem;
}

.smart-dispatch-handover-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
}

.smart-dispatch-handover-search {
    padding: 0.35rem 0.55rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.35rem;
    font-size: 0.8rem;
}

.smart-dispatch-handover-search:focus-visible {
    outline: 2px solid #0073CF;
    outline-offset: 1px;
}

.smart-dispatch-handover-results {
    min-height: 4rem;
    overflow-y: auto;
}

.smart-dispatch-handover-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smart-dispatch-handover-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 0.78rem;
}

.smart-dispatch-handover-option:hover,
.smart-dispatch-handover-option:has(input:checked) {
    background: rgba(0, 115, 207, 0.08);
}

.smart-dispatch-handover-option input {
    margin-top: 0.2rem;
}

.smart-dispatch-handover-option-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.4rem;
}

.smart-dispatch-handover-option-name {
    font-weight: 600;
}

.smart-dispatch-handover-option-address {
    flex-basis: 100%;
    color: #4b5563;
    font-size: 0.72rem;
}

.smart-dispatch-handover-depot {
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.65rem;
    font-weight: 600;
}

.smart-dispatch-handover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Drop-time guide: drawn by smart-dispatch-timeline.js during a drag. Fixed, so it is not inside the
   scrolled rows; never a drop target itself. */
.smart-dispatch-drop-guide {
    display: none;
    position: fixed;
    width: 0;
    border-left: 2px solid #0073cf;
    pointer-events: none;
    z-index: 30;
}

/* Resize shadow: drawn by smart-dispatch-timeline.js during a resize drag over the block as it was when
   the drag began (its old times); the solid drop guide marks the edge the resize will save. */
.smart-dispatch-resize-shadow {
    display: none;
    position: fixed;
    box-sizing: border-box;
    border: 2px dashed #0073CF;
    border-radius: 0.35rem;
    background: rgba(0, 115, 207, 0.06);
    pointer-events: none;
    z-index: 29;
}

/* Drag preview (every owner): the dragged card under the pointer, moved by smart-dispatch-timeline.js with a
   transform, once per frame, never animated (so nothing to calm for reduced motion). Fixed, so it shows over the
   legs pane too; never a drop target itself. */
.smart-dispatch-drag-preview {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 40;
    will-change: transform;
}

.smart-dispatch-drag-preview.is-shown {
    display: block;
}

/* Only the card is see-through, like the browser's own drag image (what is under it still shows a little); its
   badges stay solid, so their contrast holds. */
.smart-dispatch-drag-preview-card {
    opacity: 0.85;
}

/* The picture of the card: out of its row's flow (a block is placed on its row inline, which the picture drops). */
.smart-dispatch-drag-preview-card > * {
    position: relative;
    top: 0;
    left: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

/* "Blocked" (the new way) until the card is over a truck that can take it. The badge is #b91c1c: at least 5.4:1 against every
   card colour (5.37:1 on a past block's #e8eaed, 6.47:1 on a leg card's white), its white glyph 6.47:1 on it; the
   white ring keeps it apart from the card. */
.smart-dispatch-drag-ban {
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #b91c1c;
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
}

.smart-dispatch-drag-preview.is-blocked .smart-dispatch-drag-ban {
    display: inline-flex;
}

/* Time badge: the range the drop will save ("08:30–11:30"), above the preview card, or above the dragged edge of a
   resize. Shown and filled by smart-dispatch-timeline.js; no transition or animation (so nothing to calm for reduced
   motion). The status toast's navy: white text on #1c2230 is 15.9:1 (at least 4.5:1 needed); the white ring keeps
   it apart from whatever is under it. */
.smart-dispatch-drag-time {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 4px);
    padding: 0 0.35rem;
    border-radius: 0.25rem;
    background: #1c2230;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

/* A resize's badge: fixed like the guide, centred on the dragged edge (left) just above the block (top). */
.smart-dispatch-resize-time {
    position: fixed;
    bottom: auto;
    transform: translate(-50%, calc(-100% - 4px));
    z-index: 30;
}

/* —— Guided tour (smart-dispatch-tour.js, Driver.js popoverClass) ——
   The navy look of the status toast: #1c2230 ground, white title, #c9d1de text, the toast's blue text buttons.
   Contrast on #1c2230: white 15.9:1, #c9d1de 10.3:1, #7fb0ff 7.2:1, #94a3b8 6.2:1, #8a93a6 5.2:1. The popover is
   drawn outside the board, so these rules are not under .smart-dispatch-shell; the double class beats driver.css. */
.driver-popover.smart-dispatch-tour {
    background-color: #1c2230;
    color: #c9d1de;
    font-family: inherit;
    border-radius: 8px;
    padding: 16px 16px 12px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(16, 22, 34, 0.28);
}

.driver-popover.smart-dispatch-tour .driver-popover-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    padding-right: 28px;
}

.driver-popover.smart-dispatch-tour .driver-popover-description {
    color: #c9d1de;
    font-size: 14px;
    line-height: 1.5;
}

/* Progress and buttons on one row, the "Don't show this again" box on its own row under them. */
.driver-popover.smart-dispatch-tour .driver-popover-footer {
    flex-wrap: wrap;
    row-gap: 10px;
    margin-top: 14px;
}

.driver-popover.smart-dispatch-tour .driver-popover-progress-text {
    color: #94a3b8;
    font-size: 12px;
}

.driver-popover.smart-dispatch-tour .driver-popover-footer-btn {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 5px;
    background-color: transparent;
    color: #c9d1de;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-shadow: none;
}

.driver-popover.smart-dispatch-tour .driver-popover-next-btn {
    color: #7fb0ff;
}

.driver-popover.smart-dispatch-tour .driver-popover-footer-btn:hover {
    background-color: #2a3245;
}

.driver-popover.smart-dispatch-tour .driver-popover-footer-btn:focus {
    background-color: transparent;
}

.driver-popover.smart-dispatch-tour .driver-popover-footer-btn:focus-visible,
.driver-popover.smart-dispatch-tour .driver-popover-close-btn:focus-visible,
.driver-popover.smart-dispatch-tour .smart-dispatch-tour-hide input:focus-visible {
    outline: 2px solid #7fb0ff;
    outline-offset: 2px;
}

.driver-popover.smart-dispatch-tour .driver-popover-close-btn {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    color: #8a93a6;
    font-size: 18px;
    line-height: 28px;
}

.driver-popover.smart-dispatch-tour .driver-popover-close-btn:hover {
    background-color: #2a3245;
    color: #ffffff;
}

.driver-popover.smart-dispatch-tour .smart-dispatch-tour-hide {
    flex-basis: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #3a4357;
    color: #c9d1de;
    font-size: 13px;
    cursor: pointer;
}

.driver-popover.smart-dispatch-tour .smart-dispatch-tour-hide input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #7fb0ff;
    cursor: pointer;
}

/* The part the tour points at gets a light ring, so it stands out even on the dark header, where the overlay
   barely darkens anything around it. The ring sits inside Driver.js's stage padding, so the overlay never covers it. */
.smart-dispatch-tour-open .driver-active-element {
    outline: 2px solid #7fb0ff;
    outline-offset: 3px;
}

/* While the tour is open the board's idle hint ("Drag a leg or a block onto a truck row...", the toast the
   timeline marks data-idle) would sit beside the popover; it is hidden, not closed, so it is back as it was when
   the tour ends. Every other line still shows. */
.smart-dispatch-tour-open [data-testid="smart-dispatch-toast"][data-idle] {
    display: none;
}

/* The arrow takes the popover colour on the side that points at the board. */
.driver-popover.smart-dispatch-tour .driver-popover-arrow-side-left { border-left-color: #1c2230; }
.driver-popover.smart-dispatch-tour .driver-popover-arrow-side-right { border-right-color: #1c2230; }
.driver-popover.smart-dispatch-tour .driver-popover-arrow-side-top { border-top-color: #1c2230; }
.driver-popover.smart-dispatch-tour .driver-popover-arrow-side-bottom { border-bottom-color: #1c2230; }

/* —— Reduced motion ——
   The legs pane, the detail pane and the map zone panel slide (width transitions above). With
   "reduce motion" on, they and anything added later in the board snap instead of moving. */
@media (prefers-reduced-motion: reduce) {
    .smart-dispatch-shell *,
    .smart-dispatch-shell *::before,
    .smart-dispatch-shell *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
