/* Theme overrides are isolated from the default light appearance. */
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; padding:7px; border:1px solid var(--line); border-radius:9px; background:var(--white); color:var(--ink); cursor:pointer; order:99; }
.theme-toggle svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.theme-toggle:focus-visible { outline:3px solid #e85060; outline-offset:3px; }
@media screen {
html[data-theme="dark"] {
 color-scheme:dark;
 --om-demo-ink:#f4f5ff; --om-demo-muted:#b1b9d2; --om-demo-line:#343b5c; --om-demo-bg:#11152b; --om-demo-panel:#1b213b; --om-demo-mint:#ff8996; --om-demo-teal:#bac8ff;
 --ink:#f4f5ff; --ink2:#e1e5f5; --muted:#b1b9d2; --line:#343b5c;
 --soft:#11152b; --soft2:#242b49; --white:#1b213b;
 --surface-0:#11152b; --surface-1:#1b213b; --surface-2:#222944; --surface-glass:rgba(27,33,59,.96);
 --glass-bg:rgba(22,27,49,.96); --glass-border:#343b5c; --glass-shadow:0 4px 20px #080b1c55;
 --border-subtle:#2c3452; --border-strong:#667397;
 --mint:#ff8996; --mint-hover:#ea5266; --mint-dark:#ff8996; --mint-light:#3b2941; --mint-subtle:#2b233b; --teal:#bac8ff;
 --gold:#f4cb78; --gold-light:#3b3224; --amber:#ffd080; --amber-light:#3b3024;
 --emerald:#7be0b0; --emerald-light:#183b36; --rose:#ff92aa; --rose-light:#44273b;
 --sky:#8ed1ff; --sky-light:#213752; --purple:#c8b2ff; --purple-light:#342c50; --gray-light:#2c324a;
 --text-muted:#b1b9d2; --color-warning-bg:#3b3024; --color-info-bg:#213752;
}
html[data-theme="dark"] :is(body,main,.login,.shell:not(.hidden)) { background:var(--soft); color:var(--ink); }
html[data-theme="dark"] :is(header,.topbar,.module-nav) { background:var(--glass-bg); }
html[data-theme="dark"] :is(.login-inner,.login-icon-input,.privacy-box,.kanban-empty,.rips-validation-status,.rips-validation-item) { background:var(--white); border-color:var(--line); }
html[data-theme="dark"] :is(.mobile-menu-toggle,.header-actions .btn-ghost,.role-pill,.stat-value,.stat-label,.page-eyebrow,.login-brand h1,.login-brand p,.login-icon-field > span:first-child,.header-icon-btn,.module-tab,.nav-close-btn,.lead-link-row button) { color:var(--ink); }
html[data-theme="dark"] :is(.btn-primary,.btn-dark,.login button[type="submit"],.wa-link) { background:#c9364f !important; color:#fff; box-shadow:none; }
html[data-theme="dark"] :is(.btn-primary,.btn-dark,.login button[type="submit"],.wa-link):hover { background:#aa2940 !important; }
html[data-theme="dark"] .module-tab { background:var(--white); }
html[data-theme="dark"] .module-tab.active { background:#343659 !important; color:#fff !important; border-color:#6971a2; box-shadow:none !important; }
html[data-theme="dark"] .module-tab.active::before { color:#fff; }
html[data-theme="dark"] :is(.module-tab:not(.active):hover,.header-icon-btn:hover,.stage-body.drag-over) { background:var(--soft2); color:var(--ink); }
html[data-theme="dark"] :is(.brand-mark,.user-avatar-circle,.toast) { color:#fff; }
html[data-theme="dark"] .toast.success { background:#234a40; }
html[data-theme="dark"] .toast.error { background:#9c2840; }
html[data-theme="dark"] .clinical-alert { background:var(--sky-light); color:var(--sky); border-color:var(--line); }
html[data-theme="dark"] :is(.clinical-warning,.clinical-rips-validation-row.advertencia,.rips-semaforo-yellow) { background:var(--amber-light); color:var(--amber); }
html[data-theme="dark"] :is(.clinical-ok,.clinical-alert.success,.rips-semaforo-green) { background:var(--emerald-light); color:var(--emerald); }
html[data-theme="dark"] :is(.clinical-alert.error,.clinical-rips-validation-row.critico,.rips-semaforo-red) { background:var(--rose-light); color:var(--rose); }
html[data-theme="dark"] .clinical-rips-validation-row.info { background:var(--sky-light); color:var(--sky); }
html[data-theme="dark"] .rips-validation-list-success b { color:var(--emerald); }
html[data-theme="dark"] .danger-link { background:var(--rose-light) !important; color:var(--rose); border-color:var(--rose) !important; }
html[data-theme="dark"] .skl { background:linear-gradient(90deg,#232b47 25%,#343c5c 50%,#232b47 75%); background-size:1200px 100%; }
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder { color:var(--muted); opacity:1; }
html[data-theme="dark"] .apexcharts-text { fill:var(--muted); }
html[data-theme="dark"] .apexcharts-tooltip { background:var(--white); color:var(--ink); border-color:var(--line); }
html[data-theme="dark"] .apexcharts-tooltip-title { background:var(--soft2); border-color:var(--line); }
html[data-theme="dark"] .theme-toggle { color:#ffd080; background:var(--soft2); }
html[data-theme="dark"] .shell:not(.hidden) :is(.card,.stat-card,.kanban-card,.stage,.clinical-card,.rips-json-preview,.modal,.compact-item,.lead-card,.appt-item,.task-row,.ops-item,.status-item,.clinical-list-item,.rips-validation-card,.module-nav,.module-tab:not(.active),input,select,textarea) { background:var(--white); border-color:var(--line); color:var(--ink); }
html[data-theme="dark"] .shell:not(.hidden) .module-nav::before { background:var(--white); color:var(--ink); border-color:var(--line); }
html[data-theme="dark"] .shell:not(.hidden) :is(.page-title,.stat-value,.stat-label,.page-eyebrow,.section-label,.header-actions .btn-ghost) { color:var(--ink) !important; }
html[data-theme="dark"] .shell:not(.hidden) :is(.page-sub,.card-sub) { color:var(--muted); }
html[data-theme="dark"] .shell:not(.hidden) .stat-trend { background:var(--soft2); color:var(--ink) !important; }
html[data-theme="dark"] .module-tab::before { color:var(--teal); }
}
