/* Global dark mode layer */

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg-body: #0f141b;
  --bg-sidebar: #111827;
  --bg-light: #0f141b;
  --text-primary: #e5e7eb;
  --text-secondary: #aab4c4;
  --text-muted: #8f9aae;
  --border-color: #273142;
  --surface-0: #131b26;
  --surface-1: #0f141b;
  --surface-2: #1b2432;
  --text-strong: #f3f4f6;
  --text-default: #d1d5db;
  --text-soft: #9aa4b2;
  --border-soft: #2a3445;
}

html[data-theme="dark"] body {
  background: var(--bg-body) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .content-wrapper,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .container-fluid {
  background: transparent !important;
}

html[data-theme="dark"] .navbar {
  background: rgba(15, 20, 27, 0.96) !important;
  border-bottom-color: var(--border-color) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .sidebar {
  background: var(--bg-sidebar) !important;
  border-right-color: var(--border-color) !important;
}

html[data-theme="dark"] .sidebar .nav-link,
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .table,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .small.text-muted,
html[data-theme="dark"] .form-text {
  color: var(--text-secondary) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-custom,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .popover {
  background-color: var(--surface-0) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .dropdown-header,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table thead th {
  background-color: #182233 !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .table tbody tr:hover,
html[data-theme="dark"] .nav-link:hover {
  background-color: #1d2838 !important;
}

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

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
  background-color: #0f1725 !important;
  border-color: #344055 !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .form-control::placeholder {
  color: #8f9aae !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  border-color: color-mix(in srgb, var(--theme-color) 60%, #64748b) !important;
  box-shadow: 0 0 0 0.2rem rgba(138, 28, 28, 0.25) !important;
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-success,
html[data-theme="dark"] .btn-outline-danger {
  background-color: #182233 !important;
  border-color: #344055 !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .alert-success {
  background-color: rgba(34, 197, 94, 0.12) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #bbf7d0 !important;
}

html[data-theme="dark"] .alert-danger {
  background-color: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fecaca !important;
}

html[data-theme="dark"] .alert-warning {
  background-color: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}

html[data-theme="dark"] .alert-info {
  background-color: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.35) !important;
  color: #bae6fd !important;
}

/* Navbar toggle button */
.theme-toggle-btn {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #6b7280;
  background: transparent;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(138, 28, 28, 0.08);
  color: #8a1c1c;
}

html[data-theme="dark"] .theme-toggle-btn {
  color: #cbd5e1;
  border-color: #334155;
  background: #111827;
}

html[data-theme="dark"] .theme-toggle-btn:hover {
  color: #f8fafc;
  background: #1f2937;
}

/* Auth pages */
html[data-theme="dark"] .auth-right {
  background: #101722 !important;
}

html[data-theme="dark"] .auth-form-container {
  background: #131b27 !important;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-right h4,
html[data-theme="dark"] .auth-right p,
html[data-theme="dark"] .auth-right label,
html[data-theme="dark"] .auth-right .text-muted,
html[data-theme="dark"] .auth-right .form-label {
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .auth-right .text-muted,
html[data-theme="dark"] .auth-right .small {
  color: var(--text-secondary) !important;
}

html[data-theme="dark"] .auth-right .form-control {
  background: #0e1623 !important;
  border-color: #344055 !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .auth-right .form-control::placeholder {
  color: #8f9aae !important;
}

/* Floating toggle on auth pages */
.auth-theme-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  z-index: 1200;
}

html[data-theme="dark"] .auth-theme-toggle {
  border-color: #334155;
  background: #111827;
  color: #f8fafc;
}

/* Contrast/visibility refinements */
html[data-theme="dark"] a {
  color: #93c5fd;
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus {
  color: #bfdbfe;
}

html[data-theme="dark"] .navbar .nav-link,
html[data-theme="dark"] .navbar .navbar-brand,
html[data-theme="dark"] .navbar .dropdown-item,
html[data-theme="dark"] .navbar .fw-bold,
html[data-theme="dark"] .navbar small {
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-body,
html[data-theme="dark"] .bg-secondary-subtle,
html[data-theme="dark"] .bg-success-subtle,
html[data-theme="dark"] .bg-warning-subtle,
html[data-theme="dark"] .bg-danger-subtle,
html[data-theme="dark"] .bg-info-subtle {
  background-color: #182233 !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .badge.bg-light,
html[data-theme="dark"] .badge.text-dark {
  background-color: #243246 !important;
  color: #e5e7eb !important;
  border-color: #344055 !important;
}

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

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

html[data-theme="dark"] .nav-tabs .nav-link,
html[data-theme="dark"] .nav-pills .nav-link {
  color: var(--text-secondary) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-pills .nav-link.active {
  color: #ffffff !important;
  background-color: color-mix(in srgb, var(--theme-color) 65%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 65%, #111827) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover,
html[data-theme="dark"] .nav-pills .nav-link:hover {
  color: #f8fafc !important;
  background-color: #1d2838 !important;
}

html[data-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: var(--border-color) !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: #162131 !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .page-link {
  background-color: #182233 !important;
  border-color: #344055 !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .page-link:hover {
  background-color: #223044 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .page-item.active .page-link {
  background-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  color: #ffffff !important;
}

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

html[data-theme="dark"] .btn-link {
  color: #93c5fd !important;
}

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

html[data-theme="dark"] .form-check-input {
  background-color: #111827;
  border-color: #4b5563;
}

html[data-theme="dark"] .form-check-input:checked {
  background-color: color-mix(in srgb, var(--theme-color) 70%, #111827);
  border-color: color-mix(in srgb, var(--theme-color) 70%, #111827);
}

html[data-theme="dark"] .form-select option {
  background: #111827;
  color: #e5e7eb;
}

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) brightness(0.9);
}

/* Sidebar links + highlighting */
html[data-theme="dark"] .sidebar .text-muted {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .sidebar .nav-link {
  color: #c7d2e3 !important;
  background: transparent !important;
  border-radius: 8px !important;
}

html[data-theme="dark"] .sidebar .nav-link i {
  color: #93a4bb !important;
}

html[data-theme="dark"] .sidebar .nav-link:hover {
  color: #f8fafc !important;
  background: #1d293a !important;
}

html[data-theme="dark"] .sidebar .nav-link:hover i {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sidebar .nav-link.active,
html[data-theme="dark"] .sidebar .nav-link[aria-expanded="true"] {
  color: #ffffff !important;
  background: color-mix(in srgb, var(--theme-color) 62%, #111827) !important;
  box-shadow:
    inset 3px 0 0 color-mix(in srgb, var(--theme-color) 88%, #ffffff),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .sidebar .nav-link.active i,
html[data-theme="dark"] .sidebar .nav-link[aria-expanded="true"] i {
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar .collapse .nav-link {
  color: #b9c7da !important;
}

html[data-theme="dark"] .sidebar .collapse .nav-link.active {
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar .nav-link.text-danger {
  color: #fca5a5 !important;
}

html[data-theme="dark"] .sidebar .nav-link.text-danger:hover {
  color: #fecaca !important;
  background: rgba(185, 28, 28, 0.22) !important;
}

/* Calendar (FullCalendar) contrast */
html[data-theme="dark"] #calendar {
  color: #e5e7eb;
}

html[data-theme="dark"] .fc {
  --fc-border-color: #334155;
  --fc-page-bg-color: #131b26;
  --fc-neutral-bg-color: #182233;
  --fc-neutral-text-color: #cbd5e1;
  --fc-list-event-hover-bg-color: #1d293a;
}

html[data-theme="dark"] .fc .fc-scrollgrid,
html[data-theme="dark"] .fc-theme-standard td,
html[data-theme="dark"] .fc-theme-standard th {
  border-color: #334155 !important;
}

html[data-theme="dark"] .fc .fc-col-header-cell,
html[data-theme="dark"] .fc .fc-daygrid-day {
  background-color: #131b26;
}

html[data-theme="dark"] .fc .fc-col-header-cell-cushion,
html[data-theme="dark"] .fc .fc-daygrid-day-number,
html[data-theme="dark"] .fc .fc-toolbar-title,
html[data-theme="dark"] .fc .fc-list-day-text,
html[data-theme="dark"] .fc .fc-list-day-side-text {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .fc .fc-daygrid-day.fc-day-today {
  background-color: rgba(245, 158, 11, 0.14) !important;
}

html[data-theme="dark"] .fc .fc-button-primary {
  background-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .fc .fc-button-primary:hover {
  background-color: color-mix(in srgb, var(--theme-color) 82%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 82%, #111827) !important;
}

html[data-theme="dark"] .fc .fc-button-primary:disabled {
  opacity: 0.65;
}

html[data-theme="dark"] .fc .fc-event {
  border: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .fc .fc-list {
  border-color: #334155 !important;
}

html[data-theme="dark"] .fc .fc-list-event td {
  background-color: #131b26;
  color: #e5e7eb;
  border-color: #334155 !important;
}

html[data-theme="dark"] .fc .fc-list-event:hover td {
  background-color: #1d293a;
}

/* Teacher class view + class grades dark refinements */
html[data-theme="dark"] .class-tabs-compact .card-body {
  background: #131b26 !important;
}

html[data-theme="dark"] .class-tabs-compact .class-mobile-tabs .nav-link {
  background: #182233 !important;
  border-color: #344055 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .class-tabs-compact .class-mobile-tabs .nav-link.active {
  background: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .class-tabs-compact .class-mobile-tabs .nav-link:hover {
  background: #223044 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .module-description {
  color: #a8b5c7 !important;
}

html[data-theme="dark"] .wysiwyg-shell {
  background: #0f1725 !important;
  border-color: #344055 !important;
}

html[data-theme="dark"] .wysiwyg-toolbar {
  background: #182233 !important;
  border-bottom-color: #344055 !important;
}

html[data-theme="dark"] .wysiwyg-editor {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .wysiwyg-editor:empty:before {
  color: #8fa0b5 !important;
}

html[data-theme="dark"] #active-chat #chat-student-name {
  background: #182233 !important;
  color: #e5e7eb !important;
  border-bottom-color: #334155 !important;
}

html[data-theme="dark"] #active-chat #messages-container {
  background: #0f1725 !important;
}

html[data-theme="dark"] #active-chat .bg-light {
  background: #1f2937 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .chat-empty-state {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .student-chat.active {
  background: #243246 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .ecr-container {
  background: #0f1725 !important;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent !important;
}

html[data-theme="dark"] .ecr-container::-webkit-scrollbar-track {
  background: #111827 !important;
}

html[data-theme="dark"] .ecr-container::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5) !important;
}

html[data-theme="dark"] .ecr-container::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.7) !important;
}

html[data-theme="dark"] .ecr-container thead th,
html[data-theme="dark"] .ecr-container thead td,
html[data-theme="dark"] .ecr-header-main tr {
  background: #182233 !important;
  border-bottom-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .ecr-assessment-title {
  background: #1a2535 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .ecr-assessment-title a,
html[data-theme="dark"] .ecr-assessment-title span {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .ecr-summary-head {
  background: linear-gradient(135deg, #223044 0%, #1b2636 100%) !important;
  border-left-color: #334155 !important;
  color: #d1d5db !important;
}

html[data-theme="dark"] .ecr-summary-total {
  color: #d1fae5 !important;
}

html[data-theme="dark"] .ecr-summary-ps {
  color: #fecaca !important;
}

html[data-theme="dark"] .ecr-summary-ws {
  color: #dcfce7 !important;
}

html[data-theme="dark"] .ecr-max-score-row td {
  background: #1a2432 !important;
  color: #aebbd0 !important;
  border-top-color: #334155 !important;
}

html[data-theme="dark"] .ecr-table .sticky-col,
html[data-theme="dark"] .ecr-table tbody td.sticky-col {
  background: #111827 !important;
  color: #e5e7eb !important;
  border-right-color: #334155 !important;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .ecr-score-cell {
  background: #0f1725 !important;
}

html[data-theme="dark"] .ecr-score-cell:hover {
  background: #1a2535 !important;
}

html[data-theme="dark"] .ecr-input {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .ecr-input:focus {
  background: #1a2535 !important;
}

html[data-theme="dark"] .ecr-score-cell.selected {
  background: #294449 !important;
}

html[data-theme="dark"] .ecr-table tbody tr:nth-child(even) {
  background: #131d2a !important;
}

html[data-theme="dark"] .ecr-table tbody tr:hover {
  background: #1b2636 !important;
}

html[data-theme="dark"] .ecr-table tbody td[class*="bg-success"] {
  background: #14532d !important;
  color: #dcfce7 !important;
}

html[data-theme="dark"] .ecr-table tbody td[class*="bg-warning"] {
  background: #713f12 !important;
  color: #fef3c7 !important;
}

html[data-theme="dark"] .ecr-table tbody td[class*="bg-dark"] {
  background: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .ecr-table tbody td[class*="bg-info"] {
  background: #164e63 !important;
  color: #cffafe !important;
}

html[data-theme="dark"] .ecr-table tbody td[class*="bg-white"] {
  background: #111827 !important;
  color: #fca5a5 !important;
  border-color: #b91c1c !important;
}

html[data-theme="dark"] .ecr-table tbody td[class*="bg-secondary"] {
  background: #3f1d2e !important;
  color: #fecdd3 !important;
}

html[data-theme="dark"] .ecr-save-footer {
  background: linear-gradient(to right, #111827 0%, #1b2636 100%) !important;
  border-top-color: #334155 !important;
}

html[data-theme="dark"] .modal-footer.bg-light {
  background: #182233 !important;
}

html[data-theme="dark"] .class-record-title {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .ecr-overview-card,
html[data-theme="dark"] .ecr-stat-card,
html[data-theme="dark"] #ecrTableCard,
html[data-theme="dark"] .ecr-toolbar-row,
html[data-theme="dark"] .ecr-save-footer,
html[data-theme="dark"] .card.card-custom.border-0.mb-2,
html[data-theme="dark"] .card.border-0.shadow-sm.h-100,
html[data-theme="dark"] .card.border-0.shadow-sm.h-100 > .card-body,
html[data-theme="dark"] .card.card-custom.border-0.shadow-sm.mb-3 > .card-body {
  background: #131b26 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .ecr-overview-card {
  border-left-color: color-mix(in srgb, var(--theme-color) 62%, #111827) !important;
}

html[data-theme="dark"] .ecr-stat-card {
  background: linear-gradient(180deg, #131b26 0%, #182233 100%) !important;
}

html[data-theme="dark"] .ecr-stat-warning {
  border-left-color: #f59e0b !important;
}

html[data-theme="dark"] .ecr-stat-label,
html[data-theme="dark"] .ecr-stat-note,
html[data-theme="dark"] .ecr-toolbar-row .form-label,
html[data-theme="dark"] .ecr-toolbar-row .text-muted,
html[data-theme="dark"] .ecr-overview-card .text-muted,
html[data-theme="dark"] #ecrSaveMessageTop,
html[data-theme="dark"] #ecrSaveMessage,
html[data-theme="dark"] .ecr-save-footer .text-muted {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .ecr-stat-value,
html[data-theme="dark"] .ecr-overview-card .fw-bold,
html[data-theme="dark"] .ecr-overview-card h4,
html[data-theme="dark"] .ecr-overview-card .btn,
html[data-theme="dark"] .ecr-overview-card .btn i {
  color: #f8fafc !important;
}

html[data-theme="dark"] .ecr-overview-card .badge.text-bg-light,
html[data-theme="dark"] .card.card-custom.border-0.mb-2 .badge.bg-light {
  background: #1f2937 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .card.card-custom.border-0.mb-2 .text-primary {
  color: #93c5fd !important;
}

html[data-theme="dark"] .card.card-custom.border-0.mb-2 .text-dark,
html[data-theme="dark"] .ecr-table thead.text-dark,
html[data-theme="dark"] .ecr-table .text-dark {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .ecr-toolbar-row .form-control,
html[data-theme="dark"] .ecr-toolbar-row .form-select,
html[data-theme="dark"] #manualColumnModal .form-control,
html[data-theme="dark"] #manualColumnModal .form-select,
html[data-theme="dark"] #customFillModal .form-control {
  background: #0f1725 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .ecr-toolbar-row .form-control::placeholder,
html[data-theme="dark"] #manualColumnModal .form-control::placeholder,
html[data-theme="dark"] #customFillModal .form-control::placeholder {
  color: #8fa0b5 !important;
}

html[data-theme="dark"] .ecr-toolbar-row .btn-light {
  background: #1f2937 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

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

html[data-theme="dark"] .ecr-toolbar-row .btn-outline-secondary:hover,
html[data-theme="dark"] .ecr-toolbar-row .btn-outline-secondary:focus {
  background: #223044 !important;
  border-color: #64748b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .ecr-container table,
html[data-theme="dark"] .ecr-table {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .ecr-table th,
html[data-theme="dark"] .ecr-table td {
  border-color: #334155 !important;
}

html[data-theme="dark"] .ecr-table tbody td,
html[data-theme="dark"] .ecr-table tbody th {
  color: #dbe4f0 !important;
}

html[data-theme="dark"] .ecr-table tbody td[style*="background-color: rgba(196, 30, 58"],
html[data-theme="dark"] .ecr-table tbody td[style*="background-color: rgba(56, 142, 60"] {
  background-color: #1f2937 !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .ecr-table tbody td.bg-dark,
html[data-theme="dark"] .ecr-table tbody td[class*="bg-dark"] {
  background: #273449 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .ecr-table tbody td.bg-info,
html[data-theme="dark"] .ecr-table tbody td[class*="bg-info"] {
  background: #16384a !important;
  color: #d5f3ff !important;
}

html[data-theme="dark"] .ecr-table tbody td.bg-white,
html[data-theme="dark"] .ecr-table tbody td[class*="bg-white"] {
  background: #111827 !important;
  color: #fca5a5 !important;
  border-color: #b91c1c !important;
}

html[data-theme="dark"] .ecr-table tbody td.bg-secondary,
html[data-theme="dark"] .ecr-table tbody td[class*="bg-secondary"] {
  background: #3a2332 !important;
  color: #ffd5df !important;
}

html[data-theme="dark"] .ecr-table tbody td.sticky-col small,
html[data-theme="dark"] .ecr-table tbody td small.text-muted {
  color: #94a3b8 !important;
}

html[data-theme="dark"] #manualColumnModal .modal-content,
html[data-theme="dark"] #customFillModal .modal-content {
  background: #131b26 !important;
  color: #e5e7eb !important;
  border: 1px solid #334155 !important;
}

html[data-theme="dark"] #manualColumnModal .modal-body,
html[data-theme="dark"] #customFillModal .modal-body {
  background: #131b26 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] #manualColumnModal .modal-footer.bg-light,
html[data-theme="dark"] #customFillModal .modal-footer.bg-light {
  background: #182233 !important;
  border-top-color: #334155 !important;
}

html[data-theme="dark"] #manualColumnModal .form-label,
html[data-theme="dark"] #manualColumnModal .form-label.text-dark,
html[data-theme="dark"] #customFillModal .form-label,
html[data-theme="dark"] #customFillModal .text-muted {
  color: #dbe4f0 !important;
}

html[data-theme="dark"] #manualColumnModal .btn-light {
  background: #1f2937 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] #customFillModal .btn-secondary {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

/* Notifications + modals + alerts dark refinements */
html[data-theme="dark"] .notif-dropdown-menu {
  background: #131b26 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .notif-dropdown-menu .dropdown-header {
  border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .notif-dropdown-menu .dropdown-item {
  background: #131b26 !important;
  border-bottom-color: #273142 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .notif-dropdown-menu .dropdown-item:hover,
html[data-theme="dark"] .notif-dropdown-menu .dropdown-item:focus {
  background: #1d293a !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .notif-dropdown-menu .dropdown-item.bg-light {
  background: #1a2535 !important;
}

html[data-theme="dark"] .notif-dropdown-menu .dropdown-item.bg-white {
  background: #131b26 !important;
}

html[data-theme="dark"] .notif-dropdown-menu h6,
html[data-theme="dark"] .notif-dropdown-menu h6[style*="color:"],
html[data-theme="dark"] .notif-dropdown-menu .small,
html[data-theme="dark"] .notif-dropdown-menu .text-muted {
  color: #dbe4f0 !important;
}

html[data-theme="dark"] .notif-dropdown-menu .dropdown-item.text-center {
  background: #182233 !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .notification-list-container {
  background: #131b26 !important;
  scrollbar-color: rgba(148, 163, 184, 0.45) #111827 !important;
}

html[data-theme="dark"] .notification-list-container::-webkit-scrollbar-track {
  background: #111827 !important;
}

html[data-theme="dark"] .notification-list-container::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5) !important;
}

html[data-theme="dark"] .notification-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.7) !important;
}

html[data-theme="dark"] .notification-item {
  background: #131b26 !important;
  border-left-color: transparent !important;
}

html[data-theme="dark"] .notification-item:hover {
  background: #1a2535 !important;
  border-left-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
}

html[data-theme="dark"] .notification-item.active {
  background: #1f2937 !important;
  border-left-color: color-mix(in srgb, var(--theme-color) 78%, #111827) !important;
}

html[data-theme="dark"] .notification-item.unread {
  background: #1b2432 !important;
}

html[data-theme="dark"] .notification-item h6,
html[data-theme="dark"] .notification-item .text-dark,
html[data-theme="dark"] .notification-detail-card h4,
html[data-theme="dark"] .notification-detail-card h4[style*="color:"],
html[data-theme="dark"] .notification-list-container h5.text-dark {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .notification-message-content {
  background: #182233 !important;
  border-left-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .notification-detail-card .card-header,
html[data-theme="dark"] .notification-detail-card .card-body {
  background: #131b26 !important;
}

html[data-theme="dark"] .app-modal .modal-content,
html[data-theme="dark"] #appAlertModal .modal-content,
html[data-theme="dark"] #appConfirmModal .modal-content {
  background: #131b26 !important;
  border: 1px solid #334155 !important;
}

html[data-theme="dark"] .app-modal .modal-header,
html[data-theme="dark"] .app-modal .modal-footer,
html[data-theme="dark"] #appAlertModal .modal-header,
html[data-theme="dark"] #appAlertModal .modal-footer,
html[data-theme="dark"] #appConfirmModal .modal-header,
html[data-theme="dark"] #appConfirmModal .modal-footer {
  background: #182233 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .app-modal .modal-title,
html[data-theme="dark"] .app-modal .modal-body,
html[data-theme="dark"] #appAlertBody,
html[data-theme="dark"] #appConfirmBody {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .modal-backdrop.show {
  opacity: 0.65;
}

html[data-theme="dark"] .alert {
  border-width: 1px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .alert .alert-link {
  color: #ffffff !important;
}

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

/* Admin pages dark refinements */
html[data-theme="dark"] .page-head h3,
html[data-theme="dark"] .page-head h4,
html[data-theme="dark"] .page-head h5,
html[data-theme="dark"] .page-head .fw-bold {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .page-meta {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .card.card-custom.bg-light,
html[data-theme="dark"] .bg-light.border-dashed,
html[data-theme="dark"] #studentFields.bg-light {
  background: #182233 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .bg-white.border.rounded {
  background: #131b26 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .table thead.bg-light th,
html[data-theme="dark"] .table thead.bg-light td,
html[data-theme="dark"] thead.bg-light th,
html[data-theme="dark"] thead.bg-light td {
  background: #1b2636 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  background: #1b2636 !important;
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .users-table-wrap,
html[data-theme="dark"] .table-responsive {
  background: #131b26 !important;
}

html[data-theme="dark"] .main-content .list-group-item:hover {
  background-color: #1d293a !important;
}

html[data-theme="dark"] .grading-config-list .grading-config-option {
  background: linear-gradient(180deg, #152235 0%, #101a29 100%);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.32);
}

html[data-theme="dark"] .grading-config-list .grading-config-option-title {
  color: #f8fafc;
}

html[data-theme="dark"] .grading-config-list .grading-config-option-meta {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .grading-config-list .grading-config-option:hover,
html[data-theme="dark"] .grading-config-list .grading-config-option:focus-visible {
  background: linear-gradient(180deg, rgba(138, 28, 28, 0.28) 0%, rgba(138, 28, 28, 0.2) 100%);
  border-color: rgba(244, 114, 114, 0.55);
  color: #fff1f2;
}

html[data-theme="dark"] .grading-config-list .grading-config-option:hover .grading-config-option-title,
html[data-theme="dark"] .grading-config-list .grading-config-option:focus-visible .grading-config-option-title {
  color: #fff1f2;
}

html[data-theme="dark"] .grading-config-list .grading-config-option:hover .grading-config-option-meta,
html[data-theme="dark"] .grading-config-list .grading-config-option:focus-visible .grading-config-option-meta {
  color: #fecdd3 !important;
}

html[data-theme="dark"] .hover-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .badge.bg-warning.text-dark {
  background-color: #854d0e !important;
  color: #fef3c7 !important;
}

html[data-theme="dark"] .badge.bg-info.text-dark {
  background-color: #155e75 !important;
  color: #cffafe !important;
}

html[data-theme="dark"] .btn-group .btn.active,
html[data-theme="dark"] #paginationControls .btn.active {
  background: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 70%, #111827) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .card-header.bg-white {
  background: #182233 !important;
}

html[data-theme="dark"] .card-footer {
  background: #182233 !important;
  border-color: #334155 !important;
}

/* Table hover/highlight refinements */
html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e5e7eb;
  --bs-table-border-color: #334155;
  --bs-table-striped-bg: #162131;
  --bs-table-striped-color: #e5e7eb;
  --bs-table-hover-bg: #1d293a;
  --bs-table-hover-color: #f8fafc;
  --bs-table-active-bg: #243246;
  --bs-table-active-color: #ffffff;
}

html[data-theme="dark"] .table-hover > tbody > tr > * {
  transition: background-color 0.16s ease, color 0.16s ease;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: #1d293a !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: #162131 !important;
}

html[data-theme="dark"] .table .table-active,
html[data-theme="dark"] .table-active > th,
html[data-theme="dark"] .table-active > td {
  background-color: #243246 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .table td.text-dark,
html[data-theme="dark"] .table th.text-dark,
html[data-theme="dark"] .table .text-dark {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .table thead.table-light th,
html[data-theme="dark"] .table thead.table-light td,
html[data-theme="dark"] .table .table-light th,
html[data-theme="dark"] .table .table-light td,
html[data-theme="dark"] .table .table-danger th,
html[data-theme="dark"] .table .table-danger td {
  background-color: #1b2636 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .table-responsive {
  scrollbar-color: rgba(148, 163, 184, 0.5) #111827 !important;
}

html[data-theme="dark"] .table-responsive::-webkit-scrollbar-track {
  background: #111827 !important;
}

html[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55) !important;
}

html[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.75) !important;
}

html[data-theme="dark"] tr.user-row-click:hover > *,
html[data-theme="dark"] tr.class-row-click:hover > *,
html[data-theme="dark"] tr.section-row-click:hover > *,
html[data-theme="dark"] tr.subject-row-click:hover > * {
  background-color: #223044 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] tr.user-row-click:focus-visible,
html[data-theme="dark"] tr.class-row-click:focus-visible,
html[data-theme="dark"] tr.section-row-click:focus-visible,
html[data-theme="dark"] tr.subject-row-click:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--theme-color) 75%, #e2e8f0);
  outline-offset: -2px;
}

/* Shared class workspace refinements */
html[data-theme="dark"] .content-wrapper {
  background-color: var(--bg-body) !important;
}

html[data-theme="dark"] .text-theme {
  color: #fca5a5 !important;
}

html[data-theme="dark"] .module-description,
html[data-theme="dark"] .overview-stat-label,
html[data-theme="dark"] .overview-quick-link p,
html[data-theme="dark"] .chat-empty-state,
html[data-theme="dark"] .student-class-subnav .nav-link,
html[data-theme="dark"] .teacher-class-subnav .nav-link,
html[data-theme="dark"] .class-mobile-tabs .nav-link {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .overview-stat-value,
html[data-theme="dark"] .overview-quick-link,
html[data-theme="dark"] .overview-quick-link h1,
html[data-theme="dark"] .overview-quick-link h2,
html[data-theme="dark"] .overview-quick-link h3,
html[data-theme="dark"] .overview-quick-link h4,
html[data-theme="dark"] .overview-quick-link h5,
html[data-theme="dark"] .overview-quick-link h6,
html[data-theme="dark"] .overview-quick-link strong,
html[data-theme="dark"] .achievement-class-strip .text-dark,
html[data-theme="dark"] .student-module-card .text-dark,
html[data-theme="dark"] .teacher-module-card .text-dark {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .overview-quick-link {
  background: #131b26 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .overview-quick-link:hover {
  background: #172233 !important;
  border-color: #475569 !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .overview-list-item + .overview-list-item {
  border-top-color: rgba(148, 163, 184, 0.22) !important;
}

html[data-theme="dark"] .student-class-subnav .nav-link,
html[data-theme="dark"] .teacher-class-subnav .nav-link {
  background: #131b26 !important;
  border: 1px solid #334155 !important;
}

html[data-theme="dark"] .student-class-subnav .nav-link:hover,
html[data-theme="dark"] .teacher-class-subnav .nav-link:hover,
html[data-theme="dark"] .class-mobile-tabs .nav-link:hover {
  background: #1b2636 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .student-class-subnav .nav-link.active,
html[data-theme="dark"] .teacher-class-subnav .nav-link.active,
html[data-theme="dark"] .class-tabs-compact .class-mobile-tabs .nav-link.active {
  background: color-mix(in srgb, var(--theme-color) 68%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 68%, #111827) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .class-tabs-compact .card-body {
  background: #131b26 !important;
}

html[data-theme="dark"] .class-tabs-compact .class-mobile-tabs .nav-link {
  background: #182233 !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .achievement-class-strip .progress {
  background: #243246 !important;
}

html[data-theme="dark"] .wysiwyg-shell {
  border-color: #334155 !important;
  background: #131b26 !important;
}

html[data-theme="dark"] .wysiwyg-toolbar {
  border-bottom-color: #334155 !important;
  background: #182233 !important;
}

html[data-theme="dark"] .wysiwyg-editor {
  background: #131b26 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .wysiwyg-editor:empty:before {
  color: #8f9aae !important;
}

html[data-theme="dark"] .card-header.bg-white,
html[data-theme="dark"] .card-header.bg-light,
html[data-theme="dark"] .modal-footer.bg-light,
html[data-theme="dark"] .border-top.p-3.bg-light-subtle,
html[data-theme="dark"] .input-group-text.bg-white {
  background: #182233 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .badge.bg-light.text-dark.border,
html[data-theme="dark"] .badge.bg-light.text-dark,
html[data-theme="dark"] .input-group-text.bg-white i {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .student-class-hero .text-dark,
html[data-theme="dark"] .teacher-class-hero .text-dark {
  color: #ffffff !important;
}

html[data-theme="dark"] .teacher-achievement-card,
html[data-theme="dark"] .teacher-achievement-card .card-header,
html[data-theme="dark"] .teacher-achievement-card .card-body {
  background: #182233 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .teacher-achievement-item {
  background: #111827 !important;
  border-color: #334155 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .teacher-achievement-item h1,
html[data-theme="dark"] .teacher-achievement-item h2,
html[data-theme="dark"] .teacher-achievement-item h3,
html[data-theme="dark"] .teacher-achievement-item h4,
html[data-theme="dark"] .teacher-achievement-item h5,
html[data-theme="dark"] .teacher-achievement-item h6,
html[data-theme="dark"] .teacher-achievement-item .fw-bold,
html[data-theme="dark"] .teacher-achievement-item .fw-semibold {
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-achievement-item p,
html[data-theme="dark"] .teacher-achievement-card .text-muted,
html[data-theme="dark"] .teacher-achievement-item .text-muted,
html[data-theme="dark"] #teacherAchievementModal .form-text {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .teacher-achievement-chip {
  background: #1f2b3d !important;
  color: #dbe5f0 !important;
  border: 1px solid rgba(71, 85, 105, 0.5) !important;
}

html[data-theme="dark"] .teacher-achievement-status-active {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, 0.28) !important;
}

html[data-theme="dark"] .teacher-achievement-status-inactive {
  background: rgba(100, 116, 139, 0.22) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] .teacher-achievement-icon {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
}

html[data-theme="dark"] #teacherAchievementModal .modal-content,
html[data-theme="dark"] #teacherAchievementModal .modal-header,
html[data-theme="dark"] #teacherAchievementModal .modal-body,
html[data-theme="dark"] #teacherAchievementModal .modal-footer {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

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

html[data-theme="dark"] #teacherAchievementModal .btn-light {
  background: #1f2b3d !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] #teacherAchievementModal .btn-light:hover {
  background: #243246 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .teacher-classes-hero {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32%),
    linear-gradient(135deg, #182233 0%, #111827 52%, #0f172a 100%) !important;
  border-color: #334155 !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .teacher-classes-kicker {
  background: rgba(248, 113, 113, 0.12) !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .teacher-classes-hero h1,
html[data-theme="dark"] .teacher-classes-hero h2,
html[data-theme="dark"] .teacher-classes-hero h3,
html[data-theme="dark"] .teacher-classes-hero h4,
html[data-theme="dark"] .teacher-classes-hero h5,
html[data-theme="dark"] .teacher-classes-hero h6,
html[data-theme="dark"] .teacher-classes-hero .fw-bold {
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-classes-hero .text-muted,
html[data-theme="dark"] .teacher-summary-note,
html[data-theme="dark"] .teacher-filter-box label,
html[data-theme="dark"] .teacher-empty-state.text-muted,
html[data-theme="dark"] .teacher-empty-state p {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .teacher-summary-card {
  background: #131b26 !important;
  border-color: #334155 !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="dark"] .teacher-summary-label {
  color: #8fa3bf !important;
}

html[data-theme="dark"] .teacher-summary-value {
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-empty-state {
  background: #131b26 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] .teacher-empty-state .text-dark,
html[data-theme="dark"] .teacher-empty-state h1,
html[data-theme="dark"] .teacher-empty-state h2,
html[data-theme="dark"] .teacher-empty-state h3,
html[data-theme="dark"] .teacher-empty-state h4,
html[data-theme="dark"] .teacher-empty-state h5,
html[data-theme="dark"] .teacher-empty-state h6 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-analytics-hero {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32%),
    linear-gradient(135deg, #182233 0%, #111827 52%, #0f172a 100%) !important;
  border-color: #334155 !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .teacher-analytics-kicker {
  background: rgba(248, 113, 113, 0.12) !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .teacher-analytics-hero h1,
html[data-theme="dark"] .teacher-analytics-hero h2,
html[data-theme="dark"] .teacher-analytics-hero h3,
html[data-theme="dark"] .teacher-analytics-hero h4,
html[data-theme="dark"] .teacher-analytics-hero h5,
html[data-theme="dark"] .teacher-analytics-hero h6,
html[data-theme="dark"] .teacher-analytics-hero .fw-bold,
html[data-theme="dark"] .teacher-priority-item .fw-bold,
html[data-theme="dark"] .teacher-roster-card .fw-bold,
html[data-theme="dark"] .teacher-chart-card .fw-bold,
html[data-theme="dark"] .teacher-action-card .fw-bold,
html[data-theme="dark"] .teacher-roster-card .fw-semibold {
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-analytics-hero .text-muted,
html[data-theme="dark"] .teacher-analytics-note,
html[data-theme="dark"] .teacher-priority-item .text-muted,
html[data-theme="dark"] .teacher-chart-card .text-muted,
html[data-theme="dark"] .teacher-roster-card .text-muted,
html[data-theme="dark"] .teacher-action-card .text-muted {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .teacher-analytics-stat,
html[data-theme="dark"] .teacher-action-card,
html[data-theme="dark"] .teacher-chart-card,
html[data-theme="dark"] .teacher-roster-card {
  background: #131b26 !important;
  border-color: #334155 !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="dark"] .teacher-analytics-stat-label {
  color: #8fa3bf !important;
}

html[data-theme="dark"] .teacher-analytics-stat-value {
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-risk-chip {
  background: #1f2b3d !important;
  color: #dbe5f0 !important;
  border: 1px solid rgba(71, 85, 105, 0.5) !important;
}

html[data-theme="dark"] .teacher-risk-chip.high {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.24) !important;
}

html[data-theme="dark"] .teacher-risk-chip.medium {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
}

html[data-theme="dark"] .teacher-risk-chip.low {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.24) !important;
}

html[data-theme="dark"] .teacher-priority-item {
  background: #111827 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .teacher-chart-card .card-header,
html[data-theme="dark"] .teacher-action-card .card-header,
html[data-theme="dark"] .teacher-roster-card .card-header {
  background: #182233 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .announcement-shell,
html[data-theme="dark"] .student-people-shell,
html[data-theme="dark"] .student-message-shell,
html[data-theme="dark"] .teacher-people-shell,
html[data-theme="dark"] .classwork-shell,
html[data-theme="dark"] .teacher-message-shell {
  background: #131b26 !important;
  border-color: #334155 !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .announcement-composer,
html[data-theme="dark"] .announcement-shell-header,
html[data-theme="dark"] .student-people-toolbar,
html[data-theme="dark"] .student-message-header,
html[data-theme="dark"] .teacher-people-toolbar,
html[data-theme="dark"] .student-message-form-wrap,
html[data-theme="dark"] .classwork-toolbar,
html[data-theme="dark"] .teacher-message-header,
html[data-theme="dark"] .teacher-thread-filters,
html[data-theme="dark"] .teacher-message-thread-header,
html[data-theme="dark"] .teacher-message-form-wrap {
  background: linear-gradient(180deg, #182233 0%, #131b26 100%) !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .announcement-card,
html[data-theme="dark"] .student-message-list,
html[data-theme="dark"] .teacher-roster-item,
html[data-theme="dark"] .student-roster-item,
html[data-theme="dark"] .recognition-history-item,
html[data-theme="dark"] .teacher-message-thread,
html[data-theme="dark"] .teacher-thread-sidebar,
html[data-theme="dark"] .teacher-message-list,
html[data-theme="dark"] .teacher-assessment-card {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .announcement-body,
html[data-theme="dark"] .announcement-card .fw-semibold,
html[data-theme="dark"] .student-message-header .fw-semibold,
html[data-theme="dark"] .student-people-toolbar .fw-semibold,
html[data-theme="dark"] .teacher-people-toolbar .fw-semibold,
html[data-theme="dark"] .classwork-toolbar .fw-semibold,
html[data-theme="dark"] .teacher-message-header .fw-semibold,
html[data-theme="dark"] .teacher-message-thread-header,
html[data-theme="dark"] .teacher-assessment-card .fw-semibold,
html[data-theme="dark"] .teacher-assessment-card .text-dark,
html[data-theme="dark"] .student-roster-item .text-dark,
html[data-theme="dark"] .teacher-roster-item .text-dark,
html[data-theme="dark"] .recognition-history-item .text-dark,
html[data-theme="dark"] .announcement-empty .text-dark {
  color: #f8fafc !important;
}

html[data-theme="dark"] .announcement-shell .text-muted,
html[data-theme="dark"] .student-people-shell .text-muted,
html[data-theme="dark"] .student-message-shell .text-muted,
html[data-theme="dark"] .teacher-people-shell .text-muted,
html[data-theme="dark"] .classwork-shell .text-muted,
html[data-theme="dark"] .classwork-toolbar-copy p,
html[data-theme="dark"] .teacher-message-shell .text-muted,
html[data-theme="dark"] .announcement-empty,
html[data-theme="dark"] .announcement-empty p {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .student-people-chip,
html[data-theme="dark"] .teacher-people-summary-chip,
html[data-theme="dark"] .teacher-chat-achievement-muted,
html[data-theme="dark"] .achievement-indicator-pill-muted {
  background: #1f2b3d !important;
  color: #dbe5f0 !important;
  border-color: rgba(71, 85, 105, 0.5) !important;
}

html[data-theme="dark"] .teacher-thread-preview,
html[data-theme="dark"] .teacher-thread-meta {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .teacher-message-shell .student-chat.active {
  background: #1b2636 !important;
}

html[data-theme="dark"] .student-message-list {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
}

html[data-theme="dark"] .teacher-message-list {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
}

html[data-theme="dark"] .teacher-assessment-icon {
  background: #1f2b3d !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .teacher-assessment-meta,
html[data-theme="dark"] .teacher-assessment-meta .text-muted,
html[data-theme="dark"] .teacher-assessment-meta small {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .announcement-section-header,
html[data-theme="dark"] .announcement-feed-card,
html[data-theme="dark"] #announcementsContainer .card.border-0.shadow-sm,
html[data-theme="dark"] #noResults.card,
html[data-theme="dark"] #createAnnouncementModal .modal-content,
html[data-theme="dark"] #createAnnouncementModal .card.border-0.bg-light,
html[data-theme="dark"] .modal .alert.alert-light {
  background: #131b26 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .announcement-section-header {
  background: linear-gradient(180deg, #182233 0%, #131b26 100%) !important;
}

html[data-theme="dark"] .announcement-section-header h5,
html[data-theme="dark"] .announcement-feed-card h6,
html[data-theme="dark"] #noResults h5,
html[data-theme="dark"] #createAnnouncementModal .modal-title,
html[data-theme="dark"] .modal .modal-title {
  color: #f8fafc !important;
}

html[data-theme="dark"] .announcement-feed-card .badge.bg-light,
html[data-theme="dark"] .btn-announcement-view .badge.bg-light {
  background: #1f2937 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .announcement-body-copy,
html[data-theme="dark"] .announcement-meta-line,
html[data-theme="dark"] .announcement-section-header .text-muted,
html[data-theme="dark"] #announcementsContainer .text-muted,
html[data-theme="dark"] #noResults .text-muted,
html[data-theme="dark"] #createAnnouncementModal .text-muted,
html[data-theme="dark"] .modal .alert.alert-light .text-muted {
  color: #9fb0c5 !important;
}

html[data-theme="dark"] .btn-announcement-view {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4f0 !important;
}

html[data-theme="dark"] .btn-announcement-view:hover,
html[data-theme="dark"] .btn-announcement-view:focus {
  background: #1b2636 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .input-group-text.bg-white,
html[data-theme="dark"] #searchInput,
html[data-theme="dark"] #audienceFilter,
html[data-theme="dark"] #sortFilter,
html[data-theme="dark"] #createAnnouncementModal .form-control,
html[data-theme="dark"] #createAnnouncementModal .form-select {
  background: #0f1725 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] #searchInput::placeholder,
html[data-theme="dark"] #createAnnouncementModal .form-control::placeholder,
html[data-theme="dark"] #createAnnouncementModal textarea::placeholder {
  color: #8fa0b5 !important;
}

html[data-theme="dark"] #createAnnouncementModal .modal-body,
html[data-theme="dark"] #createAnnouncementModal .modal-footer {
  background: #131b26 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] #createAnnouncementModal .modal-footer.bg-light {
  background: #182233 !important;
}

html[data-theme="dark"] #createAnnouncementModal .alert.alert-info,
html[data-theme="dark"] .modal .alert.alert-info {
  background: #16384a !important;
  border-color: #25637d !important;
  color: #d5f3ff !important;
}

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

html[data-theme="dark"] .btn-outline-secondary.shadow-sm,
html[data-theme="dark"] .btn-outline-danger.shadow-sm {
  background: transparent !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .teacher-assessment-meta .meta-separator {
  color: #64748b !important;
}

html[data-theme="dark"] .classwork-shell .form-control,
html[data-theme="dark"] .classwork-shell .form-select,
html[data-theme="dark"] .teacher-message-shell .form-control,
html[data-theme="dark"] .teacher-message-shell .form-select {
  background-color: #111827 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .classwork-shell .form-control::placeholder,
html[data-theme="dark"] .teacher-message-shell .form-control::placeholder {
  color: #8fa3bf !important;
}

html[data-theme="dark"] .teacher-message-shell input[type="file"]::file-selector-button {
  background: #1f2b3d !important;
  color: #e5e7eb !important;
  border: 1px solid #334155 !important;
}

html[data-theme="dark"] .announcement-avatar,
html[data-theme="dark"] .recognition-history-icon {
  border-color: rgba(245, 158, 11, 0.22) !important;
}

html[data-theme="dark"] .recognition-note {
  background: rgba(245, 158, 11, 0.12) !important;
  border-left-color: rgba(245, 158, 11, 0.42) !important;
  color: #f3e5c3 !important;
}

html[data-theme="dark"] .reports-scope-note {
  background: rgba(138, 28, 28, 0.18) !important;
  color: #f3c4c4 !important;
}

html[data-theme="dark"] .reports-filter-card,
html[data-theme="dark"] .reports-panel-card,
html[data-theme="dark"] .reports-kpi-card,
html[data-theme="dark"] .reports-table-scroll,
html[data-theme="dark"] .reports-chart-body,
html[data-theme="dark"] .reports-insight-card,
html[data-theme="dark"] .tab-pane .card.border-0.bg-light,
html[data-theme="dark"] .tab-pane .card.border-0.bg-light .card-body {
  background: #1b2433 !important;
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .reports-panel-card .card-header,
html[data-theme="dark"] .reports-filter-card .card-header,
html[data-theme="dark"] .card-header.bg-white,
html[data-theme="dark"] .bg-white.border-bottom.p-3 {
  background: #202c3d !important;
  border-color: #314056 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .reports-page-head h3,
html[data-theme="dark"] .reports-panel-card h5,
html[data-theme="dark"] .reports-panel-card h6,
html[data-theme="dark"] .reports-insight-card h6,
html[data-theme="dark"] .reports-table td,
html[data-theme="dark"] .reports-table th,
html[data-theme="dark"] .reports-table .fw-semibold,
html[data-theme="dark"] .reports-table .text-dark,
html[data-theme="dark"] .reports-filter-card .form-label,
html[data-theme="dark"] .reports-kpi-card h2,
html[data-theme="dark"] .reports-kpi-card .fw-bold {
  color: #e5edf8 !important;
}

html[data-theme="dark"] .reports-page-head .page-meta,
html[data-theme="dark"] .reports-live-note,
html[data-theme="dark"] .reports-panel-card small,
html[data-theme="dark"] .reports-risk-meta,
html[data-theme="dark"] .reports-empty-state,
html[data-theme="dark"] .reports-empty-state .text-muted,
html[data-theme="dark"] .reports-table .text-muted,
html[data-theme="dark"] .reports-insight-card p,
html[data-theme="dark"] .reports-insight-card .text-muted,
html[data-theme="dark"] .reports-kpi-card small.text-muted {
  color: #9fb0c9 !important;
}

html[data-theme="dark"] .reports-filter-card .form-select,
html[data-theme="dark"] .reports-filter-card .form-control,
html[data-theme="dark"] .reports-reset-btn {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .reports-filter-card .form-select:focus,
html[data-theme="dark"] .reports-filter-card .form-control:focus {
  background: #111827 !important;
  border-color: #7c3aed !important;
  color: #e5edf8 !important;
  box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.18) !important;
}

html[data-theme="dark"] .reports-tab-nav .nav-link {
  color: #aebed5 !important;
}

html[data-theme="dark"] .reports-tab-nav .nav-link.active,
html[data-theme="dark"] .reports-tab-nav .show > .nav-link {
  background: #8a1c1c !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .reports-insight-card {
  background: linear-gradient(180deg, #1f2b3b 0%, #17212f 100%) !important;
  border: 1px solid #314056 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .reports-insight-chip {
  background: rgba(17, 24, 39, 0.92) !important;
  border-color: #334155 !important;
  color: #d7e3f4 !important;
}

html[data-theme="dark"] .reports-rank-pill {
  background: rgba(138, 28, 28, 0.22) !important;
  color: #f5d0d0 !important;
}

html[data-theme="dark"] .reports-score-pill {
  background: #8a1c1c !important;
  color: #fff !important;
}

html[data-theme="dark"] .reports-risk-list .list-group-item,
html[data-theme="dark"] .tab-pane .list-group-item,
html[data-theme="dark"] .reports-panel-card .list-group-item {
  background: transparent !important;
  border-color: #2f3b52 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .reports-table th {
  background: #111827 !important;
  color: #aebed5 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .reports-table td {
  background: transparent !important;
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .badge.bg-light,
html[data-theme="dark"] .badge.bg-light.text-dark,
html[data-theme="dark"] .badge.bg-light.text-dark.border {
  background: #111827 !important;
  color: #dbe7f6 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .alert.alert-light.border,
html[data-theme="dark"] .bg-light.p-4.rounded,
html[data-theme="dark"] .card.border.mt-3,
html[data-theme="dark"] .card.border.mt-3 .card-body {
  background: #1b2433 !important;
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .alert.alert-light.border .fw-semibold,
html[data-theme="dark"] .alert.alert-light.border strong,
html[data-theme="dark"] .bg-light.p-4.rounded h6,
html[data-theme="dark"] .card.border.mt-3 h6,
html[data-theme="dark"] .table.table-bordered td,
html[data-theme="dark"] .table.table-bordered th,
html[data-theme="dark"] .table.table-hover td,
html[data-theme="dark"] .table.table-hover th,
html[data-theme="dark"] .table.table-sm td,
html[data-theme="dark"] .table.table-sm th {
  color: #e5edf8 !important;
}

html[data-theme="dark"] .alert.alert-light.border .text-muted,
html[data-theme="dark"] .bg-light.p-4.rounded .text-muted,
html[data-theme="dark"] .card.border.mt-3 .text-muted,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .table .text-muted.small {
  color: #9fb0c9 !important;
}

html[data-theme="dark"] .bg-light.p-4.rounded .form-select,
html[data-theme="dark"] .bg-light.p-4.rounded .form-control,
html[data-theme="dark"] .table.table-bordered .form-select,
html[data-theme="dark"] .table.table-hover .form-select {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .bg-light.p-4.rounded .form-select:focus,
html[data-theme="dark"] .bg-light.p-4.rounded .form-control:focus,
html[data-theme="dark"] .table.table-bordered .form-select:focus,
html[data-theme="dark"] .table.table-hover .form-select:focus {
  background: #111827 !important;
  border-color: #7c3aed !important;
  color: #e5edf8 !important;
  box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.18) !important;
}

html[data-theme="dark"] .table.table-bordered,
html[data-theme="dark"] .table.table-hover,
html[data-theme="dark"] .table.table-sm {
  border-color: #334155 !important;
}

html[data-theme="dark"] .table.table-bordered td,
html[data-theme="dark"] .table.table-hover td,
html[data-theme="dark"] .table.table-sm td {
  background: transparent !important;
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .table.table-bordered thead.bg-light th,
html[data-theme="dark"] .table.table-hover thead.bg-light th,
html[data-theme="dark"] .table.table-sm thead.bg-light th {
  background: #202c3d !important;
  border-color: #314056 !important;
  color: #dbe7f6 !important;
}

html[data-theme="dark"] .achievement-hero-card,
html[data-theme="dark"] .learning-support-card,
html[data-theme="dark"] .dashboard-updates-card,
html[data-theme="dark"] .student-dashboard-hero-card,
html[data-theme="dark"] .student-dashboard-hero-card .card-body {
  background: #17212f !important;
  border-color: #2f3b52 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .achievement-kicker,
html[data-theme="dark"] .achievement-summary-pill-soft,
html[data-theme="dark"] .learning-metric-pill,
html[data-theme="dark"] .learning-support-card .badge.bg-white.text-dark,
html[data-theme="dark"] .learning-support-card .badge.bg-white,
html[data-theme="dark"] .achievement-hero-card .badge.bg-white.text-dark {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe7f6 !important;
}

html[data-theme="dark"] .achievement-summary-pill {
  background: color-mix(in srgb, var(--theme-color) 28%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 44%, #334155) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .achievement-next-card,
html[data-theme="dark"] .achievement-empty-state,
html[data-theme="dark"] .achievement-badge-card,
html[data-theme="dark"] .learning-support-panel,
html[data-theme="dark"] .learning-focus-card,
html[data-theme="dark"] .dashboard-updates-card .list-group-item,
html[data-theme="dark"] .achievement-unlock-toast,
html[data-theme="dark"] #achievementsModal .modal-content,
html[data-theme="dark"] #achievementsModal .modal-header,
html[data-theme="dark"] #achievementsModal .modal-body {
  background: #1b2433 !important;
  border-color: #2f3b52 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .achievement-next-card-complete {
  background: linear-gradient(180deg, #1d2939 0%, #17212f 100%) !important;
}

html[data-theme="dark"] .achievement-badge-earned {
  background: linear-gradient(180deg, #1d2f24 0%, #17212f 100%) !important;
}

html[data-theme="dark"] .achievement-badge-locked {
  background: #1b2433 !important;
}

html[data-theme="dark"] .achievement-icon-bubble,
html[data-theme="dark"] .achievement-badge-icon,
html[data-theme="dark"] .learning-support-icon {
  background: color-mix(in srgb, var(--theme-color) 16%, #111827) !important;
  color: #dff3e3 !important;
  border-color: color-mix(in srgb, var(--theme-color) 28%, #334155) !important;
}

html[data-theme="dark"] .achievement-progress-bar,
html[data-theme="dark"] .achievement-progress-bar .progress {
  background: #111827 !important;
}

html[data-theme="dark"] .achievement-progress-bar .progress-bar {
  background: linear-gradient(90deg, var(--theme-color) 0%, color-mix(in srgb, var(--theme-color) 75%, #ffffff) 100%) !important;
}

html[data-theme="dark"] .learning-support-action-item,
html[data-theme="dark"] .dashboard-inline-tabs .nav-link,
html[data-theme="dark"] .dashboard-updates-card .text-muted,
html[data-theme="dark"] .achievement-hero-card .text-muted,
html[data-theme="dark"] .learning-support-card .text-muted,
html[data-theme="dark"] #achievementsModal .text-muted,
html[data-theme="dark"] .achievement-unlock-toast .text-muted {
  color: #9fb0c9 !important;
}

html[data-theme="dark"] .dashboard-inline-tabs {
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .dashboard-inline-tabs .nav-link.active,
html[data-theme="dark"] .dashboard-inline-tabs .show > .nav-link {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .dashboard-inline-tabs .nav-link:not(.active):hover {
  background: color-mix(in srgb, var(--theme-color) 8%, transparent) !important;
  color: #dbe7f6 !important;
}

html[data-theme="dark"] .learning-support-card .btn-outline-warning,
html[data-theme="dark"] .learning-support-card .btn-outline-success,
html[data-theme="dark"] .learning-support-card .btn-outline-secondary,
html[data-theme="dark"] .dashboard-updates-card .btn-link,
html[data-theme="dark"] .achievement-hero-card .btn-outline-success {
  background: #111827 !important;
}

html[data-theme="dark"] .learning-support-card .btn-outline-warning {
  border-color: #d4a017 !important;
  color: #f6d36b !important;
}

html[data-theme="dark"] .learning-support-card .btn-outline-success,
html[data-theme="dark"] .achievement-hero-card .btn-outline-success,
html[data-theme="dark"] .dashboard-updates-card .btn-link {
  border-color: color-mix(in srgb, var(--theme-color) 40%, #334155) !important;
  color: #dff3e3 !important;
}

html[data-theme="dark"] .learning-support-card .btn-outline-secondary {
  border-color: #475569 !important;
  color: #dbe7f6 !important;
}

html[data-theme="dark"] .student-dashboard-hero-card .badge.bg-white.text-dark {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

html[data-theme="dark"] .student-classes-hero {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--theme-color) 12%, transparent), transparent 32%),
    linear-gradient(135deg, #17212f 0%, #1b2433 48%, #182333 100%) !important;
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .student-classes-kicker {
  background: color-mix(in srgb, var(--theme-color) 14%, #111827) !important;
  color: #dff3e3 !important;
}

html[data-theme="dark"] .student-classes-hero h2,
html[data-theme="dark"] .student-summary-value,
html[data-theme="dark"] .student-empty-state h5 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .student-classes-hero .text-muted,
html[data-theme="dark"] .student-summary-label,
html[data-theme="dark"] .student-summary-note,
html[data-theme="dark"] .student-empty-state .text-muted {
  color: #9fb0c9 !important;
}

html[data-theme="dark"] .student-summary-card,
html[data-theme="dark"] .student-empty-state {
  background: #1b2433 !important;
  border-color: #2f3b52 !important;
}

html[data-theme="dark"] .pending-summary-card,
html[data-theme="dark"] .pending-task-card,
html[data-theme="dark"] .pending-task-card .card-body {
  background: #17212f !important;
  border-color: #2f3b52 !important;
  color: #e5edf8 !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe7f6 !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter:hover {
  background: color-mix(in srgb, var(--theme-color) 10%, #111827) !important;
  border-color: color-mix(in srgb, var(--theme-color) 30%, #334155) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter-all.active,
html[data-theme="dark"] .task-filter-pills .task-filter-upcoming.active {
  background: var(--theme-color) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter-due-soon {
  color: #f6d36b !important;
  border-color: rgba(212, 160, 23, 0.35) !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter-due-soon:hover,
html[data-theme="dark"] .task-filter-pills .task-filter-due-soon.active {
  background: #8f6b08 !important;
  border-color: #b98b10 !important;
  color: #fff7da !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter-overdue {
  color: #f5b4b4 !important;
  border-color: rgba(198, 40, 40, 0.35) !important;
}

html[data-theme="dark"] .task-filter-pills .task-filter-overdue:hover,
html[data-theme="dark"] .task-filter-pills .task-filter-overdue.active {
  background: #9f1f1f !important;
  border-color: #c62828 !important;
  color: #fff1f1 !important;
}

html[data-theme="dark"] .task-status-badge.upcoming {
  background: color-mix(in srgb, var(--theme-color) 18%, #111827) !important;
  color: #dff3e3 !important;
}

html[data-theme="dark"] .task-status-badge.due-soon {
  background: rgba(184, 134, 11, 0.18) !important;
  color: #f6d36b !important;
}

html[data-theme="dark"] .task-status-badge.overdue {
  background: rgba(198, 40, 40, 0.18) !important;
  color: #f5b4b4 !important;
}

html[data-theme="dark"] .task-type-badge {
  background: #111827 !important;
  color: #dbe7f6 !important;
  border: 1px solid #334155 !important;
}
