:root {
  --erp-bg: #f5f7fb;
  --erp-surface: #ffffff;
  --erp-surface-2: #f1f4f8;
  --erp-border: #dfe5ec;
  --erp-text: #263241;
  --erp-muted: #6c7886;
  --erp-link: #1976d2;
  --erp-input-bg: #ffffff;
  --erp-shadow: rgba(24, 36, 51, .12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --erp-bg: #101720;
  --erp-surface: #1a2532;
  --erp-surface-2: #243244;
  --erp-border: #36485c;
  --erp-text: #dce6f1;
  --erp-muted: #9eacbb;
  --erp-link: #ffffff;
  --erp-input-bg: #131d28;
  --erp-shadow: rgba(0, 0, 0, .35);
}

/* Keep every textual element fully legible in dark mode. */
html[data-theme="dark"] body,
html[data-theme="dark"] body :where(
  h1, h2, h3, h4, h5, h6,
  p, a, span, div, label, legend, small, strong, em,
  li, dt, dd, th, td, caption,
  input, textarea, select, option, button
) {
  color: #fff !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(255, 255, 255, .78) !important;
  opacity: 1;
}

html[data-theme="dark"] input:disabled,
html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] .disabled,
html[data-theme="dark"] [aria-disabled="true"] {
  color: #fff !important;
  opacity: .72;
}

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

