html[data-theme=day]{color-scheme:light}
/* Interruptor sol/luna: el contorno permanece luminoso en ambos estados. */
.theme-toggle{position:relative;display:inline-flex;align-items:center;justify-content:space-between;flex:none;width:84px;height:40px;padding:4px;border:1px solid #90a9d4;border-radius:24px;background:linear-gradient(120deg,#eef3fc,#fbeef2);color:#657b9a;isolation:isolate;box-shadow:0 0 0 2px #729be419,0 0 15px #477ed43d,0 0 19px #bd52672b;animation:theme-glow 3.2s ease-in-out infinite;cursor:pointer}
.theme-toggle::before{content:'';position:absolute;left:4px;top:4px;width:34px;height:30px;border-radius:18px;background:#fff;box-shadow:0 2px 7px #3a5e9826;transition:transform .22s,background .22s;z-index:-1}
.theme-option{width:34px;height:30px;display:grid;place-items:center;pointer-events:none}
.theme-option svg{width:19px;height:19px}
.theme-option--sun{color:#a97626}
.theme-toggle:focus-visible{outline:3px solid #598ce1;outline-offset:4px}
.login-panel{position:relative}
.login-theme-control{position:absolute;right:24px;top:24px}
.loading-view{color:var(--text)}
@keyframes theme-glow{0%,100%{box-shadow:0 0 0 2px #729be419,0 0 12px #477ed438,0 0 17px #bd526729}50%{box-shadow:0 0 0 2px #729be42d,0 0 20px #477ed451,0 0 25px #bd52673b}}
html[data-theme=night]{--bg:#101827;--surface:#192436;--text:#e0e8f5;--muted:#a6b5ca;--line:#34435a;--blue:#98bafa;--red:#f3a0b0;--green:#83d8b3;--amber:#eac180;--module-red:#f1a3b2;--soft-blue:#253750;--soft-red:#412b39;--shadow:0 9px 30px #00000026;color-scheme:dark}
html[data-theme=night] body{background:radial-gradient(ellipse at 0 0,#192840,transparent 48%),radial-gradient(ellipse at 100% 20%,#2c2031,transparent 44%),var(--bg);color:var(--text)}
html[data-theme=night] .theme-toggle{background:linear-gradient(120deg,#1d2b42,#382936);border-color:#7797c6}
html[data-theme=night] .theme-toggle::before{transform:translateX(38px);background:#354864}
html[data-theme=night] .theme-option--sun{color:#91a2bb}
html[data-theme=night] .theme-option--moon{color:#e0e9ff}
html[data-theme=night] :is(.topbar,.portal-mode .topbar){background:#142034f5;border-color:var(--line);box-shadow:0 4px 20px #00000020}
html[data-theme=night] :is(.topbar-home,.topbar-links a,.breadcrumb strong,.profile strong){color:#e1eafb}
html[data-theme=night] :is(.breadcrumb,.breadcrumb span,.today-label,.profile small,.page-footer){color:var(--muted)}
html[data-theme=night] .avatar{background:#293b57;color:#b6cefa}
html[data-theme=night] .brand-mark{background:linear-gradient(140deg,#4d74a9,#2d4b77);box-shadow:0 5px 17px #00000036}
html[data-theme=night] :is(.page-header,.portal-mode .page-header){background:radial-gradient(ellipse at 90% 15%,#3b293c,transparent 45%),linear-gradient(115deg,#1e314e,#1a2639 58%,#2a2231);border-color:#3c4b65;box-shadow:var(--shadow)}
html[data-theme=night] :is(.page-header h1,.portal-mode .page-header h1,.panel h3,.dialog-header h2){color:#e5edfa}
html[data-theme=night] :is(.page-header p,.portal-mode .page-header p){color:#b0bfd5}
html[data-theme=night] :is(.eyebrow,.portal-mode .page-header .eyebrow){color:#a1bff1}
html[data-theme=night] .page-symbol{background:#263a58;color:#a8c5f5;border-color:#405572}
html[data-theme=night] .portal-hero-art{color:#a7c5f0}
html[data-theme=night] .app-shell.portal-mode::before{background-color:#101827;background-image:linear-gradient(110deg,#101827ed,#111a2acf),url('../images/fondos/inicio-trailer.png')}
html[data-theme=night] :is(.portal-overview>a,.portal-mode .portal-overview>a,.module-directory-toolbar,.portal-mode .module-directory-toolbar,.module-directory-label,.portal-mode .module-directory-label,.portal-mode .page-footer){background:#19263bf5;border-color:#3b4b66;box-shadow:0 5px 22px #00000020;color:#d2e1f6}
html[data-theme=night] .portal-overview>a:nth-child(2){border-color:#64414f}
html[data-theme=night] :is(.portal-overview small,.module-directory-label>span,.overview-arrow){color:#a8bbd6}
html[data-theme=night] :is(.portal-overview strong,.module-directory-label strong){color:#e0eafa}
html[data-theme=night] :is(.overview-icon,.stat-icon,.empty-state .empty-icon,.step-number){background:#293d5b;color:#a3c2f5;border-color:#3e587a}
html[data-theme=night] .portal-overview>a:nth-child(2) .overview-icon{background:#49303d;border-color:#715061;color:#f0b0c0}
html[data-theme=night] .module-group-button{color:#b5c4da}
html[data-theme=night] .module-group-button:hover{background:#283952}
html[data-theme=night] .module-group-button.active{background:#2d4263;border-color:#4a648b;color:#dbe8ff}
html[data-theme=night] .module-card{--card-edge:#4b6e9d;--card-glow:#508be52e;background:#18263b;border-color:var(--card-edge);box-shadow:0 7px 24px #00000026;color:#e1eafa}
html[data-theme=night] .module-card--red{--card-edge:#995269;--card-glow:#d9658c2b}
html[data-theme=night] .module-card-face{background:linear-gradient(135deg,#244975,#345d8c 58%,#22436a)}
html[data-theme=night] .module-card--red .module-card-face{background:linear-gradient(135deg,#753443,#8b4352 58%,#622b3b)}
html[data-theme=night] :is(.module-card-face h2,.module-card--red .module-card-face h2){color:#f0f4fd}
html[data-theme=night] :is(.module-card-label,.module-card--red .module-card-label){background:#14243dcc;border-color:#6486b6;color:#d5e5ff}
html[data-theme=night] .module-card--red .module-card-label{background:#3e2030cc;border-color:#b3798a;color:#ffe0e8}
html[data-theme=night] .module-card-icon{background:#16283edb;color:#bed9ff;border-color:#5f82b2;box-shadow:0 8px 22px #00000026}
html[data-theme=night] .module-card--red .module-card-icon{background:#402131db;color:#ffd0dc;border-color:#ba7c90;box-shadow:0 8px 22px #00000026}
html[data-theme=night] .module-card-caption{background:linear-gradient(#19283e,#162236)}
html[data-theme=night] .module-card-caption p{color:#c5d1e2}
html[data-theme=night] .module-card-footer{border-color:#3b4d69}
html[data-theme=night] .module-card-footer small{color:#adbdd3}
html[data-theme=night] .module-card-footer strong{color:#b5d0ff}
html[data-theme=night] .module-card-footer strong span{background:#293e5b}
html[data-theme=night] .module-card--red .module-card-footer strong{color:#f7b5c5}
html[data-theme=night] .module-card--red .module-card-footer strong span{background:#493044}
html[data-theme=night] :is(.workspace-navigation a,.workspace-summary,.panel,.balance-card,.stat-card,.stat-card:nth-child(2n),.stat-card.accent,.welcome-strip,.checklist a){background:linear-gradient(120deg,#1a293f,#1b2537);border-color:var(--line);color:var(--text);box-shadow:var(--shadow)}
html[data-theme=night] :is(.workspace-navigation a.active,.report-tabs button.active){background:#2c4262;color:#d0e2ff;border-color:#5877a2}
html[data-theme=night] :is(.workspace-summary strong,.stat-value,.alert-count){color:#e5edfc}
html[data-theme=night] :is(.workspace-summary span,.workspace-summary-note,.stat-top,.stat-note,.stat-card.accent .stat-top,.stat-card.accent .stat-note,.balance-card span,.checklist small,.chart-legend){color:#afc0d8}
html[data-theme=night] :is(.stat-card:nth-child(2n) .stat-icon,.stat-card.accent .stat-icon){background:#493244;border-color:#6d4b62;color:#efb5ca}
html[data-theme=night] :is(.panel-header,.table-toolbar,.period-bar,.dialog-header,.dialog-footer,.report-heading){background:linear-gradient(110deg,#22324a,#1c283c 75%,#2c2539);border-color:var(--line);color:var(--text)}
html[data-theme=night] :is(th,.panel th,thead th){background:#263750;color:#c6d7f0;border-color:#42516b}
html[data-theme=night] :is(td,.panel td,.alert-row,.history-reference){border-color:#33435c}
html[data-theme=night] :is(tbody tr:hover,.panel tbody tr:hover){background:#263850}
html[data-theme=night] :is(input,select,textarea,.module-search input,.login-card input){background:#132034;color:#e5edfa;border-color:#485d7a!important;accent-color:#91b3ef}
html[data-theme=night] :is(input,textarea)::placeholder{color:#91a5c0;opacity:1}
html[data-theme=night] :is(input,select,textarea):focus{border-color:#89abe5!important;box-shadow:0 0 0 3px #7ba0e129}
html[data-theme=night] :is(label,.field-help,.small-text,.detail-item small,.import-summary,.record-count,.pager,.period-note){color:var(--muted)}
html[data-theme=night] input::file-selector-button{background:#2a3e5b;color:#dce8fa;border:1px solid #526d94;border-radius:7px;padding:6px 9px;margin-right:10px}
html[data-theme=night] :is(.button.secondary,.report-tabs button,.workspace-navigation a){background:#263850;color:#d2e2fb;border-color:#4d6588}
html[data-theme=night] :is(.button.secondary:hover,.report-tabs button:hover,.workspace-navigation a:hover){background:#344b6c}
html[data-theme=night] .button.primary{background:linear-gradient(120deg,#426fae,#355988);color:#fff;border-color:#6788b7;box-shadow:0 4px 15px #00000020}
html[data-theme=night] .button.danger{background:#4a2936;color:#fac0ce;border-color:#94566c}
html[data-theme=night] :is(.icon-button,.link-button,.trailer-toggle){color:#acc6ef}
html[data-theme=night] :is(.icon-button:hover,.trailer-toggle:hover){background:#2b3e5a;color:#e2edff}
html[data-theme=night] .row-actions button{background:#293e5a;color:#c9defd;border-color:#476386}
html[data-theme=night] .row-actions button[data-action=delete]{background:#4a2936;color:#fac0ce;border-color:#94566c}
html[data-theme=night] .notice{background:#233a58;border-color:#48648d;color:#c4d7f2}
html[data-theme=night] :is(.notice.warning,.historical-form){background:#382d21;border-color:#806540;color:#f0cf9f}
html[data-theme=night] :is(.historical-origin,.historical-origin p,.historical-origin li){color:#c6c8d3}
html[data-theme=night] .historical-marker{color:#f0c88e}
html[data-theme=night] .badge{background:#304057;color:#c2d0e3}
html[data-theme=night] .badge.green{background:#1c4438;color:#a1e2c3}
html[data-theme=night] .badge.red{background:#4c2835;color:#f5b2c3}
html[data-theme=night] .badge.amber{background:#473622;color:#f0cb95}
html[data-theme=night] .badge.blue{background:#273f62;color:#b3d1ff}
html[data-theme=night] .alert-icon{background:#493723;color:#f1cb8d}
html[data-theme=night] :is(.unit-summary,.unit-notes,.unit-trailer){background:linear-gradient(120deg,#1e3049,#20293d 75%,#322637);border-color:#465774}
html[data-theme=night] :is(.unit-facts>div,.unit-fact){background:#19273d;border-color:#3d5070;color:#e0eafa}
html[data-theme=night] :is(.unit-notes p,.unit-notes small,.trailer-caption){color:#bacbe3}
html[data-theme=night] .form-section{color:#b9d2f7;border-color:#425674}
html[data-theme=night] dialog{background:#19263a;border-color:#506480;color:var(--text);box-shadow:0 25px 100px #00000066}
html[data-theme=night] dialog::backdrop{background:#050b16b3}
html[data-theme=night] .document-list a{background:#263851;color:#c5dcff}
html[data-theme=night] .chart:before{background:repeating-linear-gradient(to top,transparent 0,transparent 49px,#34435a 49px,#34435a 50px)}
html[data-theme=night] .login-view{background:#101827}
html[data-theme=night] .login-panel{background:linear-gradient(140deg,#142136,#1c2234)}
html[data-theme=night] .login-story{background:radial-gradient(ellipse at 15% 50%,#263f67,transparent 65%),radial-gradient(ellipse at 100% 5%,#4d2d43,transparent 60%),#131e31}
html[data-theme=night] :is(.login-card p,.login-card>small,.story-content p,.story-footer,.story-pills){color:#afc0d8}
html[data-theme=night] .loading-view{background:linear-gradient(140deg,#142136,#111827 65%,#2d2033);color:#e2ecfd}
html[data-theme=night] .loading-view small{color:#acbfdc}
html[data-theme=night] .toast{background:#2b4262;color:#e2edff;border:1px solid #6d8ab6}
html[data-theme=night] .toast.error{background:#643243;border-color:#bf748b;color:#ffe6ed}
@media(max-width:600px){.theme-toggle{width:78px;height:38px;padding:3px}.theme-toggle::before{left:3px;top:3px;width:32px;height:30px}.theme-option{width:32px;height:30px}html[data-theme=night] .theme-toggle::before{transform:translateX(38px)}.login-theme-control{right:20px;top:20px}}
@media(prefers-reduced-motion:reduce){.theme-toggle{animation:none;box-shadow:0 0 0 2px #729be42d,0 0 18px #477ed451,0 0 22px #bd52673b}.theme-toggle::before{transition:none}}
@media print{html[data-theme=night]{--bg:#fff;--surface:#fff;--text:#111;--muted:#444;--line:#ccc;--blue:#245b9a;--red:#9c263d;--green:#226947;--amber:#825a18;color-scheme:light}html[data-theme=night] body,html[data-theme=night] :is(.panel,.stat-card,.stat-card:nth-child(2n),.stat-card.accent,.panel-header,.table-toolbar,.period-bar,.dialog-header,.dialog-footer,.workspace-summary,.balance-card,.report-heading,.unit-summary,.unit-facts>div,.unit-notes,.unit-trailer,th,.panel th,thead th){background:#fff!important;color:#111!important;box-shadow:none!important}html[data-theme=night] :is(h1,h2,h3,p,strong,small,span,label,td,th,.stat-top,.stat-note,.stat-value,.workspace-summary strong){color:#111!important}.theme-toggle,.login-theme-control{display:none!important}}

html[data-theme=night] .portal-mode .page-actions .button.secondary{background:#263850;color:#d2e2fb;border-color:#4d6588}
html[data-theme=night] :is(.report-tabs button.active,.workspace-navigation a.active){background:#2c4262;color:#d0e2ff;border-color:#5877a2;box-shadow:inset 0 -2px #89a7cf}

@media print{.report-tabs,.workspace-navigation{display:none!important}html[data-theme=night] :is(.page-header,.portal-mode .page-header,.module-card,.module-card-face,.module-card--red .module-card-face,.module-card-caption,.module-directory-toolbar,.module-directory-label,.portal-overview>a,.badge,.badge.green,.badge.red,.badge.amber,.badge.blue){background:#fff!important;color:#111!important;border-color:#bbb!important;box-shadow:none!important}}
