:root{color-scheme:light}
.theme-select{font-size:11px;width:100px}
.topbar .theme-select{width:94px;max-width:94px;flex:none}
.topbar #clientFilter{min-width:0}
.login-form-wrap{position:relative}
.login-theme{position:absolute;top:20px;right:20px;width:110px}
.theme-buttons{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);border-radius:7px;background:#fff;flex:none}
.theme-buttons button{border:0;border-radius:4px;background:transparent;color:#526b86;padding:6px 8px;font-size:11px;white-space:nowrap;cursor:pointer}
.theme-buttons button[aria-pressed="true"]{background:#e5eef9;color:#133f70;font-weight:650}
.login-theme.theme-buttons{width:auto}
[data-theme="dark"] .theme-buttons{background:#1e2d3d;border-color:#42566d}
[data-theme="dark"] .theme-buttons button{color:#c0d2e5}
[data-theme="dark"] .theme-buttons button[aria-pressed="true"]{background:#355676;color:#fff}
@media(max-width:800px){.theme-buttons button{padding:6px;font-size:10px}.topbar-actions{gap:6px}}

:root[data-theme="dark"]{color-scheme:dark;background:#101923;color:#dce7f2;--navy:#a4caff;--blue:#9bc6ff;--teal:#65cec0;--muted:#a0b1c3;--line:#304153;--red:#ff9aaa;--green:#78d5ab;--amber:#e7be79;--surface:#182431;--raised:#1e2d3d}
[data-theme="dark"] body{background:#101923}
[data-theme="dark"] :is(.sidebar,.topbar,.stat,.device-card,.client-card,.table-wrap,.card,.empty,.remote-card,.connection-panels article,.history-filter-card,.history-stat,.history-chart-card,.login-card,dialog){background:var(--surface);border-color:var(--line);color:#dce7f2}
[data-theme="dark"] .topbar{background:#14202c}
[data-theme="dark"] :is(.brand,.login-card:before){background-color:transparent;border-radius:0}
[data-theme="dark"] :is(.brand img,.intro-conect){content:url('logo-conect-white.png')}
[data-theme="dark"] .login-card:before{background-image:url('logo-conect-white.png')}
[data-theme="dark"] img[alt="Electroservis"]{background:transparent;border-radius:0;padding:0;filter:grayscale(1) invert(1) brightness(1.8)}
[data-theme="dark"] :is(.breadcrumb strong,.nav,.device-type,.stat-label,.connection-gateway,.connection-compact-link,.connection-label,.connection-strip,.device-location,th){color:#a8bcd1}
[data-theme="dark"] :is(.nav:hover,.nav.active,.account>span,.client-avatar,.stat-icon,.nav b,.mode-tag,.history-range.selected){background:#263e59;color:#c4dfff}
[data-theme="dark"] .nav-divider{background:var(--line)}
[data-theme="dark"] :is(.btn,.icon-btn,input,select,textarea,.topbar select,.history-range){background:var(--raised);border-color:#42566d;color:#e0ebf6}
[data-theme="dark"] :is(input,textarea)::placeholder{color:#91a5ba}
[data-theme="dark"] :is(label,.notice-filters label){color:#b4c6d9}
[data-theme="dark"] .error-text{color:#ff9eae}
[data-theme="dark"] :is(input,select,textarea,button,a):focus-visible{outline:2px solid #9bc6ff;outline-offset:2px}
[data-theme="dark"] .btn.primary{background:#265b92;border-color:#5087be;color:#fff}
[data-theme="dark"] .btn.danger{background:#412735;border-color:#875062;color:#ffb0bb}
[data-theme="dark"] :is(td,.device-card-bottom,.dialog-actions,.account,.remote-result,footer,.history-tabs,.history-hover){border-color:var(--line)}
[data-theme="dark"] th{background:#1d2c3c}
[data-theme="dark"] :is(.empty h3,.remote-result strong){color:#c1d8f0}
[data-theme="dark"] .badge{background:#2b394b;color:#b8c8d9}
[data-theme="dark"] :is(.badge.green,.stat-icon.green,.monitoring-state.live){background:#1b3c33;color:#8de3bb}
[data-theme="dark"] :is(.badge.red,.stat-icon.red){background:#442833;color:#ffacb9}
[data-theme="dark"] :is(.badge.amber,.stat-icon.amber){background:#403724;color:#f1cc8b}
[data-theme="dark"] .monitoring-state{background:#283b50;color:#c0d2e5}
[data-theme="dark"] .connection-state.online,[data-theme="dark"] .connection-compact-link.online b{color:#81dcb3}
[data-theme="dark"] .connection-state.offline,[data-theme="dark"] .connection-compact-link.offline b{color:#ff9eae}
[data-theme="dark"] .connection-state.pending,[data-theme="dark"] .connection-compact-link.pending b{color:#ecc47e}
[data-theme="dark"] :is(.mini-power,.mini-diagram){background:#1c2b3c;border-color:#35485e}
[data-theme="dark"] .mini-power .power-wire:after{background:#1c2b3c}
[data-theme="dark"] :is(.mini-power .power-node,.mini-power .power-caption){color:#a8bcd1}
[data-theme="dark"] :is(.mini-power .power-node.mains.active,.mini-power .power-caption.mains){color:#88d8b0}
[data-theme="dark"] :is(.mini-power .power-node.generator.active,.mini-power .power-caption.generator){color:#88d8b0}
[data-theme="dark"] .mini-power .power-node.load.active{color:#88d8b0}
[data-theme="dark"] .battery{background:#1b3c33;color:#9ce3bf}
[data-theme="dark"] .remote-button{background:#2a3d52;border-color:#506a85;color:#e0ebf6}
[data-theme="dark"] .remote-button.selected{background:#265b92;color:#fff}
[data-theme="dark"] .remote-button.start{background:#26764f;border-color:#58a178;color:#fff}
[data-theme="dark"] .remote-button.stop{background:#994052;border-color:#cb7487;color:#fff}
[data-theme="dark"] :is(.notice,.history-error){background:#3d2631;border-color:#805062;color:#ffb8c2}
[data-theme="dark"] .notice.success{background:#1c3a32;border-color:#3b7860;color:#a0e8c4}
[data-theme="dark"] :is(.history-warning,.history-quality){background:#3a3325;border-color:#746343;color:#edcf95}
[data-theme="dark"] .history-tab{color:#a2b6ca}
[data-theme="dark"] .history-tab.selected{color:#b2d4ff;border-bottom-color:#b2d4ff}
[data-theme="dark"] .chart-grid{stroke:#33465b}
[data-theme="dark"] .chart-label{fill:#adbed1}
[data-theme="dark"] .trend-line{stroke:#7bc8e5}
[data-theme="dark"] .trend-dot{fill:#7bc8e5;stroke:#182431}
[data-theme="dark"] .notification-row{background:#182431;border-color:var(--line);color:#dce7f2}
[data-theme="dark"] .notification-row.unread{background:#20364c;border-left-color:#7fbaff}
[data-theme="dark"] .notification-icon{background:#2a4059;color:#bfdcff}
[data-theme="dark"] .login-form-wrap{background:#101923}
[data-theme="dark"] .login-foot{color:#a0b1c3}
[data-theme="dark"] .confirm-copy{color:#c4d6e9!important}
[data-theme="dark"] :is(.fleet-map,.location-picker){background:#1b2a3a;border-color:var(--line)}
[data-theme="dark"] :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip,.leaflet-bar a,.leaflet-control-attribution){background:#1e2d3d;color:#e0ebf6}
[data-theme="dark"] .leaflet-control-attribution a{color:#b2d4ff}
[data-theme="dark"] .brand-intro{background:#101923}
@media(max-width:800px){.topbar #clientFilter{flex:1;width:0}.topbar .theme-select{width:80px;max-width:80px}}
