:root{color-scheme:light}
.theme-toggle{width:auto;margin:0 8px 0 0;padding:9px 12px;border:1px solid #b7c9bf;border-radius:8px;background:#fff;color:#14251f;font:600 13px/1.4 system-ui;cursor:pointer;white-space:nowrap}
.theme-toggle:hover{background:#e6f3ed;color:#14251f}
.theme-toggle:focus-visible{outline:3px solid #37ac83;outline-offset:3px}
.theme-toggle-standalone{position:fixed;right:18px;top:14px;z-index:20}
.theme-toggle-sidebar{width:100%;margin:0;text-align:left}
body:has(>.theme-toggle-standalone){padding-top:70px}
html[data-theme="dark"]{color-scheme:dark;--ink:#e6eeea;--muted:#a8bbb2;--line:#34483f;--paper:#101b17;--card:#1b2b24;--green:#77d9ad;--green-soft:#243f33;--amber:#f5c16c;--amber-soft:#44371f;--red:#ff9696;--red-soft:#482c30}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] :is(.panel,.card,main.card,section,dialog,.modal-box,.employee-edit-box,.calendar-day,.message-body,.message-head,.report-sidebar){background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(input,select,textarea,option){background:#14221c;color:var(--ink);border-color:#526b5e;accent-color:#77d9ad}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#a8bbb2;opacity:1}
html[data-theme="dark"] :is(.secondary,.theme-toggle){background:#243b30;color:#e6eeea;border-color:#526b5e}
html[data-theme="dark"] :is(.secondary,.theme-toggle):hover{background:#34513f;color:#fff}
html[data-theme="dark"] :is(.filter-btn,.calendar-filter){background:#243b30;color:var(--ink);border-color:#526b5e}
html[data-theme="dark"] :is(.filter-btn,.calendar-filter):hover,html[data-theme="dark"] .filter-btn.active{background:#167451;color:#fff;border-color:#77d9ad}
html[data-theme="dark"] .deadline{background:#243f33;color:var(--ink);border-left-color:#77d9ad}
html[data-theme="dark"] .deadline.soon{background:#51401f;color:#fff0c7;border-left-color:#f5c16c}
html[data-theme="dark"] .deadline.urgent{background:#512f34;color:#ffd6d6;border-left-color:#ff9696}
html[data-theme="dark"] :is(button.primary,#loginForm button,#createForm button,#passwordForm button,#resetForm button){background:#167451;color:#fff}
html[data-theme="dark"] :is(a,.panel a){color:#86dfb6}
html[data-theme="dark"] :is(td,th,.service-row,.profile-section,.kv,.panel-head,.task,.update,.calendar-toolbar,.message-item,.report-row,.employee-record,.profile-uploads,.service-group,.employee-intake,.step,.doc-request){border-color:var(--line)}
html[data-theme="dark"] tr:hover td{background:#263b30}
html[data-theme="dark"] :is(.client-item.selected,.client-item:hover,.message-item.selected,.message-item:hover,.calendar-day.today,.report-note,.document-read-status,.onboarding-success){background:var(--green-soft);color:var(--ink)}
html[data-theme="dark"] :is(.calendar-day.muted,.onboarding-stepper span,.bar,.qiwa-preview){background:#25372d;color:var(--muted)}
html[data-theme="dark"] .onboarding-stepper span.active{background:#167451;color:#fff}
html[data-theme="dark"] .score-ring:before{background:var(--card)}
html[data-theme="dark"] .error{background:var(--red-soft);color:var(--red)}
html[data-theme="dark"] :is(small,.note,.intro,.date,.message-head p,.task span,.report-row span){color:var(--muted)}
html[data-theme="dark"] :is(.modal,.employee-edit-modal){background:#0009}
html[data-theme="dark"] .document-actions :is(a,button,button.secondary){background:#243f33;color:#77d9ad;border-color:#526b5e}
html[data-theme="dark"] .document-actions :is(a,button,button.secondary):hover{background:#34513f;color:#fff;border-color:#77d9ad}
@media(max-width:540px){.topbar>div:last-child{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.theme-toggle{margin-right:0}}
