/* The switch is independent of route, authentication and app re-renders. */
.studio-theme-toggle{position:fixed;top:16px;right:18px;z-index:60;width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid #cce4d6;border-radius:12px;background:#ffffff;color:#008f5b;box-shadow:0 3px 12px #14382612;cursor:pointer;transition:background .15s,border-color .15s}
.studio-theme-toggle svg{width:21px;height:21px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
.studio-theme-toggle:hover{background:#edf8f1;border-color:#83caa3}.studio-theme-toggle:focus-visible{outline:3px solid #3fbd83;outline-offset:3px}
.studio-topbar{padding-right:76px}
html[data-theme=dark]{color-scheme:dark;--studio-bg:#000000;--studio-paper:#090909;--studio-ink:#eef2ef;--studio-muted:#a6aaa7;--studio-line:#262626;--studio-accent:#63d98b;--studio-soft:#0d1c13;--ink:#eef2ef;--muted:#a6aaa7;--line:#262626;--soft:#0d1c13;color:#eef2ef;background:#000000}
html[data-theme=dark] body,html[data-theme=dark] .content,html[data-theme=dark] .boot,html[data-theme=dark] .auth-screen{background:#000000;color:#eef2ef}
html[data-theme=dark] .studio-theme-toggle{background:#101713;color:#63d98b;border-color:#3a5b48;box-shadow:0 3px 12px #00000030}
html[data-theme=dark] .studio-theme-toggle:hover{background:#2a4938}
/* Surfaces and separators, including all legacy working modules. */
html[data-theme=dark] :is(.studio-overview>div,.studio-launcher,.studio-directory,.studio-person-card,.studio-vehicle-card,.studio-mobile-nav,.panel,.stat,.vehicle-card,.vehicle-mini,.driver-action,.driver-record,.balance-card,.payroll-driver-card,.auth-card,.unsaved-card,.form-actions,.payroll-modal-summary>div){background:#090909;color:#eef2ef;border-color:#262626}
html[data-theme=dark] :is(.studio-topbar,.studio-rail){background:#090909;border-color:#262626}
html[data-theme=dark] :is(.studio-company,.studio-next-grid article,.studio-view-toggle,.studio-vehicle-card-service,.studio-person-card,.attachment,.driver-mini-summary>span,.locked-role){background:#111111;border-color:#262626;color:#eef2ef}
html[data-theme=dark] :is(.studio-section-title,.studio-next,.studio-directory-toolbar,.studio-rail-foot,.studio-vehicle-card-link,.studio-vehicle-card-service,.panel-head,.panel-body,.detail-line,.list-row,.payroll-record,.payroll-review,.tariff-list button){border-color:#262626}
html[data-theme=dark] .studio-next-grid article{background:#080808}
html[data-theme=dark] :is(.studio-launcher:hover,.studio-person-card:hover,.studio-vehicle-card:hover,.vehicle-card:hover,.vehicle-mini:hover,.driver-record:hover,.priority-row:hover,.service-queue>button:hover){background:#101713;border-color:#4b8863}
html[data-theme=dark] :is(.studio-next-grid strong,.studio-topbar strong,.studio-user b,.studio-form-pane h3,.studio-person strong,.studio-vehicle-name strong,.studio-vehicle-card h2,.detail-stat b,.list-title,.attention-title,.cost-main b,.auth-card h1,.auth-card h2){color:#eef2ef}
html[data-theme=dark] :is(.studio-home-heading p,.studio-page-title p,.studio-date,.studio-overview span,.studio-overview small,.studio-section-title>span,.studio-next-grid p,.studio-launcher small,.studio-filter>span,.studio-directory-meta,.studio-person small,.studio-job,.studio-person-card p,.studio-people-table td>small,.studio-vehicle-table td>small,.studio-vehicle-card p,.studio-vehicle-card-line>span,.studio-vehicle-card-service>span,.studio-vehicle-card-service>small,.studio-topbar>div:first-child,.studio-user small,.stat-top,.stat-note,.period,.small,.tiny,.field-note,.bar-value,.bar-label,.attention-sub,.vehicle-bottom,.plate-note,.eyebrow,.breadcrumb,.form-hint,.auth-card p){color:#a6aaa7}
html[data-theme=dark] :is(.studio-access-label,.studio-vehicle-plate,.plate){background:#112318;border-color:#3c5b48;color:#bcebd0!important}
html[data-theme=dark] :is(.studio-launcher-icon,.studio-person>span,.studio-person-avatar,.studio-vehicle-name>span,.studio-vehicle-symbol,.truck-icon,.attention-icon,.row-icon,.driver-record-icon){background:#112318;color:#63d98b}
html[data-theme=dark] :is(.studio-kicker,.studio-vehicle-card-link,.studio-person-card>small,.btn.ghost,.chart-footer button,.command-icon){color:#63d98b}
/* Black labels stay black in the light theme; dark uses bright text with green icons. */
html[data-theme=dark] .studio-rail :is(.studio-brand,.studio-brand small,.studio-company strong,.studio-company small,.studio-rail-foot,.studio-rail-foot small,.studio-nav-group>p,.studio-nav-item,.studio-planned-nav>div){color:#eef2ef}
html[data-theme=dark] .studio-rail .studio-nav-item.active{background:#112a1a;color:#ffffff;box-shadow:inset 3px 0 0 #63d98b}
html[data-theme=dark] .studio-rail .studio-nav-item:hover{background:#112017}
html[data-theme=dark] .studio-rail :is(.studio-nav-item svg,.studio-planned-nav>div>svg){background:#112318;border-color:#3a634b;color:#63d98b}
html[data-theme=dark] .studio-rail .studio-nav-item.active svg{background:#153520;border-color:#508967;color:#81e6a4}
html[data-theme=dark] .studio-rail .studio-planned-nav small{background:#112017;border-color:#3a634b;color:#b5d7c3}
html[data-theme=dark] .studio-mobile-nav .studio-nav-item{color:#eef2ef}html[data-theme=dark] .studio-mobile-nav .studio-nav-item svg{color:#63d98b}
html[data-theme=dark] .studio-mobile-nav .studio-nav-item.active{background:#112a1a;color:#ffffff}
html[data-theme=dark] .studio-view-toggle button{color:#a6aaa7}html[data-theme=dark] .studio-view-toggle button.active{background:#12301d;color:#eef2ef}
html[data-theme=dark] .studio-sync{color:#a9c7b6}html[data-theme=dark] .studio-sync.sync-failed{color:#ffb4aa}
/* Tables, controls and status colours. */
html[data-theme=dark] :is(th,.studio-content table th){background:#111111;color:#b9bfbb;border-color:#262626}
html[data-theme=dark] :is(td,.studio-content table td,tbody tr){border-color:#262626;color:#eef2ef}
html[data-theme=dark] .click-row:hover,html[data-theme=dark] .click-row:focus-visible{background:#102017}
html[data-theme=dark] :is(.input,select.input,.studio-directory .input,.role-control select){background:#050505;color:#eef2ef;border-color:#333333}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#97aa9e;opacity:1}
html[data-theme=dark] :is(input,textarea,select):disabled{background:#151515;color:#9ba89f}
html[data-theme=dark] .btn{background:#112017;color:#eef2ef;border-color:#333333}
html[data-theme=dark] .btn:hover{background:#294b36}html[data-theme=dark] .btn.primary{background:#63d98b;border-color:#63d98b;color:#07140b}
html[data-theme=dark] .btn.primary:hover{background:#7ae39e}html[data-theme=dark] .btn.ghost{background:transparent;color:#63d98b}
html[data-theme=dark] .btn.danger{background:#382620;color:#ffb6a8;border-color:#654438}
html[data-theme=dark] .icon-btn{color:#b1c6b9}html[data-theme=dark] .icon-btn:hover{background:#294b36;color:#75eab0}
html[data-theme=dark] .status{background:#214431;color:#a5ebbd;border-color:#396b4a}
html[data-theme=dark] .status.neutral{background:#202020;color:#c7d2cb}
html[data-theme=dark] .status.pending{background:#453821;color:#f2ce89}html[data-theme=dark] .status.returned{background:#462c27;color:#ffb9ab}
html[data-theme=dark] :is(.notice,.access-note,.sync-failed,.error-notice,.field-hint,.payroll-close-preview){background:#112017;color:#c7e6d4;border-color:#3d634c}
html[data-theme=dark] :is(.error-notice,.sync-failed){background:#402a27;color:#ffc2b7;border-color:#66423b}
html[data-theme=dark] :is(.form-error,.studio-due-soon,.overdue){color:#f2c781}html[data-theme=dark] .form-error{color:#ffc2b7}
/* Side panels and other dialogs keep the same palette as their parent page. */
html[data-theme=dark] .studio-window{background:#090909;color:#eef2ef;border-color:#262626}
html[data-theme=dark] .studio-window::backdrop{background:#00000070}
html[data-theme=dark] .studio-window :is(.modal-head,.modal-body,.studio-drawer-tabs,.form-actions){background:#090909;border-color:#262626;color:#eef2ef}
html[data-theme=dark] .studio-window .modal-head p,html[data-theme=dark] .studio-window .field{color:#b9bfbb}
html[data-theme=dark] .studio-window .input{background:#050505;color:#eef2ef;border-color:#333333}
html[data-theme=dark] .studio-window .detail-stat{background:#112017;color:#eef2ef}
html[data-theme=dark] .studio-drawer-tabs button{color:#b9bfbb}html[data-theme=dark] .studio-drawer-tabs button[aria-selected=true]{color:#63d98b;border-color:#63d98b}
html[data-theme=dark] .studio-form-pane .form-hint{background:#112017;border-color:#333333;color:#b8d4c1!important}
html[data-theme=dark] .studio-form-pane details{background:#090909;border-color:#333333}html[data-theme=dark] .studio-form-pane details summary{color:#d3e4d9}
/* Existing driver dashboard, payroll and reports. */
html[data-theme=dark] :is(.driver-mini-summary,.driver-summary .stat:first-child,.category-chip,.tab,.command,.priority-row,.cost-row,.service-queue>button,.payroll-modal-summary>div){background:#101713;border-color:#262626;color:#eef2ef}
html[data-theme=dark] :is(.tab.active,.category-chip.active){background:#112a1a;border-color:#4b8863;color:#97edbe}
html[data-theme=dark] :is(.priority-title,.priority-row strong,.driver-record-title,.payroll-record b,.score-value,.metric-value,.command b,.driver-action b,.cost-row strong){color:#eef2ef}
html[data-theme=dark] .score-ring::after{background:#090909}html[data-theme=dark] .score-ring{color:#eef2ef}
html[data-theme=dark] .bar{background:#305a41}html[data-theme=dark] .bar-item:nth-child(2) .bar{background:#63d98b}
html[data-theme=dark] .progress{background:#2b4033}html[data-theme=dark] .driver-mini-summary .returned{background:#462c27;color:#ffb9ab}
html[data-theme=dark] .payroll-close-preview>strong{border-color:#3d634c}html[data-theme=dark] #toast{background:#d9eee1;color:#173622}
@media(max-width:780px){.studio-theme-toggle{top:12px;right:15px;width:36px;height:36px;border-radius:10px}.studio-rail{padding-top:17px}.studio-brand{padding-right:48px}.studio-topbar{padding-right:64px}}
@media(prefers-reduced-motion:reduce){.studio-theme-toggle{transition:none}}
/* Black surfaces continue into earnings and legacy report accents. */
html[data-theme=dark]{--green:#63d98b;--green-dark:#81e6a4}
html[data-theme=dark] .earnings-hero{background:#090909;border:1px solid #263b2b;box-shadow:none;color:#eef2ef}
html[data-theme=dark] .earnings-hero>div>strong,html[data-theme=dark] .earnings-breakdown b,html[data-theme=dark] .report-total strong{color:#63d98b}
html[data-theme=dark] .earnings-breakdown{background:#262626}html[data-theme=dark] .earnings-breakdown span{background:#111111}html[data-theme=dark] .earnings-breakdown .pending{background:#252014}
html[data-theme=dark] .payroll-record-icon{background:#102318;color:#63d98b}
html[data-theme=dark] .studio-company>span{background:#102318;color:#63d98b}
html[data-theme=dark] .studio-presence{background:#63d98b}
/* Keep drawer close controls clear of the fixed theme button. */
.studio-window.studio-drawer .modal-head{padding-right:80px}
@media(max-width:780px){.studio-window.studio-drawer .modal-head{padding-right:70px}}