html[data-theme="dark"] .navbar-bg { background-color: #152130 !important; }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar-content { background-color: #1c2a3a !important; }

html[data-theme="dark"] .footer,
html[data-theme="dark"] .tab-content {
  background-color: var(--erp-bg) !important;
  color: var(--erp-muted) !important;
  border-color: var(--erp-border) !important;
}

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

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

html[data-theme="dark"] .nav-tabs .nav-link:hover {
  background-color: rgba(105, 180, 255, .08) !important;
  color: #dcecff !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-tabs .nav-item.show .nav-link {
  background-color: var(--erp-surface-2) !important;
  border-color: var(--erp-border) var(--erp-border) var(--erp-surface-2) !important;
  color: #f4f7fb !important;
}

html[data-theme="dark"] .alert-info {
  background-color: #163b4a !important;
  border-color: #286174 !important;
  color: #c9f1ff !important;
}

html[data-theme="dark"] .alert-warning {
  background-color: #44391d !important;
  border-color: #77622b !important;
  color: #ffe9a6 !important;
}

html[data-theme="dark"] .alert-danger {
  background-color: #47252a !important;
  border-color: #7b3b45 !important;
  color: #ffc8cf !important;
}

html[data-theme="dark"] .alert-success {
  background-color: #183d31 !important;
  border-color: #2e6a55 !important;
  color: #bdebd9 !important;
}

html[data-theme="dark"] .bg-lighter-green,
html[data-theme="dark"] .bg-success-2 {
  background-color: #1d4838 !important;
  color: #d7f7e8 !important;
}

html[data-theme="dark"] .bg-attendance-pending {
  background-color: #273445 !important;
  color: var(--erp-text) !important;
}

html[data-theme="dark"] .bg-danger-2,
html[data-theme="dark"] .bg-danger-3 {
  background-color: #512c34 !important;
  color: #ffd8dd !important;
}

html[data-theme="dark"] .bg-warning-2 {
  background-color: #4a3d23 !important;
  color: #ffecb5 !important;
}

html[data-theme="dark"] .freeze {
  background-color: #263548 !important;
}

/* Course detail lesson states: apply color to cells so Bootstrap's table layer
   cannot wash out the status background set on the row. */
html[data-theme="dark"] .course-details-page .table > thead > tr > th {
  background-color: #29394c !important;
  border-color: #40536a !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr > td {
  background-color: #1d2937 !important;
  border-color: #34475a !important;
  color: #fff !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-lighter-green > td {
  background-color: #1d302d !important;
  border-color: #304b46 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-attendance-pending > td {
  background-color: #222d3a !important;
  border-color: #354659 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-warning-2 > td {
  background-color: #332f25 !important;
  border-color: #514936 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-danger-2 > td {
  background-color: #30272e !important;
  border-color: #523b45 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-lighter-green > td:first-child {
  border-left: 4px solid #3d9a73 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-attendance-pending > td:first-child {
  border-left: 4px solid #71849a !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-warning-2 > td:first-child {
  border-left: 4px solid #d09a37 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-danger-2 > td:first-child {
  border-left: 4px solid #c25a68 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr:not([class*="bg-"]):hover > td {
  background-color: rgba(105, 180, 255, .08) !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-lighter-green:hover > td {
  background-color: #243a35 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-attendance-pending:hover > td {
  background-color: #293746 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-warning-2:hover > td {
  background-color: #3d382a !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-danger-2:hover > td {
  background-color: #3a2d35 !important;
}

html[data-theme="dark"] .course-details-page .table > tbody > tr.bg-danger-2 .line-through {
  opacity: .72;
}

html[data-theme="dark"] .course-details-page .bg-danger-3 {
  background-color: #783340 !important;
  border: 1px solid #a9505d;
  color: #fff !important;
}

html[data-theme="dark"] .course-details-page .bg-warning-3 {
  background-color: #6a4d18 !important;
  border: 1px solid #96702c;
  color: #fff !important;
}

html[data-theme="dark"] .course-details-page .bg-info-3 {
  background-color: #17647c !important;
  border: 1px solid #3a8ca4;
  color: #fff !important;
}

html[data-theme="dark"] .course-details-page .alert-outline-info,
html[data-theme="dark"] .course-details-page .box.border {
  background-color: #202e3e !important;
  border-color: #40536a !important;
  color: #fff !important;
}

.course-details-page .course-details-heading {
  min-height: 44px;
}

.course-details-page .course-details-heading h1 {
  min-width: 0;
}

.course-details-page .course-operations {
  margin-left: auto;
}

.course-details-page .course-summary-panel {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 1rem 1.15rem !important;
  border-radius: 8px;
  line-height: 1.65;
}

.course-details-page .course-summary-panel > br:first-child {
  display: none;
}

html[data-theme="dark"] .course-details-page .course-summary-panel.alert-primary {
  background-color: #203246 !important;
  border-color: #3c5873 !important;
  color: #fff !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .course-details-page .course-summary-panel a {
  color: #9fd0ff !important;
  text-decoration-color: rgba(159, 208, 255, .45);
}

html[data-theme="dark"] .course-details-page .course-summary-panel .bg-info-3 {
  margin-top: .35rem;
  padding: .35rem .55rem;
  background-color: #20566b !important;
  border-color: #397d96;
}

html[data-theme="dark"] .course-details-page .course-details-heading .border {
  background-color: #202e3e !important;
  border-color: #40536a !important;
  border-radius: 7px;
}

html[data-theme="dark"] .course-details-page .student-row {
  margin-bottom: .5rem;
  padding: .65rem .75rem;
  background-color: #1b2938 !important;
  border: 1px solid #3a4d62 !important;
  border-radius: 8px;
  color: #fff !important;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

html[data-theme="dark"] .course-details-page .student-row:last-child {
  margin-bottom: 0;
}

html[data-theme="dark"] .course-details-page .student-row:hover {
  background-color: #26394d !important;
  border-color: #5c7896 !important;
  transform: translateY(-1px);
}

html[data-theme="dark"] .course-details-page .student-row .circle-32 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

html[data-theme="dark"] .course-details-page .student-row .text-info,
html[data-theme="dark"] .course-details-page .student-row .text-secondary {
  color: #d8e5f2 !important;
}

html[data-theme="dark"] .course-details-page .pop-note i {
  color: #c8d6e5 !important;
}

html[data-theme="dark"] .course-details-page .pop-note:hover::after {
  background-color: #29394c !important;
  border: 1px solid #4a6079;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .course-details-page .pop-note:hover::before {
  border-color: transparent transparent #4a6079 transparent !important;
}

html[data-theme="dark"] .tt-card,
html[data-theme="dark"] .tt-kpi,
html[data-theme="dark"] .tt-foot,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .pill {
  background-color: var(--erp-surface) !important;
  border-color: var(--erp-border) !important;
  color: var(--erp-text) !important;
}

html[data-theme="dark"] .wrap table th {
  background-color: #29394c !important;
  color: #f4f7fb !important;
  border-color: var(--erp-border) !important;
}

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

html[data-theme="dark"] .muted,
html[data-theme="dark"] .kpi .l {
  color: var(--erp-muted) !important;
}

html[data-theme="dark"] .tt-chip,
html[data-theme="dark"] .tt-prog {
  background-color: var(--erp-surface-2) !important;
  border-color: var(--erp-border) !important;
  color: var(--erp-text) !important;
}

html[data-theme="dark"] .pagination .page-link,
html[data-theme="dark"] .dataTables_paginate .paginate_button {
  background-color: var(--erp-surface-2) !important;
  border-color: var(--erp-border) !important;
  color: var(--erp-link) !important;
}

html[data-theme="dark"] .pagination .page-item.active .page-link,
html[data-theme="dark"] .dataTables_paginate .paginate_button.current {
  background-color: #356da6 !important;
  border-color: #4a8ac8 !important;
  color: #fff !important;
}

html[data-theme="dark"] .pagination .page-item.disabled .page-link,
html[data-theme="dark"] .dataTables_paginate .paginate_button.disabled {
  background-color: #1a2430 !important;
  color: #718096 !important;
}

html[data-theme="dark"] pre,
html[data-theme="dark"] code:not(.hljs) {
  background-color: #111a24 !important;
  color: #dce6f1 !important;
  border-color: var(--erp-border) !important;
}

/* Compatibility layer for legacy inline light-theme declarations. */
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] tr[style*="#f2f2f2"],
html[data-theme="dark"] tr[style*="#F2F2F2"] {
  background-color: var(--erp-surface) !important;
  color: var(--erp-text) !important;
}

html[data-theme="dark"] [style*="#d4edda"],
html[data-theme="dark"] [style*="#D4EDDA"] {
  background-color: #1d4838 !important;
  color: #d7f7e8 !important;
}

html[data-theme="dark"] [style*="#f8d7da"],
html[data-theme="dark"] [style*="#F8D7DA"] {
  background-color: #512c34 !important;
  color: #ffd8dd !important;
}

html[data-theme="dark"] .student-source-answer.badge {
  background-color: #21435a !important;
  border-color: #37647e !important;
  color: #bfe7ff !important;
}

html[data-theme="dark"] #radios {
  background-color: #3b3720 !important;
  border: 1px solid #645d32 !important;
  color: #fff1a8 !important;
}

html[data-theme="dark"] #radios label,
html[data-theme="dark"] #radios strong {
  color: #fff1a8 !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .h1,
html[data-theme="dark"] .h2,
html[data-theme="dark"] .h3,
html[data-theme="dark"] .h4,
html[data-theme="dark"] .h5,
html[data-theme="dark"] .h6,
html[data-theme="dark"] label,
html[data-theme="dark"] legend,
html[data-theme="dark"] th,
html[data-theme="dark"] strong {
  color: #f4f7fb !important;
}

html[data-theme="dark"] .navbar-bg,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
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,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .table-row [class*="col-"]:last-child {
  background-color: var(--erp-surface) !important;
  color: var(--erp-text) !important;
  border-color: var(--erp-border) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .table-responsive.border {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16) !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"] .accordion-button:not(.collapsed),
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-1 tr:first-child th,
html[data-theme="dark"] .table-1-sm tr:first-child th,
html[data-theme="dark"] .table-2 tr:first-child th,
html[data-theme="dark"] .table-row [class*="col-"]:first-child {
  background-color: var(--erp-surface-2) !important;
  color: var(--erp-text) !important;
  border-color: var(--erp-border) !important;
}

html[data-theme="dark"] .bg-light-2,
html[data-theme="dark"] .badge-custom {
  background-color: var(--erp-surface-2) !important;
  color: #f4f7fb !important;
  border: 1px solid var(--erp-border);
}

html[data-theme="dark"] thead.bg-light,
html[data-theme="dark"] thead.bg-secondary,
html[data-theme="dark"] thead.table-light,
html[data-theme="dark"] .table > thead {
  background-color: #29394c !important;
  color: #f4f7fb !important;
}

html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--erp-text);
  --bs-table-border-color: var(--erp-border);
  --bs-table-striped-bg: rgba(255, 255, 255, .035);
  --bs-table-striped-color: var(--erp-text);
  --bs-table-hover-bg: rgba(112, 183, 255, .1);
  --bs-table-hover-color: var(--erp-text);
  color: var(--erp-text) !important;
  border-color: var(--erp-border) !important;
}

