/* ═══════════════════════════════════════════════════════════════
   Theme toggle icons
   Dark mode (default): ☀ visible — click to go light
   Light mode:          🌙 visible — click to go dark
   ══════════════════════════════════════════════════════════════ */
.hi-theme-icon-moon                             { display: none; }
.hi-theme-icon-sun                              { display: inline; }
body[data-theme="light"] .hi-theme-icon-sun     { display: none; }
body[data-theme="light"] .hi-theme-icon-moon    { display: inline; }

/* ═══════════════════════════════════════════════════════════════
   Light theme — global overrides  (body[data-theme="light"])
   ══════════════════════════════════════════════════════════════ */

/* ── Base ──────────────────────────────────────────────────── */
body[data-theme="light"]               { background-color: #f0f2f5; color: #1a1f2e; }
body[data-theme="light"] h2,
body[data-theme="light"] h3            { color: #1a1f2e; }
body[data-theme="light"] .card         { background: #ffffff; color: #1a1f2e; border-color: #dde1eb; }

/* Bootstrap form controls */
body[data-theme="light"] .form-control {
    background-color: #ffffff !important;
    border-color: #c5cad8 !important;
    color: #1a1f2e !important;
}
body[data-theme="light"] .form-control:focus {
    background-color: #ffffff !important;
    color: #1a1f2e !important;
}
body[data-theme="light"] .form-control::placeholder { color: #9aa0b0 !important; }

/* ── Dash DataTable ────────────────────────────────────────── */
body[data-theme="light"] .dash-spreadsheet-container .dash-spreadsheet-inner th,
body[data-theme="light"] .dash-spreadsheet-container .dash-spreadsheet-inner td {
    background-color: #ffffff !important;
    color: #1a1f2e !important;
    border-color: #dde1eb !important;
}
body[data-theme="light"] .dash-spreadsheet-container .dash-header {
    background-color: #f0f2f5 !important;
    color: #1a1f2e !important;
}
body[data-theme="light"] .dash-filter input {
    background-color: #f8f9fc !important;
    color: #1a1f2e !important;
    border-color: #c5cad8 !important;
}
body[data-theme="light"] .dash-table-container .previous-page,
body[data-theme="light"] .dash-table-container .next-page,
body[data-theme="light"] .dash-table-container .last-page,
body[data-theme="light"] .dash-table-container .first-page {
    color: #1a1f2e !important;
    background-color: #ffffff !important;
    border-color: #c5cad8 !important;
}
body[data-theme="light"] .dash-table-container .page-number {
    color: #1a1f2e !important;
    background-color: #f0f2f5 !important;
}

/* ── DatePicker ────────────────────────────────────────────── */
body[data-theme="light"] .dash-date-picker-range input {
    background-color: #ffffff !important;
    color: #1a1f2e !important;
    border-color: #c5cad8 !important;
}

/* ══════════════════════════════════════════════════════════════
   SERVICE BOOKING  (light)
   ══════════════════════════════════════════════════════════════ */
body[data-theme="light"] .svc-page          { background: #f0f2f5 !important; color: #1a1f2e; }
body[data-theme="light"] .svc-header        { background: #ffffff !important; border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .svc-page-title    { color: #1a1f2e !important; }
body[data-theme="light"] .svc-branch-chip   { background: #eef0f5 !important; color: #1a1f2e !important; border: 1px solid #dde1eb; }
body[data-theme="light"] .svc-last-synced,
body[data-theme="light"] .svc-server-clock  { color: #5a6478 !important; }

/* Tabs */
body[data-theme="light"] .svc-tabs          { background: #ffffff !important; border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .svc-tab           { color: #5a6478 !important; }
body[data-theme="light"] .svc-tab:hover     { color: #1a1f2e !important; background: transparent !important; }
body[data-theme="light"] .svc-tab-active    { color: #1a1f2e !important; border-bottom-color: #4a9eff !important; }

/* Body panels */
body[data-theme="light"] .svc-left-panel    { background: #f8f9fc !important; border-right-color: #dde1eb !important; }
body[data-theme="light"] .svc-right-panel   { background: #f0f2f5 !important; }

/* Calendar */
body[data-theme="light"] .svc-cal-title     { color: #1a1f2e !important; }
body[data-theme="light"] .svc-cal-nav       { color: #5a6478 !important; }
body[data-theme="light"] .svc-cal-nav:hover { background: #eef0f5 !important; color: #1a1f2e !important; }
body[data-theme="light"] .svc-cal-daynames span { color: #5a6478 !important; }
body[data-theme="light"] .svc-cal-cell      { color: #5a6478 !important; }
body[data-theme="light"] .svc-cal-cell:not(.svc-cal-empty):hover { background: #eef0f5 !important; color: #1a1f2e !important; }
body[data-theme="light"] .svc-cal-has-booking { color: #1a1f2e !important; }
body[data-theme="light"] .svc-legend-item   { color: #5a6478 !important; }

/* Left KPI */
body[data-theme="light"] .svc-left-kpi      { background: #ffffff !important; }
body[data-theme="light"] .svc-left-date     { color: #5a6478 !important; }
body[data-theme="light"] .svc-kpi-row       { border-bottom-color: #eef0f5 !important; }
body[data-theme="light"] .svc-kpi-label     { color: #5a6478 !important; }
body[data-theme="light"] .svc-kpi-value     { color: #1a1f2e !important; }
body[data-theme="light"] .svc-kpi-divider   { background: #eef0f5 !important; }

/* Top KPI cards */
body[data-theme="light"] .svc-top-card      { background: #ffffff !important; border-color: #dde1eb !important; }
body[data-theme="light"] .svc-top-card-label { color: #5a6478 !important; }
body[data-theme="light"] .svc-top-card-value { color: #1a1f2e !important; }

/* Filter dropdowns */
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-control {
    background: #ffffff !important;
    border-color: #c5cad8 !important;
    color: #1a1f2e !important;
}
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-value-label,
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-value,
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-placeholder { color: #5a6478 !important; }
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-arrow-zone .Select-arrow { border-top-color: #5a6478 !important; }
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-menu-outer {
    background: #ffffff !important;
    border-color: #c5cad8 !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-option { background: #ffffff !important; color: #1a1f2e !important; }
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-option.is-focused { background: #f0f2f5 !important; }
body[data-theme="light"] .svc-page .svc-filter-dropdown .Select-option.is-selected { background: #dbeafe !important; color: #1d4ed8 !important; }

/* Search + sort */
body[data-theme="light"] .svc-search-input  { background: #ffffff !important; border-color: #c5cad8 !important; color: #1a1f2e !important; }
body[data-theme="light"] .svc-search-input::placeholder { color: #9aa0b0 !important; }
body[data-theme="light"] .svc-sort-label    { color: #5a6478 !important; }
body[data-theme="light"] .svc-sort-chip     { background: #ffffff !important; border-color: #c5cad8 !important; color: #5a6478 !important; box-shadow: 0 1px 2px rgba(0,0,0,0.08) !important; }
body[data-theme="light"] .svc-sort-chip:hover { background: #f0f4ff !important; border-color: #4a9eff !important; color: #1a1f2e !important; }
body[data-theme="light"] .svc-sort-chip-active { background: rgba(74,158,255,0.12) !important; border-color: #4a9eff !important; color: #4a9eff !important; }

/* Date group headers */
body[data-theme="light"] .svc-date-group-header { border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .svc-date-group-label  { color: #1a1f2e !important; }
body[data-theme="light"] .svc-date-group-count  { color: #5a6478 !important; }
body[data-theme="light"] .svc-booking-header-inner { border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .svc-date-label        { color: #1a1f2e !important; }
body[data-theme="light"] .svc-record-count      { color: #5a6478 !important; }

/* Booking cards */
body[data-theme="light"] .svc-booking-card      { background: #ffffff !important; border-color: #dde1eb !important; }
body[data-theme="light"] .svc-view-toggle-btn   { background: #eef0f5 !important; border-color: #c5cad8 !important; color: #5a6478 !important; }
body[data-theme="light"] .svc-view-toggle-btn:hover { background: #e0e5f0 !important; color: #1a1f2e !important; }

/* ── Service Booking card internals (light) ────────────────── */
body[data-theme="light"] .svc-vehicle-id        { color: #1a1f2e !important; }
body[data-theme="light"] .svc-vehicle-model,
body[data-theme="light"] .svc-vehicle-location,
body[data-theme="light"] .svc-card-meta,
body[data-theme="light"] .svc-odo,
body[data-theme="light"] .svc-svc-odo,
body[data-theme="light"] .svc-bk-odo,
body[data-theme="light"] .svc-tile-odo,
body[data-theme="light"] .svc-tile-meta,
body[data-theme="light"] .svc-tile-date,
body[data-theme="light"] .svc-card-remarks,
body[data-theme="light"] .svc-no-data           { color: #5a6478 !important; }
body[data-theme="light"] .svc-card-odo-row      { background: rgba(0,0,0,0.04) !important; }
body[data-theme="light"] .svc-card-remarks-row  { border-top-color: #eef0f5 !important; }
body[data-theme="light"] .svc-sep               { color: #c5cad8 !important; }
body[data-theme="light"] .svc-tile-footer       { border-top-color: #eef0f5 !important; }
body[data-theme="light"] .svc-tile {
    background: #ffffff !important;
    border-color: #dde1eb !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}
body[data-theme="light"] .svc-tile-title        { color: #1a1f2e !important; }

/* ══════════════════════════════════════════════════════════════
   DISPATCHING  (light)
   ══════════════════════════════════════════════════════════════ */
body[data-theme="light"] .dsp-page          { background: #f0f2f5 !important; color: #1a1f2e; }
body[data-theme="light"] .dsp-header        { background: #ffffff !important; border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .dsp-page-title    { color: #1a1f2e !important; }
body[data-theme="light"] .dsp-date-input    {
    background: #ffffff !important;
    border-color: #c5cad8 !important;
    color: #1a1f2e !important;
    color-scheme: light !important;
}
body[data-theme="light"] .dsp-date-sep      { color: #5a6478 !important; }
body[data-theme="light"] .dsp-last-synced   { color: #5a6478 !important; }

/* KPI cards */
body[data-theme="light"] .dsp-kpi-card      { background: #ffffff !important; border-left-color: #dde1eb !important; }
body[data-theme="light"] .dsp-kpi-label     { color: #5a6478 !important; }
body[data-theme="light"] .dsp-kpi-value     { color: #1a1f2e !important; }

/* Tabs */
body[data-theme="light"] .dsp-tabs          { background: #ffffff !important; border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .dsp-tab           { color: #5a6478 !important; }
body[data-theme="light"] .dsp-tab:hover     { color: #1a1f2e !important; background: transparent !important; }
body[data-theme="light"] .dsp-tab-active    { color: #1a1f2e !important; border-bottom-color: #4a9eff !important; }

/* Content + empty state */
body[data-theme="light"] .dsp-empty         { color: #5a6478 !important; }

/* Leaderboard */
body[data-theme="light"] .dsp-lb-item       { background: #ffffff !important; }
body[data-theme="light"] .dsp-lb-value      { color: #1a1f2e !important; }
body[data-theme="light"] .dsp-lb-chip       { background: rgba(0,0,0,0.05) !important; color: #5a6478 !important; }
body[data-theme="light"] .dsp-lb-dates      { color: #5a6478 !important; }

/* Record cards */
body[data-theme="light"] .dsp-record-card   { background: #ffffff !important; border-left-color: #c5cad8 !important; }
body[data-theme="light"] .dsp-rec-plate     { color: #1a1f2e !important; }
body[data-theme="light"] .dsp-rec-date,
body[data-theme="light"] .dsp-rec-meta,
body[data-theme="light"] .dsp-rec-times     { color: #5a6478 !important; }

/* ══════════════════════════════════════════════════════════════
   FLEET STATUS  (light)
   ══════════════════════════════════════════════════════════════ */
body[data-theme="light"] .flt-page          { background: #f0f2f5 !important; color: #1a1f2e; }
body[data-theme="light"] .flt-header        { background: #ffffff !important; border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .flt-page-title    { color: #1a1f2e !important; }

/* KPI row */
body[data-theme="light"] .flt-kpi-card      { background: #ffffff !important; border-color: #dde1eb !important; }
body[data-theme="light"] .flt-kpi-card-btn:hover { background: #f0f4ff !important; }
body[data-theme="light"] .flt-kpi-label     { color: #5a6478 !important; }
body[data-theme="light"] .flt-kpi-value     { color: #1a1f2e !important; }

/* Filters / toggles */
body[data-theme="light"] .flt-tog-label     { color: #5a6478 !important; }
body[data-theme="light"] .flt-tog           { border-color: #c5cad8 !important; background: #ffffff !important; color: #5a6478 !important; }
body[data-theme="light"] .flt-tog:hover     { border-color: #4a9eff !important; color: #1a1f2e !important; background: #f0f4ff !important; }
body[data-theme="light"] .flt-tog-active    { background: #e8f0fe !important; border-color: #4a7adf !important; color: #1a3a8a !important; }
body[data-theme="light"] .flt-search-input  { background: #ffffff !important; border-color: #c5cad8 !important; color: #1a1f2e !important; }
body[data-theme="light"] .flt-search-input::placeholder { color: #9aa0b0 !important; }

/* Legend */
body[data-theme="light"] .flt-legend-label  { color: #5a6478 !important; }
body[data-theme="light"] .flt-legend-div    { background: #c5cad8 !important; }

/* View buttons */
body[data-theme="light"] .flt-view-btn      { background: #eef0f5 !important; color: #5a6478 !important; border-color: #c5cad8 !important; }
body[data-theme="light"] .flt-view-btn-active { background: #4a9eff !important; color: #ffffff !important; border-color: #4a9eff !important; }
body[data-theme="light"] .flt-expand-btn,
body[data-theme="light"] .flt-sync-btn      { background: #eef0f5 !important; border-color: #c5cad8 !important; color: #5a6478 !important; }
body[data-theme="light"] .flt-last-synced   { color: #9aa0b0 !important; }

/* State / route groups */
body[data-theme="light"] .flt-state-group   { border-color: #dde1eb !important; }
body[data-theme="light"] .flt-state-summary { background: #eef0f5 !important; }
body[data-theme="light"] .flt-state-summary:hover { background: #e4e8f4 !important; }
body[data-theme="light"] .flt-state-name    { color: #1a1f2e !important; }
body[data-theme="light"] .flt-state-body    { background: #f8f9fc !important; }
body[data-theme="light"] .flt-route-group   { border-color: #dde1eb !important; }
body[data-theme="light"] .flt-route-summary { background: #f0f2f5 !important; }
body[data-theme="light"] .flt-route-summary:hover { background: #e8ecf5 !important; }
body[data-theme="light"] .flt-route-code    { color: #1a1f2e !important; }
body[data-theme="light"] .flt-route-name    { color: #5a6478 !important; }
body[data-theme="light"] .flt-rstat-total,
body[data-theme="light"] .flt-rstat-routes  { background: #e8ecf5 !important; color: #5a6478 !important; }

/* Vehicle rows */
body[data-theme="light"] .flt-route-body    { border-top-color: #dde1eb !important; }
body[data-theme="light"] .flt-crow          { background: #ffffff !important; border-bottom-color: #eef0f5 !important; }
body[data-theme="light"] .flt-crow:last-child { border-bottom: none !important; }
body[data-theme="light"] .flt-cplate        { color: #1a1f2e !important; }
body[data-theme="light"] .flt-row           { background: #ffffff !important; border-color: #dde1eb !important; }
body[data-theme="light"] .flt-row:hover     { background: #f0f4ff !important; }
body[data-theme="light"] .flt-plate         { color: #1a1f2e !important; }
body[data-theme="light"] .flt-bus-type      { background: #eef0f5 !important; color: #5a6478 !important; }
body[data-theme="light"] .flt-meta-dim,
body[data-theme="light"] .flt-row-sub,
body[data-theme="light"] .flt-rec-times     { color: #5a6478 !important; }
body[data-theme="light"] .flt-no-data       { color: #5a6478 !important; }

/* Table view */
body[data-theme="light"] .flt-tbl-header    { background: #eef0f5 !important; color: #5a6478 !important; border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .flt-trow          { border-bottom-color: #eef0f5 !important; color: #1a1f2e !important; }
body[data-theme="light"] .flt-trow:hover    { background: #f0f4ff !important; }

/* Modal */
body[data-theme="light"] .flt-modal         { background: rgba(0,0,0,0.5) !important; }
body[data-theme="light"] .flt-modal-card    { background: #ffffff !important; color: #1a1f2e !important; border-color: #dde1eb !important; }
body[data-theme="light"] .flt-modal-header  { border-bottom-color: #dde1eb !important; }
body[data-theme="light"] .flt-modal-plate   { color: #1a1f2e !important; }
body[data-theme="light"] .flt-modal-close   { color: #5a6478 !important; }

/* Dropdown filter inside fleet page */
body[data-theme="light"] .flt-page .flt-filter-dropdown .Select-control { background: #ffffff !important; border-color: #c5cad8 !important; }
body[data-theme="light"] .flt-page .flt-filter-dropdown .Select-value-label,
body[data-theme="light"] .flt-page .flt-filter-dropdown .Select-placeholder { color: #5a6478 !important; }
body[data-theme="light"] .flt-page .flt-filter-dropdown .Select-menu-outer { background: #ffffff !important; border-color: #c5cad8 !important; }
body[data-theme="light"] .flt-page .flt-filter-dropdown .Select-option { background: #ffffff !important; color: #1a1f2e !important; }
body[data-theme="light"] .flt-page .flt-filter-dropdown .Select-option.is-focused { background: #f0f2f5 !important; }

/* ── Landing page (light) ──────────────────────────────────── */
body[data-theme="light"] .hi-landing-page       { background-color: #f0f2f5 !important; }
body[data-theme="light"] .hi-landing-title      { color: #1a1f2e !important; }
body[data-theme="light"] .hi-landing-subtitle   { color: #5a6478 !important; }
body[data-theme="light"] .hi-landing-card       { background-color: #ffffff !important; border-color: #dde1eb !important; box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important; }
body[data-theme="light"] .hi-landing-card-title { color: #1a1f2e !important; }
body[data-theme="light"] .hi-landing-card-desc  { color: #5a6478 !important; }
body[data-theme="light"] .hi-landing-card:hover     { border-color: #adb5bd !important; }
body[data-theme="light"] .hi-landing-section-title  { color: #6c757d !important; border-bottom-color: #dee2e6 !important; }
body[data-theme="light"] .hi-landing-ext-icon       { color: #6c757d !important; }

/* Light theme overrides for dashboard-c dropdowns */
body[data-theme="light"] #c-route-dropdown .Select-control,
body[data-theme="light"] #c-groupby-dropdown .Select-control {
    background-color: #ffffff !important;
    border-color: #c5cad8 !important;
    color: #1a1f2e !important;
}
body[data-theme="light"] #c-route-dropdown .Select-value-label,
body[data-theme="light"] #c-groupby-dropdown .Select-value-label,
body[data-theme="light"] #c-route-dropdown .Select-placeholder,
body[data-theme="light"] #c-groupby-dropdown .Select-placeholder { color: #5a6478 !important; }
body[data-theme="light"] #c-route-dropdown .Select-menu-outer,
body[data-theme="light"] #c-groupby-dropdown .Select-menu-outer {
    background-color: #ffffff !important;
    border-color: #c5cad8 !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}
body[data-theme="light"] #c-route-dropdown .Select-option,
body[data-theme="light"] #c-groupby-dropdown .Select-option {
    background-color: #ffffff !important;
    color: #1a1f2e !important;
}
body[data-theme="light"] #c-route-dropdown .Select-option.is-focused,
body[data-theme="light"] #c-groupby-dropdown .Select-option.is-focused { background-color: #f0f2f5 !important; }
body[data-theme="light"] #c-route-dropdown .Select-option.is-selected,
body[data-theme="light"] #c-groupby-dropdown .Select-option.is-selected { background-color: #dbeafe !important; color: #1d4ed8 !important; }

/* ═══════════════════════════════════════════════════════════════
   Global dark theme — dcc.Dropdown (react-select v1) ALL pages
   Applies to every dcc.Dropdown in the app on dark theme.
   Per-page overrides in other CSS files take precedence if needed.
   ══════════════════════════════════════════════════════════════ */
body:not([data-theme="light"]) .Select-control:not(.hi-payslip *) {
    background-color: #1e2537 !important;
    border-color: rgba(255,255,255,0.15) !important;
    color: #e8eaf0 !important;
}
body:not([data-theme="light"]) .Select-value-label:not(.hi-payslip *),
body:not([data-theme="light"]) .Select-placeholder:not(.hi-payslip *) { color: #adb5bd !important; }
body:not([data-theme="light"]) .Select-input > input:not(.hi-payslip *) { color: #e8eaf0 !important; }
body:not([data-theme="light"]) .Select-menu-outer:not(.hi-payslip *) {
    background-color: #1e2537 !important;
    border-color: rgba(255,255,255,0.15) !important;
}
body:not([data-theme="light"]) .Select-option:not(.hi-payslip *) {
    background-color: #1e2537 !important;
    color: #e8eaf0 !important;
}
body:not([data-theme="light"]) .Select-option.is-focused:not(.hi-payslip *)  { background-color: #2d3a52 !important; }
body:not([data-theme="light"]) .Select-option.is-selected:not(.hi-payslip *) { background-color: #3a4a6b !important; color: #ffffff !important; }
body:not([data-theme="light"]) .Select-arrow:not(.hi-payslip *)             { border-top-color: #8a96b0 !important; }
body:not([data-theme="light"]) .Select-clear:not(.hi-payslip *)             { color: #8a96b0 !important; }
body:not([data-theme="light"]) .Select-noresults:not(.hi-payslip *)         { color: #8a96b0 !important; background:#1e2537 !important; }
/* VirtualizedSelect (older Dash react-select wrapper) */
body:not([data-theme="light"]) .VirtualizedSelectFocusedOption:not(.hi-payslip *)  { background:#2d3a52 !important; color:#e8eaf0 !important; }
body:not([data-theme="light"]) .VirtualizedSelectSelectedOption:not(.hi-payslip *) { background:#3a4a6b !important; color:#ffffff !important; }
