:root[data-theme="dark"] { color-scheme: dark; --panel-bg:#0b1220; --panel-ink:#eef2ff; --panel-muted:#a3acc2; --panel-border:#293247; }
:root[data-theme="dark"] body.panel-body { background:#0b1220; color:var(--panel-ink); }
:root[data-theme="dark"] .panel-topbar { background:rgba(15,23,42,.94); }
:root[data-theme="dark"] .panel-card, :root[data-theme="dark"] .card, :root[data-theme="dark"] .account-dropdown, :root[data-theme="dark"] .panel-home, :root[data-theme="dark"] .panel-toggle, :root[data-theme="dark"] .panel-cache-button, :root[data-theme="dark"] .form-control, :root[data-theme="dark"] .form-select, :root[data-theme="dark"] .select2-container--default .select2-selection--single, :root[data-theme="dark"] .modal-content, :root[data-theme="dark"] .dropdown-menu { background:#111a2c!important; color:#eef2ff!important; border-color:#2b364d!important; }
:root[data-theme="dark"] .table { --bs-table-bg:transparent; --bs-table-color:#e7ebf6; --bs-table-border-color:#2b364d; }
:root[data-theme="dark"] .text-dark, :root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3, :root[data-theme="dark"] h4, :root[data-theme="dark"] h5, :root[data-theme="dark"] label { color:#eef2ff!important; }
:root[data-theme="dark"] .text-muted, :root[data-theme="dark"] small { color:#a3acc2!important; }
:root[data-theme="dark"] .account-trigger:hover, :root[data-theme="dark"] .panel-account.open .account-trigger, :root[data-theme="dark"] .account-dropdown a:hover { background:#1a2539; }
.panel-preference-actions { display:flex; align-items:center; gap:8px; }
.panel-preference-button { width:40px; height:40px; display:grid; place-items:center; border:1px solid var(--panel-border); border-radius:10px; background:#fff; color:var(--panel-ink); font-weight:800; cursor:pointer; }
:root[data-theme="dark"] .panel-preference-button { background:#111a2c; }
.app-toast-region { position:fixed; z-index:2000; top:18px; right:18px; width:min(390px,calc(100vw - 28px)); display:grid; gap:10px; pointer-events:none; }
.app-toast { pointer-events:auto; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:11px; padding:13px 14px; color:#fff; background:#334155; border-radius:12px; box-shadow:0 16px 38px rgba(15,23,42,.25); opacity:0; transform:translateY(-10px); transition:.22s ease; }
.app-toast.show { opacity:1; transform:none; }.app-toast-success{background:#15803d}.app-toast-danger{background:#b91c1c}.app-toast-info{background:#1d4ed8}
.app-toast button { border:0; background:transparent; color:inherit; font-size:22px; line-height:1; }
.field-validation-error { display:block; margin-top:5px; color:#dc2626!important; font-size:12px; font-weight:600; animation:validation-in .18s ease; }
@keyframes validation-in { from { opacity:0; transform:translateY(-3px) } }
@media(max-width:575.98px){.panel-preference-actions{gap:5px}.panel-preference-button{width:36px;height:36px}.app-toast-region{top:10px;right:10px}.panel-header-tools{gap:6px!important}}
/* Legacy dashboard components contain hard-coded light colors. These scoped
   overrides keep cards, tables, controls, and footer readable in dark mode. */
:root[data-theme="dark"] body.panel-body .panel-wrap,
:root[data-theme="dark"] body.panel-body .panel-main { background:#0b1220!important; color:#e7ebf6!important; }
:root[data-theme="dark"] body.panel-body .panel-main .contact-card,
:root[data-theme="dark"] body.panel-body .panel-main .panel-card,
:root[data-theme="dark"] body.panel-body .panel-main .card,
:root[data-theme="dark"] body.panel-body .panel-main .stat-card,
:root[data-theme="dark"] body.panel-body .panel-main .panel-filter,
:root[data-theme="dark"] body.panel-body .panel-main .profile-step,
:root[data-theme="dark"] body.panel-body .panel-main .document-current,
:root[data-theme="dark"] body.panel-body .panel-main .brand-preview { background:#111a2c!important; color:#e7ebf6!important; border-color:#2b364d!important; box-shadow:0 8px 28px rgba(0,0,0,.22)!important; }
:root[data-theme="dark"] body.panel-body .panel-footer { background:#111a2c!important; color:#aeb8cc!important; border-color:#2b364d!important; }
:root[data-theme="dark"] body.panel-body .panel-main .table { --bs-table-bg:transparent!important; --bs-table-color:#e7ebf6!important; --bs-table-border-color:#2b364d!important; color:#e7ebf6!important; }
:root[data-theme="dark"] body.panel-body .panel-main .table > :not(caption) > * > * { background-color:transparent!important; color:#e7ebf6!important; border-color:#2b364d!important; box-shadow:none!important; }
:root[data-theme="dark"] body.panel-body .panel-main .table thead th { background:#182338!important; color:#cbd5e1!important; border-color:#344057!important; }
:root[data-theme="dark"] body.panel-body .panel-main .table tbody tr:hover > * { background:#172136!important; }
:root[data-theme="dark"] body.panel-body .panel-main p,
:root[data-theme="dark"] body.panel-body .panel-main td,
:root[data-theme="dark"] body.panel-body .panel-main .panel-status-toggle strong,
:root[data-theme="dark"] body.panel-body .panel-main .profile-form-card .form-label,
:root[data-theme="dark"] body.panel-body .panel-main .account-form-card .form-label { color:#d7deeb!important; }
:root[data-theme="dark"] body.panel-body .panel-main .text-muted,
:root[data-theme="dark"] body.panel-body .panel-main .panel-person-info span,
:root[data-theme="dark"] body.panel-body .panel-main .panel-person-info small { color:#aeb8cc!important; }
:root[data-theme="dark"] body.panel-body .panel-toggle,
:root[data-theme="dark"] body.panel-body .panel-home,
:root[data-theme="dark"] body.panel-body .panel-cache-button,
:root[data-theme="dark"] body.panel-body .panel-main .btn-outline-brand,
:root[data-theme="dark"] body.panel-body .panel-main .icon-btn,
:root[data-theme="dark"] body.panel-body .panel-main .page-link,
:root[data-theme="dark"] body.panel-body .panel-main .panel-status-stack > .small { background:#111a2c!important; border-color:#344057!important; }
:root[data-theme="dark"] body.panel-body .panel-main .form-control::placeholder { color:#7f8ba3!important; opacity:1; }
:root[data-theme="dark"] .select2-dropdown,
:root[data-theme="dark"] .select2-search__field,
:root[data-theme="dark"] .select2-results__option { background:#111a2c!important; color:#e7ebf6!important; border-color:#2b364d!important; }
:root[data-theme="dark"] .select2-results__option--highlighted,
:root[data-theme="dark"] .select2-results__option[aria-selected="true"] { background:#1d4ed8!important; color:#fff!important; }
