.analytics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.analytics-card{display:flex;gap:1rem;align-items:center;padding:1.2rem;border-radius:18px;background:var(--card-bg,#fff);box-shadow:0 8px 24px rgba(15,23,42,.08)}.analytics-card span,.profile360-kpi span{display:block;font-size:.82rem;color:#64748b}.analytics-card strong,.profile360-kpi strong{display:block;font-size:1.65rem}.analytics-card small,.profile360-kpi small{color:#94a3b8}.analytics-icon{font-size:1.7rem}.analytics-danger{border:1px solid rgba(239,68,68,.25)}.attendance-chart{display:flex;gap:.7rem;align-items:flex-end;min-height:240px;overflow-x:auto;padding:.75rem 0}.attendance-bar-column{min-width:38px;flex:1;text-align:center}.attendance-bar-track{height:170px;border-radius:10px;background:rgba(148,163,184,.15);display:flex;align-items:flex-end;overflow:hidden}.attendance-bar{width:100%;border-radius:10px 10px 0 0;background:linear-gradient(180deg,#4f46e5,#22c55e);min-height:3px}.attendance-bar-value,.attendance-bar-label{font-size:.72rem;color:#64748b;margin:.25rem 0}.overview-mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.overview-mini-grid>div{padding:1rem;border-radius:14px;background:rgba(148,163,184,.08)}.overview-mini-grid span{display:block;color:#64748b;font-size:.8rem}.overview-mini-grid strong{font-size:1.45rem}.performance-list,.risk-list,.notification-list,.teacher-comments-list{display:flex;flex-direction:column;gap:.65rem}.performance-item,.risk-item,.notification-item{display:flex;align-items:center;gap:.8rem;padding:.85rem 1rem;border-radius:14px;text-decoration:none;color:inherit;background:rgba(148,163,184,.07);transition:.2s}.performance-item:hover,.risk-item:hover,.notification-item:hover{transform:translateY(-1px);background:rgba(79,70,229,.08)}.performance-rank{font-weight:800;color:#4f46e5;width:32px}.performance-main,.risk-main,.notification-content{display:flex;flex-direction:column;flex:1}.performance-main small,.risk-main small,.notification-content small,.notification-content span{color:#64748b}.performance-score,.risk-metrics{display:flex;flex-direction:column;text-align:right}.risk-good{border-left:4px solid #22c55e}.risk-attention{border-left:4px solid #f59e0b}.risk-danger{border-left:4px solid #ef4444}.profile360-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.25rem}.profile360-identity{display:flex;align-items:center;gap:1rem}.profile360-avatar{width:72px;height:72px;border-radius:22px;display:grid;place-items:center;font-size:1.7rem;font-weight:800;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff}.risk-badge{padding:.42rem .7rem;border-radius:999px;background:rgba(148,163,184,.12);font-size:.82rem;font-weight:700}.profile360-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-bottom:1.25rem}.profile360-kpi{padding:1rem 1.1rem;border-radius:16px;background:var(--card-bg,#fff);box-shadow:0 8px 24px rgba(15,23,42,.06)}.risk-profile-card{padding:1rem;border-radius:16px;background:rgba(148,163,184,.06)}.risk-profile-status{font-size:1.25rem;font-weight:800;margin-bottom:1rem}.risk-profile-metrics{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}.risk-profile-metrics>div,.profile-info-grid>div{padding:.8rem;border-radius:12px;background:rgba(148,163,184,.09)}.risk-profile-metrics span,.profile-info-grid span{display:block;color:#64748b;font-size:.78rem}.profile-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}.attendance-calendar{display:flex;flex-wrap:wrap;gap:.55rem}.attendance-calendar-day{width:46px;height:58px;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(148,163,184,.08)}.attendance-calendar-day span{font-size:1.2rem}.attendance-calendar-day small{color:#64748b}.attendance-legend{display:flex;flex-wrap:wrap;gap:.75rem;font-size:.78rem;color:#64748b}.teacher-comment-card{padding:1rem;border-radius:14px;background:rgba(148,163,184,.07)}.teacher-comment-head{display:flex;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.teacher-comment-head span{color:#64748b;font-size:.8rem}.weekly-schedule-wrap{overflow:hidden}.weekly-schedule-table{width:100%;border-collapse:separate;border-spacing:0;min-width:1100px}.weekly-schedule-table th,.weekly-schedule-table td{border-right:1px solid rgba(148,163,184,.16);border-bottom:1px solid rgba(148,163,184,.16);padding:.65rem;vertical-align:top}.weekly-schedule-table thead th{background:rgba(148,163,184,.08);text-align:center;font-size:.82rem}.weekly-time-cell,.weekly-time-head{width:80px;background:rgba(148,163,184,.05)!important}.weekly-schedule-cell{min-width:145px;height:90px}.weekly-lesson-card{display:flex;flex-direction:column;gap:.18rem;padding:.7rem;border-radius:12px;text-decoration:none;color:#0f172a;margin-bottom:.45rem;border-left:4px solid transparent;box-shadow:0 2px 8px rgba(15,23,42,.05)}.weekly-lesson-card strong{font-size:.88rem}.weekly-lesson-card span,.weekly-lesson-card small,.weekly-lesson-time{font-size:.72rem;color:#64748b}.schedule-subject-0{background:#eef2ff;border-color:#6366f1}.schedule-subject-1{background:#ecfeff;border-color:#06b6d4}.schedule-subject-2{background:#f0fdf4;border-color:#22c55e}.schedule-subject-3{background:#fff7ed;border-color:#f97316}.schedule-subject-4{background:#fdf2f8;border-color:#ec4899}.schedule-subject-5{background:#fefce8;border-color:#eab308}.weekly-schedule-footer{padding:.75rem 1rem;color:#64748b;font-size:.8rem}.notification-bell{position:relative;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;text-decoration:none;background:rgba(148,163,184,.12);font-size:1.1rem}.notification-count{position:absolute;top:-6px;right:-6px;background:#ef4444;color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;font-size:.67rem;font-weight:800}.notification-icon{font-size:1.35rem}.notification-arrow{color:#94a3b8}.notification-success{border-left:4px solid #22c55e}.notification-warning{border-left:4px solid #f59e0b}.notification-danger{border-left:4px solid #ef4444}.notification-info{border-left:4px solid #3b82f6}[data-theme="dark"] .analytics-card,[data-theme="dark"] .profile360-kpi,[data-theme="dark"] .weekly-schedule-wrap{background:#111827}[data-theme="dark"] .weekly-lesson-card{color:#e5e7eb}[data-theme="dark"] .schedule-subject-0,[data-theme="dark"] .schedule-subject-1,[data-theme="dark"] .schedule-subject-2,[data-theme="dark"] .schedule-subject-3,[data-theme="dark"] .schedule-subject-4,[data-theme="dark"] .schedule-subject-5{background:#1f2937}@media(max-width:1100px){.analytics-grid,.profile360-kpis{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.analytics-grid,.profile360-kpis,.profile-info-grid{grid-template-columns:1fr}.profile360-header{align-items:flex-start;flex-direction:column}.teacher-comment-head{flex-direction:column}.topbar-user .user-info{display:none}}

/* =========================================================
   DARK MODE CONSISTENCY LAYER
   Loaded after site.css so every role and Bootstrap component
   receives the same dark surfaces, borders and readable text.
   ========================================================= */
html[data-theme="dark"] {
    --dm-page: #0b1120;
    --dm-surface: #111827;
    --dm-surface-soft: #172033;
    --dm-surface-hover: #1e293b;
    --dm-border: #2f3d55;
    --dm-heading: #f8fafc;
    --dm-text: #e5e7eb;
    --dm-muted: #94a3b8;
    --card-bg: #111827;
    --bs-body-bg: #0b1120;
    --bs-body-color: #e5e7eb;
    --bs-border-color: #2f3d55;
    --bs-secondary-color: #94a3b8;
    --bs-tertiary-bg: #172033;
    color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app,
html[data-theme="dark"] .main-wrapper,
html[data-theme="dark"] .page-content {
    background: var(--dm-page) !important;
    color: var(--dm-text);
}

html[data-theme="dark"] .sidebar {
    background: #0d1424;
    border-right: 1px solid rgba(148, 163, 184, .10);
}

html[data-theme="dark"] .sidebar-brand {
    border-color: rgba(148, 163, 184, .12);
}

html[data-theme="dark"] .sidebar-link {
    color: #cbd5e1;
}

html[data-theme="dark"] .sidebar-link:hover {
    background: rgba(148, 163, 184, .10);
    color: #fff;
}

html[data-theme="dark"] .topbar {
    background: #0f172a !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .02);
}

html[data-theme="dark"] .topbar-title,
html[data-theme="dark"] .user-email,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .dashboard-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .page-content h1,
html[data-theme="dark"] .page-content h2,
html[data-theme="dark"] .page-content h3,
html[data-theme="dark"] .page-content h4,
html[data-theme="dark"] .page-content h5,
html[data-theme="dark"] .page-content h6 {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .dashboard-subtitle,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .user-role {
    color: var(--dm-muted) !important;
}

html[data-theme="dark"] .dashboard-date {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .dropdown-menu {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .offcanvas-header {
    background: var(--dm-surface-soft) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .card.shadow-sm,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .teacher-stat-card,
html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .profile360-kpi {
    box-shadow: 0 10px 30px rgba(0, 0, 0, .20) !important;
}

html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .teacher-quick-action,
html[data-theme="dark"] .relation-option,
html[data-theme="dark"] .parent-option,
html[data-theme="dark"] .performance-item,
html[data-theme="dark"] .risk-item,
html[data-theme="dark"] .notification-item,
html[data-theme="dark"] .teacher-comment-card,
html[data-theme="dark"] .risk-profile-card,
html[data-theme="dark"] .risk-profile-metrics > div,
html[data-theme="dark"] .profile-info-grid > div,
html[data-theme="dark"] .attendance-calendar-day,
html[data-theme="dark"] .overview-mini-grid > div {
    background: var(--dm-surface-soft) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .quick-action:hover,
html[data-theme="dark"] .teacher-quick-action:hover,
html[data-theme="dark"] .relation-option:hover,
html[data-theme="dark"] .parent-option:hover,
html[data-theme="dark"] .performance-item:hover,
html[data-theme="dark"] .risk-item:hover,
html[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .teacher-lesson-row:hover,
html[data-theme="dark"] .recent-item:hover,
html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background: var(--dm-surface-hover) !important;
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .recent-item,
html[data-theme="dark"] .teacher-lesson-row,
html[data-theme="dark"] .teacher-attendance-row,
html[data-theme="dark"] .teacher-grade-entry-row,
html[data-theme="dark"] .teacher-schedule-item,
html[data-theme="dark"] .parent-schedule-row,
html[data-theme="dark"] .parent-recent-grade,
html[data-theme="dark"] .teacher-topic-info-row,
html[data-theme="dark"] .activity-log-row {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .recent-info strong,
html[data-theme="dark"] .relation-info strong,
html[data-theme="dark"] .parent-option-info strong,
html[data-theme="dark"] .teacher-lesson-time strong,
html[data-theme="dark"] .teacher-lesson-title,
html[data-theme="dark"] .teacher-lesson-topic,
html[data-theme="dark"] .teacher-lesson-topic strong,
html[data-theme="dark"] .schedule-day-name,
html[data-theme="dark"] .schedule-time strong,
html[data-theme="dark"] .schedule-subject strong,
html[data-theme="dark"] .management-empty h5,
html[data-theme="dark"] .teacher-empty h5,
html[data-theme="dark"] .person-name,
html[data-theme="dark"] .record-date,
html[data-theme="dark"] .form-card-header h5,
html[data-theme="dark"] .salary-period-value {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .recent-info span,
html[data-theme="dark"] .relation-info span,
html[data-theme="dark"] .parent-option-info span,
html[data-theme="dark"] .teacher-lesson-time span,
html[data-theme="dark"] .teacher-lesson-small-label,
html[data-theme="dark"] .management-empty p,
html[data-theme="dark"] .teacher-empty p,
html[data-theme="dark"] .record-time {
    color: var(--dm-muted) !important;
}

html[data-theme="dark"] .schedule-day,
html[data-theme="dark"] .teacher-schedule-day,
html[data-theme="dark"] .parent-schedule-day,
html[data-theme="dark"] .salary-period,
html[data-theme="dark"] .teacher-salary-filter-card,
html[data-theme="dark"] .teacher-salary-calculation,
html[data-theme="dark"] .parent-child-card,
html[data-theme="dark"] .parent-subject-card,
html[data-theme="dark"] .parent-topic-content {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .schedule-day-header,
html[data-theme="dark"] .teacher-schedule-day-header,
html[data-theme="dark"] .parent-schedule-day-header {
    background: var(--dm-surface-soft) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="number"] {
    background-color: var(--dm-surface-soft) !important;
    border-color: #3b4b65 !important;
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] textarea:focus {
    background-color: var(--dm-surface-soft) !important;
    border-color: #6366f1 !important;
    color: #fff !important;
    box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .16) !important;
}

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

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled,
html[data-theme="dark"] .form-control[readonly] {
    background: #0f172a !important;
    color: var(--dm-muted) !important;
    opacity: 1;
}

html[data-theme="dark"] .form-select option {
    background: var(--dm-surface-soft);
    color: var(--dm-heading);
}

html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(.75);
}

html[data-theme="dark"] .form-check-input {
    background-color: var(--dm-surface-soft);
    border-color: #475569;
}

html[data-theme="dark"] .form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--dm-text);
    --bs-table-border-color: var(--dm-border);
    --bs-table-striped-bg: rgba(148, 163, 184, .035);
    --bs-table-striped-color: var(--dm-text);
    --bs-table-hover-bg: var(--dm-surface-hover);
    --bs-table-hover-color: #fff;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table-light > * {
    background: var(--dm-surface-soft) !important;
    border-color: var(--dm-border) !important;
    color: #a8b5c9 !important;
}

html[data-theme="dark"] .table tbody td,
html[data-theme="dark"] .table tfoot td {
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--dm-surface-hover);
    color: #fff !important;
}

html[data-theme="dark"] .btn-light {
    background: var(--dm-surface-hover) !important;
    border-color: #475569 !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .btn-light:hover {
    background: #334155 !important;
    border-color: #64748b !important;
    color: #fff !important;
}

html[data-theme="dark"] .btn-outline-secondary {
    border-color: #526079 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background: #334155 !important;
    color: #fff !important;
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .dropdown-header {
    color: var(--dm-text);
}

html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] hr {
    border-color: var(--dm-border) !important;
    opacity: 1;
}

html[data-theme="dark"] .pagination .page-link {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .pagination .page-link:hover {
    background: var(--dm-surface-hover) !important;
    color: #fff !important;
}

html[data-theme="dark"] .pagination .active > .page-link,
html[data-theme="dark"] .pagination .page-item.active .page-link {
    background: #4f46e5 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}

html[data-theme="dark"] .pagination .disabled > .page-link {
    background: #0f172a !important;
    color: #64748b !important;
}

html[data-theme="dark"] .nav-tabs {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
    border-color: transparent;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--dm-border);
    background: var(--dm-surface-soft);
    color: #fff;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) var(--dm-border) var(--dm-surface) !important;
    color: #fff !important;
}

html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #1d2750 !important;
    color: #c7d2fe !important;
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1) opacity(.8);
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light {
    background: var(--dm-surface-soft) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .text-dark {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .alert-success {
    background: #0d2b23 !important;
    color: #a7f3d0 !important;
    border: 1px solid #145c48 !important;
}

html[data-theme="dark"] .alert-danger {
    background: #35161a !important;
    color: #fecaca !important;
    border: 1px solid #7f1d1d !important;
}

html[data-theme="dark"] .alert-warning {
    background: #332508 !important;
    color: #fde68a !important;
    border: 1px solid #854d0e !important;
}

html[data-theme="dark"] .alert-info {
    background: #10253b !important;
    color: #bae6fd !important;
    border: 1px solid #075985 !important;
}

html[data-theme="dark"] .status-present,
html[data-theme="dark"] .grade-high,
html[data-theme="dark"] .salary-amount {
    background: #10372c !important;
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .status-absent {
    background: #3b171b !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .status-late,
html[data-theme="dark"] .grade-low,
html[data-theme="dark"] .teacher-grade-button {
    background: #3a260d !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .status-excused,
html[data-theme="dark"] .grade-good {
    background: #18264d !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .grade-neutral {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

/* A blacklisted student's average always reads as an alert, regardless
   of the grade-low/good/high/neutral color it would otherwise get. */
tr.exam-blacklisted .grade-badge,
html[data-theme="dark"] tr.exam-blacklisted .grade-badge,
.big-exam-rankings tr.big-exam-blacklisted .grade-badge,
html[data-theme="dark"] .big-exam-rankings tr.big-exam-blacklisted .grade-badge {
    background: #dc2626 !important;
    color: #fff !important;
}

html[data-theme="dark"] .parent-contact-item {
    background: #131b2e;
    border-color: #253047;
}

html[data-theme="dark"] .parent-contact-name {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .parent-relation-badge {
    background: #10372c;
    color: #6ee7b7;
}

html[data-theme="dark"] .parent-contact-email {
    color: #94a3b8;
}

html[data-theme="dark"] .phone-action-trigger {
    background: #1e1b4b;
    border-color: #4338ca;
    color: #c7d2fe;
}

html[data-theme="dark"] .phone-action-trigger:hover {
    background: #24215a;
}

html[data-theme="dark"] tr.big-exam-row-mine td,
html[data-theme="dark"] tr.leaderboard-row-mine td,
html[data-theme="dark"] tr.exam-row-mine td {
    background: #1e1b4b;
}

html[data-theme="dark"] .teacher-status-pending,
html[data-theme="dark"] .readonly-badge,
html[data-theme="dark"] .teacher-count-label,
html[data-theme="dark"] .risk-badge {
    background: var(--dm-surface-hover) !important;
    border-color: var(--dm-border) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .stat-students,
html[data-theme="dark"] .teacher-stat-students,
html[data-theme="dark"] .teacher-quick-grade,
html[data-theme="dark"] .student-relation-icon {
    background: #202750 !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .stat-teachers,
html[data-theme="dark"] .teacher-stat-groups,
html[data-theme="dark"] .teacher-quick-icon,
html[data-theme="dark"] .teacher-relation-icon,
html[data-theme="dark"] .salary-avatar {
    background: #10372c !important;
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .stat-groups,
html[data-theme="dark"] .teacher-stat-lessons,
html[data-theme="dark"] .teacher-quick-topic,
html[data-theme="dark"] .subject-color,
html[data-theme="dark"] .relation-icon.subject-icon {
    background: #3a260d !important;
    color: #fdba74 !important;
}

html[data-theme="dark"] .stat-subjects,
html[data-theme="dark"] .teacher-stat-salary,
html[data-theme="dark"] .teacher-quick-schedule {
    background: #3a1830 !important;
    color: #f9a8d4 !important;
}

html[data-theme="dark"] .teacher-info-stat-icon,
html[data-theme="dark"] .management-empty-icon,
html[data-theme="dark"] .teacher-empty-icon,
html[data-theme="dark"] .parent-empty-icon,
html[data-theme="dark"] .recent-avatar,
html[data-theme="dark"] .parent-option-avatar {
    background: var(--dm-surface-hover) !important;
    border-color: var(--dm-border) !important;
    color: #a5b4fc !important;
}

html[data-theme="dark"] .analytics-card,
html[data-theme="dark"] .profile360-kpi,
html[data-theme="dark"] .weekly-schedule-wrap {
    background: var(--dm-surface) !important;
    border: 1px solid var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .analytics-card span,
html[data-theme="dark"] .analytics-card small,
html[data-theme="dark"] .profile360-kpi span,
html[data-theme="dark"] .profile360-kpi small,
html[data-theme="dark"] .attendance-bar-value,
html[data-theme="dark"] .attendance-bar-label,
html[data-theme="dark"] .overview-mini-grid span,
html[data-theme="dark"] .performance-main small,
html[data-theme="dark"] .risk-main small,
html[data-theme="dark"] .notification-content small,
html[data-theme="dark"] .notification-content span,
html[data-theme="dark"] .risk-profile-metrics span,
html[data-theme="dark"] .profile-info-grid span,
html[data-theme="dark"] .attendance-calendar-day small,
html[data-theme="dark"] .attendance-legend,
html[data-theme="dark"] .teacher-comment-head span,
html[data-theme="dark"] .weekly-schedule-footer {
    color: var(--dm-muted) !important;
}

html[data-theme="dark"] .analytics-card strong,
html[data-theme="dark"] .profile360-kpi strong,
html[data-theme="dark"] .overview-mini-grid strong,
html[data-theme="dark"] .performance-main strong,
html[data-theme="dark"] .performance-score strong,
html[data-theme="dark"] .risk-main strong,
html[data-theme="dark"] .profile360-header strong,
html[data-theme="dark"] .teacher-comment-card strong {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .attendance-bar-track {
    background: #243047;
}

html[data-theme="dark"] .weekly-schedule-table th,
html[data-theme="dark"] .weekly-schedule-table td {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .weekly-schedule-table thead th,
html[data-theme="dark"] .weekly-time-cell,
html[data-theme="dark"] .weekly-time-head {
    background: var(--dm-surface-soft) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .weekly-lesson-card {
    color: var(--dm-heading) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .weekly-lesson-card span,
html[data-theme="dark"] .weekly-lesson-card small,
html[data-theme="dark"] .weekly-lesson-time {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .schedule-subject-0 { background: #23264a !important; border-color: #818cf8; }
html[data-theme="dark"] .schedule-subject-1 { background: #12323a !important; border-color: #22d3ee; }
html[data-theme="dark"] .schedule-subject-2 { background: #153526 !important; border-color: #4ade80; }
html[data-theme="dark"] .schedule-subject-3 { background: #3a260d !important; border-color: #fb923c; }
html[data-theme="dark"] .schedule-subject-4 { background: #3a1830 !important; border-color: #f472b6; }
html[data-theme="dark"] .schedule-subject-5 { background: #37300c !important; border-color: #facc15; }

html[data-theme="dark"] .notification-bell {
    background: var(--dm-surface-hover) !important;
    border: 1px solid var(--dm-border);
}

html[data-theme="dark"] .notification-bell:hover {
    background: #334155 !important;
}

html[data-theme="dark"] .calendar-grid {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .calendar-grid-head,
html[data-theme="dark"] .calendar-grid-cell-blank {
    background: var(--dm-surface-soft) !important;
}

html[data-theme="dark"] .calendar-grid-cell,
html[data-theme="dark"] .calendar-grid-head {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .calendar-grid-day-number,
html[data-theme="dark"] .activity-log-time,
html[data-theme="dark"] .achievement-badge-name {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .achievement-badge,
html[data-theme="dark"] .leaderboard-row,
html[data-theme="dark"] .journal-cell,
html[data-theme="dark"] .journal-sticky-col {
    background: var(--dm-surface-soft) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .journal-cell-empty {
    background: #1e293b !important;
    color: #64748b !important;
}

html[data-theme="dark"] .ai-assistant-panel {
    background: #111827 !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45) !important;
}

html[data-theme="dark"] .ai-assistant-header {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] .ai-assistant-title {
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] .ai-assistant-msg-assistant .ai-assistant-bubble {
    background: var(--dm-surface-hover) !important;
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .ai-assistant-input {
    background: #0f172a !important;
    border-color: #3b4b65 !important;
    color: var(--dm-heading) !important;
}

html[data-theme="dark"] ::selection {
    background: #4f46e5;
    color: #fff;
}

/* Attendance status dots - replaces emoji circles with a plain colored
   dot, matching the status-badge colors used elsewhere. */
.calendar-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.calendar-dot-present { background: #15803d; }
.calendar-dot-absent { background: #dc2626; }
.calendar-dot-late { background: #b45309; }
.calendar-dot-excused { background: #2563eb; }
.calendar-dot-unknown { background: #94a3b8; }

.attendance-legend .calendar-dot { margin-right: 4px; vertical-align: middle; }
