/**
 * SLS ERP — Global dark mode (loads after page CSS to override light !important rules)
 */

html[data-theme="dark"] {
    --school-panel: #1e293b;
    --school-panel-soft: #172033;
    --school-border: #334155;
    --school-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    --school-shadow-hover: 0 18px 42px rgba(0, 0, 0, 0.45);
    --sls-dark-surface: #1e293b;
    --sls-dark-surface-raised: #243044;
    --sls-dark-surface-soft: #172033;
    --sls-dark-border: #334155;
    --sls-dark-border-soft: #475569;
    --sls-dark-text: #f1f5f9;
    --sls-dark-text-muted: #94a3b8;
    --sls-dark-text-subtle: #64748b;
    --sls-dark-link: #5eead4;
    --sls-dark-link-hover: #99f6e4;
    --sls-dark-input-bg: #0f172a;
    --sls-dark-hover: rgba(148, 163, 184, 0.12);
}

/* ── Main panels & cards ── */
html[data-theme="dark"] #main-content .bg-white,
html[data-theme="dark"] #main-content .bg-white\/90,
html[data-theme="dark"] #mainDataBoard {
    background: linear-gradient(180deg, var(--sls-dark-surface) 0%, var(--sls-dark-surface-soft) 100%) !important;
    border-color: var(--sls-dark-border) !important;
    box-shadow: var(--school-shadow) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-md {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .hover\:bg-slate-50:hover,
html[data-theme="dark"] tr.hover\:bg-slate-50:hover {
    background-color: var(--sls-dark-hover) !important;
}

/* ── Typography ── */
html[data-theme="dark"] .text-slate-300 { color: #cbd5e1 !important; }
html[data-theme="dark"] .text-slate-400 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-slate-500 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-slate-600 { color: #cbd5e1 !important; }
html[data-theme="dark"] .text-slate-700 { color: #e2e8f0 !important; }
html[data-theme="dark"] .text-slate-800 { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-slate-900 { color: #f8fafc !important; }

html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-500,
html[data-theme="dark"] a.text-blue-600,
html[data-theme="dark"] .sls-student-hover-link {
    color: var(--sls-dark-link) !important;
}

html[data-theme="dark"] a.text-blue-600:hover,
html[data-theme="dark"] .sls-student-hover-link:hover {
    color: var(--sls-dark-link-hover) !important;
}

html[data-theme="dark"] .text-teal-600,
html[data-theme="dark"] .text-teal-700 { color: #2dd4bf !important; }
html[data-theme="dark"] .text-emerald-500,
html[data-theme="dark"] .text-emerald-600 { color: #34d399 !important; }
html[data-theme="dark"] .text-amber-500,
html[data-theme="dark"] .text-amber-600 { color: #fbbf24 !important; }

/* ── Borders & dividers ── */
html[data-theme="dark"] .border-slate-50,
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-slate-300,
html[data-theme="dark"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-amber-50 {
    background-color: var(--sls-dark-surface-raised) !important;
}

/* ── Filter pills ── */
html[data-theme="dark"] .filter-btn:not(.active) {
    background: linear-gradient(180deg, #243044 0%, #1a2435 100%) !important;
    color: #e2e8f0 !important;
    border-color: var(--sls-dark-border-soft) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .filter-btn:not(.active):hover {
    background: linear-gradient(180deg, #2d3a50 0%, #243044 100%) !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .filter-btn.active {
    box-shadow: 0 12px 24px rgba(13, 148, 136, 0.35) !important;
}

/* ── Tables ── */
html[data-theme="dark"] #studentsTable,
html[data-theme="dark"] #studentsTable thead,
html[data-theme="dark"] table {
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #studentsTable thead th,
html[data-theme="dark"] #studentsTable thead .col-select {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #studentsTable tbody tr,
html[data-theme="dark"] #students-tbody tr {
    background-color: transparent;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #studentsTable tbody td,
html[data-theme="dark"] #students-tbody td {
    background-color: transparent !important;
    border-color: var(--sls-dark-border) !important;
    color: #e2e8f0;
}

html[data-theme="dark"] #studentsTable tbody .col-select {
    background: var(--sls-dark-surface) !important;
}

html[data-theme="dark"] #students-tbody tr:hover td {
    background: rgba(51, 65, 85, 0.55) !important;
}

html[data-theme="dark"] #studentsTable thead th .sort-link {
    color: #cbd5e1;
}

html[data-theme="dark"] #studentsTable thead th .sort-link:hover {
    color: #5eead4;
}

html[data-theme="dark"] .overflow-x-auto.rounded-lg.border {
    border-color: var(--sls-dark-border) !important;
}

/* ── Summary cards ── */
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .summary-card[data-card-type='active'],
html[data-theme="dark"] .summary-card[data-card-type='applications'],
html[data-theme="dark"] .summary-card[data-card-type='inactive'],
html[data-theme="dark"] .summary-card[data-card-type='bus'] {
    background: linear-gradient(180deg, var(--sls-dark-surface) 0%, var(--sls-dark-surface-soft) 100%) !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .summary-card::after {
    background: radial-gradient(circle at center, rgba(148, 163, 184, 0.08) 0%, transparent 66%) !important;
}

html[data-theme="dark"] .summary-card-collapse-btn {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: var(--sls-dark-border) !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .summary-card-collapse-btn:hover {
    color: #5eead4 !important;
    border-color: #0d9488 !important;
}

html[data-theme="dark"] .summary-mini-filter[data-card-type='old_students'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='bus_old_subscription'] {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.45) 0%, rgba(15, 118, 110, 0.25) 100%) !important;
    color: #99f6e4 !important;
    border-color: rgba(45, 212, 191, 0.35) !important;
}

html[data-theme="dark"] .summary-mini-filter[data-card-type='newly_applied_this_year'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='approved_and_active'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='bus_new_subscription'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='approved'] {
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.45) 0%, rgba(16, 185, 129, 0.2) 100%) !important;
    color: #6ee7b7 !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
}

html[data-theme="dark"] .summary-mini-filter[data-card-type='waiting_list'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='pending_subscription'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='bus_pending_subscription'] {
    background: linear-gradient(135deg, rgba(124, 45, 18, 0.45) 0%, rgba(217, 119, 6, 0.2) 100%) !important;
    color: #fdba74 !important;
    border-color: rgba(251, 146, 60, 0.35) !important;
}

html[data-theme="dark"] .summary-mini-filter[data-card-type='canceled_application'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='bus_canceled_subscription'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='canceled'] {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.55) 0%, rgba(71, 85, 105, 0.35) 100%) !important;
    color: #cbd5e1 !important;
    border-color: var(--sls-dark-border-soft) !important;
}

html[data-theme="dark"] .summary-mini-filter[data-card-type='rejected_application'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='bus_rejected_subscription'],
html[data-theme="dark"] .summary-mini-filter[data-card-type='rejected'] {
    background: linear-gradient(135deg, rgba(136, 19, 55, 0.45) 0%, rgba(225, 29, 72, 0.2) 100%) !important;
    color: #fda4af !important;
    border-color: rgba(244, 63, 94, 0.35) !important;
}

/* ── Toolbar buttons ── */
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .year-filter-shell,
html[data-theme="dark"] #exportDropdown > button,
html[data-theme="dark"] #columnsDropdown > button,
html[data-theme="dark"] #toggleFiltersBtn,
html[data-theme="dark"] #bubbleToggleDropdown > button,
html[data-theme="dark"] #toggleSummaryGridBtn,
html[data-theme="dark"] #collapseAllSummaryCardsBtn {
    background: linear-gradient(180deg, #243044 0%, #1a2435 100%) !important;
    color: #e2e8f0 !important;
    border-color: var(--sls-dark-border-soft) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .year-filter-shell:hover,
html[data-theme="dark"] #toggleSummaryGridBtn:hover,
html[data-theme="dark"] #collapseAllSummaryCardsBtn:hover {
    background: linear-gradient(180deg, #2d3a50 0%, #243044 100%) !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .btn-primary {
    box-shadow: 0 12px 24px rgba(13, 148, 136, 0.35) !important;
}

/* ── Dropdowns ── */
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .col-dropdown-menu,
html[data-theme="dark"] .bubble-dropdown-menu {
    background: #0f172a !important;
    border-color: var(--sls-dark-border) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55) !important;
}

html[data-theme="dark"] .dropdown a,
html[data-theme="dark"] .col-dropdown-item {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .dropdown a:hover,
html[data-theme="dark"] .col-dropdown-item:hover {
    background: var(--sls-dark-hover) !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .dropdown-menu .sticky,
html[data-theme="dark"] .col-dropdown-menu .sticky {
    background: #0f172a !important;
}

/* ── Form controls ── */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--sls-dark-input-bg) !important;
    color: var(--sls-dark-text) !important;
    border-color: var(--sls-dark-border-soft) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: #14b8a6 !important;
    outline-color: rgba(20, 184, 166, 0.35);
}

html[data-theme="dark"] #yearFilter {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] option {
    background: #0f172a;
    color: #f1f5f9;
}

/* ── Tom Select ── */
html[data-theme="dark"] .ts-wrapper .ts-control,
html[data-theme="dark"] .ts-wrapper.single.input-active .ts-control,
html[data-theme="dark"] .ts-wrapper.multi .ts-control {
    background: var(--sls-dark-input-bg) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: var(--sls-dark-text) !important;
}

html[data-theme="dark"] .ts-dropdown {
    background-color: #0f172a !important;
    border-color: var(--sls-dark-border) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55) !important;
}

html[data-theme="dark"] .ts-dropdown .option {
    color: #e2e8f0;
}

html[data-theme="dark"] .ts-dropdown .option:hover,
html[data-theme="dark"] .ts-dropdown .active {
    background-color: #0f766e !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .ts-wrapper.multi .ts-control > div {
    background: rgba(13, 148, 136, 0.25) !important;
    color: #99f6e4 !important;
    border-color: rgba(45, 212, 191, 0.35) !important;
}

html[data-theme="dark"] .tag-chip {
    background: rgba(13, 148, 136, 0.2) !important;
    border-color: rgba(45, 212, 191, 0.35) !important;
    color: #99f6e4 !important;
}

/* ── Modals ── */
html[data-theme="dark"] .sls-student-modal-backdrop {
    background: rgba(2, 6, 23, 0.72) !important;
}

html[data-theme="dark"] #studentModalContent,
html[data-theme="dark"] #fpIncomeModalContent,
html[data-theme="dark"] #extraFeeModalPanel,
html[data-theme="dark"] .sls-student-modal-panel {
    background: var(--sls-dark-surface) !important;
    color: var(--sls-dark-text);
    border: 1px solid var(--sls-dark-border) !important;
}

html[data-theme="dark"] .sls-modal-shell-footer,
html[data-theme="dark"] .sls-modal-shell-footer .btn-secondary {
    background: linear-gradient(180deg, #243044 0%, #1a2435 100%) !important;
    border-color: var(--sls-dark-border) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-modal-shell-footer .btn-secondary:hover {
    background: #2d3a50 !important;
}

/* ── Attendance page ── */
html[data-theme="dark"] .att-toggle {
    border-color: var(--sls-dark-border) !important;
    background: var(--sls-dark-surface-raised) !important;
}

html[data-theme="dark"] .att-toggle label {
    color: #cbd5e1 !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .adv-dropzone {
    background-color: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: #cbd5e1;
}

html[data-theme="dark"] .adv-dropzone.dragover {
    background-color: rgba(37, 99, 235, 0.15) !important;
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] .staged-file-card {
    background: var(--sls-dark-surface) !important;
    border-color: var(--sls-dark-border) !important;
    color: #e2e8f0;
}

/* ── Attendance page ── */
html[data-theme="dark"] .sls-attendance-page #students-tbody td,
html[data-theme="dark"] .sls-attendance-page #students-tbody tr td {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--present,
html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--present > td {
    background-color: rgba(16, 185, 129, 0.14) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--absent,
html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--absent > td {
    background-color: rgba(239, 68, 68, 0.14) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--late,
html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--late > td {
    background-color: rgba(245, 158, 11, 0.14) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--excused,
html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--excused > td {
    background-color: rgba(59, 130, 246, 0.14) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--present:hover > td {
    background-color: rgba(16, 185, 129, 0.26) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--absent:hover > td {
    background-color: rgba(239, 68, 68, 0.26) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--late:hover > td {
    background-color: rgba(245, 158, 11, 0.26) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.sls-att-row--excused:hover > td {
    background-color: rgba(59, 130, 246, 0.26) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr:hover > td,
html[data-theme="dark"] .sls-attendance-page #students-tbody tr.student-row:hover td {
    background-color: rgba(51, 65, 85, 0.58) !important;
}

html[data-theme="dark"] .sls-attendance-page #students-tbody tr.student-row:hover {
    box-shadow: inset 3px 0 0 #14b8a6;
}

html[data-theme="dark"] .sls-attendance-page .att-toggle {
    border-color: var(--sls-dark-border) !important;
    background: var(--sls-dark-surface-raised) !important;
}

html[data-theme="dark"] .sls-attendance-page .att-toggle label,
html[data-theme="dark"] .sls-attendance-page .att-toggle .sls-pale-btn {
    background-color: var(--sls-dark-surface-raised) !important;
    color: #94a3b8 !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .sls-attendance-page .att-toggle .sls-pale-btn.sls-pale-active.sls-pale-btn--p,
html[data-theme="dark"] .sls-attendance-page .att-toggle input[value="Present"]:checked + label {
    background-color: #10b981 !important;
    color: #fff !important;
}

html[data-theme="dark"] .sls-attendance-page .att-toggle .sls-pale-btn.sls-pale-active.sls-pale-btn--a,
html[data-theme="dark"] .sls-attendance-page .att-toggle input[value="Absent"]:checked + label {
    background-color: #ef4444 !important;
    color: #fff !important;
}

html[data-theme="dark"] .sls-attendance-page .att-toggle .sls-pale-btn.sls-pale-active.sls-pale-btn--l,
html[data-theme="dark"] .sls-attendance-page .att-toggle input[value="Late"]:checked + label {
    background-color: #f59e0b !important;
    color: #fff !important;
}

html[data-theme="dark"] .sls-attendance-page .att-toggle .sls-pale-btn.sls-pale-active.sls-pale-btn--e,
html[data-theme="dark"] .sls-attendance-page .att-toggle input[value="Excused"]:checked + label {
    background-color: #3b82f6 !important;
    color: #fff !important;
}

html[data-theme="dark"] .sls-attendance-page .summary-card.bg-white {
    background: var(--sls-dark-surface) !important;
    border-color: var(--sls-dark-border) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32) !important;
}

html[data-theme="dark"] .sls-attendance-page .summary-card:hover {
    filter: none !important;
    transform: translateY(-3px);
    border-color: rgba(45, 212, 191, 0.38) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42) !important;
}

html[data-theme="dark"] .sls-attendance-page .col-attendance_notes input {
    background: var(--sls-dark-input-bg) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-attendance-page .col-attendance_docs button,
html[data-theme="dark"] .sls-attendance-page .bg-slate-100.border-slate-200 {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border) !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-attendance-page .col-attendance_docs button:hover {
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .sls-attendance-page .col-daily_reports .bg-indigo-50 {
    background: rgba(99, 102, 241, 0.18) !important;
    border-color: rgba(129, 140, 248, 0.35) !important;
    color: #c7d2fe !important;
}

html[data-theme="dark"] .sls-attendance-page .col-daily_reports .bg-indigo-50:hover {
    background: #4f46e5 !important;
    color: #fff !important;
}

/* Attendance modals */
html[data-theme="dark"] #docsModal .bg-white,
html[data-theme="dark"] #reportModal .bg-white,
html[data-theme="dark"] #docsModal form.bg-white,
html[data-theme="dark"] #reportModal .bg-white.border {
    background: var(--sls-dark-surface) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #docsModal .bg-slate-50,
html[data-theme="dark"] #reportModal .bg-indigo-50,
html[data-theme="dark"] #docsModal .bg-slate-50\/30,
html[data-theme="dark"] #reportModal .bg-slate-50\/50,
html[data-theme="dark"] #reportModal .bg-slate-100 {
    background: #172033 !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #reportModal .text-indigo-800,
html[data-theme="dark"] #reportModal .text-indigo-600 {
    color: #c7d2fe !important;
}

html[data-theme="dark"] #reportModal .text-indigo-400 {
    color: #a5b4fc !important;
}

html[data-theme="dark"] .sls-pale-btn {
    background-color: var(--sls-dark-surface-raised) !important;
    color: #cbd5e1 !important;
}

/* ── Loader & misc ── */
html[data-theme="dark"] .loader {
    border-color: #334155;
    border-top-color: #14b8a6;
}

html[data-theme="dark"] #backdrop {
    background-color: rgba(0, 0, 0, 0.65) !important;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f172a;
}

html[data-theme="dark"] #students-tbody::-webkit-scrollbar-thumb {
    background: #475569;
}

html[data-theme="dark"] #students-tbody::-webkit-scrollbar-track {
    background: #0f172a;
}

/* ── Bulk toolbar ── */
html[data-theme="dark"] .sls-bulk-toolbar {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18) 0%, rgba(15, 23, 42, 0.95) 48%, #172033 100%) !important;
    border-color: rgba(45, 212, 191, 0.35) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .sls-bulk-toolbar-selection {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .sls-bulk-toolbar-count {
    color: #5eead4 !important;
}

html[data-theme="dark"] .sls-bulk-btn--secondary,
html[data-theme="dark"] .sls-bulk-btn--ghost,
html[data-theme="dark"] .sls-bulk-btn--clear-selection,
html[data-theme="dark"] .sls-clear-filters-btn {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-bulk-btn--secondary:hover,
html[data-theme="dark"] .sls-bulk-btn--ghost:hover,
html[data-theme="dark"] .sls-bulk-btn--clear-selection:hover,
html[data-theme="dark"] .sls-clear-filters-btn:hover {
    background: rgba(13, 148, 136, 0.2) !important;
    border-color: #14b8a6 !important;
    color: #99f6e4 !important;
}

html[data-theme="dark"] .sls-bulk-export-menu {
    background: #0f172a !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .sls-bulk-export-item {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-bulk-export-item:hover {
    background: var(--sls-dark-hover) !important;
}

html[data-theme="dark"] .sls-student-save-menu {
    background: #0f172a !important;
    border-color: var(--sls-dark-border) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .sls-student-save-menu-title {
    color: #94a3b8;
}

html[data-theme="dark"] .sls-student-save-menu-item {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-student-save-menu-item:hover,
html[data-theme="dark"] .sls-student-save-menu-item:focus-visible {
    background: var(--sls-dark-hover) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .sls-student-save-menu-name {
    color: #f8fafc !important;
}

html[data-theme="dark"] .sls-student-save-badge--grade {
    background: rgba(8, 145, 178, 0.2) !important;
    color: #67e8f9 !important;
    border-color: rgba(103, 232, 249, 0.35) !important;
}

html[data-theme="dark"] .sls-student-save-badge--class {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #c7d2fe !important;
    border-color: rgba(199, 210, 254, 0.35) !important;
}

html[data-theme="dark"] .row-selected .col-select,
html[data-theme="dark"] .row-selected td {
    background: rgba(13, 148, 136, 0.15) !important;
}

/* ── Student modal internals ── */
html[data-theme="dark"] #studentModalContent,
html[data-theme="dark"] #studentModalContent.bg-white {
    background: var(--sls-dark-surface) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #modalDragHandle,
html[data-theme="dark"] #studentModalContent #modalDragHandle {
    background: linear-gradient(180deg, #243044 0%, #1e293b 100%) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #studentModalContent .sls-student-modal-tabs-bar,
html[data-theme="dark"] #studentModalContent .sls-student-modal-tabs-bar.bg-slate-50 {
    background: #172033 !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #studentModalContent #studentForm > .p-6,
html[data-theme="dark"] #studentModalContent .tab-content,
html[data-theme="dark"] #studentModalContent .bg-slate-50\/50 {
    background: rgba(15, 23, 42, 0.55) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #studentModalContent .bg-white,
html[data-theme="dark"] #studentModalContent .form-section-wrapper,
html[data-theme="dark"] #studentModalContent .legal-docs-container {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #studentModalContent .bg-slate-50,
html[data-theme="dark"] #studentModalContent .bg-slate-50\/50,
html[data-theme="dark"] #studentModalContent .bg-indigo-50\/50,
html[data-theme="dark"] #studentModalContent .bg-orange-50\/50 {
    background: rgba(30, 41, 59, 0.65) !important;
}

html[data-theme="dark"] #studentModalContent .border-indigo-200,
html[data-theme="dark"] #studentModalContent .border-orange-200 {
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #studentModalContent .p-5.bg-white.border-t,
html[data-theme="dark"] #studentModalContent form > .bg-white.border-t {
    background: linear-gradient(180deg, #243044 0%, #1e293b 100%) !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #studentModalContent .ring-slate-200 {
    --tw-ring-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] .sls-modal-title-main,
html[data-theme="dark"] .sls-modal-title-name-value,
html[data-theme="dark"] #modalTitle.sls-modal-title,
html[data-theme="dark"] #modalTitle .text-slate-800 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .sls-modal-title-meta {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-modal-title-loading {
    color: #64748b !important;
}

html[data-theme="dark"] .sls-modal-title-name-row--en .sls-modal-title-name-tag {
    background: rgba(37, 99, 235, 0.25) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
}

html[data-theme="dark"] .sls-modal-title-name-row--ar .sls-modal-title-name-tag {
    background: rgba(217, 119, 6, 0.25) !important;
    color: #fcd34d !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
}

html[data-theme="dark"] .sls-family-name-lang {
    background: #1e293b !important;
    border-color: rgba(167, 139, 250, 0.35) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .sls-family-name-lang__btn {
    color: #c4b5fd !important;
}

html[data-theme="dark"] .sls-family-name-lang__btn + .sls-family-name-lang__btn {
    border-inline-start-color: rgba(167, 139, 250, 0.35) !important;
}

html[data-theme="dark"] .sls-family-name-lang__btn:hover {
    background: rgba(139, 92, 246, 0.18) !important;
}

html[data-theme="dark"] .sls-family-name-lang__btn.is-active {
    background: #7c3aed !important;
    color: #fff !important;
}

html[data-theme="dark"] .sls-popup-lang,
html[data-theme="dark"] .sls-student-form-lang {
    background: #1e293b !important;
    border-color: rgba(45, 212, 191, 0.35) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .sls-popup-lang__btn,
html[data-theme="dark"] .sls-student-form-lang__btn {
    color: #99f6e4 !important;
}

html[data-theme="dark"] .sls-popup-lang__btn + .sls-popup-lang__btn,
html[data-theme="dark"] .sls-student-form-lang__btn + .sls-student-form-lang__btn {
    border-inline-start-color: rgba(45, 212, 191, 0.35) !important;
}

html[data-theme="dark"] .sls-popup-lang__btn:hover,
html[data-theme="dark"] .sls-student-form-lang__btn:hover {
    background: rgba(20, 184, 166, 0.18) !important;
}

html[data-theme="dark"] .sls-popup-lang__btn.is-active,
html[data-theme="dark"] .sls-student-form-lang__btn.is-active {
    background: #0d9488 !important;
    color: #fff !important;
}

html[data-theme="dark"] #studentModalContent .tab-btn {
    color: #94a3b8 !important;
    border-color: transparent !important;
}

html[data-theme="dark"] #studentModalContent .tab-btn.active {
    color: #5eead4 !important;
    border-color: #14b8a6 !important;
}

html[data-theme="dark"] #studentModalContent .tab-btn:hover {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #studentModalContent nav[aria-label="Tabs"] a {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #studentModalContent nav[aria-label="Tabs"] a.active,
html[data-theme="dark"] #studentModalContent nav[aria-label="Tabs"] a:hover {
    color: #5eead4 !important;
    border-color: #14b8a6 !important;
}

html[data-theme="dark"] #studentModalFullViewBtn {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #studentModalFullViewBtn:hover {
    background: rgba(13, 148, 136, 0.2) !important;
    border-color: #14b8a6 !important;
    color: #5eead4 !important;
}

html[data-theme="dark"] #modalDragHandle .text-slate-500 {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #modalDragHandle .hover\:text-slate-800:hover {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #studentForm .sls-field-label__icon {
    background: linear-gradient(145deg, rgba(14, 116, 144, 0.35) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    color: #67e8f9 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] #studentForm .form-section-wrapper:has(.fa-user-tie) .sls-field-label__icon {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.35) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] #studentForm .form-section-wrapper:has(.fa-female) .sls-field-label__icon {
    background: linear-gradient(145deg, rgba(190, 24, 93, 0.35) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    color: #f9a8d4 !important;
}

html[data-theme="dark"] #otherGuardianSection .sls-field-label__icon {
    background: linear-gradient(145deg, rgba(194, 65, 12, 0.35) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
    color: #fdba74 !important;
}

/* Student photo banner */
html[data-theme="dark"] .sls-student-photo-banner {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.28) 0%, rgba(30, 41, 59, 0.95) 55%, rgba(15, 23, 42, 0.98) 100%) !important;
    border-color: rgba(45, 212, 191, 0.28) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .sls-student-photo-banner-cover {
    background:
        radial-gradient(circle at 10% 0%, rgba(20, 184, 166, 0.15), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(99, 102, 241, 0.12), transparent 50%) !important;
}

html[data-theme="dark"] .sls-student-photo-banner-title {
    color: #5eead4 !important;
}

html[data-theme="dark"] .sls-student-photo-banner-text {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-student-photo-preview-wrap {
    background: linear-gradient(135deg, #243044 50%, rgba(15, 118, 110, 0.35)) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .sls-student-photo-preview-img,
html[data-theme="dark"] .sls-student-photo-preview-initials {
    box-shadow: inset 0 0 0 2px rgba(51, 65, 85, 0.85) !important;
    background: #0f172a !important;
}

html[data-theme="dark"] .sls-student-photo-preview-initials {
    color: #5eead4 !important;
}

html[data-theme="dark"] .sls-student-photo-banner-hint {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-student-photo-camera-btn {
    border-color: var(--sls-dark-surface) !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__backdrop {
    background: rgba(2, 6, 23, 0.72) !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__panel {
    background: var(--sls-dark-surface, #0f172a) !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__title {
    color: #5eead4 !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__hint {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__close {
    background: var(--sls-dark-surface-raised, #1e293b) !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__btn {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.18) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    border-color: rgba(94, 234, 212, 0.22) !important;
    color: #99f6e4 !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__btn--gallery {
    background: linear-gradient(180deg, rgba(51, 65, 85, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-student-photo-source-chooser__cancel {
    background: var(--sls-dark-surface-raised, #1e293b) !important;
    border-color: var(--sls-dark-border, #334155) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sls-student-photo-action-btn {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sls-student-photo-action-btn--muted:hover {
    background: rgba(248, 113, 113, 0.12) !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
    color: #fca5a5 !important;
}

/* Profile rail — active card should stay on-brand, not blinding white */
html[data-theme="dark"] .sls-profile-rail-item.is-active {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.18) 0%, rgba(15, 118, 110, 0.42) 100%) !important;
    border-color: #5eead4 !important;
    color: #f0fdfa !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .sls-profile-rail-item.is-active .sls-profile-rail-name-value {
    color: #f0fdfa !important;
}

html[data-theme="dark"] .sls-profile-rail-item.is-active .sls-profile-rail-sub {
    color: rgba(204, 251, 241, 0.82) !important;
}

html[data-theme="dark"] .sls-profile-rail-item.is-active .sls-profile-rail-name-row--en .sls-profile-rail-name-tag {
    background: rgba(37, 99, 235, 0.35) !important;
    color: #bfdbfe !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
}

html[data-theme="dark"] .sls-profile-rail-item.is-active .sls-profile-rail-name-row--ar .sls-profile-rail-name-tag {
    background: rgba(217, 119, 6, 0.35) !important;
    color: #fde68a !important;
    border-color: rgba(251, 191, 36, 0.45) !important;
}

html[data-theme="dark"] .sls-profile-rail-count,
html[data-theme="dark"] .sls-profile-rail-collapsed-count {
    background: rgba(15, 23, 42, 0.88) !important;
    color: #5eead4 !important;
    border: 1px solid rgba(94, 234, 212, 0.35);
}

/* Secondary modals (export, delete confirm, etc.) */
html[data-theme="dark"] #studentExportModal .bg-white,
html[data-theme="dark"] .sls-student-export-modal-panel,
html[data-theme="dark"] .sls-student-export-progress-modal-panel,
html[data-theme="dark"] .sls-student-class-modal-panel,
html[data-theme="dark"] #studentDeleteSecurityModal .bg-white,
html[data-theme="dark"] .fixed.inset-0 .relative.bg-white {
    background: var(--sls-dark-surface) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text);
}

html[data-theme="dark"] #list-loader {
    background: rgba(15, 23, 42, 0.82) !important;
}

html[data-theme="dark"] [data-request-id].bg-white {
    background: var(--sls-dark-surface) !important;
    border-color: rgba(251, 191, 36, 0.25) !important;
}

/* ── Filter group labels ── */
html[data-theme="dark"] .filter-group .text-slate-600 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .filter-group {
    border-color: var(--sls-dark-border) !important;
}

/* ── Date inputs ── */
html[data-theme="dark"] .sls-date-triple select,
html[data-theme="dark"] .sls-date-picker-popup {
    background-color: var(--sls-dark-input-bg) !important;
    color: var(--sls-dark-text) !important;
    border-color: var(--sls-dark-border-soft) !important;
}

html[data-theme="dark"] .sls-date-triple select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E") !important;
}

html[data-theme="dark"] .sls-date-picker-day:hover {
    background: var(--sls-dark-hover) !important;
}

/* ── Focus rings on dark inputs ── */
html[data-theme="dark"] .focus\:ring-blue-200:focus {
    --tw-ring-color: rgba(20, 184, 166, 0.35) !important;
}

html[data-theme="dark"] .focus\:border-blue-500:focus {
    border-color: #14b8a6 !important;
}

/* ── Global shell (any page) ── */
html[data-theme="dark"] #app-site-footer {
    background-color: #0f172a !important;
    border-top: 1px solid var(--sls-dark-border) !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] #main-content .fixed.inset-0 .bg-white,
html[data-theme="dark"] #main-content .fixed .bg-white.rounded-xl,
html[data-theme="dark"] #main-content .fixed .bg-white.rounded-2xl {
    background: var(--sls-dark-surface) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text);
}

/* ── Sidebar (dark shell) ── */
html[data-theme="dark"] #sidebar.bg-teal-800 {
    background: linear-gradient(185deg, #0b1220 0%, #0f2926 42%, #115e59 100%) !important;
    border-inline-end: 1px solid rgba(45, 212, 191, 0.14);
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] #sidebar .border-teal-700 {
    border-color: rgba(45, 212, 191, 0.18) !important;
}

html[data-theme="dark"] #sidebar a,
html[data-theme="dark"] #sidebar .menu-group-header,
html[data-theme="dark"] #sidebar #desktop-sidebar-toggle {
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

html[data-theme="dark"] #sidebar a:hover,
html[data-theme="dark"] #sidebar .menu-group-header:hover,
html[data-theme="dark"] #sidebar .menu-group-hub-link:hover,
html[data-theme="dark"] #sidebar #desktop-sidebar-toggle:hover {
    background: rgba(45, 212, 191, 0.16) !important;
    color: #f0fdfa !important;
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.22);
}

html[data-theme="dark"] #sidebar a.active {
    background: rgba(45, 212, 191, 0.24) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.35);
}

html[data-theme="dark"] #sidebar a.active::after {
    background-color: #fbbf24 !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

html[data-theme="dark"] #sidebar .sidebar-brand-text,
html[data-theme="dark"] #sidebar .sidebar-label {
    color: #ecfdf5;
}

html[data-theme="dark"] #sidebar i.fa-fw {
    color: #99f6e4;
}

html[data-theme="dark"] #sidebar a:hover i.fa-fw,
html[data-theme="dark"] #sidebar a.active i.fa-fw {
    color: #ccfbf1;
}

html[data-theme="dark"] .sidebar-hover-tooltip {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(45, 212, 191, 0.28);
    color: #f0fdfa;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ── Summary cards hover ── */
html[data-theme="dark"] .summary-card:hover {
    background: linear-gradient(180deg, #243044 0%, #1a2435 100%) !important;
    border-color: rgba(45, 212, 191, 0.42) !important;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(45, 212, 191, 0.12) !important;
}

html[data-theme="dark"] .summary-card:hover h2,
html[data-theme="dark"] .summary-card:hover .text-slate-800 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .summary-card:hover .text-slate-400 {
    color: #94a3b8 !important;
}

/* ── Table row hover ── */
html[data-theme="dark"] #students-tbody tr.student-row:hover td {
    background: rgba(51, 65, 85, 0.62) !important;
}

html[data-theme="dark"] #students-tbody tr.student-row:hover {
    box-shadow: inset 3px 0 0 #14b8a6;
}

html[data-theme="dark"] #students-tbody tr.student-row:hover .sls-student-hover-link {
    color: #99f6e4 !important;
}

/* ── Profile rail hover ── */
html[data-theme="dark"] .sls-profile-rail-item:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(94, 234, 212, 0.5) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .sls-profile-rail-item.is-active:hover {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.24) 0%, rgba(15, 118, 110, 0.48) 100%) !important;
    border-color: #99f6e4 !important;
}

/* ── Student hover preview card ── */
html[data-theme="dark"] .sls-student-hover-card {
    background: linear-gradient(180deg, #1e293b 0%, #172033 100%) !important;
    border-color: rgba(45, 212, 191, 0.28) !important;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(45, 212, 191, 0.1) !important;
}

html[data-theme="dark"] .sls-student-hover-cover {
    background: linear-gradient(135deg, #0f766e 0%, #1d4ed8 55%, #5b21b6 100%) !important;
}

html[data-theme="dark"] .sls-student-hover-photo-wrap {
    background: linear-gradient(135deg, #243044 60%, rgba(15, 118, 110, 0.45)) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .sls-student-hover-photo,
html[data-theme="dark"] .sls-student-hover-photo.sls-student-hover-photo--logo {
    background: #0f172a !important;
}

html[data-theme="dark"] .sls-student-hover-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .sls-student-hover-name-ar,
html[data-theme="dark"] .sls-student-hover-parents {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-student-hover-status {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .sls-student-hover-meta {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .sls-student-hover-meta span {
    background: rgba(15, 23, 42, 0.75) !important;
    border-color: var(--sls-dark-border) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sls-student-hover-meta span i {
    color: #5eead4 !important;
}

html[data-theme="dark"] .sls-student-hover-qr {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.2), rgba(15, 23, 42, 0.85)) !important;
    border-color: rgba(45, 212, 191, 0.28) !important;
}

html[data-theme="dark"] .sls-student-hover-qr-title {
    color: #5eead4 !important;
}

html[data-theme="dark"] .sls-student-hover-qr-item {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-student-hover-btn--id {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-student-hover-btn--id:hover {
    background: rgba(13, 148, 136, 0.2) !important;
    border-color: #14b8a6 !important;
    color: #99f6e4 !important;
}

html[data-theme="dark"] .sls-student-hover-edit {
    background: var(--sls-dark-surface-raised) !important;
    border-color: var(--sls-dark-border-soft) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sls-student-hover-edit:hover {
    background: rgba(51, 65, 85, 0.65) !important;
    color: #f1f5f9 !important;
}

/* ── Chat rooms (full page + modal) ── */
html[data-theme="dark"] body.page-chat-room #dm-chat-room-host {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] {
    background: #243044 !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] .text-slate-800,
html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] .text-slate-700,
html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] .font-semibold {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] .text-slate-500,
html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] .text-slate-400,
html[data-theme="dark"] #dm-room-float-hover.dc-float[data-dc-theme="dark"] .text-slate-600 {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .bg-white,
html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .bg-slate-50,
html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .bg-slate-100 {
    background-color: transparent !important;
}

html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) input[type="text"],
html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) #dm-room-input {
    background: var(--sls-dark-input-bg) !important;
    border-color: var(--sls-dark-border) !important;
    color: var(--sls-dark-text) !important;
}

html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .text-teal-800,
html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .text-teal-700,
html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .text-teal-600 {
    color: #2dd4bf !important;
}

html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .bg-teal-50,
html[data-theme="dark"] #dm-room-panel-shell.dc-room:not(.dc-room-light) .bg-teal-100 {
    background: rgba(20, 184, 166, 0.12) !important;
}

/* ── Notifications: header dropdown + full page ──
   Rows still use Tailwind bg-white / bg-teal-50. Global dark text rules then
   paint light copy onto those light cards. Keep surfaces dark here. */
html[data-theme="dark"] #header-noti-dropdown {
    background: #0f172a !important;
    border-color: var(--sls-dark-border) !important;
}

html[data-theme="dark"] #header-noti-dropdown .noti-dropdown-row.bg-white,
html[data-theme="dark"] #header-noti-dropdown .noti-dropdown-row.noti-row-read,
html[data-theme="dark"] #header-noti-dropdown .noti-menu-toggle {
    background-color: #0f172a !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-teal-50,
html[data-theme="dark"] #header-noti-dropdown .noti-dropdown-row.noti-row-unread,
html[data-theme="dark"] #notifications-infinite-root .bg-teal-50\/30,
html[data-theme="dark"] #notifications-infinite-root .noti-row-unread,
html[data-theme="dark"] #main-content .noti-row-unread {
    background-color: rgba(20, 184, 166, 0.14) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #notifications-infinite-root .noti-row-read,
html[data-theme="dark"] #main-content .noti-row-read {
    background: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #header-noti-dropdown .noti-dropdown-row:hover,
html[data-theme="dark"] #header-noti-dropdown .hover\:bg-slate-50:hover,
html[data-theme="dark"] #notifications-infinite-root .hover\:bg-slate-50:hover {
    background-color: #1e293b !important;
}

html[data-theme="dark"] #header-noti-dropdown .noti-dropdown-row.bg-teal-50:hover,
html[data-theme="dark"] #header-noti-dropdown .noti-dropdown-row.noti-row-unread:hover,
html[data-theme="dark"] #notifications-infinite-root .noti-row-unread:hover {
    background-color: rgba(20, 184, 166, 0.22) !important;
}

html[data-theme="dark"] :is(#notification-list, #full-notification-list) .noti-date-heading {
    color: #94a3b8 !important;
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] #header-noti-filters,
html[data-theme="dark"] #header-noti-dropdown .header-noti-footer {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] #header-noti-dropdown .bell-module-pill:not(.is-active),
html[data-theme="dark"] #header-noti-dropdown .bell-evt-pill:not(.is-active) {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #header-noti-dropdown .bell-module-pill:not(.is-active):hover,
html[data-theme="dark"] #header-noti-dropdown .bell-evt-pill:not(.is-active):hover {
    background: #334155 !important;
    border-color: #64748b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #header-noti-dropdown .noti-menu-toggle,
html[data-theme="dark"] #notifications-infinite-root .page-menu-toggle {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #notifications-infinite-root .page-menu {
    background: #1e293b !important;
    border-color: #475569 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] #header-noti-dropdown #mark-all-read:hover,
html[data-theme="dark"] #header-noti-dropdown #header-noti-see-all:hover {
    background: rgba(20, 184, 166, 0.12) !important;
}

html[data-theme="dark"] .sls-noti-changes li {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sls-noti-change-field,
html[data-theme="dark"] .sls-noti-change-to {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .sls-noti-change-from,
html[data-theme="dark"] .sls-noti-change-arrow {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-blue-100,
html[data-theme="dark"] #notifications-infinite-root .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.22) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-emerald-100,
html[data-theme="dark"] #notifications-infinite-root .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-rose-100,
html[data-theme="dark"] #notifications-infinite-root .bg-rose-100 {
    background-color: rgba(244, 63, 94, 0.2) !important;
    color: #fda4af !important;
    border-color: rgba(244, 63, 94, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-indigo-100,
html[data-theme="dark"] #notifications-infinite-root .bg-indigo-100 {
    background-color: rgba(99, 102, 241, 0.22) !important;
    color: #a5b4fc !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-amber-100,
html[data-theme="dark"] #notifications-infinite-root .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-violet-100,
html[data-theme="dark"] #notifications-infinite-root .bg-violet-100 {
    background-color: rgba(139, 92, 246, 0.22) !important;
    color: #c4b5fd !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-teal-100,
html[data-theme="dark"] #notifications-infinite-root .bg-teal-100 {
    background-color: rgba(20, 184, 166, 0.2) !important;
    color: #5eead4 !important;
    border-color: rgba(20, 184, 166, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .bg-sky-100,
html[data-theme="dark"] #notifications-infinite-root .bg-sky-100 {
    background-color: rgba(14, 165, 233, 0.22) !important;
    color: #7dd3fc !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-blue-700,
html[data-theme="dark"] #notifications-infinite-root .text-blue-700 {
    color: #93c5fd !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-emerald-700,
html[data-theme="dark"] #notifications-infinite-root .text-emerald-700 {
    color: #6ee7b7 !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-rose-700,
html[data-theme="dark"] #notifications-infinite-root .text-rose-700 {
    color: #fda4af !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-indigo-700,
html[data-theme="dark"] #notifications-infinite-root .text-indigo-700 {
    color: #a5b4fc !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-amber-700,
html[data-theme="dark"] #header-noti-dropdown .text-amber-800,
html[data-theme="dark"] #notifications-infinite-root .text-amber-700,
html[data-theme="dark"] #notifications-infinite-root .text-amber-800 {
    color: #fcd34d !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-violet-700,
html[data-theme="dark"] #notifications-infinite-root .text-violet-700 {
    color: #c4b5fd !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-sky-700,
html[data-theme="dark"] #notifications-infinite-root .text-sky-700 {
    color: #7dd3fc !important;
}

html[data-theme="dark"] #header-noti-search-wrap {
    background: #0f172a !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] #header-noti-dropdown .header-noti-search-input,
html[data-theme="dark"] .sls-notif-search-input {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #header-noti-dropdown .header-noti-search-input::placeholder,
html[data-theme="dark"] .sls-notif-search-input::placeholder {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #header-noti-search-clear {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #header-noti-search-clear:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-rose-500 {
    color: #fb7185 !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-slate-500,
html[data-theme="dark"] #header-noti-dropdown .placeholder\:text-slate-400 {
    color: #94a3b8 !important;
}

html[data-theme="dark"] #header-noti-dropdown .text-slate-300 {
    color: #64748b !important;
}

html[data-theme="dark"] #header-noti-module-tabs .bell-module-pill.is-active {
    background-color: #334155 !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .sls-notif-area-chip.is-active,
html[data-theme="dark"] .sls-notif-evt-chip.is-active {
    color: #fff !important;
}

/* ── Faceprint (ZKTeco) page — keep surfaces dark after global remaps ── */
html[data-theme="dark"] .zk-page .zk-toolbar,
html[data-theme="dark"] .zk-page .zk-tabs,
html[data-theme="dark"] .zk-page .zk-card,
html[data-theme="dark"] .zk-page .zk-board {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .zk-page .zk-tablist {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .zk-page .zk-tab {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .zk-page .zk-tab:hover,
html[data-theme="dark"] .zk-page .zk-tab[aria-selected="true"] {
    background: #1e293b !important;
    color: #5eead4 !important;
}

html[data-theme="dark"] .zk-page .zk-tab[aria-selected="true"] {
    border-bottom-color: #2dd4bf !important;
}

html[data-theme="dark"] .zk-page .zk-board__head {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .zk-page .zk-board--absent .zk-board__head {
    background: rgba(136, 19, 55, 0.28) !important;
}

html[data-theme="dark"] .zk-page .zk-board__title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .zk-page .zk-board table thead th {
    background: #0f172a !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .zk-page .zk-board--absent table thead th {
    background: rgba(136, 19, 55, 0.35) !important;
    color: #fecdd3 !important;
}

html[data-theme="dark"] .zk-page .zk-board tbody,
html[data-theme="dark"] .zk-page .zk-board tbody tr,
html[data-theme="dark"] .zk-page .zk-board__body {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .zk-page .zk-roll-row.hover\:bg-teal-50\/60:hover {
    background: rgba(45, 212, 191, 0.1) !important;
}

html[data-theme="dark"] .zk-page .zk-roll-row.hover\:bg-rose-50\/60:hover {
    background: rgba(251, 113, 133, 0.1) !important;
}

html[data-theme="dark"] .zk-page .hover\:bg-teal-50:hover {
    background: rgba(45, 212, 191, 0.14) !important;
}

html[data-theme="dark"] .zk-page .hover\:bg-rose-50:hover {
    background: rgba(251, 113, 133, 0.14) !important;
}

html[data-theme="dark"] .zk-page .hover\:bg-slate-50:hover {
    background: rgba(148, 163, 184, 0.12) !important;
}

html[data-theme="dark"] .zk-page button[data-zk-roll-print],
html[data-theme="dark"] .zk-page button[data-zk-roll-edit],
html[data-theme="dark"] .zk-page button[data-zk-user-edit],
html[data-theme="dark"] .zk-page button[data-zk-user-delete] {
    background: #0f172a !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .zk-page .zk-board__search,
html[data-theme="dark"] .zk-page .zk-board__export-btn {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .zk-page .zk-board--present .zk-board__export-btn {
    color: #5eead4 !important;
}

html[data-theme="dark"] .zk-page .zk-board--absent .zk-board__export-btn {
    color: #fda4af !important;
}

html[data-theme="dark"] .zk-page .zk-roll-name {
    color: #e2e8f0;
}
html[data-theme="dark"] .zk-page .zk-inactive-hint {
    border-color: #5b21b6;
    background: rgba(91, 33, 182, 0.22);
    color: #ddd6fe;
}


html[data-theme="dark"] .zk-modal__panel {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .zk-modal__head {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}
