/* ========================================================================
   EMIS GLOBAL THEME SYSTEM V1 — 7 persistent themes across the full shell
   ======================================================================== */
html[data-emis-theme="snow"]{--emis-primary:#0f2b46;--emis-primary-dark:#081a2b;--emis-accent:#e11d48;--emis-success:#0f766e;--emis-bg:#f5f8fb;--emis-surface:#fff;--emis-surface-soft:#f3f6f9;--emis-text:#0f172a;--emis-muted:#64748b;--emis-border:#dce4eb;--emis-header:#0f2b46;--emis-sidebar:#112c46;--emis-sidebar-deep:#081a2b;--emis-focus:#0f766e;--emis-theme-color:#081a2b;color-scheme:light}
html[data-emis-theme="ocean"]{--emis-primary:#0369a1;--emis-primary-dark:#0c4a6e;--emis-accent:#0891b2;--emis-success:#0f766e;--emis-bg:#f0f9ff;--emis-surface:#fff;--emis-surface-soft:#edf8fd;--emis-text:#102a43;--emis-muted:#5f7284;--emis-border:#d3e5ee;--emis-header:#075985;--emis-sidebar:#075985;--emis-sidebar-deep:#0c4a6e;--emis-focus:#0284c7;--emis-theme-color:#075985;color-scheme:light}
html[data-emis-theme="emerald"]{--emis-primary:#166534;--emis-primary-dark:#14532d;--emis-accent:#0f766e;--emis-success:#15803d;--emis-bg:#f3faf5;--emis-surface:#fff;--emis-surface-soft:#edf7ef;--emis-text:#14251b;--emis-muted:#65776a;--emis-border:#d5e5d8;--emis-header:#166534;--emis-sidebar:#14532d;--emis-sidebar-deep:#0b3a20;--emis-focus:#15803d;--emis-theme-color:#14532d;color-scheme:light}
html[data-emis-theme="royal"]{--emis-primary:#5b21b6;--emis-primary-dark:#3b0764;--emis-accent:#7c3aed;--emis-success:#0f766e;--emis-bg:#f8f5ff;--emis-surface:#fff;--emis-surface-soft:#f3effb;--emis-text:#211633;--emis-muted:#71657f;--emis-border:#e2daed;--emis-header:#4c1d95;--emis-sidebar:#4c1d95;--emis-sidebar-deep:#2e1065;--emis-focus:#7c3aed;--emis-theme-color:#4c1d95;color-scheme:light}
html[data-emis-theme="amber"]{--emis-primary:#92400e;--emis-primary-dark:#78350f;--emis-accent:#d97706;--emis-success:#0f766e;--emis-bg:#fffaf0;--emis-surface:#fff;--emis-surface-soft:#fff5df;--emis-text:#2e2117;--emis-muted:#786a5c;--emis-border:#eadfce;--emis-header:#92400e;--emis-sidebar:#78350f;--emis-sidebar-deep:#451a03;--emis-focus:#d97706;--emis-theme-color:#78350f;color-scheme:light}
html[data-emis-theme="slate"]{--emis-primary:#475569;--emis-primary-dark:#1e293b;--emis-accent:#0f766e;--emis-success:#0f766e;--emis-bg:#f1f5f9;--emis-surface:#fff;--emis-surface-soft:#edf1f5;--emis-text:#172033;--emis-muted:#64748b;--emis-border:#d7dfe8;--emis-header:#334155;--emis-sidebar:#334155;--emis-sidebar-deep:#0f172a;--emis-focus:#475569;--emis-theme-color:#334155;color-scheme:light}
html[data-emis-theme="midnight"]{--emis-primary:#172554;--emis-primary-dark:#020617;--emis-accent:#38bdf8;--emis-success:#2dd4bf;--emis-bg:#07111f;--emis-surface:#0f1b2d;--emis-surface-soft:#132238;--emis-text:#e7eef8;--emis-muted:#9aabc0;--emis-border:#26364d;--emis-header:#081326;--emis-sidebar:#0d1a31;--emis-sidebar-deep:#020617;--emis-focus:#38bdf8;--emis-theme-color:#081326;color-scheme:dark}

html[data-emis-theme]{--primary:var(--emis-primary);--primary-dark:var(--emis-primary-dark);--accent:var(--emis-accent);--bg-soft:var(--emis-bg);--bg-white:var(--emis-surface);--text-dark:var(--emis-text);--text-muted:var(--emis-muted);--text-soft:color-mix(in srgb,var(--emis-muted) 70%,transparent);--border:var(--emis-border);--border-soft:color-mix(in srgb,var(--emis-border) 56%,transparent);--success:var(--emis-success)}
body{background:radial-gradient(circle at top right,color-mix(in srgb,var(--emis-primary) 10%,transparent),transparent 30%),var(--emis-bg)!important;color:var(--emis-text);transition:background .2s ease,color .2s ease}.main-content{background:transparent!important}.top-header{background:linear-gradient(135deg,var(--emis-header),color-mix(in srgb,var(--emis-header) 82%,var(--emis-primary)))!important}.sidebar{background:linear-gradient(180deg,var(--emis-sidebar),var(--emis-sidebar-deep))!important}.base-footer{background:color-mix(in srgb,var(--emis-surface) 94%,var(--emis-bg))!important;color:var(--emis-muted)!important;border-color:var(--emis-border)!important}.dropdown-menu,.base-dropdown-menu,.base-notif-menu{background:var(--emis-surface)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important}.dropdown-menu a,.dropdown-menu button,.base-notif-menu li{color:var(--emis-text)!important}.dropdown-menu a:hover{background:var(--emis-surface-soft)!important;color:var(--emis-primary)!important}.base-icon-btn:focus-visible,.base-nav-button:focus-visible,.sidebar a:focus-visible{outline:3px solid color-mix(in srgb,var(--emis-focus) 35%,transparent)!important;outline-offset:2px}.emis-mobile-dock{background:color-mix(in srgb,var(--emis-surface) 96%,transparent)!important;border-color:var(--emis-border)!important}.emis-mobile-dock a,.emis-mobile-dock button{color:var(--emis-muted)!important}.emis-mobile-dock a.active{color:var(--emis-primary)!important}

/* Theme picker */
.theme-picker{position:relative}.theme-toggle-button{min-width:42px;gap:6px;padding:0 9px!important}.theme-toggle-label{font-size:.72rem;font-weight:800;white-space:nowrap}.theme-chevron{font-size:.58rem;opacity:.75}.theme-menu{right:0!important;left:auto!important;width:min(320px,calc(100vw - 24px));padding:8px!important;border:1px solid var(--emis-border)!important;border-radius:14px!important;background:var(--emis-surface)!important;box-shadow:0 18px 48px rgba(2,12,27,.18)!important}.theme-menu-head{padding:6px 7px 9px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--emis-border)}.theme-menu-head strong{color:var(--emis-text);font-size:.78rem}.theme-menu-head small{color:var(--emis-muted);font-size:.62rem}.theme-options{display:grid;gap:4px;margin-top:6px}.theme-option{width:100%;padding:8px;border:1px solid transparent;border-radius:10px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;background:transparent;color:var(--emis-text);font:inherit;text-align:left;cursor:pointer}.theme-option:hover{background:var(--emis-surface-soft)}.theme-option.active{border-color:color-mix(in srgb,var(--emis-focus) 32%,var(--emis-border));background:color-mix(in srgb,var(--emis-focus) 8%,var(--emis-surface))}.theme-swatch{width:30px;height:30px;border-radius:9px;display:grid;grid-template-columns:1fr 1fr;overflow:hidden;border:1px solid rgba(127,127,127,.25)}.theme-swatch i{display:block}.theme-option-copy strong,.theme-option-copy small{display:block}.theme-option-copy strong{font-size:.72rem}.theme-option-copy small{margin-top:1px;color:var(--emis-muted);font-size:.59rem}.theme-option-check{color:var(--emis-focus);opacity:0}.theme-option.active .theme-option-check{opacity:1}

/* Generic theme coverage for inputs, dialogs, utility cards and modern workspaces. */
body :where(input,select,textarea){accent-color:var(--emis-focus)}body :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){color:var(--emis-text)}body :where(.global-flash,.modal-content,.cred-container,.dialog-modal,.confirmation-modal,.student-details-modal){border-color:var(--emis-border)}body :where(.btn-primary,.subject-btn.primary,.teacher-add-button){background:var(--emis-primary)!important;border-color:var(--emis-primary)!important;color:#fff!important}.sidebar-menu a.active{border-color:color-mix(in srgb,var(--emis-accent) 28%,transparent)!important;background:color-mix(in srgb,#fff 9%,transparent)!important}.sidebar-menu a.active .sidebar-nav-icon{box-shadow:0 8px 22px color-mix(in srgb,var(--emis-accent) 22%,transparent)!important}

/* Midnight needs explicit surface coverage because many older page modules hard-code white. */
html[data-emis-theme="midnight"] body{background:#07111f!important;color:#e7eef8!important}html[data-emis-theme="midnight"] :where(.main-content,.admin-page,.promotion-page,.subject-manager-page,.academic-admin-hub,.teacher-phase3){color:#e7eef8}html[data-emis-theme="midnight"] :where(.admin-card,.admin-stat-card,.teacher-stat-card,.teacher-directory-card,.teacher-assignment-card,.subject-panel,.admin-hub-hero,.admin-hub-section-head,.access-role-card,.identity-summary-grid article,.identity-generator-card,.identity-register-card,.identity-audit-card,.promotion-header,.class-snapshot-card,.hybrid-class-bar,.promotion-roadmap-panel,.class-operation-card,.promotion-filter-panel,.promotion-table-panel,.promotion-activity-panel,.settings-box,.table-panel,.mini-list-panel,.side-summary-card,.status-row,.report-setup-panel,.report-toolbar,.report-workspace,.result-card,.dashboard-card){background:#0f1b2d!important;border-color:#26364d!important;color:#e7eef8!important;box-shadow:0 10px 28px rgba(0,0,0,.18)!important}html[data-emis-theme="midnight"] :where(h1,h2,h3,h4,h5,strong,label,.table-heading-line h2,.filter-panel-title h2){color:#edf4ff!important}html[data-emis-theme="midnight"] :where(p,small,.sub-text,.muted-text,.section-description,.table-scroll-hint){color:#9aabc0!important}html[data-emis-theme="midnight"] :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.promotion-search-box,.activity-search){background:#132238!important;color:#edf4ff!important;border-color:#2a3c56!important}html[data-emis-theme="midnight"] :where(table tbody td,.identity-table td){color:#e2ebf7!important;border-color:#26364d!important}html[data-emis-theme="midnight"] :where(table tbody tr:nth-child(even)){background:#101e31!important}html[data-emis-theme="midnight"] :where(table tbody tr:hover){background:#172942!important}html[data-emis-theme="midnight"] :where(table thead th){border-color:#33445e!important}html[data-emis-theme="midnight"] :where(.modal-content,.cred-container,.aa-modal-card,.student-details-modal){background:#0f1b2d!important;color:#e7eef8!important;border-color:#2a3c56!important}html[data-emis-theme="midnight"] .sidebar-overlay{background:rgba(0,0,0,.62)!important}

@media(max-width:900px){.theme-toggle-label{display:none}.theme-toggle-button{padding:0!important}.theme-menu{position:fixed!important;top:auto!important;right:10px!important;bottom:78px!important;left:10px!important;width:auto!important;max-height:70dvh;overflow:auto}.theme-menu-head{position:sticky;top:-8px;z-index:2;background:var(--emis-surface)}}

/* ========================================================================
   GLOBAL MODULE COVERAGE — theme every workspace, dialog and action surface
   ======================================================================== */
html[data-emis-theme] body :where(.admin-card,.admin-stat-card,.dashboard-card,.stat-card,.info-card,.settings-box,.table-panel,.mini-list-panel,.side-summary-card,.status-row,.teacher-stat-card,.teacher-directory-card,.teacher-assignment-card,.subject-panel,.admin-hub-hero,.admin-hub-section-head,.access-role-card,.identity-summary-grid article,.identity-generator-card,.identity-register-card,.identity-audit-card,.promotion-header,.class-snapshot-card,.hybrid-class-bar,.promotion-roadmap-panel,.class-operation-card,.promotion-filter-panel,.promotion-table-panel,.promotion-activity-panel,.report-setup-panel,.report-toolbar,.report-workspace,.result-card,.modal-content,.cred-container,.dialog-modal,.confirmation-modal,.student-details-modal,.aa-modal-card){border-color:var(--emis-border)}
html[data-emis-theme]:not([data-emis-theme="midnight"]) body :where(.admin-card,.admin-stat-card,.dashboard-card,.stat-card,.info-card,.settings-box,.table-panel,.mini-list-panel,.side-summary-card,.status-row,.teacher-stat-card,.teacher-directory-card,.teacher-assignment-card,.subject-panel,.admin-hub-hero,.admin-hub-section-head,.access-role-card,.identity-summary-grid article,.identity-generator-card,.identity-register-card,.identity-audit-card,.promotion-header,.class-snapshot-card,.hybrid-class-bar,.promotion-roadmap-panel,.class-operation-card,.promotion-filter-panel,.promotion-table-panel,.promotion-activity-panel,.report-setup-panel,.report-toolbar,.report-workspace,.result-card,.modal-content,.cred-container,.dialog-modal,.confirmation-modal,.student-details-modal,.aa-modal-card){background-color:color-mix(in srgb,var(--emis-surface) 97%,var(--emis-primary) 3%);color:var(--emis-text)}
html[data-emis-theme] body :where(.btn-primary,.primary-btn,.pm-btn-primary,.subject-btn.primary,.teacher-add-button,.identity-primary-btn,.save-btn,.action-btn.primary){background:linear-gradient(135deg,var(--emis-primary-dark),var(--emis-primary))!important;border-color:var(--emis-primary)!important;color:#fff!important}
html[data-emis-theme] body :where(.btn-secondary,.pm-btn-secondary,.secondary-btn,.table-tool-btn,.icon-filter-btn){border-color:var(--emis-border)!important;color:var(--emis-text)}
html[data-emis-theme] body :where(.badge.active,.status-active,.active-badge,.table-live-badge,.promotion-live-badge){border-color:color-mix(in srgb,var(--emis-success) 30%,var(--emis-border));color:var(--emis-success)}
html[data-emis-theme] body :where(.modal-overlay,.pm-overlay,.cred-overlay,.aa-modal-overlay){backdrop-filter:blur(4px)}
html[data-emis-theme] body ::selection{background:color-mix(in srgb,var(--emis-focus) 28%,transparent);color:var(--emis-text)}
html[data-emis-theme] body :where(a,button,input,select,textarea){transition:border-color .18s ease,background-color .18s ease,color .18s ease,box-shadow .18s ease}

/* ========================================================================
   HEADER THEME PLACEMENT V2 — dedicated palette control + uniform nav row
   ======================================================================== */
.top-header{gap:.9rem!important}
.header-theme-slot{flex:0 0 auto;display:flex;align-items:center;margin-left:.2rem}
.header-theme-slot .theme-picker{display:flex;align-items:center}
.header-theme-slot .theme-toggle-button{width:auto!important;min-width:146px!important;height:42px!important;padding:0 11px!important;display:inline-flex!important;grid-auto-flow:initial!important;align-items:center!important;justify-content:center!important;gap:7px!important;border:1px solid rgba(255,255,255,.11)!important;border-radius:13px!important;background:rgba(255,255,255,.075)!important;color:#fff!important;overflow:hidden;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}
.header-theme-slot .theme-toggle-button:hover{background:rgba(255,255,255,.13)!important;border-color:rgba(255,255,255,.16)!important;transform:none}
.header-theme-slot .theme-toggle-button>i:first-child{width:20px;height:20px;display:grid;place-items:center;border-radius:7px;background:rgba(255,255,255,.09);font-size:.72rem;flex:0 0 20px}
.header-theme-slot .theme-toggle-label{max-width:92px;overflow:hidden;text-overflow:ellipsis;font-size:.72rem;font-weight:850;letter-spacing:.005em}
.header-theme-slot .theme-chevron{margin-left:auto;font-size:.55rem}
.header-theme-slot .theme-menu{left:0!important;right:auto!important;top:calc(100% + .7rem)!important}
.base-nav{gap:1.15rem!important;margin-left:auto!important}
.base-nav-link,.base-nav-button{min-height:42px;padding:0 .28rem!important;justify-content:center;font-size:.9rem!important;line-height:1!important}
.base-actions{gap:.5rem!important;margin-left:.35rem!important}
.base-actions>.base-dropdown,.base-actions>.base-user{flex:0 0 auto}
.base-actions .base-icon-btn{width:42px!important;height:42px!important;border-radius:13px!important}
.base-user{min-height:42px;padding:.3rem .55rem!important;border:1px solid rgba(255,255,255,.06);background:rgba(255,255,255,.075)!important}

@media(max-width:1220px){.header-theme-slot .theme-toggle-button{min-width:42px!important;width:42px!important;padding:0!important}.header-theme-slot .theme-toggle-label,.header-theme-slot .theme-chevron{display:none!important}.base-nav{gap:.85rem!important}.base-actions{margin-left:.15rem!important}}
@media(max-width:980px){.header-theme-slot{margin-left:auto}.header-theme-slot .theme-menu{left:auto!important;right:0!important}.base-actions{margin-left:0!important}}
@media(max-width:768px){.header-theme-slot{margin-left:0}.header-theme-slot .theme-menu{position:fixed!important;top:auto!important;right:10px!important;bottom:70px!important;left:10px!important;width:auto!important}.top-header{gap:6px!important}}
@media(max-width:560px){.header-theme-slot .theme-toggle-button{width:36px!important;min-width:36px!important;height:36px!important;border-radius:11px!important}.header-theme-slot .theme-toggle-button>i:first-child{width:18px;height:18px;flex-basis:18px;font-size:.65rem}.base-actions .base-icon-btn{width:36px!important;height:36px!important;border-radius:11px!important}}

/* ========================================================================
   EMIS GLOBAL THEME SYSTEM V2 — SAGE-INSPIRED FULL APPLICATION THEMING
   Ten palettes. Semantic surfaces cascade through page shells, cards, tables,
   forms, modals and mobile UI while preserving official printable documents.
   ======================================================================== */
html[data-emis-theme="snow"]{--emis-primary:#123b63;--emis-primary-dark:#0a2743;--emis-accent:#e11d48;--emis-success:#0f8a70;--emis-warning:#c27a13;--emis-danger:#c92f4d;--emis-bg:#f3f6fa;--emis-bg-2:#e9eff6;--emis-surface:#ffffff;--emis-surface-2:#f8fafc;--emis-surface-3:#edf2f7;--emis-hover:#eef5fb;--emis-table-head:#eaf1f6;--emis-table-stripe:#f8fbfd;--emis-text:#10233b;--emis-muted:#617489;--emis-border:#d7e1ea;--emis-header:#102f50;--emis-sidebar:#123552;--emis-sidebar-deep:#081d31;--emis-focus:#146c94;--emis-theme-color:#102f50;--emis-shadow:0 16px 44px rgba(22,49,78,.08);color-scheme:light}
html[data-emis-theme="ocean"]{--emis-primary:#0879b6;--emis-primary-dark:#075178;--emis-accent:#06b6d4;--emis-success:#0d8b70;--emis-warning:#c77a12;--emis-danger:#c83b58;--emis-bg:#eaf6ff;--emis-bg-2:#dff0fb;--emis-surface:#fbfdff;--emis-surface-2:#eef9ff;--emis-surface-3:#dceff9;--emis-hover:#e5f4fb;--emis-table-head:#dcecf5;--emis-table-stripe:#f1f9fd;--emis-text:#102b40;--emis-muted:#5d7488;--emis-border:#cfe1ec;--emis-header:#075985;--emis-sidebar:#075985;--emis-sidebar-deep:#063b5c;--emis-focus:#0ea5e9;--emis-theme-color:#075985;--emis-shadow:0 16px 44px rgba(8,89,133,.10);color-scheme:light}
html[data-emis-theme="emerald"]{--emis-primary:#12805c;--emis-primary-dark:#0f6046;--emis-accent:#16a34a;--emis-success:#0f8a62;--emis-warning:#b97917;--emis-danger:#c13f4f;--emis-bg:#edf8f2;--emis-bg-2:#e2f0e8;--emis-surface:#fbfffd;--emis-surface-2:#f0f8f3;--emis-surface-3:#e3f0e8;--emis-hover:#e9f5ee;--emis-table-head:#e1eee6;--emis-table-stripe:#f4faf6;--emis-text:#162c23;--emis-muted:#60776b;--emis-border:#d0e2d7;--emis-header:#0f6b49;--emis-sidebar:#10583f;--emis-sidebar-deep:#093c2a;--emis-focus:#18a36f;--emis-theme-color:#0f6b49;--emis-shadow:0 16px 44px rgba(16,88,63,.10);color-scheme:light}
html[data-emis-theme="royal"]{--emis-primary:#6d3bd1;--emis-primary-dark:#482190;--emis-accent:#a855f7;--emis-success:#16866f;--emis-warning:#c17d16;--emis-danger:#d13b65;--emis-bg:#f4f0ff;--emis-bg-2:#ebe4fb;--emis-surface:#fefcff;--emis-surface-2:#f7f2ff;--emis-surface-3:#ede5fb;--emis-hover:#f1eafe;--emis-table-head:#e9e0f8;--emis-table-stripe:#faf7ff;--emis-text:#2a1d3f;--emis-muted:#766789;--emis-border:#dfd4ed;--emis-header:#51239b;--emis-sidebar:#4a1d8d;--emis-sidebar-deep:#2c1057;--emis-focus:#8b5cf6;--emis-theme-color:#51239b;--emis-shadow:0 16px 44px rgba(81,35,155,.11);color-scheme:light}
html[data-emis-theme="ruby"]{--emis-primary:#be123c;--emis-primary-dark:#881337;--emis-accent:#f43f5e;--emis-success:#0f8a70;--emis-warning:#c57b11;--emis-danger:#b91c1c;--emis-bg:#fff1f4;--emis-bg-2:#fbe4e9;--emis-surface:#fffafb;--emis-surface-2:#fff3f6;--emis-surface-3:#f9e4e9;--emis-hover:#fdebef;--emis-table-head:#f5dde4;--emis-table-stripe:#fff7f9;--emis-text:#3a1c25;--emis-muted:#856674;--emis-border:#efd3dc;--emis-header:#9f1239;--emis-sidebar:#881337;--emis-sidebar-deep:#560c25;--emis-focus:#e11d48;--emis-theme-color:#9f1239;--emis-shadow:0 16px 44px rgba(159,18,57,.10);color-scheme:light}
html[data-emis-theme="amber"]{--emis-primary:#c46b08;--emis-primary-dark:#92400e;--emis-accent:#f59e0b;--emis-success:#148268;--emis-warning:#d97706;--emis-danger:#c2413d;--emis-bg:#fff8eb;--emis-bg-2:#f8edda;--emis-surface:#fffdf9;--emis-surface-2:#fff8ed;--emis-surface-3:#f7ead5;--emis-hover:#fbf0df;--emis-table-head:#f4e5cf;--emis-table-stripe:#fffbf3;--emis-text:#352619;--emis-muted:#7f6d5b;--emis-border:#ead9c2;--emis-header:#9a4d06;--emis-sidebar:#7f4209;--emis-sidebar-deep:#532805;--emis-focus:#d97706;--emis-theme-color:#9a4d06;--emis-shadow:0 16px 44px rgba(146,64,14,.10);color-scheme:light}
html[data-emis-theme="aqua"]{--emis-primary:#0f8f91;--emis-primary-dark:#0f5d65;--emis-accent:#06b6d4;--emis-success:#0f8a70;--emis-warning:#c28519;--emis-danger:#c73c58;--emis-bg:#eafcfb;--emis-bg-2:#ddf4f3;--emis-surface:#fbffff;--emis-surface-2:#effafa;--emis-surface-3:#ddf1f1;--emis-hover:#e5f6f5;--emis-table-head:#d9eded;--emis-table-stripe:#f2fbfb;--emis-text:#143235;--emis-muted:#617b7d;--emis-border:#cde3e3;--emis-header:#0b6d73;--emis-sidebar:#0d5c63;--emis-sidebar-deep:#083c42;--emis-focus:#0ea5a8;--emis-theme-color:#0b6d73;--emis-shadow:0 16px 44px rgba(11,109,115,.10);color-scheme:light}
html[data-emis-theme="midnight"]{--emis-primary:#3b82f6;--emis-primary-dark:#1d4ed8;--emis-accent:#00d084;--emis-success:#19c98f;--emis-warning:#ffad21;--emis-danger:#ff4d65;--emis-bg:#06080d;--emis-bg-2:#0b0f16;--emis-surface:#151922;--emis-surface-2:#1b202b;--emis-surface-3:#222936;--emis-hover:#202733;--emis-table-head:#1e2530;--emis-table-stripe:#181d27;--emis-text:#f4f7fb;--emis-muted:#98a3b6;--emis-border:#303846;--emis-header:#111721;--emis-sidebar:#121821;--emis-sidebar-deep:#090d13;--emis-focus:#3b82f6;--emis-theme-color:#111721;--emis-shadow:0 18px 50px rgba(0,0,0,.30);color-scheme:dark}
html[data-emis-theme="deepnavy"]{--emis-primary:#0ea5e9;--emis-primary-dark:#0369a1;--emis-accent:#22d3ee;--emis-success:#20c997;--emis-warning:#f7a928;--emis-danger:#ff5b72;--emis-bg:#050b15;--emis-bg-2:#08111e;--emis-surface:#0d1726;--emis-surface-2:#132033;--emis-surface-3:#192a40;--emis-hover:#17283d;--emis-table-head:#142338;--emis-table-stripe:#101b2b;--emis-text:#e8f3ff;--emis-muted:#91a8bf;--emis-border:#263b52;--emis-header:#071426;--emis-sidebar:#09182b;--emis-sidebar-deep:#040b14;--emis-focus:#22d3ee;--emis-theme-color:#071426;--emis-shadow:0 18px 50px rgba(0,0,0,.32);color-scheme:dark}
html[data-emis-theme="darkviolet"]{--emis-primary:#a855f7;--emis-primary-dark:#7e22ce;--emis-accent:#ec4899;--emis-success:#27c795;--emis-warning:#ffb229;--emis-danger:#ff5c7a;--emis-bg:#0d0715;--emis-bg-2:#120a1d;--emis-surface:#171021;--emis-surface-2:#21172d;--emis-surface-3:#2b1d3b;--emis-hover:#281b37;--emis-table-head:#241833;--emis-table-stripe:#1a1225;--emis-text:#f8f2ff;--emis-muted:#b2a2c3;--emis-border:#3a2a4d;--emis-header:#1b0b2f;--emis-sidebar:#160a26;--emis-sidebar-deep:#0c0514;--emis-focus:#c084fc;--emis-theme-color:#1b0b2f;--emis-shadow:0 18px 50px rgba(0,0,0,.32);color-scheme:dark}

html[data-emis-theme]{--primary:var(--emis-primary);--primary-dark:var(--emis-primary-dark);--accent:var(--emis-accent);--bg:var(--emis-bg);--bg-soft:var(--emis-bg);--bg-white:var(--emis-surface);--card:var(--emis-surface);--surface:var(--emis-surface);--surface-2:var(--emis-surface-2);--surface-3:var(--emis-surface-3);--text-dark:var(--emis-text);--text:var(--emis-text);--ink:var(--emis-text);--muted:var(--emis-muted);--text-muted:var(--emis-muted);--text-soft:color-mix(in srgb,var(--emis-muted) 72%,transparent);--border:var(--emis-border);--border-soft:color-mix(in srgb,var(--emis-border) 66%,transparent);--line:var(--emis-border);--line-soft:color-mix(in srgb,var(--emis-border) 65%,transparent);--success:var(--emis-success);--warning:var(--emis-warning);--danger:var(--emis-danger)}
html[data-emis-theme],html[data-emis-theme] body{background:var(--emis-bg)!important;color:var(--emis-text)!important}body{background:radial-gradient(circle at 6% 0,color-mix(in srgb,var(--emis-primary) 9%,transparent),transparent 28%),radial-gradient(circle at 98% 2%,color-mix(in srgb,var(--emis-accent) 7%,transparent),transparent 24%),linear-gradient(180deg,var(--emis-bg),var(--emis-bg-2))!important}.main-content,.content-area{background:transparent!important;color:var(--emis-text)!important}.base-footer{background:color-mix(in srgb,var(--emis-surface) 94%,var(--emis-bg))!important;color:var(--emis-muted)!important;border-color:var(--emis-border)!important}
.top-header{background:linear-gradient(120deg,var(--emis-header),color-mix(in srgb,var(--emis-header) 72%,var(--emis-primary) 28%))!important;box-shadow:0 10px 30px color-mix(in srgb,var(--emis-sidebar-deep) 34%,transparent)!important}.sidebar{background:linear-gradient(180deg,var(--emis-sidebar),var(--emis-sidebar-deep))!important}.sidebar-menu a:hover{background:color-mix(in srgb,#fff 10%,transparent)!important}.sidebar-menu a.active{background:color-mix(in srgb,#fff 13%,transparent)!important;border-color:color-mix(in srgb,var(--emis-accent) 58%,transparent)!important}.sidebar-role{background:color-mix(in srgb,var(--emis-accent) 18%,transparent)!important;color:color-mix(in srgb,var(--emis-accent) 70%,#fff)!important}

/* SAGE-style semantic token bridges for each major EMIS workspace. */
.emis-dashboard{--dash-blue:var(--emis-primary);--dash-blue-dark:var(--emis-primary-dark);--dash-blue-soft:color-mix(in srgb,var(--emis-primary) 13%,var(--emis-surface));--dash-gold:var(--emis-warning);--dash-ink:var(--emis-text);--dash-muted:var(--emis-muted);--dash-line:var(--emis-border);--dash-panel:var(--emis-surface);--dash-success:var(--emis-success);--dash-warning:var(--emis-warning);--dash-danger:var(--emis-danger);--dash-shadow:var(--emis-shadow);background:radial-gradient(circle at 5% 0,color-mix(in srgb,var(--emis-primary) 11%,transparent),transparent 24%),linear-gradient(180deg,var(--emis-bg),var(--emis-bg-2))!important;color:var(--emis-text)!important}
.promotion-page{--pm-bg:var(--emis-bg);--pm-bg-deep:var(--emis-bg-2);--pm-surface:var(--emis-surface);--pm-surface-soft:var(--emis-surface-2);--pm-surface-muted:var(--emis-surface-3);--pm-text:var(--emis-text);--pm-text-strong:var(--emis-text);--pm-muted:var(--emis-muted);--pm-muted-light:color-mix(in srgb,var(--emis-muted) 78%,transparent);--pm-border:var(--emis-border);--pm-border-soft:color-mix(in srgb,var(--emis-border) 70%,transparent);--pm-primary:var(--emis-primary);--pm-primary-dark:var(--emis-primary-dark);--pm-primary-deep:color-mix(in srgb,var(--emis-primary-dark) 82%,#000 18%);--pm-primary-soft:color-mix(in srgb,var(--emis-primary) 12%,var(--emis-surface));--pm-primary-softer:color-mix(in srgb,var(--emis-primary) 6%,var(--emis-surface));--pm-secondary:color-mix(in srgb,var(--emis-text) 74%,var(--emis-surface));--pm-secondary-soft:var(--emis-surface-3);--pm-green:var(--emis-success);--pm-amber:var(--emis-warning);--pm-red:var(--emis-danger);--pm-shadow-xs:0 3px 10px color-mix(in srgb,var(--emis-sidebar-deep) 8%,transparent);--pm-shadow-sm:var(--emis-shadow)}
.academy-page{--ac-navy:var(--emis-primary-dark);--ac-ink:var(--emis-text);--ac-muted:var(--emis-muted);--ac-line:var(--emis-border);--ac-soft:var(--emis-surface-2);--ac-teal:var(--emis-primary);--ac-teal-soft:color-mix(in srgb,var(--emis-primary) 12%,var(--emis-surface));--ac-purple:color-mix(in srgb,var(--emis-accent) 80%,var(--emis-primary));--ac-purple-soft:color-mix(in srgb,var(--emis-accent) 10%,var(--emis-surface));--ac-white:var(--emis-surface);--ac-shadow:var(--emis-shadow);background:radial-gradient(circle at 4% 0,color-mix(in srgb,var(--emis-primary) 8%,transparent),transparent 22%),linear-gradient(180deg,var(--emis-bg),var(--emis-bg-2))!important;color:var(--emis-text)!important}
.attendance-studio{--att-ink:var(--emis-text);--att-muted:var(--emis-muted);--att-line:var(--emis-border);--att-card:var(--emis-surface);--att-blue:var(--emis-primary);--att-sky:var(--emis-accent);--att-green:var(--emis-success);--att-red:var(--emis-danger);--att-orange:var(--emis-warning);--att-yellow:var(--emis-warning);--att-purple:color-mix(in srgb,var(--emis-accent) 70%,#7c3aed);--att-dark:var(--emis-text)}
.ca-page{--ca-bg:var(--emis-bg);--ca-card:var(--emis-surface);--ca-navy:var(--emis-text);--ca-navy-2:color-mix(in srgb,var(--emis-text) 86%,var(--emis-surface));--ca-muted:var(--emis-muted);--ca-soft:var(--emis-surface-2);--ca-border:var(--emis-border);--ca-green:var(--emis-success);--ca-green-dark:color-mix(in srgb,var(--emis-success) 74%,#000);--ca-red:var(--emis-danger);--ca-orange:var(--emis-warning);--ca-blue:var(--emis-primary);--ca-purple:var(--emis-accent);--ca-shadow:var(--emis-shadow)}
.admin-results-page{--ar-bg:var(--emis-bg);--ar-bg-deep:var(--emis-bg-2);--ar-surface:var(--emis-surface);--ar-surface-soft:var(--emis-surface-2);--ar-surface-muted:var(--emis-surface-3);--ar-text:var(--emis-text);--ar-text-strong:var(--emis-text);--ar-muted:var(--emis-muted);--ar-muted-light:color-mix(in srgb,var(--emis-muted) 78%,transparent);--ar-border:var(--emis-border);--ar-border-soft:color-mix(in srgb,var(--emis-border) 70%,transparent);--ar-primary:var(--emis-primary);--ar-primary-dark:var(--emis-primary-dark);--ar-primary-deep:color-mix(in srgb,var(--emis-primary-dark) 84%,#000);--ar-primary-soft:color-mix(in srgb,var(--emis-primary) 12%,var(--emis-surface));--ar-secondary:color-mix(in srgb,var(--emis-text) 72%,var(--emis-surface));--ar-secondary-soft:var(--emis-surface-3);--ar-blue:var(--emis-primary);--ar-green:var(--emis-success);--ar-amber:var(--emis-warning);--ar-purple:var(--emis-accent);--ar-red:var(--emis-danger);--ar-cyan:color-mix(in srgb,var(--emis-accent) 66%,#06b6d4)}
.report-page{--report-bg:var(--emis-bg);--report-card:var(--emis-surface);--report-navy:var(--emis-text);--report-navy-2:color-mix(in srgb,var(--emis-text) 84%,var(--emis-surface));--report-muted:var(--emis-muted);--report-soft:var(--emis-surface-2);--report-border:var(--emis-border);--report-green:var(--emis-success);--report-green-dark:color-mix(in srgb,var(--emis-success) 72%,#000);--report-red:var(--emis-danger);--report-orange:var(--emis-warning);--report-blue:var(--emis-primary);--report-purple:var(--emis-accent);--report-shadow:var(--emis-shadow)}
.academic-settings-page{--aset-blue:var(--emis-primary);--aset-blue-dark:var(--emis-primary-dark);--aset-blue-soft:color-mix(in srgb,var(--emis-primary) 12%,var(--emis-surface));--aset-gold:var(--emis-warning);--aset-gold-soft:color-mix(in srgb,var(--emis-warning) 12%,var(--emis-surface));--aset-text:var(--emis-text);--aset-muted:var(--emis-muted);--aset-border:var(--emis-border);--aset-card:var(--emis-surface);--aset-success:var(--emis-success);--aset-danger:var(--emis-danger);--aset-warning:var(--emis-warning);--aset-shadow:var(--emis-shadow)}
.subject-manager-page{--sub-blue:var(--emis-primary);--sub-blue-dark:var(--emis-primary-dark);--sub-blue-soft:color-mix(in srgb,var(--emis-primary) 12%,var(--emis-surface));--sub-teal:var(--emis-success);--sub-teal-soft:color-mix(in srgb,var(--emis-success) 11%,var(--emis-surface));--sub-purple:var(--emis-accent);--sub-purple-soft:color-mix(in srgb,var(--emis-accent) 11%,var(--emis-surface));--sub-gold:var(--emis-warning);--sub-gold-soft:color-mix(in srgb,var(--emis-warning) 12%,var(--emis-surface));--sub-red:var(--emis-danger);--sub-text:var(--emis-text);--sub-muted:var(--emis-muted);--sub-border:var(--emis-border);--sub-card:var(--emis-surface);--sub-soft:var(--emis-surface-2);--sub-shadow:var(--emis-shadow);--sub-shadow-soft:0 8px 24px color-mix(in srgb,var(--emis-sidebar-deep) 9%,transparent)}
.academic-admin-hub{--aa-ink:var(--emis-text);--aa-muted:var(--emis-muted);--aa-line:var(--emis-border);--aa-accent:var(--emis-primary);--aa-accent-dark:var(--emis-primary-dark);--aa-soft:var(--emis-surface-2);--aa-surface:var(--emis-surface)}
.history-shell{--hist-navy:var(--emis-primary-dark);--hist-blue:var(--emis-primary);--hist-purple:var(--emis-accent);--hist-teal:var(--emis-success);--hist-green:var(--emis-success);--hist-amber:var(--emis-warning);--hist-ink:var(--emis-text);--hist-muted:var(--emis-muted);--hist-line:var(--emis-border);--hist-soft:var(--emis-surface-2)}
.attendance-studio,.ca-page,.admin-results-page,.report-page,.broad-shell,.history-shell{--aw-ink:var(--emis-text);--aw-muted:var(--emis-muted);--aw-line:var(--emis-border);--aw-line-strong:color-mix(in srgb,var(--emis-border) 82%,var(--emis-text) 18%);--aw-bg:var(--emis-bg);--aw-panel:var(--emis-surface);--aw-soft:var(--emis-surface-2);--aw-teal:var(--emis-primary);--aw-teal-deep:var(--emis-primary-dark);--aw-navy:var(--emis-primary-dark);--aw-shadow:var(--emis-shadow)}

/* Full page surfaces: cards, workspaces, tables, utility strips, modal panels and hidden drawers all follow the selected theme. */
html[data-emis-theme] body :where(.dash-hero,.dash-stat-card,.result-pulse-card,.dash-panel,.quick-access-panel:not(.quick-access-top),.academy-header,.academy-context-strip,.academy-snapshot,.academy-panel,.academy-toolbar,.academy-table-wrap,.promotion-header,.class-snapshot-card,.hybrid-class-bar,.promotion-roadmap-panel,.class-operation-card,.promotion-filter-panel,.promotion-table-panel,.promotion-activity-panel,.admin-hub-hero,.admin-hub-section-head,.admin-hub-panel .teacher-directory-card,.admin-hub-panel .teacher-assignment-card,.id-hub-summary,.id-hub-table,.subject-panel,.subject-stat-card,.subject-hero,.subject-card,.subject-catalog-card,.academic-hero,.academic-status-card,.academic-panel,.settings-box,.table-panel,.mini-list-panel,.side-summary-card,.status-row,.attendance-control-dock,.attendance-register-card,.ca-control-panel,.ca-table-card,.results-filter-panel,.result-card,.report-control-panel,.report-data-card,.report-preview-card,.report-cumulative-hub,.report-hybrid-workspace,.broad-controls,.broad-view,.history-toolbar-card,.history-search-card,.history-insight-card,.history-term-card,.modal-content,.cred-container,.dialog-modal,.confirmation-modal,.student-details-modal,.aa-modal-card,.academy-modal-panel,.academy-sync-editor-panel,.report-modal-panel,.attendance-confirm-modal,.attendance-student-modal,.attendance-history-modal,.ca-modal-panel,.ca-quickedit-panel){background:var(--emis-surface)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important;box-shadow:var(--emis-shadow)!important}
html[data-emis-theme] body :where(.academy-overview-lines>button,.academy-overview-lines>button>b,.report-bridge,.filter-control,.promotion-search-box,.rows-per-page-control,.activity-search,.activity-stat-grid article,.transition-flow>div,.operation-metrics>div,.destination-readiness>div,.subject-filter-bar,.subject-search,.subject-card-metric,.subject-card-section,.subject-card-class-list,.id-hub-table th,.identity-summary-grid article,.teacher-directory-controls,.teacher-profile-strip,.teacher-builder-grid,.academic-feature-row span,.academic-rules-panel,.academic-live-card .academic-live-head,.pulse-metrics>div,.spark-wrap,.module-health-list,.smart-alert,.history-view-tabs,.transcript-action-bar,.transcript-student-grid,.transcript-summary-grid article,.transcript-session-head,.transcript-session-metric){background:var(--emis-surface-2)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important}
html[data-emis-theme] body :where(.academy-tabs,.admin-hub-tabs,.activity-tabs,.segmented,.report-app-dock,.report-action-dock,.ca-action-dock,.column-menu,.bulk-bar,.active-filter-bar,.access-policy-strip,.roster-coverage,.score-context-summary,.result-summary-mini){background:var(--emis-surface-3)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important}
html[data-emis-theme] body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea,.promotion-search-box,.activity-search,.inline-search,.module-search){background:var(--emis-surface-2)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important;box-shadow:none!important}html[data-emis-theme] body :where(input,textarea)::placeholder{color:color-mix(in srgb,var(--emis-muted) 76%,transparent)!important}html[data-emis-theme] body :where(input,select,textarea):focus{border-color:var(--emis-focus)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--emis-focus) 18%,transparent)!important}
html[data-emis-theme] body :where(h1,h2,h3,h4,h5,h6,strong,.card-title,.panel-title,.student-name,.subject-name){color:var(--emis-text)}html[data-emis-theme] body :where(p,small,.sub-text,.muted-text,.section-description,.table-scroll-hint,.helper-text,.snapshot-copy span,.academy-section-title p){color:var(--emis-muted)}
html[data-emis-theme] body :where(.academy-table,.promotion-table,.identity-table,.subject-table,.attendance-table,.ca-table,.results-table,.report-test-table,.broad-table,.record-table,.creds-table,.data-table){background:var(--emis-surface)!important;color:var(--emis-text)!important}html[data-emis-theme] body :where(.academy-table,.promotion-table,.identity-table,.subject-table,.attendance-table,.ca-table,.results-table,.report-test-table,.broad-table,.record-table,.creds-table,.data-table) thead th{background:var(--emis-table-head)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important}html[data-emis-theme] body :where(.academy-table,.promotion-table,.identity-table,.subject-table,.attendance-table,.ca-table,.results-table,.report-test-table,.broad-table,.record-table,.creds-table,.data-table) tbody td{color:var(--emis-text)!important;border-color:var(--emis-border)!important}html[data-emis-theme] body :where(.academy-table,.promotion-table,.identity-table,.subject-table,.attendance-table,.ca-table,.results-table,.report-test-table,.broad-table,.record-table,.creds-table,.data-table) tbody tr:nth-child(even){background:var(--emis-table-stripe)!important}html[data-emis-theme] body :where(.academy-table,.promotion-table,.identity-table,.subject-table,.attendance-table,.ca-table,.results-table,.report-test-table,.broad-table,.record-table,.creds-table,.data-table) tbody tr:hover{background:var(--emis-hover)!important}
html[data-emis-theme] body :where(.btn-primary,.primary-btn,.pm-btn-primary,.subject-btn.primary,.teacher-add-button,.identity-primary-btn,.save-btn,.action-btn.primary,.academy-btn.primary,.snapshot-open,.history-btn.primary,.report-mini-btn.primary,.ca-primary-btn){background:linear-gradient(135deg,var(--emis-primary-dark),var(--emis-primary))!important;border-color:var(--emis-primary)!important;color:#fff!important;box-shadow:0 8px 18px color-mix(in srgb,var(--emis-primary) 20%,transparent)!important}html[data-emis-theme] body :where(.btn-secondary,.pm-btn-secondary,.secondary-btn,.table-tool-btn,.icon-filter-btn,.academy-btn.ghost,.subject-btn.secondary,.history-btn:not(.primary),.dash-btn-ghost){background:var(--emis-surface-2)!important;border-color:var(--emis-border)!important;color:var(--emis-text)!important}html[data-emis-theme] body :where(.btn-secondary,.pm-btn-secondary,.secondary-btn,.table-tool-btn,.icon-filter-btn,.academy-btn.ghost,.subject-btn.secondary,.history-btn:not(.primary),.dash-btn-ghost):hover{background:var(--emis-hover)!important;border-color:color-mix(in srgb,var(--emis-primary) 30%,var(--emis-border))!important}
html[data-emis-theme] body :where(.dropdown-menu,.base-dropdown-menu,.base-notif-menu,.theme-menu){background:var(--emis-surface)!important;color:var(--emis-text)!important;border-color:var(--emis-border)!important}.dropdown-menu a,.dropdown-menu button,.base-notif-menu li{color:var(--emis-text)!important}.dropdown-menu a:hover,.dropdown-menu button:hover{background:var(--emis-hover)!important;color:var(--emis-primary)!important}

/* Theme picker upgraded for ten palettes. */
.theme-menu{width:min(560px,calc(100vw - 24px))!important;padding:10px!important;border-radius:17px!important;background:var(--emis-surface)!important;box-shadow:0 24px 64px color-mix(in srgb,var(--emis-sidebar-deep) 28%,transparent)!important}.theme-menu-head{padding:7px 8px 11px}.theme-menu-head strong{font-size:.84rem}.theme-menu-head small{font-size:.65rem}.theme-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.theme-option{min-height:58px;padding:8px 9px;border:1px solid var(--emis-border);background:var(--emis-surface-2);border-radius:12px}.theme-option:hover{background:var(--emis-hover);border-color:color-mix(in srgb,var(--emis-focus) 35%,var(--emis-border))}.theme-option.active{background:color-mix(in srgb,var(--emis-focus) 12%,var(--emis-surface));border-color:color-mix(in srgb,var(--emis-focus) 55%,var(--emis-border));box-shadow:inset 3px 0 0 var(--emis-focus)}.theme-swatch{width:34px;height:34px;border-radius:10px}.theme-option-copy strong{font-size:.76rem}.theme-option-copy small{font-size:.60rem;line-height:1.35}

/* Dashboard surfaces inherit the chosen page theme; the launcher intentionally remains a strong dark app island for legibility. */
html[data-emis-theme] .emis-dashboard .dash-hero{background:linear-gradient(120deg,var(--emis-surface),color-mix(in srgb,var(--emis-surface) 90%,var(--emis-primary) 10%))!important;border-color:var(--emis-border)!important}.emis-dashboard .dash-hero h1,.emis-dashboard .panel-header h2,.emis-dashboard .result-pulse-heading h2{color:var(--emis-text)!important}.emis-dashboard .dash-hero-main>p,.emis-dashboard .dash-stat-copy small,.emis-dashboard .health-row small{color:var(--emis-muted)!important}.emis-dashboard .dash-stat-card,.emis-dashboard .result-pulse-card,.emis-dashboard .dash-panel{background:linear-gradient(180deg,var(--emis-surface),var(--emis-surface-2))!important;border-color:var(--emis-border)!important;color:var(--emis-text)!important}.emis-dashboard .pulse-metrics>div,.emis-dashboard .spark-wrap,.emis-dashboard .health-row,.emis-dashboard .smart-alert{background:var(--emis-surface-2)!important;border-color:var(--emis-border)!important;color:var(--emis-text)!important}

/* True dark themes: every application surface follows the page; no white islands remain. */
html[data-emis-theme="midnight"] body,html[data-emis-theme="deepnavy"] body,html[data-emis-theme="darkviolet"] body{background:linear-gradient(180deg,var(--emis-bg),var(--emis-bg-2))!important;color:var(--emis-text)!important}html[data-emis-theme="midnight"] body :where(.main-content,.admin-page,.admin-shell,.promotion-page,.subject-manager-page,.academic-admin-hub,.teacher-phase3,.academy-page,.attendance-studio,.ca-page,.admin-results-page,.report-page,.broad-shell,.history-shell,.academic-settings-page),html[data-emis-theme="deepnavy"] body :where(.main-content,.admin-page,.admin-shell,.promotion-page,.subject-manager-page,.academic-admin-hub,.teacher-phase3,.academy-page,.attendance-studio,.ca-page,.admin-results-page,.report-page,.broad-shell,.history-shell,.academic-settings-page),html[data-emis-theme="darkviolet"] body :where(.main-content,.admin-page,.admin-shell,.promotion-page,.subject-manager-page,.academic-admin-hub,.teacher-phase3,.academy-page,.attendance-studio,.ca-page,.admin-results-page,.report-page,.broad-shell,.history-shell,.academic-settings-page){color:var(--emis-text)!important;background-color:transparent!important}.emis-theme-dark .sidebar-overlay{background:rgba(0,0,0,.68)!important}

/* Official report cards remain paper-white in every app theme. */
html[data-emis-theme] .generated-report-sheet,html[data-emis-theme] .emis-report-card{background:#fff!important;color:#05070b!important}html[data-emis-theme] .generated-report-sheet :where(h1,h2,h3,h4,h5,h6,strong,span,small,td,th,label,p),html[data-emis-theme] .emis-report-card :where(h1,h2,h3,h4,h5,h6,strong,span,small,td,th,label,p){color:inherit}html[data-emis-theme] .report-sheet-canvas{background:color-mix(in srgb,var(--emis-bg) 82%,var(--emis-surface))!important}

/* Mobile keeps the same semantic surfaces instead of reverting to old white hard-codes. */
.emis-mobile-dock{background:color-mix(in srgb,var(--emis-surface) 96%,transparent)!important;border-color:var(--emis-border)!important;box-shadow:0 -12px 34px color-mix(in srgb,var(--emis-sidebar-deep) 18%,transparent)!important}.emis-mobile-dock a,.emis-mobile-dock button{color:var(--emis-muted)!important}.emis-mobile-dock a.active{color:var(--emis-primary)!important}.header-mobile-menu{border-color:color-mix(in srgb,#fff 12%,transparent)!important;background:color-mix(in srgb,#fff 8%,transparent)!important}
@media(max-width:900px){.theme-menu{position:fixed!important;top:auto!important;right:10px!important;bottom:78px!important;left:10px!important;width:auto!important;max-height:72dvh;overflow:auto}.theme-options{grid-template-columns:1fr 1fr}.theme-menu-head{position:sticky;top:-10px;z-index:2;background:var(--emis-surface)}}
@media(max-width:560px){.theme-options{grid-template-columns:1fr}.theme-option{min-height:52px}.theme-option-copy small{display:block}}
@media print{html[data-emis-theme],html[data-emis-theme] body{background:#fff!important;color:#000!important}.top-header,.sidebar,.emis-mobile-dock,.base-footer{print-color-adjust:exact}.generated-report-sheet,.emis-report-card,#reportSheetCanvas,#pdfPreviewCanvas{background:#fff!important;color:#05070b!important}}

/* Themed hero gradients keep every palette premium instead of flat. */
html[data-emis-theme] body :where(.academy-header,.promotion-header,.admin-hub-hero,.subject-hero,.academic-hero,.attendance-ribbon,.ca-hero,.results-header,.report-hero,.broad-hero,.history-hero){background:linear-gradient(125deg,var(--emis-surface) 0%,color-mix(in srgb,var(--emis-surface) 90%,var(--emis-primary) 10%) 58%,color-mix(in srgb,var(--emis-surface) 93%,var(--emis-accent) 7%) 100%)!important;border-color:var(--emis-border)!important;color:var(--emis-text)!important}
html[data-emis-theme] .emis-dashboard .academic-period-card{background:linear-gradient(135deg,var(--emis-primary-dark),var(--emis-primary) 66%,color-mix(in srgb,var(--emis-primary) 76%,var(--emis-accent) 24%))!important;border-color:color-mix(in srgb,#fff 12%,transparent)!important;color:#fff!important;box-shadow:0 16px 34px color-mix(in srgb,var(--emis-primary-dark) 28%,transparent)!important}html[data-emis-theme] .emis-dashboard .academic-period-card :where(strong,b,span,small,i){color:inherit!important}
