/* Staff-only neutral palette. Loaded exclusively by StaffPanelProvider.
   Palette overrides only: no dimensions, visibility, layout or interaction changes. */
body.fi-panel-staff {
    --staff-page: #172235;
    --staff-panel: #202e43;
    --staff-surface: #26384f;
    --staff-border: #3b4d63;
    --staff-text: #e9eef7;
    --staff-muted: #aebcd0;
    --staff-sidebar: #111a29;
    background-color: var(--staff-page) !important;
    color: var(--staff-text) !important;
}
html:has(> body.fi-panel-staff) { background-color: #172235 !important; }
body.fi-panel-staff :is(.fi-layout, .fi-main-ctn,
    .ct-vehicles-shell, .ct-drivers-shell, .ct-prov-shell, .hm-workspace,
    .cc-comm-workspace, .cc-comm-pane, .cc-detail-overlay, .cc-detail-panel) {
    background-color: var(--staff-page) !important;
    background-image: none !important;
}
body.fi-panel-staff :is(.fi-sidebar, .fi-sidebar-nav, .ct-dispatch-sidebar-logout) {
    background-color: var(--staff-sidebar) !important;
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff .fi-sidebar .fi-sidebar-item-label { color: var(--staff-text) !important; }
body.fi-panel-staff .fi-sidebar .fi-sidebar-item-icon { color: var(--staff-muted) !important; }
body.fi-panel-staff .fi-sidebar .fi-sidebar-item > a:hover { background-color: var(--staff-panel) !important; }
body.fi-panel-staff .fi-sidebar .fi-sidebar-item.fi-active > a,
body.fi-panel-staff .fi-sidebar .fi-sidebar-item > a[aria-current="page"] {
    background-color: var(--staff-surface) !important;
}
/* Existing gold active labels, icons and indicator remain authoritative. */
body.fi-panel-staff .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label,
body.fi-panel-staff .fi-sidebar a[aria-current="page"] .fi-sidebar-item-label { color: #fef3c7 !important; }
body.fi-panel-staff .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon,
body.fi-panel-staff .fi-sidebar a[aria-current="page"] .fi-sidebar-item-icon { color: #fbbf24 !important; }

/* Shared Staff surfaces and all ten Staff pages, including the hidden v2 shell. */
body.fi-panel-staff :is(.fi-card, .fi-section, .fi-modal-window,
    .cr4-card, .cr4-side-card, .cr4-summary-card,
    .cc-engine-bar, .cc-tools-bar, .cc-search-bar, .cc-status-strip, .cc-card, .cc-pagination,
    .hm-sidebar, .hm-card, .hm-stat, .hm-zone, .cc-comm-card, .cc-detail-card,
    .lm-toolbar, .tr-toolbar, .tr-playback, .tr-card,
    .ct-card, .ct-vehicles-card, .ct-heading, .ct-panel,
    .rc-toolbar, .rc-panel, .ccv2-card) {
    background-color: var(--staff-panel) !important;
    background-image: none !important;
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff :is(.cr4-wrap, .cc-wrap, .lm-wrap, .tr-wrap, .ct-stat,
    .ct-vehicles-shell, .ct-drivers-shell, .ct-prov-shell, .rc-shell, .rc-panel, .ccv2-card,
    .fi-section, .fi-card, .fi-ta-ctn) { color: var(--staff-text) !important; }
body.fi-panel-staff .ccv2-card.ccv2-focus { border-color: #f59e0b !important; }

/* Neutral form surfaces. Status/accent buttons and focus border colors are retained. */
body.fi-panel-staff :is(.cr4-input, .cr4-textarea, .cr4-select,
    .cc-search-input, .cc-date-input, .cc-comm-input, .cc-comm-select, .cc-comm-textarea,
    .lm-toolbar input, .lm-toolbar select, .tr-toolbar input, .tr-toolbar select,
    .ct-input, .ct-select, .ct-filters input, .rc-control, .rc-control option,
    .fi-input-wrp, .fi-select-input, .fi-fo-textarea) {
    background-color: var(--staff-surface) !important;
    background-image: none !important;
    color: var(--staff-text) !important;
}
body.fi-panel-staff :is(.cr4-input, .cr4-textarea, .cr4-select,
    .cc-search-input, .cc-date-input, .cc-comm-input, .cc-comm-select, .cc-comm-textarea,
    .lm-toolbar input, .lm-toolbar select, .tr-toolbar input, .tr-toolbar select,
    .ct-input, .ct-select, .ct-filters input, .rc-control):not(:focus) {
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff :is(.cr4-input, .cr4-textarea, .cc-search-input, .cc-comm-input,
    .cc-comm-textarea, .ct-input, .rc-control, .fi-input)::placeholder { color: var(--staff-muted) !important; }
body.fi-panel-staff :is(.cr4-mini-box, .cr4-vehicle-empty, .cr4-search-results, .cr4-search-item,
    .cr4-vehicle-item, .cc-detail-stat, .cc-delivery-row,
    .cc-driver-pick-row, .lm-map-wrap, .tr-map-wrap) {
    background-color: var(--staff-panel) !important;
    background-image: none !important;
}
body.fi-panel-staff :is(.cr4-mini-box, .cr4-vehicle-empty, .cr4-search-results,
    .cr4-vehicle-item:not(.selected), .cc-table-wrap, .cc-detail-stat,
    .cc-delivery-row, .cc-driver-pick-row:not(.active), .lm-map-wrap, .tr-map-wrap) {
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff :is(.cr4-search-item:hover, .cr4-search-item.active,
    .cc-driver-pick-row:hover, .cc-driver-pick-row.active, .cr4-vehicle-item:hover,
    .cc-table tbody tr:hover) { background-color: var(--staff-surface) !important; }
body.fi-panel-staff .cr4-form-actions {
    background: linear-gradient(180deg, rgba(32,46,67,0) 0%, rgba(32,46,67,.94) 20%, #202e43 100%) !important;
}
body.fi-panel-staff :is(.cr4-pill:not(.active), .cr4-source-btn:not(.active),
    .cr4-chip:not(.active):not(.route-active), .cr4-btn-secondary,
    .cc-engine-btn:not(.active), .cc-filter-btn:not(.active), .cc-tool-btn:not(.active):not(.active-comm),
    .cc-action-btn, .cc-page-btn, .cc-page-number:not(.active),
    .lm-toolbar button, .tr-toolbar button, .tr-playback button, .ct-btn-gray,
    .rc-page-link:not(.is-active)) {
    background-color: #30445c !important;
    background-image: none !important;
    border-color: #465a73 !important;
    color: #edf3fb !important;
}

/* Tables: preserve semantic row/status fills and badges. */
body.fi-panel-staff :is(.cc-table thead th, .ct-vehicles-table thead,
    .ct-drivers-table thead, .ct-prov-table thead, .rc-table thead th, .fi-ta-header-cell) {
    background-color: var(--staff-surface) !important;
    color: var(--staff-text) !important;
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff :is(.cc-table tbody td, .ct-vehicles-table td, .ct-drivers-table td,
    .ct-prov-table td, .rc-table td, .fi-ta-cell) {
    color: var(--staff-text) !important;
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff :is(.cc-table tbody tr, .ct-vehicles-table tr, .ct-drivers-table tr,
    .ct-prov-table tr, .rc-table tr) { border-color: var(--staff-border) !important; }

/* Statistics tokens preserve the existing per-status accents and bar colors. */
body.fi-panel-staff .ct-stat {
    --ct-bg: #202e43;
    --ct-line: #3b4d63;
    --ct-dim: #aebcd0;
}
body.fi-panel-staff .ct-kpi { background-color: var(--staff-panel) !important; }
body.fi-panel-staff :is(.ct-track, .ct-tag) { background-color: var(--staff-surface) !important; }

/* Neutral secondary text only; colored status labels remain unchanged. */
body.fi-panel-staff :is(.cr4-inline-label, .cr4-step-label, .cr4-label, .cr4-mini-label,
    .cr4-mini-value.empty, .cr4-search-sub, .cr4-search-empty, .cr4-vehicle-empty,
    .cc-date-range-label, .cc-status-strip, .cc-row-id, .cc-customer-sub, .cc-vehicle-sub,
    .cc-route-label, .cc-description-sub, .cc-desc-debug, .cc-driver-empty,
    .cc-detail-sub, .cc-detail-muted, .cc-detail-kv .k, .cc-detail-stat span, .cc-detail-event-sub,
    .lm-toolbar label, .lm-stats, .tr-stats,
    .ct-context, .ct-step, .ct-stage-bottom small, .ct-rates small, .ct-footnote,
    .ct-outcome small, .ct-total, .ct-empty, .ct-filters label, .ct-kpi h2,
    .ct-card-sub, .ct-subtitle, .rc-label, .rc-muted, .ccv2-muted, .ccv2-grid dt) {
    color: var(--staff-muted) !important;
}
body.fi-panel-staff .cr4-dispatcher-address .cr4-label { color: #86efac !important; }
body.fi-panel-staff .cr4-customer-position .cr4-label { color: #fca5a5 !important; }

/* Existing light zone workspaces retain their operational colors. Only their dark debug surfaces change. */
body.fi-panel-staff :is(.ze-bottom-panel, .ze-debug-palette) {
    background-color: var(--staff-page) !important;
    border-color: var(--staff-border) !important;
}
body.fi-panel-staff .ze-debug-row:not(.selected) {
    background-color: var(--staff-panel) !important;
    color: var(--staff-muted) !important;
    border-color: var(--staff-border) !important;
}
/* Depth: outer canvases and inset tables differ from actual cards. */
body.fi-panel-staff :is(.fi-ta-ctn, .cc-table-wrap, .rc-shell, .rc-table-card,
    .rc-preview-stage, .hm-stage) {
    background-color: var(--staff-page) !important;
    background-image: none !important;
    border-color: var(--staff-border) !important;
}
/* Do not paint every nested Filament layout/container as another solid panel. */
body.fi-panel-staff :is(.fi-main, .fi-page, .fi-page-content),
body.fi-panel-staff :is(.fi-card, .fi-section) :is(.fi-card, .fi-section) {
    background-color: transparent !important;
    background-image: none !important;
}
/* The input wrapper owns its surface; its nested control does not repaint it. */
body.fi-panel-staff .fi-input-wrp :is(.fi-input, .fi-select-input, .fi-fo-textarea) {
    background-color: transparent !important;
    background-image: none !important;
}
/* Map tiles, markers, state badges, accent buttons and white receipt paper are untouched. */
