/* The original CH Systems palette remains the default dark theme. */
.button.trip-route{background:#182b37;color:#a9becb;border-color:#415a69;opacity:1}
.button.trip-route.selected{background:#45636e;color:#fff;border-color:#68e5cf;box-shadow:inset 0 0 0 1px #68e5cf;font-weight:700}
[data-theme=light] .button.trip-route{background:#d7e1e7;color:#48616d;border-color:#b5c6d0}
[data-theme=light] .button.trip-route.selected{background:#fff;color:#124f48;border-color:#008a76;box-shadow:inset 0 0 0 1px #008a76}
.route-driver-link{padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:700;text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:4px;text-decoration-color:var(--accent)}
.route-driver-link:focus-visible{outline:2px solid var(--accent);outline-offset:5px;border-radius:3px}
.tracking-switch{margin:10px 0 4px}.tracking-control-note{display:block;max-width:360px;color:var(--muted);line-height:1.5;margin-bottom:12px}
.sidebar .bottom .theme-switch{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:10px 12px;margin:0 0 14px;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--surface-raised);color:var(--text);font-size:12px}
.sidebar .bottom .theme-switch:hover{background:#36515f;border-color:#5a7c87;color:var(--text)}
.theme-track{display:block;position:relative;flex:0 0 44px;width:44px;height:24px;border:1px solid #54717e;border-radius:20px;background:#182b37}
.theme-thumb{position:absolute;display:grid;place-items:center;width:18px;height:18px;left:2px;top:2px;border-radius:50%;background:#c7dbe6;color:#1b3948;transition:transform .18s,background-color .18s}
.theme-thumb span{display:grid;place-items:center}.theme-thumb svg{width:13px;height:13px}.theme-thumb .theme-sun{display:none}
[data-theme=light] .theme-thumb{transform:translateX(20px);background:#007f70;color:#fff}[data-theme=light] .theme-thumb .theme-moon{display:none}[data-theme=light] .theme-thumb .theme-sun{display:grid}
@media(min-width:761px){.menu-collapsed .sidebar:not(.is-peeking) .theme-current{display:none}.menu-collapsed .sidebar:not(.is-peeking) .theme-switch{justify-content:center;padding:9px 0;border-color:transparent;background:none}}
@media(max-width:760px){.sidebar .bottom{flex-wrap:wrap}.sidebar .bottom .theme-switch{flex:1 0 100%;margin:0}.sidebar .bottom .theme-switch .theme-track{margin-left:auto}}
@media(prefers-reduced-motion:reduce){.theme-thumb{transition:none}}

:root[data-theme=light]{color-scheme:light;--bg:#f3f6f8;--surface:#fff;--surface-raised:#eaf1f5;--line:#d2e0e7;--text:#19303e;--muted:#586e7e;--accent:#00d1b2;--accent-soft:#dbf6ef;background:var(--bg);color:var(--text)}
[data-theme=light] body{background:radial-gradient(ellipse at 70% 0%,#00d1b20a,transparent 55%),var(--bg)}
[data-theme=light] a{color:#087c70}
[data-theme=light] :is(.eyebrow,.detail-header .eyebrow){color:#617887}
[data-theme=light] .sidebar{background:linear-gradient(155deg,#fafdfe,#edf4f7 75%);color:var(--text);border-color:var(--line)}
[data-theme=light] .sidebar.is-peeking{box-shadow:12px 0 40px #19303e20!important}
[data-theme=light] :is(.brand,.sidebar .brand,.login-box .brand){color:var(--text)}
[data-theme=light] :is(.brand small,.sidebar .brand small){color:#607887}
[data-theme=light] .brand-mark{content:url('logistics-mark-light.svg')}
[data-theme=light] .company-sign img{content:url('chs-mark-light.svg')}
[data-theme=light] .company-sign{color:#284351}
[data-theme=light] .sidebar :is(button,a){color:#526b7c}
[data-theme=light] .sidebar :is(button,a):hover{color:#173d49;background:#e0edf1}
[data-theme=light] .sidebar nav button{color:#526b7c}
[data-theme=light] .sidebar nav button:hover{background:#e2eff3;border-color:#c7dce3;color:#173d49}
[data-theme=light] .sidebar nav button.active{background:linear-gradient(90deg,#d4f5ed,#e9f7f4);border-color:#a7ded2;color:#096f60;box-shadow:inset 3px 0 var(--accent),0 0 20px #00d1b20a}
[data-theme=light] .sidebar .bottom :is(a,button){color:#526b7c}
[data-theme=light] .sidebar .bottom .theme-switch{background:#fff;color:var(--text);border-color:var(--line)}
[data-theme=light] .sidebar .bottom .theme-switch:hover{background:#e7f5f1;border-color:#94ccbf}
[data-theme=light] .theme-track{background:#c8ede3;border-color:#98cdbf}
[data-theme=light] .button{background:#fff;border-color:#c4d6df;color:#284956;box-shadow:0 1px 3px #19303e04}
[data-theme=light] .button:hover{background:#edf5f7;border-color:#a5becb;box-shadow:0 3px 14px #19303e0a}
[data-theme=light] :is(.button.primary,.primary){background:linear-gradient(120deg,#00d1b2,#00bfa9);border-color:#00b79f;color:#063b34;box-shadow:0 3px 15px #00b69a16}
[data-theme=light] .button.primary:hover{background:#19d9bb;box-shadow:0 0 22px #00b69a24}
[data-theme=light] .button.danger{color:#b7354b}
[data-theme=light] :is(.stat,.panel){background:linear-gradient(130deg,#fff,#f8fbfc);border-color:var(--line)}
[data-theme=light] .stats>.stat:nth-child(2){border-color:#b5dfd4}
[data-theme=light] .stats>.stat:nth-child(2) b{color:#07856e}
[data-theme=light] .route-layout-tools .button{background:#fff;color:#284956}
[data-theme=light] .route-layout-tools [aria-pressed=true]{background:#dff5ee;border-color:#9bd0bf;color:#0a7763}
[data-theme=light] .route-card{background:linear-gradient(130deg,#fff,#f7fafb);border-color:#d0e0e6;color:var(--text)}
[data-theme=light] .route-card:hover{background:#eef8f8;border-color:#9bbfca}
[data-theme=light] :is(.route-card.selected,.route-search-results .route-card.selected){background:linear-gradient(135deg,#ddf7ef,#eff9f7);border-color:#76c8b6;box-shadow:inset 3px 0 var(--accent),0 5px 25px #00c9ab08}
[data-theme=light] .route-card p{color:#56717e}
[data-theme=light] .route-progress>div{background:#d2e6e1}
[data-theme=light] .route-progress small{color:#477c72}
[data-theme=light] .badge{background:#e9eff4;color:#506978}
[data-theme=light] .badge.active{background:#d6f4e9;color:#087c62}
[data-theme=light] .badge.completed{background:#e1edf7;color:#366787}
[data-theme=light] .health-badge.good{background:#e0f5ed;color:#147455}
[data-theme=light] .health-badge.bad{background:#fde9ed;color:#af354c}
[data-theme=light] .health-badge.warn{background:#fff1d2;color:#8b630f}
[data-theme=light] .health-badge.muted{background:#e8eef2;color:#617581}
[data-theme=light] .battery-status{color:#12785e}[data-theme=light] .battery-status.muted{color:#657986}
[data-theme=light] .route-name{color:#42606f}
[data-theme=light] .route-fact>.ui-icon{color:#6a8594}
[data-theme=light] .route-fact.factory{color:#1d3f47}[data-theme=light] .route-fact.factory>.ui-icon{color:#059d83}
[data-theme=light] .route-map-layout .map{border-color:#c6d8e1;background:#e6eef0}
[data-theme=light] .leaflet-tile-pane{filter:saturate(.5) contrast(.9) brightness(1.03)}
[data-theme=light] .leaflet-control-attribution{background:#fffffff0!important;color:#536e7b!important}
[data-theme=light] .leaflet-control-attribution a{color:#296d7d}
[data-theme=light] .leaflet-bar a{background:#fff!important;color:#2c5363!important;border-color:#d6e2e8!important}
[data-theme=light] :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip){background:#fff;color:var(--text)}
[data-theme=light] .leaflet-container a.leaflet-popup-close-button{color:#536e7b}
[data-theme=light] :is(.map-actions .button,.gps-toggle){background:#fffffff5;color:#2f5360;border-color:#b1cbd3;box-shadow:0 3px 12px #183b4920}
[data-theme=light] .map-actions [aria-pressed=true]{background:#e1f8f0f5;color:#0e7a62;border-color:#7fc4ae}
[data-theme=light] .map-legend{color:#586f7d}
[data-theme=light] .factory-marker{color:#087965;background:#dff8ed;border-color:#28ac8c}
[data-theme=light] .live-card{background:linear-gradient(135deg,#f5fafb,#eef5f8);border-color:#cfdee5}
[data-theme=light] .live-label{color:#5b7482}
[data-theme=light] .live-status-icon{background:#dff5ee;border-color:#b0ddcf;color:#069c80}
[data-theme=light] .live-status strong{color:#067d65}
[data-theme=light] .live-status .live-address{color:#375b6b}
[data-theme=light] .live-card.warn .live-status strong{color:#936411}
[data-theme=light] .live-card.waiting .live-status strong{color:#536e7d}
[data-theme=light] .progress-numbers .delivered{color:#087f67}
[data-theme=light] .progress-bar{background:#d6e5ea}
[data-theme=light] .last-event .ui-icon{color:#079c81}[data-theme=light] .last-event time{color:#345b6c}
[data-theme=light] .monitor-status{border-color:#c4dbe4;background:#eaf3f7;color:#436777}
[data-theme=light] .monitor-status.good{background:#e5f6ec;border-color:#b5dac5;color:#24734e}
[data-theme=light] .monitor-status.bad{background:#fbecef;border-color:#e6bfc7;color:#a74353}
[data-theme=light] .monitor-status.warn{background:#fff5de;border-color:#e8d4a2;color:#896b25}
[data-theme=light] .gps-details summary{color:#527684}
[data-theme=light] .gps-details .notice{color:#577784}
[data-theme=light] .detail-tab{color:#607987}[data-theme=light] .detail-tab:hover{color:#244956}
[data-theme=light] .detail-tab[aria-selected=true]{color:#067d67}
[data-theme=light] .detail-tab span{background:#e3edf1}
[data-theme=light] .detail-tab[aria-selected=true] span{background:#d2f0e5;color:#0a795f}
[data-theme=light] .detail-tabpanel>h3{color:#335764}
[data-theme=light] .milestone:before{background:#c9d9e1}
[data-theme=light] .milestone.done:before{background:linear-gradient(90deg,#00bda7,#83cabc)}
[data-theme=light] .milestone-symbol{background:linear-gradient(145deg,#f5fafb,#e6f0f4);border-color:#c1d4df;color:#648391}
[data-theme=light] .milestone.done .milestone-symbol{color:#07846e;border-color:#77c6b5}
[data-theme=light] .milestone.active .milestone-symbol{color:#04896e;border-color:#00b49a}
[data-theme=light] .milestone time{color:#345a6a}[data-theme=light] .milestone strong{color:#4a6977}
[data-theme=light] .timers b{color:#254d5d}
[data-theme=light] th{color:#5d7a89;border-color:#d2e0e7}
[data-theme=light] td{color:#345565;border-color:#d8e5eb}
[data-theme=light] td small{color:#627c8a}
[data-theme=light] .table-scroll{scrollbar-color:#bfd2dc #f0f5f7}
[data-theme=light] :is(.table-scroll tr[data-stop]:hover,.table-scroll tr[data-stop]:focus,tr[data-event]:hover,tr[data-event]:focus){background:#e9f7f2}
[data-theme=light] .journal-group th{background:#eaf3f6;color:#426e7c;border-color:#d1e2e8}
[data-theme=light] .locate-button{color:#0d8672}
[data-theme=light] .stop-status.done{color:#21865d}[data-theme=light] .stop-status.here{color:#9b7015}[data-theme=light] .stop-status.waiting{color:#ba4955}
[data-theme=light] .scan-warning{color:#986415}
[data-theme=light] .empty{color:#69818e}[data-theme=light] .empty b{color:#365d6d}
[data-theme=light] :is(input,select,.field input,.field select,.field textarea){background:#fff;border-color:#bbd0db;color:#244858}
[data-theme=light] :is(input,select,textarea):hover{border-color:#7eabb9}
[data-theme=light] :is(input,textarea)::placeholder{color:#7a8f9b}
[data-theme=light] .notice{background:#e6f7f0;border-color:#b4ddcd;color:#347661}
[data-theme=light] .warning{background:#fff5dd;border-color:#e7cf99;color:#88641c}
[data-theme=light] .error{color:#bc3c50}
[data-theme=light] .upload{background:#eef8f8;border-color:#aacdd0}
[data-theme=light] .import-row input[readonly]{background:#e9f6ed;color:#336f50}
[data-theme=light] .schedule-panel{background:#eff8f3;border-color:#bfdccd}
[data-theme=light] .template-choice{background:#f2f7f9;border-color:#c4d8e1;color:#335867}
[data-theme=light] .template-choice small{color:#677f8b}
[data-theme=light] .template-choice.ready{background:#e8f7ed;border-color:#89c5a3;color:#2b754a}
[data-theme=light] .template-choice.ready small{color:#52896a}
[data-theme=light] .template-options{background:#fff;border-color:#b8d3dd}
[data-theme=light] .point-code{color:#295865}
[data-theme=light] .tag-row.bound input{background:#ecf8ee;border-color:#8bc8a2}
[data-theme=light] .manual-point{background:#f3f8fa;border-color:#c5dae3}
[data-theme=light] .catalog-edit{color:#0d8970}
[data-theme=light] :is(.factory-dialog,.receipt-dialog){background:#fff;color:#244858;border-color:#b9d2dc}
[data-theme=light] :is(.factory-dialog,.receipt-dialog)::backdrop{background:#1b334e66}
[data-theme=light] summary{color:#4c7485}
[data-theme=light] pre{background:#edf4f7;color:#385e70}
[data-theme=light] .analytics-bar{background:#dce9ee}
[data-theme=light] :is(.analytics-stage>small,.analytics-volumes small,.analytics-rules,.analytics-method){color:#5e7d8c}
[data-theme=light] :is(.analytics-link,.analytics-start-time,.analytics-stage-scope){color:#07816b}
[data-theme=light] .analytics-late{color:#ae5033}
[data-theme=light] .badge.analytics-late{background:#fcece5;color:#a04930}
[data-theme=light] .badge.analytics-on-time{background:#e1f4e9;color:#287b50}
[data-theme=light] .receipt-summary{background:#e7f7ef;border-color:#b8ddcb}
[data-theme=light] .receipt-summary strong{color:#2c7258}
[data-theme=light] .receipt-image-wrap{background:#e8f0f3}
[data-theme=light] #toast{background:#e0f5ee;border-color:#8bc9b7;color:#205e50;box-shadow:0 8px 40px #19303e25}
[data-theme=light] .login{background:radial-gradient(ellipse at 20% 30%,#00c9ad0f,transparent 50%),radial-gradient(ellipse at 80% 60%,#97d6e425,transparent 60%),#f3f6f8}
[data-theme=light] .login-box{background:linear-gradient(145deg,#fff,#f4fafa);border-color:#bfdadf;color:var(--text);box-shadow:0 30px 100px #19303e16}
[data-theme=light] .login-box h1 em{color:#079b83}
[data-theme=light] .delivery-step{background:#fff;border-color:#8da5b2;box-shadow:0 0 0 4px #f8fbfc;color:#073c37}
[data-theme=light] .delivery-step.done{background:#00d1b2;border-color:#00bda0}
[data-theme=light] .delivery-step.here{background:#fffbef;border-color:#d9a22c;box-shadow:0 0 0 4px #d9a22c18,0 0 15px #d9a22c18}
[data-theme=light] .delivery-step.here:after{background:#e0aa31}
[data-theme=light] .delivery-stage:before{background:#c0d0d8}
[data-theme=light] .delivery-row.done .delivery-stage:before{background:#00bda0}
[data-theme=light] .delivery-row.here .delivery-stage:before{background:linear-gradient(to bottom,#00bda0 28px,#c0d0d8 28px)}
[data-theme=light] .delivery-key{color:#5b7b89}
[data-theme=light] :is(.delivery-row:hover,.delivery-row:focus) .delivery-step.waiting{background:#e9f7f2}

/* Keep the route-list control easy to find in either theme, without pulsing. */
.route-layout-tools .button[data-routes-toggle]{background:linear-gradient(135deg,#174c48,#203d43);border-color:#328f80;color:#a1f2e0;font-weight:650;box-shadow:inset 0 1px 0 #ffffff0a,0 0 14px #00d1b21c}
.route-layout-tools .button[data-routes-toggle][aria-expanded=false]{border-color:#27b99f;box-shadow:0 0 17px #00d1b22b}
.route-layout-tools .button[data-routes-toggle]:hover{background:#225e55;border-color:#4cddbf;color:#d9fff4;box-shadow:0 0 20px #00d1b233}
[data-theme=light] .route-layout-tools .button[data-routes-toggle]{background:linear-gradient(135deg,#def8ef,#effbf7);border-color:#78c7b5;color:#0b7360;box-shadow:0 3px 14px #00a98b1a}
[data-theme=light] .route-layout-tools .button[data-routes-toggle][aria-expanded=false]{border-color:#32ad91;box-shadow:0 0 17px #00a98b24}
[data-theme=light] .route-layout-tools .button[data-routes-toggle]:hover{background:#cef4e6;border-color:#299d81;color:#075e4c;box-shadow:0 3px 18px #00a98b2a}

/* In the compact light sidebar, show only the switch itself. */
@media(min-width:761px){[data-theme=light] .menu-collapsed .sidebar:not(.is-peeking) .bottom .theme-switch{background:transparent;border-color:transparent;box-shadow:none}}
