/* Universal Theme Contrast V4 — additive presentation only; no CRM business logic. */
html.wl-theme-active .content{color:var(--wl-v4-on-bg)!important;background:var(--wl-theme-bg)!important}
html.wl-theme-active .content :is(h1,h2,h3,h4,h5,h6){color:var(--wl-v4-on-bg)!important}
html.wl-theme-active .content :is(.panel,.card,.stat-card,.kpi-card,.metric-card,.status-tile,.lead-card,.lead-filters,.lead-list,.fu-panel,.fu-card,.hr-panel,.hr-card,.pm-panel,.pm-card,.fin-card,.module-card,.tb-card):not(.tb-card){background:var(--wl-theme-surface)!important;color:var(--wl-v4-on-surface)!important;border-color:var(--wl-theme-border)!important}
html.wl-theme-active .content :is(.panel,.card,.stat-card,.kpi-card,.metric-card,.status-tile,.lead-card,.lead-filters,.lead-list,.fu-panel,.fu-card,.hr-panel,.hr-card,.pm-panel,.pm-card,.fin-card,.module-card):is(:not(.hero-total)) :is(h1,h2,h3,h4,h5,h6,strong,b){color:var(--wl-v4-on-surface)!important}
/* Dashboard captions, filter labels, descriptions, KPI subtext. */
html.wl-theme-active .content :is(.dash-kicker,.dash-eyebrow,.dash-subtitle,.page-head p,.hint,.muted,.subtext,.pm-subtitle,.fu-subtitle,.hr-hint){color:var(--wl-v4-bg-muted)!important}
html.wl-theme-active .content :is(.status-tile,.kpi-card,.metric-card,.lead-card,.lead-filters,.fu-card,.pm-card,.hr-card,.fin-card) :is(small,p,.hint,.muted,.subtext,label){color:var(--wl-v4-muted)!important}
html.wl-theme-active .content :is(.status-tile,.kpi-card,.metric-card,.lead-card,.lead-filters,.pm-card,.hr-card,.fin-card) :is(strong,b,h2,h3,h4){color:var(--wl-v4-on-surface)!important}
/* Project counters: original hardcoded pale tiles and nearly white values become legible. */
html.wl-theme-active .content .pm-stats>div{background:var(--wl-theme-surface)!important;border-color:var(--wl-theme-border)!important;color:var(--wl-v4-on-surface)!important}
html.wl-theme-active .content .pm-stats>div :is(strong,b){color:var(--wl-v4-on-surface)!important}
html.wl-theme-active .content .pm-stats>div :is(small,span){color:var(--wl-v4-muted)!important}
html.wl-theme-active .content .pm-project-grid :is(.pm-card,.pm-project-card){background:var(--wl-theme-surface)!important;color:var(--wl-v4-on-surface)!important}
html.wl-theme-active .content .pm-project-grid :is(.pm-card,.pm-project-card) :is(h3,h4,b,strong){color:var(--wl-v4-on-surface)!important}
/* Neutral badges and pills: preserve semantic status (danger/success/warning) color meaning. */
html.wl-theme-active .content .pm-project-grid :is(.pm-status,.pm-badge):not(.danger):not(.warning){background:var(--wl-theme-primary)!important;color:var(--wl-v4-on-primary)!important;border-color:var(--wl-theme-border)!important}
/* Follow-up / HR / finance tabs: accent-filled selected, solid hover, neutral normal. */
html.wl-theme-active .content :is(.fu-tabs,.hr-tabs,.fin-tabs,.fin-legacy-root-tabs)>button:not(:disabled){background:var(--wl-theme-surface)!important;color:var(--wl-v4-on-surface)!important;border:1px solid var(--wl-theme-border)!important;box-shadow:none!important;opacity:1!important}
html.wl-theme-active .content :is(.fu-tabs,.hr-tabs,.fin-tabs,.fin-legacy-root-tabs)>button:is(.selected,.active,[aria-selected="true"]):not(:disabled){background:var(--wl-v4-active)!important;color:var(--wl-v4-on-accent)!important;border-color:var(--wl-v4-active)!important;box-shadow:none!important}
html.wl-theme-active .content :is(.fu-tabs,.hr-tabs,.fin-tabs,.fin-legacy-root-tabs)>button:not(.selected):not(.active):not([aria-selected="true"]):not(:disabled):hover{background:var(--wl-v4-hover)!important;color:var(--wl-v4-on-hover)!important;border-color:var(--wl-theme-accent)!important}
html.wl-theme-active .content :is(.fu-tabs,.hr-tabs,.fin-tabs,.fin-legacy-root-tabs)>button:is(.selected,.active,[aria-selected="true"]):hover{background:var(--wl-v4-active)!important;color:var(--wl-v4-on-accent)!important}
/* Container follows theme, not a fixed blue or white background. */
html.wl-theme-active .content :is(.fu-tabs,.hr-tabs,.fin-tabs,.fin-legacy-root-tabs){background:var(--wl-theme-surface)!important;border-color:var(--wl-theme-border)!important}
/* HR main content: eliminate hardcoded white/light-grey background on dark themes. */
html.wl-theme-active .content :is(.hr-wrap,.hr-root,.hr-home,.hr-module,.hr-content,.hr-shell){background:var(--wl-theme-bg)!important;color:var(--wl-v4-on-bg)!important}
html.wl-theme-active .content :is(.hr-wrap,.hr-root,.hr-home,.hr-module,.hr-content,.hr-shell) :is(.hr-card,.hr-panel,.hr-feature,.hr-item,.hr-menu-card){background:var(--wl-theme-surface)!important;color:var(--wl-v4-on-surface)!important;border-color:var(--wl-theme-border)!important}
/* Sidebar and header always readable on their own backgrounds. */
html.wl-theme-active #sidebar,html.wl-theme-active #sidebar :is(.nav-btn,.side-top,.side-footer,.user-meta){color:var(--wl-v4-on-primary)!important}
html.wl-theme-active #sidebar .nav-btn.active{background:var(--wl-theme-accent)!important;color:var(--wl-v4-on-accent)!important;box-shadow:inset 4px 0 var(--wl-v4-on-accent)!important}
html.wl-theme-active #sidebar .nav-btn:hover{background:var(--wl-v4-hover)!important;color:var(--wl-v4-on-hover)!important}
html.wl-theme-active .topbar,html.wl-theme-active .topbar :is(.crumb,.crumb b,.live){color:var(--wl-v4-on-surface)!important}
/* Inputs and placeholder contrast; preserve form sizing and handlers. */
html.wl-theme-active .content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea):not(.tb-fields input):not(.tb-fields select){background:var(--wl-theme-surface)!important;color:var(--wl-v4-on-surface)!important;border-color:var(--wl-theme-border)!important}
html.wl-theme-active .content :is(input,textarea)::placeholder{color:var(--wl-v4-muted)!important;opacity:1!important}
html.wl-theme-active .content :is(.pm-btn,.hr-btn,.fu-btn,.fin-btn,.btn-primary,.primary):not(.danger):not(.delete):not(:disabled){color:var(--wl-v4-on-primary)!important}
@media(prefers-reduced-motion:reduce){html.wl-theme-active .content button{transition:none!important}}
