/* UCHET GLOBAL THEME V11: global UI only; financial calculations untouched. */
:root{--ut-page:#f6f7f9;--ut-surface:#fff;--ut-surface-2:#f8fafc;--ut-text:#111827;--ut-muted:#6b7280;--ut-border:#e5e7eb;--ut-hover:#f3f4f6;--ut-control:#fff;--ut-link:#2563eb;--ut-shadow:0 1px 3px #00000014;--ut-head:#111827;--ut-positive:#065f46;--ut-negative:#b91c1c;color-scheme:light}
html[data-uchet-theme="dark"]{--ut-page:#0b1424;--ut-surface:#14233a;--ut-surface-2:#1b2e49;--ut-text:#e9f2ff;--ut-muted:#acbed8;--ut-border:#334966;--ut-hover:#233a58;--ut-control:#192b45;--ut-link:#78b5ff;--ut-shadow:0 2px 12px #0005;--ut-head:#081222;--ut-positive:#69e9ba;--ut-negative:#ff9cae;color-scheme:dark}
html[data-uchet-theme="dark"] body{background:var(--ut-page)!important;color:var(--ut-text)!important}
html[data-uchet-theme="dark"] :is(.card,.dash-card,.chart-wrapper,.kpi .box,.kpi,.panel,.box,.modal-content,.modal-body,.dropdown-menu,.picker-item,.tabbar a,.pill,.alert,.backbar,.uf-info,.uf-toolbar select,.uf-btn){background-color:var(--ut-surface)!important;color:var(--ut-text)!important;border-color:var(--ut-border)!important;box-shadow:var(--ut-shadow)}
html[data-uchet-theme="dark"] :is(.dash-card,.chart-wrapper,.kpi,.panel,.box,.modal-content,.dropdown-menu,.alert,.backbar,.uf-info){border-color:var(--ut-border)!important}
html[data-uchet-theme="dark"] :is(.muted,.kpi-label,.chart-note,.legend-hint,.uf-name,.uf-toolbar label,.uf-info,.dash-title .muted){color:var(--ut-muted)!important}
html[data-uchet-theme="dark"] :is(h1,h2,h3,h4,h5,h6,legend,label,dt,dd,summary,th,td,p,strong,small){color:inherit}
html[data-uchet-theme="dark"] a:not(.btn):not(.pill):not(.active):not(.badge):not(.brand){color:var(--ut-link)}
html[data-uchet-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,option){background:var(--ut-control)!important;color:var(--ut-text)!important;border-color:var(--ut-border)!important}
html[data-uchet-theme="dark"] :is(input,textarea)::placeholder{color:#9bb0ce!important}
html[data-uchet-theme="dark"] :is(button.secondary,.btn:not(.primary):not(.danger),.dash-periods a:not(.active),.dash-periods button:not(.active),.tabbar a:not(.active),.pill:not(.active),.picker-item){background:var(--ut-control)!important;color:var(--ut-text)!important;border-color:var(--ut-border)!important}
html[data-uchet-theme="dark"] :is(button.secondary,.btn:not(.primary):not(.danger),.dash-periods a:not(.active),.tabbar a:not(.active),.pill:not(.active),.picker-item):hover{background:var(--ut-hover)!important}
html[data-uchet-theme="dark"] :is(.tabbar a.active,.pill.active,.btn.primary,.dash-periods a.active,.dash-periods button.active){background:#236fe3!important;color:#fff!important;border-color:#236fe3!important}
html[data-uchet-theme="dark"] :is(table,thead,tbody,tfoot,tr,th,td){border-color:var(--ut-border)!important}
html[data-uchet-theme="dark"] :is(th,thead){background-color:var(--ut-surface-2);color:var(--ut-text)}
html[data-uchet-theme="dark"] :is(tr.rowclick:hover,tbody tr:hover){background-color:var(--ut-hover)!important}
html[data-uchet-theme="dark"] :is(hr,.divider){border-color:var(--ut-border)!important}
html[data-uchet-theme="dark"] nav.topnav .dropdown-menu{background:var(--ut-surface)!important;border-color:var(--ut-border)!important}
html[data-uchet-theme="dark"] nav.topnav .dropdown-menu a{color:var(--ut-text)!important}
html[data-uchet-theme="dark"] nav.topnav .dropdown-menu a:hover{background:var(--ut-hover)!important}
html[data-uchet-theme="dark"] header{background:var(--ut-head)!important}
/* Common legacy inline background colors; semantic green/yellow/red highlights remain meaningful. */
html[data-uchet-theme="dark"] [style*="background:#fff" i]:not(.badge):not(.active):not(.primary):not(.danger),
html[data-uchet-theme="dark"] [style*="background: #fff" i]:not(.badge):not(.active):not(.primary):not(.danger),
html[data-uchet-theme="dark"] [style*="background-color:#fff" i]:not(.badge):not(.active),
html[data-uchet-theme="dark"] [style*="background:#f8fafc" i],
html[data-uchet-theme="dark"] [style*="background:#fafafa" i],
html[data-uchet-theme="dark"] [style*="background:#f9fafb" i],
html[data-uchet-theme="dark"] [style*="background:#f3f4f6" i]{background:var(--ut-surface-2)!important;color:var(--ut-text)!important}
html[data-uchet-theme="dark"] [style*="color:#111827" i],
html[data-uchet-theme="dark"] [style*="color: #111827" i],
html[data-uchet-theme="dark"] [style*="color:#0f172a" i],
html[data-uchet-theme="dark"] [style*="color:#334155" i]{color:var(--ut-text)!important}
html[data-uchet-theme="dark"] [style*="color:#6b7280" i],
html[data-uchet-theme="dark"] [style*="color:#64748b" i]{color:var(--ut-muted)!important}
/* Preserve meaningful status backgrounds while making the text legible. */
html[data-uchet-theme="dark"] [style*="background:#dcfce7" i]{background:#153e36!important;color:#9af0c6!important}
html[data-uchet-theme="dark"] [style*="background:#fef3c7" i],html[data-uchet-theme="dark"] [style*="background:#fffbeb" i]{background:#493b23!important;color:#ffe4a3!important}
html[data-uchet-theme="dark"] [style*="background:#fef2f2" i]{background:#482a37!important;color:#ffc1cd!important}
html[data-uchet-theme="dark"] [style*="background:#eff6ff" i],html[data-uchet-theme="dark"] [style*="background:#dbeafe" i]{background:#213e65!important;color:#c2ddff!important}
/* Old chart switch is replaced by the global control; charts follow resolved theme. */
.uchet-site-theme-switch{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap;margin:0 0 14px;color:var(--ut-muted);font-size:12px}
.uchet-site-theme-switch .ut-buttons{display:inline-flex;gap:4px;flex-wrap:wrap}
.uchet-site-theme-switch button{height:32px;padding:6px 10px;background:var(--ut-surface);color:var(--ut-text);border:1px solid var(--ut-border);border-radius:8px;font-size:12px;line-height:1.2}
.uchet-site-theme-switch button.active{background:#236fe3!important;border-color:#236fe3!important;color:#fff!important}
.uchet-site-theme-switch .ut-schedule{display:none;align-items:center;gap:6px;flex-wrap:wrap}
.uchet-site-theme-switch[data-mode="schedule"] .ut-schedule{display:flex}
.uchet-site-theme-switch input[type="time"]{height:32px!important;width:105px!important;font-size:12px!important;padding:3px 7px!important}
html[data-uchet-theme="dark"] .uchet-site-theme-switch{color:var(--ut-muted)}
@media(max-width:650px){.uchet-site-theme-switch{justify-content:flex-start}.uchet-site-theme-switch .ut-buttons{gap:3px}.uchet-site-theme-switch button{padding:5px 7px}}
@media print{html,html[data-uchet-theme="dark"]{color-scheme:light!important}html[data-uchet-theme="dark"] body{background:white!important;color:black!important}.uchet-site-theme-switch{display:none!important}}

/* UCHET PROJECT THEME CONSOLIDATION 2026-10-15.
   Only visual properties. Specific selectors for light-surface components that
   previously inherited near-white foreground in dark mode. */
html[data-uchet-theme="dark"] :is(
 .summary-card,.billing-card,.system-card,.rt-card,.rt-preview,
 .fgp-block,.fgp-group,.fgp-project,.driver-side-card,.driver-doc-item,
 .data-card,.req-tile,.mini-card,.rec-panel,.section-card,
 .salary-gibdd-panel,.salary-gibdd-line,.expense-audit,
 .system-table-wrap,.driver-doc-actions
){background-color:var(--ut-surface)!important;color:var(--ut-text)!important;border-color:var(--ut-border)!important;}
html[data-uchet-theme="dark"] :is(
 .summary-table-wrap,.summary-more,.expense-audit-alert,
 .fgp-chip,.system-check,.system-kpi,.vc-alert
){background-color:var(--ut-surface-2)!important;color:var(--ut-text)!important;border-color:var(--ut-border)!important;}
html[data-uchet-theme="dark"] :is(.summary-table,.system-table-wrap) :is(th,td){color:var(--ut-text)!important;border-color:var(--ut-border)!important;}
html[data-uchet-theme="dark"] .summary-table :is(th,td){background-color:var(--ut-surface)!important;}
html[data-uchet-theme="dark"] .summary-table thead th{background-color:var(--ut-surface-2)!important;}
html[data-uchet-theme="dark"] .summary-table tbody tr:hover td{background-color:var(--ut-hover)!important;}
html[data-uchet-theme="dark"] :is(.summary-title,.summary-field>span,.summary-subtitle,.summary-date-help,.summary-footnote,.summary-more summary){color:var(--ut-text)!important;}
html[data-uchet-theme="dark"] :is(.summary-subtitle,.summary-date-help,.summary-footnote,.summary-field>span){color:var(--ut-muted)!important;}
html[data-uchet-theme="dark"] :is(.summary-preset,.summary-btn:not(.primary):not(.secondary)){
 background:var(--ut-control)!important;color:var(--ut-text)!important;border-color:var(--ut-border)!important;}
html[data-uchet-theme="dark"] .summary-btn.primary{background:#236fe3!important;color:#fff!important;border-color:#236fe3!important;}
html[data-uchet-theme="dark"] .summary-btn.secondary{background:#4b5563!important;color:#fff!important;border-color:#4b5563!important;}
html[data-uchet-theme="dark"] .summary-note{background:#213e65!important;color:#c2ddff!important;}
/* Semantic highlights retain contrast; do not recolor whole tables indiscriminately. */
html[data-uchet-theme="dark"] :is(.status-pill,.salary-status-due,.record-auto-badge,.record-auto-dot){color:inherit;}
@media print {
 html[data-uchet-theme="dark"] :is(.summary-card,.summary-table th,.summary-table td){
  background:#fff!important;color:#111827!important;border-color:#d1d5db!important;
 }
}
