/* Shared surfaces: keep card/text pairs together across theme changes. */
:root,html[data-theme="dark"]{
 --soft-page:#141b27;--soft-card:#222d3d;--soft-inset:#2b3749;
 --soft-text:#f0f3f9;--soft-muted:#c0cad9;--soft-border:#49566a;
 --soft-accent:#d8ceff;--soft-accent-bg:#37334d;
 --soft-lavender:#292f43;--soft-blue:#233747;--soft-mint:#263b3a;
}
html[data-theme="light"]{
 --soft-page:#e9edf3;--soft-card:#f7f6fb;--soft-inset:#e9edf4;
 --soft-text:#202c40;--soft-muted:#4d5c71;--soft-border:#c8d0de;
 --soft-accent:#594082;--soft-accent-bg:#eae3f5;
 --soft-lavender:#eee9f6;--soft-blue:#e6eef7;--soft-mint:#e7f0ed;
}
/* Local modules historically define these names on different roots. */
html[data-theme] :is(body,.push-shell,.geo-app,.cal-shell,.territorial-shell,.workspace){
 --mp-bg:var(--soft-page)!important;--mp-bg2:var(--soft-page)!important;
 --mp-surface:var(--soft-card)!important;--mp-surface2:var(--soft-inset)!important;
 --mp-surface3:var(--soft-inset)!important;--mp-text:var(--soft-text)!important;--mp-muted:var(--soft-muted)!important;
 --bg:var(--soft-page)!important;--bg2:var(--soft-page)!important;--bg-2:var(--soft-page)!important;
 --panel:var(--soft-card)!important;--panel2:var(--soft-inset)!important;--panel-2:var(--soft-inset)!important;--panel-solid:var(--soft-card)!important;
 --surface:var(--soft-card)!important;--surface2:var(--soft-inset)!important;--surface3:var(--soft-inset)!important;
 --text:var(--soft-text)!important;--muted:var(--soft-muted)!important;--muted2:var(--soft-muted)!important;--soft:var(--soft-muted)!important;
 --line:var(--soft-border)!important;--mp-line:var(--soft-border)!important;
 --c-bg:var(--soft-page)!important;--c-panel:var(--soft-card)!important;--c-panel2:var(--soft-inset)!important;
 --c-text:var(--soft-text)!important;--c-muted:var(--soft-muted)!important;--c-line:var(--soft-border)!important;
}
html[data-theme] body[class*="cuik-page-"],html[data-theme] body.core-admin-page{
 background:var(--soft-page)!important;color:var(--soft-text)!important;
}
html[data-theme] body[class*="cuik-page-"] :is(
 .card,.panel,.kpi,.geo-kpi,.soc-kpi-card,.soc-panel,.geo-panel,.summary-card,.metric-card,.stat-tile,
 .table-card,.chart-card,.section-block,.executive-summary,.hero,.hero-main,.geo-hero,.scope-banner,
 .soc-command,.status-panel,.insights,.alerts,.fichas-query-workspace,.fichas-quality-panel,.fichas-record-card,
 .agenda-card,.calendar-card,.device-card,.modal-card,.modal-content,.core-modal-panel,.core-config-panel,
 .home-hero,.welcome-card,.module-card
){
 background:var(--soft-card)!important;color:var(--soft-text)!important;
 border-color:var(--soft-border)!important;box-shadow:0 6px 22px #101b2f0a!important;
}
html[data-theme] body[class*="cuik-page-"] :is(.geo-hero-health,.core-config-tabs,.detail-box,.status-panel,.filterbar,.filters,.geo-filterbar,.preview-card){
 background:var(--soft-inset)!important;color:var(--soft-text)!important;border-color:var(--soft-border)!important;
}
html[data-theme] body[class*="cuik-page-"] :is(.kpi-grid,.geo-kpi-grid,.soc-kpis,.stats-grid,.cal-kpis)>:nth-child(3n+1){background:var(--soft-lavender)!important}
html[data-theme] body[class*="cuik-page-"] :is(.kpi-grid,.geo-kpi-grid,.soc-kpis,.stats-grid,.cal-kpis)>:nth-child(3n+2){background:var(--soft-blue)!important}
html[data-theme] body[class*="cuik-page-"] :is(.kpi-grid,.geo-kpi-grid,.soc-kpis,.stats-grid,.cal-kpis)>:nth-child(3n){background:var(--soft-mint)!important}
html[data-theme] body[class*="cuik-page-"] :is(h1,h2,h3,h4,h5,h6,.kpi-value,.stat-value,.metric-value,.module-label){color:var(--soft-text)!important}
html[data-theme] body[class*="cuik-page-"] :is(
 .muted,.subtitle,.sub,.subtle,.helper,.hint,.description,.meta,.summary-text,.section-sub,.section-subtitle,
 .hero p,.card>p,.section-toolbar p,.hero-copy,.hero-subtitle,.geo-hero p,.geo-panel-head p,.geo-hero-health p,.geo-hero-health small,
 .kpi-label,.stat-label,.metric-label,.cal-summary p,.core-config-subtitle,small
){color:var(--soft-muted)!important;opacity:1}
html[data-theme] body[class*="cuik-page-"] :is(.eyebrow,.geo-eyebrow,.hero-eyebrow,.fichas-eyebrow,.section-eyebrow){
 color:var(--soft-accent)!important;background-color:var(--soft-accent-bg)!important;border-color:var(--soft-border)!important;
}
html[data-theme] body[class*="cuik-page-"] :is(input,textarea)::placeholder{color:var(--soft-muted)!important;opacity:1}
html[data-theme] body[class*="cuik-page-"] :is(th,td){color:var(--soft-text);border-color:var(--soft-border)!important}
html[data-theme] body[class*="cuik-page-"] thead th{background:var(--soft-inset)!important;color:var(--soft-muted)!important}
/* Text inside strong-color actions follows that action, not card headings. */
html[data-theme] body[class*="cuik-page-"] :is(button,a.btn,a.button,.primary-button) :is(strong,small,h3){color:inherit!important}
html[data-theme] body[class*="cuik-page-"] :is(.topbar,.core-shell-topbar,.geo-topbar,.eb-topbar,.territorial-topbar,.push-topbar,.cal-topbar,.fichas-topbar,.soc-topbar){
 background:var(--soft-card)!important;color:var(--soft-text)!important;border-color:var(--soft-border)!important;
}
@media print{html[data-theme] body[class*="cuik-page-"] :is(.card,.panel,.hero,.geo-hero){box-shadow:none!important}}
/* Supporting copy and compact status surfaces use the same readable pairs. */
html[data-theme] body[class*="cuik-page-"] :is(.sidebar-status,.nav-count,.quick,.empty,.hero-summary,.geo-scope-card){
 background:var(--soft-inset)!important;color:var(--soft-text)!important;border-color:var(--soft-border)!important;
}
html[data-theme] body[class*="cuik-page-"] :is(.kpi-title,.kpi-foot,.kpi-sub,.scope-banner small,.sidebar-status small,.hero p,.insight p,.quick small,.nav-label){color:var(--soft-muted)!important}
html[data-theme="light"] body[class*="cuik-page-"]{
 --green:#166747!important;--ok:#166747!important;--success:#166747!important;
 --red:#ae2948!important;--danger:#ae2948!important;--bad:#ae2948!important;
 --yellow:#7a530d!important;--warn:#7a530d!important;--warning:#7a530d!important;
 --cyan:#006879!important;--secondary:#006879!important;
 --mp-green:#166747!important;--mp-danger:#ae2948!important;--mp-warning:#7a530d!important;--mp-cyan:#006879!important;
}
html[data-theme="light"] body[class*="cuik-page-"] :is(.good,.success,.status-pill.good,.badge.good,.form-message.success){color:#166747!important}
html[data-theme="light"] body[class*="cuik-page-"] :is(.warn,.warning,.note,.badge.warn){color:#7a530d!important}
html[data-theme="light"] body[class*="cuik-page-"] :is(.bad,.error,.badge.bad,.btn.danger,.button.danger){color:#ae2948!important}
html[data-theme="light"] body[class*="cuik-page-"] .button-badge{background:#ae2948!important;color:#fff!important}
html[data-theme] body[class*="cuik-page-"] .quick strong{color:var(--soft-text)!important}
html[data-theme] body[class*="cuik-page-"] :is(.quick,.hero,.hero-main){border-radius:18px}
/* Modules with their own surface/typography token families. */
html[data-theme] body[class*="cuik-page-"]{
 --surface-1:var(--soft-card)!important;--surface-2:var(--soft-inset)!important;--surface-3:var(--soft-inset)!important;
 --sp-bg:var(--soft-page)!important;--sp-bg-elev:var(--soft-inset)!important;--sp-panel:var(--soft-card)!important;
 --sp-text:var(--soft-text)!important;--sp-muted:var(--soft-muted)!important;
}
html[data-theme] body[class*="cuik-page-"] :is(.mini,.fichas-search-panel,.fichas-empty-state,.chip,.nav-count){background:var(--soft-inset)!important;color:var(--soft-muted)!important;border-color:var(--soft-border)!important}
html[data-theme] body[class*="cuik-page-"] :is(.nav-item:not(.active) b,.version,.scope-banner small,.card-head p,.fichas-search-help,.fichas-search-help span,.soc-command-copy p,.soc-kpi-top>span,.soc-chip,.soc-panel-head p){color:var(--soft-muted)!important}
html[data-theme] body[class*="cuik-page-"] .gradient-text{background:none!important;-webkit-text-fill-color:var(--soft-text)!important;color:var(--soft-text)!important}
html[data-theme] body[class*="cuik-page-"] :is(.nav-item.active,.nav-item.active:hover) .nav-label{color:inherit!important}
html[data-theme="light"] body[class*="cuik-page-"] :is(.signal,.badge:not(.good):not(.warn):not(.bad)){background:var(--soft-inset)!important;color:var(--soft-muted)!important}
html[data-theme="light"] body[class*="cuik-page-"] .signal.good{background:#e1efe7!important;color:#14583c!important}
html[data-theme="light"] body[class*="cuik-page-"] .signal.warn{background:#f4ebd8!important;color:#714800!important}
html[data-theme="light"] body[class*="cuik-page-"] .signal.risk{background:#f4e3e8!important;color:#94223e!important}
html[data-theme] body[class*="cuik-page-"]{
 --eb-bg:var(--soft-page)!important;--eb-panel:var(--soft-card)!important;--eb-panel2:var(--soft-inset)!important;
 --eb-soft:var(--soft-inset)!important;--eb-sidebar:var(--soft-card)!important;--eb-text:var(--soft-text)!important;--eb-muted:var(--soft-muted)!important;--eb-line:var(--soft-border)!important;
 --gt-bg:var(--soft-page)!important;--gt-panel:var(--soft-card)!important;--gt-soft:var(--soft-inset)!important;
 --gt-text:var(--soft-text)!important;--gt-muted:var(--soft-muted)!important;--gt-line:var(--soft-border)!important;
}
html[data-theme] body[class*="cuik-page-"] .scope-pill{background:var(--soft-accent-bg)!important;color:var(--soft-accent)!important}
html[data-theme] body[class*="cuik-page-"] .notification-preview small{color:#4d5c71!important}
html[data-theme] body[class*="cuik-page-"] .button-badge{background:#ae2948!important;color:#fff!important}
