:root { --theme-bg:#f8f9ff;--theme-panel:#fff;--theme-inset:#eef3fc;--theme-text:#0b1c30;--theme-muted:#596578;--theme-line:#dbe1ef;--theme-accent:#0051d5; }
html[data-theme=dark] { --theme-bg:#0b1730;--theme-panel:#20385e;--theme-inset:#2c4b73;--theme-text:#f5f9ff;--theme-muted:#bfd0e8;--theme-line:#4a6a91;--theme-accent:#6dc9ff; }
.checked-theme-row { display:flex;align-items:center;gap:10px;width:100%;min-height:64px;padding:12px 10px;border:0;border-radius:8px;background:var(--theme-panel);color:var(--theme-text);font:inherit;text-align:left; }
.checked-theme-row b { flex:1;font-size:14px; }
.checked-theme-row [data-theme-current] { font-size:13px;color:var(--theme-muted); }
.checked-theme-row>.material-symbols-outlined:first-child { color:var(--theme-accent); }
#checked-theme-dialog { position:fixed;inset:0;z-index:160;display:flex;align-items:flex-end;justify-content:center;background:#0009; }
#checked-theme-dialog section { width:min(100%,480px);padding:24px 18px calc(20px + env(safe-area-inset-bottom,0px));border-radius:8px 8px 0 0;background:var(--theme-panel);color:var(--theme-text); }
#checked-theme-dialog h2 { margin:0 0 16px;font:700 20px/26px Inter,sans-serif; }
#checked-theme-dialog button { display:grid;grid-template-columns:28px 1fr 24px;align-items:center;gap:12px;width:100%;min-height:60px;padding:12px;border:0;border-radius:8px;text-align:left;background:transparent;color:var(--theme-text);font:600 16px/22px Inter,sans-serif; }
#checked-theme-dialog [aria-checked=true] { background:var(--theme-inset);color:var(--theme-accent); }
#checked-theme-dialog .theme-check { visibility:hidden; }
#checked-theme-dialog [aria-checked=true] .theme-check { visibility:visible; }
#checked-theme-dialog button:focus-visible,.checked-theme-row:focus-visible { outline:2px solid var(--theme-accent);outline-offset:2px; }
html[data-theme=dark] body,html[data-theme=dark] body>main,html[data-theme=dark] #app-header,html[data-theme=dark] #bottomNav,html[data-theme=dark] nav,html[data-theme=dark] .mg-save-bar { background:var(--theme-bg)!important;color:var(--theme-text)!important; }
html[data-theme=dark] :is(.bg-surface,.bg-surface-container-lowest,.bg-white,.bg-surface-container-low,.profile-section,.profile-identity,.employee-summary-card,.checked-distance-card,.mg-editor,.mg-metric,.mg-task,.mg-row,.mg-person,.mg-office,.mg-rules,.mg-role,.mg-times,.mg-report,.mg-empty,.mg-modal-card,.mg-report-sheet,.checked-picker-sheet,.checked-fine-sheet,.diagnostics-card,.ct-card,.ct-table-wrap,.ct-toolbar,.ct-summary,.ct-detail,.history-card) { background:var(--theme-panel)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important; }
html[data-theme=dark] :is(.bg-surface-container,.bg-surface-container-high,.bg-surface-container-highest,.mg-sync,.mg-inset,.mg-avatar,.mg-tile,.mg-search,.mg-geozone,.mg-badge,.mg-calendar-day,.mg-report-day,.mg-report-pay,.mg-report-arrow,.mg-report-range,.mg-button.pale,.profile-row-icon,.profile-avatar,.employee-summary-total,.checked-wheel-mask,.checked-select-list button,.mg-filters button) { background:var(--theme-inset)!important;color:var(--theme-text)!important; }
html[data-theme=dark] :is(.text-on-surface,.text-on-background,.checked-language-trigger,.checked-language-option,.profile-row,.mg-check,.mg-empty strong,.checked-calendar button,.checked-time-colon,.shell-back) { color:var(--theme-text)!important; }
html[data-theme=dark] :is(.text-on-surface-variant,.text-outline,.text-outline-variant,small,.mg-label,.mg-heading p,.mg-heading>small,.mg-condition-summary,.mg-default-schedule,.mg-grow>small,.mg-metric>.mg-between,.mg-editor label,.mg-modal-card label,.mg-modal-card>p,.profile-section-title,.employee-summary-card>span,#app-header small) { color:var(--theme-muted)!important; }
html[data-theme=dark] :is(.text-secondary,.text-primary,.mg-blue,.mg-text,.mg-heading h2>.material-symbols-outlined,.profile-role-badge,.checked-language-check,.checked-time-wheel button[aria-pressed=true],.preview-nav a[aria-current]) { color:var(--theme-accent)!important; }
html[data-theme=dark] :is(.text-error,.mg-red) { color:#ff9299!important; }
html[data-theme=dark] .mg-green { color:#6bddb3!important; }
html[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]),textarea,select) { background:var(--theme-inset)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important; }
html[data-theme=dark] ::placeholder { color:var(--theme-muted)!important;opacity:1; }
html[data-theme=dark] :is(#checked-language-dialog section,#checked-logout-confirm section,.checked-picker-panel,.checked-fine-dialog,.ct-photo-modal>div,.mg-zone-caption,.checked-map-all-offices,.checked-map-credits-button,.checked-map-unavailable,.checked-map-location-status,#pull-refresh) { background:var(--theme-panel)!important;color:var(--theme-text)!important; }
html[data-theme=dark] :is(#checked-logout-confirm p,.preview-nav a,.profile-row-copy small) { color:var(--theme-muted)!important; }
html[data-theme=dark] :is(.mg-role.selected,.checked-language-option[aria-pressed=true],.mg-calendar-day.selected,.checked-select-list button[aria-pressed=true]) { background:#263a52!important;color:var(--theme-accent)!important; }
html[data-theme=dark] :is(#logout-cancel,#delete-cancel,.checked-picker-cancel,.mg-select-trigger) { background:var(--theme-inset)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important; }
html[data-theme=dark] :is(.mg-filters button.active,.checked-picker-confirm,.checked-calendar button[aria-pressed=true]) { background:#0051d5!important;color:white!important; }
html[data-theme=dark] :is([class*=border-outline],.profile-section,.profile-row,.mg-rules .mg-row,.mg-day) { border-color:var(--theme-line)!important; }
html[data-theme=dark] .checked-wheel-mask:before,html[data-theme=dark] .checked-wheel-mask:after { background:none!important; }
html[data-theme=dark] .checked-time-wheel button { color:var(--theme-muted)!important; }
html[data-theme=dark] #app-header .notification-button { background:var(--theme-inset);color:var(--theme-accent); }
html[data-theme=dark] #app-header:not(.manager-header) .notification-button { background:#131f32;color:#eff4fb; }
html[data-theme=dark] #app-header.manager-header .notification-button { background:#131f32;color:#eff4fb; }
html[data-theme=dark] #checked-launch { background:#f8f9ff!important; }
html[data-theme=dark] #checked-launch .launch-word { color:#0b1c30!important; }
html[data-theme=dark] :is(.employee-profile-identity,.employee-profile-card,.employee-profile-hero,.employee-profile-header,.employee-profile-summary,.employee-profile-main>section,.profile-role,.invite,.profile-danger,.delete-account,main>section:has(#profileFirstNameInput),.week-picker,.history-summary,.history-table-wrap,.ct-date,.ct-range-sheet,.ct-stats span) { background:var(--theme-panel)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important; }
html[data-theme=dark] :is(.employee-profile-copy h1,.invite-title,.employee-summary-card strong,.ct-date button,.ct-back,.ct-range-grid button,.ct-range-head button,.ct-range-month button,.diag-page) { color:var(--theme-text)!important; }
html[data-theme=dark] :is(label,.hint,.subtitle,.employee-profile-copy p,.invite-text,.employee-summary-label,.ct-heading,.ct-context,.diag-note,.diag-heading p,.diag-copy small,.diag-state,.checked-fine-description,.checked-fine-sheet label,.offline-copy,.offline-status,#history-message,#history-empty) { color:var(--theme-muted)!important; }
html[data-theme=dark] :is(.employee-profile-avatar,#profilePhotoPreview,.ct-modes,.history-filters,.queue-strip,.ct-table thead th,.ct-table th:first-child,.history-table-wrap th,.history-row-foreign-office td,.badge,.badge.missing,.badge.future,.ct-person,.ct-off,.ct-future,.ct-inactive,.ct-waiting) { background:var(--theme-inset)!important;color:var(--theme-text)!important; }
html[data-theme=dark] :is(.profile-save-bar,#checked-offline-screen) { background:var(--theme-bg)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important; }
html[data-theme=dark] :is(#profilePhotoBtn,.diag-action,.diag-refresh,.ct-photo,.ct-actions button,.ct-manual,.checked-fine-close,.ct-photo-modal button) { background:var(--theme-inset)!important;color:var(--theme-accent)!important; }
html[data-theme=dark] :is(.ct-modes button,#passwordBack,.login-languages button,.employee-summary-card--salary strong,.profile-message,.message) { color:var(--theme-accent)!important; }
html[data-theme=dark] :is(.ct-modes button[aria-pressed=true],.ct-range-grid .ct-range-edge,.history-filters button[aria-pressed=true]) { background:#0051d5!important;color:#fff!important; }
html[data-theme=dark] :is(.profile-danger,.delete-account,.diag-denied,.diag-missing,.diag-unavailable,.ct-error,.bad-time,.checked-fine-status,.offline-status.offline-error) { color:#ff9299!important; }
html[data-theme=dark] body.profile-page #logoutBtn { background:transparent!important; border-color:#28384e!important; color:#f29a91!important; }
html[data-theme=dark] :is(.diag-granted,.ct-time-good) { color:#6bddb3!important; }
html[data-theme=dark] :is(.diag-limited,.diag-off) { color:#f4cc7a!important; }
html[data-theme=dark] .employee-summary-icon--streak { background:#463521;color:#f4cc7a!important; }
html[data-theme=dark] .employee-summary-icon--fine { background:#482b30;color:#ff9299!important; }
html[data-theme=dark] :is(.ct-person strong,.ct-ok) { background:#23443a!important;color:#9be4c8!important; }
html[data-theme=dark] :is(.ct-violation,.ct-missing) { background:#482b30!important;color:#ffadb2!important; }
html[data-theme=dark] :is(.ct-foreign,.amber,.badge.foreign-office) { background:#463b25!important;color:#f4cc7a!important; }
html[data-theme=dark] :is(.history-table-wrap td,.history-table-wrap th,.ct-table td,.ct-table th,.offline-queue) { border-color:var(--theme-line)!important; }
html[data-theme=dark] :is(.notice,.empty) { background:var(--theme-panel)!important;color:var(--theme-text)!important; }
html[data-theme=dark] :is(.notice p,.notice time,.lead) { color:var(--theme-muted)!important; }
html[data-theme=dark] :is(.clear,.notice .icon) { background:var(--theme-inset)!important;color:var(--theme-accent)!important; }
html[data-theme=dark] #passwordError { color:#ff9299!important; }
html[data-theme=dark] .bg-secondary-container { background:#0051d5!important;color:#fff!important; }
html[data-theme=dark] #bottomNav { background:#10213f!important;border-top:1px solid var(--theme-line)!important; }
html[data-theme=dark] #bottomNav .preview-nav a { color:var(--theme-muted)!important; }
html[data-theme=dark] #bottomNav .preview-nav a[aria-current=page] { color:var(--theme-text)!important;font-weight:700; }
html[data-theme=dark] #bottomNav .preview-nav a[aria-current=page]>.material-symbols-outlined:not([style]) { width:48px;height:34px;border-radius:8px;display:grid;place-items:center;background:#24558d;color:var(--theme-accent); }
html[data-theme=dark] #bottomNav .preview-nav a[aria-current=page]>.material-symbols-outlined[style] { outline:2px solid var(--theme-accent);outline-offset:2px; }
html[data-theme=dark] #app-header { border-bottom:1px solid var(--theme-line); }
html[data-theme=dark] .checked-theme-row { border-top:1px solid var(--theme-line);border-radius:0; }
html[data-theme=dark] :is(.employee-summary-card,.mg-metric,.mg-empty,.mg-task,.mg-office,.mg-person,.mg-sync) { border:1px solid var(--theme-line)!important;box-shadow:none!important; }
html[data-theme=dark] :is(.mg-empty>.material-symbols-outlined,.mg-heading h2>.material-symbols-outlined,.employee-summary-card .material-symbols-outlined) { color:var(--theme-accent)!important; }
html[data-theme=dark] body.status-page > main { background:var(--theme-bg)!important; }