html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table-1 td,
html[data-theme="dark"] .table-1-sm td,
html[data-theme="dark"] .table-2 td,
html[data-theme="dark"] .table-3 td,
html[data-theme="dark"] .table-4 td {
  color: var(--erp-text);
  border-color: var(--erp-border);
}

html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] table.dataTable > thead > tr > th {
  background-color: #29394c !important;
  color: #f4f7fb !important;
}

html[data-theme="dark"] tr[style*="#CFD4D4"],
html[data-theme="dark"] tr[style*="#cfd4d4"] {
  background-color: #263548 !important;
  color: var(--erp-text) !important;
}

html[data-theme="dark"] table.dataTable tbody tr,
html[data-theme="dark"] table.dataTable.stripe tbody tr.odd,
html[data-theme="dark"] table.dataTable.display tbody tr.odd {
  background-color: var(--erp-surface) !important;
}

html[data-theme="dark"] table.dataTable tbody tr:hover,
html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .table-hover-2 tr:hover {
  background-color: rgba(112, 183, 255, .1) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control-2,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
html[data-theme="dark"] .select2-selection,
html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-search__field {
  background-color: var(--erp-input-bg) !important;
  color: var(--erp-text) !important;
  border-color: var(--erp-border) !important;
}

html[data-theme="dark"] .select2-results__option,
html[data-theme="dark"] .select2-selection__rendered {
  color: var(--erp-text) !important;
}

html[data-theme="dark"] .select2-results__option--highlighted,
html[data-theme="dark"] .select2-results__option[aria-selected="true"] {
  background: #285b8f !important;
  color: #fff !important;
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .page-link,
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .table-row a,
html[data-theme="dark"] a:not(.btn):not(.badge) {
  color: var(--erp-link) !important;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item.active,
html[data-theme="dark"] .page-item.active .page-link {
  background-color: #285b8f !important;
  color: #fff !important;
}

html[data-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #bdc9d6;
  --bs-btn-border-color: #60758c;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #3b82c4;
  --bs-btn-hover-border-color: #3b82c4;
  color: #bdc9d6;
  border-color: #60758c;
}

html[data-theme="dark"] .sidebar-link,
html[data-theme="dark"] .sidebar-link i,
html[data-theme="dark"] .sidebar-link svg,
html[data-theme="dark"] .sidebar-item a {
  color: rgba(233, 239, 246, .82) !important;
}

html[data-theme="dark"] .sidebar-item a:hover,
html[data-theme="dark"] .sidebar-item .active {
  color: #fff !important;
}

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

html[data-theme="dark"] [style*="color: #555"],
html[data-theme="dark"] [style*="color:#555"],
html[data-theme="dark"] [style*="color: #333"],
html[data-theme="dark"] [style*="color:#333"],
html[data-theme="dark"] [style*="color:darkblue"] {
  color: var(--erp-muted) !important;
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .dropdown-divider,
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(--erp-border) !important;
}

html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }
html[data-theme="dark"] .topbar-weather__temp,
html[data-theme="dark"] .topbar-username { color: var(--erp-text) !important; }
html[data-theme="dark"] .topbar-weather__location::after { border-color: var(--erp-border); }

html[data-theme="dark"] .daterangepicker,
html[data-theme="dark"] .daterangepicker .calendar-table,
html[data-theme="dark"] .ui-datepicker,
html[data-theme="dark"] .ui-widget-content {
  background: var(--erp-surface) !important;
  color: var(--erp-text) !important;
  border-color: var(--erp-border) !important;
}

html[data-theme="dark"] .daterangepicker td.off,
html[data-theme="dark"] .daterangepicker td.off.in-range,
html[data-theme="dark"] .daterangepicker td.off.start-date,
html[data-theme="dark"] .daterangepicker td.off.end-date {
  background: var(--erp-surface-2) !important;
  color: var(--erp-muted) !important;
}

html[data-theme="dark"] .swal-modal,
html[data-theme="dark"] .swal2-popup {
  background-color: var(--erp-surface) !important;
  color: var(--erp-text) !important;
}
html[data-theme="dark"] .swal-title,
html[data-theme="dark"] .swal-text,
html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container { color: var(--erp-text) !important; }

html[data-theme="dark"] .fancybox__backdrop { background: rgba(4, 8, 13, .9) !important; }
html[data-theme="dark"] .fancybox__content { background: var(--erp-surface) !important; }

.theme-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0 .2rem;
  padding: 0 !important;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #495057;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.theme-toggle:hover { background: rgba(25, 118, 210, .1); color: #1976d2; }
.theme-toggle:focus-visible { outline: 3px solid rgba(25, 118, 210, .35); outline-offset: 2px; }
.topbar-theme-link { color: #495057; cursor: pointer; }
.topbar-theme-link:hover { color: #1976d2; }
.theme-toggle__sun { display: none; }
html[data-theme="dark"] .theme-toggle { color: #ffd166 !important; }
html[data-theme="dark"] .topbar-theme-link { color: #ffd166 !important; }
html[data-theme="dark"] [data-theme-toggle] .theme-toggle__moon { display: none; }
html[data-theme="dark"] [data-theme-toggle] .theme-toggle__sun { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* Final dark-mode text pass: override legacy page and utility colors. */
html[data-theme="dark"] body :is(
  h1, h2, h3, h4, h5, h6,
  p, a, span, div, label, legend, small, strong, em,
  li, dt, dd, th, td, caption,
  input, textarea, select, option, button
)[class] {
  color: #fff !important;
}

html[data-theme="dark"] body a[href],
html[data-theme="dark"] body .text-primary,
html[data-theme="dark"] body .text-secondary,
html[data-theme="dark"] body .text-info,
html[data-theme="dark"] body .text-muted,
html[data-theme="dark"] body .text-dark,
html[data-theme="dark"] body .text-body {
  color: #fff !important;
}

html[data-theme="dark"] body [class]:not(i):not(svg):not(path),
html[data-theme="dark"] body *:not([class]):not(i):not(svg):not(path) {
  color: #fff !important;
}

/* Restore hierarchy and rhythm in the dark sidebar while keeping text white. */
html[data-theme="dark"] .sidebar-nav > .sidebar-item {
  margin: 2px 10px;
}

html[data-theme="dark"] .sidebar-link,
html[data-theme="dark"] a.sidebar-link {
  width: calc(100% - 2px);
  padding: .68rem 1rem;
  border-left: 3px solid transparent;
  border-radius: 7px;
  background: transparent !important;
  opacity: .76;
  transition: background-color .15s ease, opacity .15s ease, border-color .15s ease;
}

html[data-theme="dark"] .sidebar-link i,
html[data-theme="dark"] .sidebar-link svg {
  width: 1.25rem;
  margin-right: .8rem;
  text-align: center;
  opacity: .88;
}

html[data-theme="dark"] .sidebar-link:hover,
html[data-theme="dark"] .sidebar-link:focus {
  background: rgba(255, 255, 255, .055) !important;
  opacity: 1;
}

html[data-theme="dark"] .sidebar-link.active,
html[data-theme="dark"] .sidebar-item.active > .sidebar-link {
  border-left-color: #69b4ff;
  background: rgba(105, 180, 255, .13) !important;
  box-shadow: inset 0 0 0 1px rgba(105, 180, 255, .08);
  font-weight: 600;
  opacity: 1;
}

html[data-theme="dark"] .sidebar-item.border-top.my-4 {
  margin-top: 1rem !important;
  margin-bottom: .5rem !important;
  padding-top: 1rem !important;
  border-color: var(--erp-border) !important;
}
