.theme-switch{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;font:12px/1.4 "Segoe UI",sans-serif;color:#675045}
.theme-switch select{width:auto!important;min-height:36px;padding:7px 24px 7px 10px!important;border:1px solid #e2d7cc!important;border-radius:9px;background:#fffdfa;color:#4a0000;cursor:pointer;font:inherit}
.theme-switch select:focus-visible{outline:2px solid #fcb31a;outline-offset:3px}
.auth-card>.theme-switch{display:flex;justify-content:flex-end;margin-bottom:22px}
@media(max-width:1200px){.theme-switch>span{display:none}.topbar-right{gap:8px!important}}
@media(max-width:650px){.topbar{flex-wrap:wrap;height:auto;min-height:72px;gap:10px!important}.topbar-right{flex-wrap:wrap}.ex-top .theme-switch select{font-size:10px;min-height:30px}.ex-top>div{gap:6px!important}.ex-top .read-tag{display:none}}
/* Screen-only: document images, signatures and print styles retain original colours. */
html[data-theme="dark"]{color-scheme:dark;--surface-0:#211c21;--surface-50:#171418;--surface-100:#302830;--line:#44363d;--ink-900:#f3ece7;--ink-700:#e0d3cc;--ink-500:#c0aca4;--ink-300:#ac9893;--ink:#f3ece7;--muted:#c0aca4;--maroon:#efb7ae}
html[data-theme="dark"] body{background:#171418!important;color:#f3ece7!important}
html[data-theme="dark"] :is(.topbar,.ex-top,.panel,.card,.kpi,.kpi-card,.stat-chip,.table-wrap,.filters,.auth-card,.modal-content,.modal-box,.modal-header,.modal-footer,.installment-card,.record-details,.notification-dropdown,.shortcuts-modal){background:#211c21!important;border-color:#44363d!important;color:#f3ece7!important;box-shadow:0 5px 20px #0002!important}
html[data-theme="dark"] :is(.main-content,.content,.dashboard-content,.auth-form-side,.auth-card-outer){background:transparent!important}
html[data-theme="dark"] :is(h1,h2,h3,h4,.page-title,.kpi-value,.kpi-label,.kpi>span,.identity,.form-field label,.filters label,.a-title,.section-kicker,.record-details strong){color:#f3ece7!important}
html[data-theme="dark"] :is(p,.hint,.page-crumb,.section-period,.note,.a-time,footer,.record-details span){color:#c0aca4!important}
html[data-theme="dark"] :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]),select,textarea,.search-box){background:#18151a!important;color:#f3ece7!important;border-color:#66505a!important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#b9a5ae!important;opacity:1}
html[data-theme="dark"] :is(th,.data-table thead th){background:#30262d!important;color:#e1c8b2!important;border-color:#44363d!important}
html[data-theme="dark"] :is(td,.data-table tbody td,.list-row,.activity-item){color:#e8dcd5!important;border-color:#44363d!important}
html[data-theme="dark"] :is(tbody tr:hover,.data-table tbody tr:hover,.activity-item:hover){background:#362b32!important}
html[data-theme="dark"] :is(.text-link,.panel-head .link,.big-value,summary,.kpi>a){color:#f0c58b!important}
html[data-theme="dark"] :is(.btn.ghost,.btn-sm:not(.solid),.secondary,.icon-btn,.filter-tabs){background:#30262d!important;color:#f5d1a5!important;border-color:#66505a!important}
html[data-theme="dark"] :is(.btn.solid,.filters button,.auth-card button[type=submit]){background:#791d2a!important;color:white!important;border-color:#b5676b!important}
html[data-theme="dark"] .featured{background:linear-gradient(125deg,#4a0000,#6e0101)!important}
html[data-theme="dark"] .theme-switch{color:#dfc9ba}
html[data-theme="dark"] .track{background:#47343a}
html[data-theme="dark"] .chart-scroll text{fill:#c0aca4}
html[data-theme="dark"] .chart-scroll line{stroke:#66505a}
html[data-theme="dark"] .ex-shell .page-title{background:linear-gradient(120deg,#4a0000,#6e0101)!important}
html[data-theme="dark"] .login-page .auth-card{padding:24px;border-radius:18px}
html[data-theme="dark"] :is(.pill,.read-tag){border:1px solid #655142}
html[data-theme="dark"] .auth-card :is(label,.help-title){color:#dfd0c7!important}
html[data-theme="dark"] .app-shell,html[data-theme="dark"] .app-shell .main{background:#171418!important}
html[data-theme="dark"] .app-shell .topbar .search-box,html[data-theme="dark"] .app-shell .topbar .icon-btn{background:#30262d!important;color:#f5d1a5!important;border-color:#66505a!important}
html[data-theme="dark"] :is(.section-period,.kpi-trend,.activity-live){background:#30262d!important;color:#dfc9ba!important;border-color:#66505a!important}
/* Shared component contrast: later light-only polish must not leak into dark mode. */
html[data-theme="dark"] .app-shell{--line:#44363d;--success:#8fe0b0;--warning:#f2c879;--danger:#ffaaa7}
html[data-theme="dark"] :is(.search-hero,.student-card,.employee-card,.empty-state,.date-nav,.attendance-row,.fee-breakdown,.payment-method-badge,.shortcuts-modal-body,.shortcuts-modal-head){background:#211c21!important;background-image:none!important;border-color:#44363d!important;color:#f3ece7!important;box-shadow:none!important}
html[data-theme="dark"] .app-shell .data-table tbody tr{background:#211c21!important}
html[data-theme="dark"] .app-shell .data-table tbody tr:nth-child(even){background:#292229!important}
html[data-theme="dark"] .app-shell .data-table tbody tr:hover{background:#382c35!important}
html[data-theme="dark"] :is(.data-table td strong,.stat-chip .v,.stat-chip .l,.empty-state h4,.fee-row.total,.salary-breakdown-row.total,.date-nav .day-label){color:#f3ece7!important}
html[data-theme="dark"] :is(.content,.ex-shell main) a:not(.btn):not(.btn-sm):not(.admission-choice):not(.contact-action):not(.welcome-primary):not(.welcome-secondary){color:#f4cc92!important}
html[data-theme="dark"] .app-shell :is(.btn,.btn-sm,.tab-item,.nav-arrow){background:#30262d!important;color:#f5d1a5!important;border-color:#76606a!important}
html[data-theme="dark"] .app-shell :is(.btn.solid,.btn-sm.solid,.tab-item.active){background:#791d2a!important;color:#fff!important;border-color:#b5676b!important}
html[data-theme="dark"] .app-shell .icon-btn svg{color:#f5d1a5!important;stroke:currentColor}
html[data-theme="dark"] :is(.pill,.att-pill,.status-toggle label,.read-tag,.payment-method-badge){background:#30262d!important;color:#e5d8cf!important;border-color:#66505a!important}
html[data-theme="dark"] :is(.pill.active,.pill.paid,.att-pill.Present,.status-toggle input:checked+label.present,.flash-success,.contact-action){background:#183c2c!important;color:#a4ebbc!important;border-color:#416d53!important}
html[data-theme="dark"] :is(.pill.pending,.pill.partial,.att-pill.Leave,.status-toggle input:checked+label.leave){background:#43331d!important;color:#f7d18c!important;border-color:#7c6036!important}
html[data-theme="dark"] :is(.pill.dropped,.pill.unpaid,.att-pill.Absent,.status-toggle input:checked+label.absent,.flash-error,.auth-error){background:#462328!important;color:#ffb9b3!important;border-color:#855058!important}
html[data-theme="dark"] .status-toggle input:checked+label{outline:2px solid currentColor;outline-offset:1px}
html[data-theme="dark"] :is(.flash-success,.flash-error,.auth-error) :is(p,span,strong){color:inherit!important}
html[data-theme="dark"] :is(.fee-row .neg,[style*="color:var(--maroon-700)"],[style*="color: var(--maroon-700)"]){color:#f4cc92!important}
html[data-theme="dark"] :is(.inst-num,.kpi-icon){background:#3b2930!important;color:#f7ce96!important}
html[data-theme="dark"] :is(.form-actions,.section-divider,hr,.shortcuts-row,.salary-breakdown-row){border-color:#44363d!important}
html[data-theme="dark"] :is([id$="Modal"],[id$="modal"])>div,html[data-theme="dark"] .topbar details>div{background:#211c21!important;color:#f3ece7!important;border-color:#66505a!important}
html[data-theme="dark"] .topbar details>div :is(a,button){color:#f4cc92!important}
html[data-theme="dark"] .topbar details>div :is([style*="background"],.notification-item){background:#292229!important;color:#f3ece7!important;border-color:#44363d!important}
html[data-theme="dark"] :is(.empty-state,.search-hero) p{color:#d4bfb5!important}
html[data-theme="dark"] :is(input,select,textarea,button,a):focus-visible{outline:2px solid #fcb31a!important;outline-offset:3px}
.theme-switch{position:relative;border:1px solid var(--line,#e8e2d9);border-radius:11px;background:var(--surface-0,#fff);padding:4px 7px;gap:8px;min-height:42px}
.theme-switch>span{font-size:11px;padding-left:5px}.theme-switch>svg{width:19px;height:19px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.theme-switch select{border:0!important;background:transparent!important;padding-left:2px!important;min-height:32px}
html[data-theme="dark"] .theme-switch{background:#211c21;border-color:#66505a;color:#f5d1a5}
html[data-theme="dark"] .theme-switch select{background:transparent!important}.auth-card>.theme-switch{width:fit-content;margin-left:auto}
.theme-switch{gap:3px;padding:5px;border-radius:14px;background:#f6f2ee;border-color:#e6dbd2;min-height:46px}
.theme-switch>span{padding:0 10px 0 6px;font-weight:600;color:#7a655a}
.theme-switch .theme-mode{display:flex;align-items:center;justify-content:center;gap:6px;min-width:36px;min-height:34px;padding:7px 9px;border:1px solid transparent;border-radius:9px;background:transparent;color:#81695d;font:600 11px/1.2 "Segoe UI",sans-serif;cursor:pointer;box-shadow:none;transition:background .15s,color .15s,box-shadow .15s}
.theme-switch .theme-mode svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-switch .theme-mode:hover{background:#eadfd5;color:#751926}
.theme-switch .theme-mode[aria-pressed="true"]{background:#fff;color:#781d29;border-color:#e3d3c6;box-shadow:0 2px 5px #4b1f1712}
.theme-switch .theme-mode:focus-visible{outline:2px solid #be873b;outline-offset:2px}
html[data-theme="dark"] .theme-switch{background:#18151a;border-color:#53414a}
html[data-theme="dark"] .theme-switch>span{color:#cdb9ad}
html[data-theme="dark"] .theme-switch .theme-mode{color:#bfa9a0;background:transparent}
html[data-theme="dark"] .theme-switch .theme-mode:hover{background:#35272f;color:#f3d4a6}
html[data-theme="dark"] .theme-switch .theme-mode[aria-pressed="true"]{background:#4c3038;border-color:#8d6265;color:#ffdc9c;box-shadow:0 2px 6px #0003}
@media(max-width:1500px){.topbar .theme-mode span,.ex-top .theme-mode span{display:none}}
@media(prefers-reduced-motion:reduce){.theme-switch .theme-mode{transition:none}}
