/* SSCI custom theme — CSS variables in :root, palette via theme-manager.js + Material Color Utilities */

:root {
  --theme-primary: #71a06a;
  --theme-primary-fg: #ffffff;
  --theme-primary-dark: #5a8354;
  --theme-primary-light: #8fb489;
  --theme-secondary: #8fb489;
  --theme-secondary-fg: #ffffff;
  --theme-body-bg: #f3f3f3;
  --theme-surface: #ffffff;
  --theme-on-surface: #333333;
  --theme-on-background: #333333;
  --theme-muted-fg: #666666;
  --theme-sidebar: #3a3633;
  --theme-nav-fg: #c5c6ca;
  --theme-header-bg: #ffffff;
  --theme-header-bg-end: #f3f3f3;
  --theme-header-fg: #6d6a69;
  --theme-panel-header-bg: #525252;
  --theme-panel-header-fg: #ffffff;
  --theme-panel-bg: #ffffff;
  --theme-content-strip: #f3f3f3;
  --theme-border: #d9dbe4;
  --theme-link: #71a06a;
  --theme-superbox-bg: #1e212a;
  --theme-superbox-fg: #a7acc0;
}

html {
  color-scheme: light;
}

html[data-bs-theme="dark"] {
  color-scheme: dark;
  --theme-body-bg: #1a1a1a;
  --theme-surface: #2b2b2b;
  --theme-on-surface: #e4e4e4;
  --theme-on-background: #e4e4e4;
  --theme-muted-fg: #a0a0a0;
  --theme-sidebar: #2b2926;
  --theme-nav-fg: #c5c6ca;
  --theme-header-bg: #2b2926;
  --theme-header-bg-end: #1f1d1b;
  --theme-header-fg: #c5c6ca;
  --theme-panel-header-bg: #3d3d3d;
  --theme-panel-bg: #2b2b2b;
  --theme-content-strip: #222222;
  --theme-border: #444444;
  --bs-body-bg: #1a1a1a;
  --bs-body-color: #e4e4e4;
  --bs-table-bg: var(--theme-panel-bg);
  --bs-table-color: var(--theme-on-surface);
  --bs-table-border-color: var(--theme-border);
  --bs-table-striped-bg: color-mix(in srgb, var(--theme-panel-bg) 88%, var(--theme-primary));
  --bs-table-hover-bg: color-mix(in srgb, var(--theme-panel-bg) 75%, var(--theme-primary));
  --bs-table-active-bg: color-mix(in srgb, var(--theme-panel-bg) 70%, var(--theme-primary));
}

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

/* ── Global surfaces ── */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--theme-body-bg) !important;
  color: var(--theme-on-surface) !important;
}

#main {
  background: var(--theme-body-bg);
  color: var(--theme-on-surface);
}

#content {
  color: var(--theme-on-surface);
}

a {
  color: var(--theme-link);
}

.page-title,
.page-title span {
  color: var(--theme-on-surface) !important;
}

/* ── Header ── */
.ribbon-button-alignment {
  display: none;
}

#ribbon {
  position: absolute !important;
  z-index: 1;
  left: 3px;
  top: 30px;
  background: 0 0;
  font-size: 11px;
  font-weight: 700;
}

#header {
  background-color: var(--theme-header-bg) !important;
  background-image: none !important;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.05);
  color: var(--theme-header-fg) !important;
}

#logo-group {
  background: var(--theme-header-bg) !important;
}

.login-info > span {
  border-bottom-color: color-mix(in srgb, var(--theme-nav-fg) 40%, transparent);
}

.login-info,
.login-info a,
.login-info strong {
  color: var(--theme-nav-fg) !important;
}

.login-info a:hover,
.login-info strong:hover {
  color: #fff !important;
}

.btn-header > :first-child > a,
.btn-header.transparent > :first-child > a {
  color: var(--theme-header-fg) !important;
  cursor: pointer !important;
}

.btn-header > :first-child > a:hover,
.btn-header.transparent > :first-child > a:hover {
  color: #222 !important;
}

#theme-btn > :first-child > a .fa {
  font-family: FontAwesome;
  font-size: 17px;
  line-height: 30px;
}

#header #hide-menu > :first-child > a,
#header #hide-menu i {
  color: var(--theme-header-fg) !important;
}

.page-title > i:first-child {
  display: none;
}

#logo-group span#activity {
  background: linear-gradient(to top, var(--theme-primary-dark), var(--theme-primary-light));
  border-color: var(--theme-primary-dark);
  color: var(--theme-primary-fg);
}

:not(.mobile-view-activated) #mobile-profile-img {
  display: inline-block !important;
}

#mobile-profile-img a.userdropdown img {
  margin-left: 3px;
}

#mobile-profile-img > li {
  display: inline-block;
  padding-right: 0;
  margin-right: -3px;
}

/* ── Sidebar / nav ── */
aside,
#left-panel {
  background: var(--theme-sidebar) !important;
}

aside .minifyme {
  background: var(--theme-primary) !important;
  color: var(--theme-primary-fg) !important;
}

aside .minifyme:hover {
  background: var(--theme-primary-light) !important;
  color: var(--theme-secondary-fg) !important;
}

:not(.menu-on-top) nav ul li.active:not(.open) > a:before,
:not(.menu-on-top) nav > ul > li.active:not(.open) > a:before {
  content: "";
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAqBAMAAAAt0TTmAAAAHlBMVEUAAAD///////////////////////////////////8kfJuVAAAACnRSTlMABQMJDRIBFhofGayHogAAAOFJREFUKM+F070RgzAMBeBU6QkbuKDnlA1INoCjpWIDzmyA2QC2zVMC6IfcIbrvnjC2xe1v3XuUs4AqoN6gBjMuYOcNqINElHskLqDuflY/fKjgC1VRCZTgu/6isaZpoByU5nYAIqgtRiRhJZp3HKc4AInUynOKQNs8LwlWc3MoNluXNEWsYmxNabdwGDefbRp4YW2rmM1dv8+ue/4+v49MLB37lTMYQdxKclbq/ELfbdaCEOPX2ftA7HRviMHU/SIl1yazUdrZ2MjMUA7gaSn8/IE6ZSHD42Y3oGQH+l+4qg+S/XPD6LV6iwAAAABJRU5ErkJggg==);
  background-repeat: no-repeat;
  background-position: left;
  border-left: 4px solid #fff;
  left: 0;
  height: 20px;
  top: 6px;
}

nav > ul > li.active:not(.open) > a:before {
  height: 26px !important;
  top: 7px !important;
}

nav ul li a {
  color: var(--theme-nav-fg) !important;
  transition: background-color 0.2s ease-in-out 0s;
  font-size: 13px;
  padding-top: 12px;
  padding-bottom: 11px;
}

nav > ul > li > a {
  padding-top: 13px;
  padding-bottom: 13px;
}

nav > ul > li > a b {
  top: 11px;
  font-size: 14px;
}

nav > ul ul li a {
  padding-top: 9px;
  padding-bottom: 8px;
}

:not(.minified) nav ul ul li > a {
  padding-left: 46px;
}

:not(.minified) nav ul ul ul li a {
  padding-left: 69px;
}

:not(.minified) nav ul ul ul ul li a {
  padding-left: 92px;
}

:not(.minified) nav ul ul ul ul ul li a {
  padding-left: 115px;
}

:not(.minified) nav ul ul ul ul ul ul li a {
  padding-left: 138px;
}

:not(.minified) nav > ul > li > a > i {
  margin-right: 9px;
}

:not(.menu-on-top) nav ul li a:hover {
  background: color-mix(in srgb, var(--theme-sidebar) 75%, black) !important;
  color: #fff !important;
}

nav ul li a:active {
  background: color-mix(in srgb, var(--theme-sidebar) 60%, black) !important;
  color: #fff !important;
}

nav ul li.open > a,
nav ul ul,
.minified nav li li,
.minified nav ul ul {
  background: color-mix(in srgb, var(--theme-sidebar) 88%, white) !important;
}

nav > ul ul li:before,
nav > ul > li > ul:before {
  border: none;
}

/* ── Content area ── */
#content > .row:first-child {
  background-color: var(--theme-content-strip) !important;
  margin-top: -10px;
  padding-top: 10px;
  margin-bottom: 13px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--theme-border);
  color: var(--theme-on-surface);
}

#ribbon,
#smart-fixed-ribbon + span {
  display: none;
}

.fixed-ribbon #content {
  padding-top: 10px;
}

/* ── Widgets / panels ── */
.jarviswidget > header {
  background: var(--theme-panel-header-bg) !important;
  color: var(--theme-panel-header-fg) !important;
  border-color: color-mix(in srgb, var(--theme-panel-header-bg) 80%, black) !important;
}

.jarviswidget > header h2,
.jarviswidget > header .widget-icon {
  width: 30px;
  padding-top: 5px;
  color: var(--theme-panel-header-fg) !important;
}

.jarviswidget > div,
.jarviswidget .widget-body {
  background-color: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
}

.widget-body-toolbar,
.smart-form.widget-body-toolbar {
  background: color-mix(in srgb, var(--theme-panel-bg) 92%, var(--theme-muted-fg)) !important;
}

.well {
  background-color: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

.smart-form header {
  background: var(--theme-content-strip) !important;
  color: var(--theme-on-surface) !important;
}

.smart-form footer {
  background: var(--theme-panel-bg) !important;
  border-color: var(--theme-border) !important;
}

/* ── Forms ── */
.form-control,
select,
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
.uneditable-input {
  background-color: var(--theme-surface) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

.select_normal {
  color: var(--theme-primary) !important;
  background-color: transparent !important;
}

/* ── Tables ── */
.table,
table.dataTable {
  color: var(--theme-on-surface);
  --bs-table-bg: var(--theme-panel-bg);
  --bs-table-color: var(--theme-on-surface);
  --bs-table-border-color: var(--theme-border);
}

.table > thead > tr > th,
.table > thead > tr > td,
.table > tfoot > tr > th,
.table > tfoot > tr > td,
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
table.dataTable tfoot td {
  background: color-mix(in srgb, var(--theme-content-strip) 70%, var(--theme-panel-bg)) !important;
  background-image: none !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
table.dataTable tbody td,
table.dataTable tbody th {
  background-color: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: color-mix(in srgb, var(--theme-panel-bg) 95%, var(--theme-primary)) !important;
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  background-color: color-mix(in srgb, var(--theme-panel-bg) 75%, var(--theme-primary)) !important;
}

/* ── Alerts keep semantic colors but readable text in dark mode ── */
[data-bs-theme="dark"] .alert-info {
  background-color: color-mix(in srgb, var(--theme-primary) 25%, var(--theme-panel-bg)) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

/* ── Misc ── */
.superbox-show {
  background: var(--theme-superbox-bg);
}

.superbox-list.active:before {
  color: var(--theme-superbox-bg);
}

.superbox-imageinfo span {
  color: var(--theme-superbox-fg);
}

#div_objectives textarea:focus,
#div_objectives textarea:hover {
  border-bottom-color: var(--theme-primary) !important;
}

/* ── Dark mode overrides for SmartAdmin hardcoded colors ── */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] #main,
[data-bs-theme="dark"] #content {
  background: var(--theme-body-bg) !important;
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] #header {
  background-color: var(--theme-header-bg) !important;
  background-image: none !important;
  color: var(--theme-header-fg) !important;
}

[data-bs-theme="dark"] #logo-group {
  background: var(--theme-header-bg) !important;
}

[data-bs-theme="dark"] .btn-header > :first-child > a,
[data-bs-theme="dark"] .btn-header.transparent > :first-child > a {
  background-color: color-mix(in srgb, var(--theme-header-bg) 70%, #000000) !important;
  background-image: none !important;
  border-color: color-mix(in srgb, var(--theme-header-fg) 25%, transparent) !important;
  box-shadow: none !important;
  color: var(--theme-header-fg) !important;
}

[data-bs-theme="dark"] .btn-header > :first-child > a:hover,
[data-bs-theme="dark"] .btn-header.transparent > :first-child > a:hover {
  background-color: color-mix(in srgb, var(--theme-header-bg) 55%, #000000) !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .btn-header > :first-child > a:active,
[data-bs-theme="dark"] .btn-header.transparent > :first-child > a:active {
  background-color: color-mix(in srgb, var(--theme-header-bg) 45%, #000000) !important;
  box-shadow: inset 0 0 3px 1px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] #header #hide-menu > :first-child > a,
[data-bs-theme="dark"] #header #hide-menu i {
  color: var(--theme-header-fg) !important;
}

[data-bs-theme="dark"] .breadcrumb,
[data-bs-theme="dark"] .breadcrumb a,
[data-bs-theme="dark"] .breadcrumb > .active {
  color: var(--theme-muted-fg) !important;
}

[data-bs-theme="dark"] .modal-content {
  background-color: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] .dropdown-menu > li > a,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] .dropdown-menu > li > a:hover,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:focus {
  background-color: color-mix(in srgb, var(--theme-primary) 20%, var(--theme-panel-bg)) !important;
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] .modal-body,
[data-bs-theme="dark"] .modal-body p,
[data-bs-theme="dark"] .modal-title {
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] .btn-default {
  background-color: var(--theme-surface) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

[data-bs-theme="dark"] .label,
[data-bs-theme="dark"] .text-muted {
  color: var(--theme-muted-fg) !important;
}

/* ── Theme modal ── */
#themeModal {
  z-index: 1000010 !important;
}

#themeModal.show {
  display: block !important;
  opacity: 1 !important;
}

#themeModal .modal-dialog {
  z-index: 1000011;
  position: relative;
}

#themeModal .theme-mode-btn.active {
  font-weight: bold;
}

#theme-color-input {
  width: 100%;
  height: 3rem;
  padding: 0.25rem;
}

#theme-color-picker {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

/* ── Smart forms ── */
.smart-form {
  color: var(--theme-muted-fg) !important;
}

.smart-form header {
  background: var(--theme-content-strip) !important;
  color: var(--theme-on-surface) !important;
  border-bottom-color: var(--theme-border) !important;
}

.smart-form fieldset {
  background: var(--theme-panel-bg) !important;
}

.smart-form fieldset + fieldset {
  border-top-color: var(--theme-border) !important;
}

.smart-form footer {
  background: color-mix(in srgb, var(--theme-panel-bg) 92%, var(--theme-muted-fg)) !important;
  border-top-color: var(--theme-border) !important;
}

.smart-form .label {
  color: var(--theme-on-surface) !important;
}

.smart-form .note,
.note {
  color: var(--theme-muted-fg) !important;
}

.smart-form legend,
.dropdown-menu legend,
.icon-menu legend {
  color: var(--theme-on-surface) !important;
  border-bottom: 1px dashed color-mix(in srgb, var(--theme-border) 80%, transparent) !important;
  background: transparent !important;
}

.map-form-help {
  color: var(--theme-on-surface);
}

.theme-adaptive-icon {
  display: inline-block;
  vertical-align: middle;
  width: 15px;
  height: 15px;
  color: inherit;
  fill: currentColor;
}

.theme-adaptive-icon--sm {
  width: 10px;
  height: 10px;
}

.theme-adaptive-icon--xs {
  width: 12px;
  height: 12px;
}

.theme-adaptive-icon--card {
  width: 50px;
  height: 50px;
  max-width: 50px;
  max-height: 50px;
  color: var(--theme-on-surface);
}

.card-title .theme-adaptive-icon {
  color: var(--theme-on-surface);
}

/* Fallback for legacy <img src="*.svg"> until JS inlines them */
html[data-bs-theme="dark"] .card-title img[src$=".svg"],
html[data-bs-theme="dark"] img.card-img[src$=".svg"] {
  filter: brightness(0) invert(0.9) !important;
}

html[data-bs-theme="dark"] .btn-outline-info img[src$=".svg"] {
  filter: brightness(0) invert(0.85) !important;
}

html[data-bs-theme="dark"] .btn-outline-success img[src$=".svg"] {
  filter: brightness(0) invert(0.75) sepia(0.2) saturate(4) hue-rotate(85deg) !important;
}

html[data-bs-theme="dark"] .btn-outline-warning img[src$=".svg"] {
  filter: brightness(0) invert(0.85) sepia(0.3) saturate(5) hue-rotate(5deg) !important;
}

html[data-bs-theme="dark"] .btn-outline-primary img[src$=".svg"] {
  filter: brightness(0) invert(0.8) sepia(0.2) saturate(4) hue-rotate(190deg) !important;
}

.btn-group > .btn-outline-success,
.widget-body-toolbar .btn-outline-success,
.jarviswidget > header .btn-outline-success {
  color: var(--bs-success, #198754) !important;
}

.btn-group > .btn-outline-warning,
.widget-body-toolbar .btn-outline-warning,
.jarviswidget > header .btn-outline-warning {
  color: #cc9a06 !important;
}

.btn-group > .btn-outline-primary,
.widget-body-toolbar .btn-outline-primary,
.jarviswidget > header .btn-outline-primary {
  color: var(--bs-primary, #0d6efd) !important;
}

.btn-group > .btn-outline-info,
.widget-body-toolbar .btn-outline-info,
.jarviswidget > header .btn-outline-info {
  color: #0aa2c0 !important;
}

[data-bs-theme="dark"] .btn-group > .btn-outline-success,
[data-bs-theme="dark"] .widget-body-toolbar .btn-outline-success,
[data-bs-theme="dark"] .jarviswidget > header .btn-outline-success {
  color: #75b798 !important;
}

[data-bs-theme="dark"] .btn-group > .btn-outline-warning,
[data-bs-theme="dark"] .widget-body-toolbar .btn-outline-warning,
[data-bs-theme="dark"] .jarviswidget > header .btn-outline-warning {
  color: #ffda6a !important;
}

[data-bs-theme="dark"] .btn-group > .btn-outline-primary,
[data-bs-theme="dark"] .widget-body-toolbar .btn-outline-primary,
[data-bs-theme="dark"] .jarviswidget > header .btn-outline-primary {
  color: #6ea8fe !important;
}

[data-bs-theme="dark"] .btn-group > .btn-outline-info,
[data-bs-theme="dark"] .widget-body-toolbar .btn-outline-info,
[data-bs-theme="dark"] .jarviswidget > header .btn-outline-info {
  color: #6edff6 !important;
}

.modal-body h5 {
  color: var(--theme-on-surface);
}

.smart-form .input input,
.smart-form .select select,
.smart-form .textarea textarea {
  background: var(--theme-surface) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

div[class*="Formset"] .note,
div[class*="formset"] .note {
  background: color-mix(in srgb, var(--theme-panel-bg) 90%, var(--theme-muted-fg)) !important;
}

/* ── django_tables2 paleblue ── */
table.paleblue {
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface);
}

table.paleblue td,
table.paleblue th {
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface) !important;
}

table.paleblue thead th,
table.paleblue thead td {
  background: color-mix(in srgb, var(--theme-content-strip) 60%, var(--theme-panel-bg)) !important;
  background-image: none !important;
  color: var(--theme-on-surface) !important;
  border-bottom-color: var(--theme-border) !important;
  border-left-color: var(--theme-border) !important;
}

table.paleblue thead th > a:link,
table.paleblue thead th > a:visited {
  color: var(--theme-link) !important;
}

table.paleblue tr.odd td,
table.paleblue tr.odd th {
  background-color: color-mix(in srgb, var(--theme-panel-bg) 88%, var(--theme-primary)) !important;
}

table.paleblue tr.even td,
table.paleblue tr.even th {
  background-color: var(--theme-panel-bg) !important;
}

table.paleblue + ul.pagination {
  background: var(--theme-panel-bg) !important;
  background-image: none !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface);
}

table.paleblue + ul.pagination > li > a {
  color: var(--theme-link) !important;
}

/* ── DataTables ── */
.dataTables_wrapper,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--theme-on-surface) !important;
}

table.dataTable tbody tr {
  background-color: var(--theme-panel-bg) !important;
}

table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd,
table.dataTable.stripe tbody tr.odd td,
table.dataTable.stripe tbody tr.odd th,
table.dataTable.display tbody tr.odd td,
table.dataTable.display tbody tr.odd th {
  background-color: color-mix(in srgb, var(--theme-panel-bg) 88%, var(--theme-primary)) !important;
}

table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover,
table.dataTable.hover tbody tr:hover td,
table.dataTable.hover tbody tr:hover th,
table.dataTable.display tbody tr:hover td,
table.dataTable.display tbody tr:hover th {
  background-color: color-mix(in srgb, var(--theme-panel-bg) 75%, var(--theme-primary)) !important;
}

table.dataTable.display tbody tr > .sorting_1,
table.dataTable.display tbody tr > .sorting_2,
table.dataTable.display tbody tr > .sorting_3,
table.dataTable.order-column tbody tr > .sorting_1,
table.dataTable.order-column tbody tr > .sorting_2,
table.dataTable.order-column tbody tr > .sorting_3,
table.dataTable.display tbody tr.odd > .sorting_1,
table.dataTable.display tbody tr.odd > .sorting_2,
table.dataTable.display tbody tr.odd > .sorting_3,
table.dataTable.display tbody tr.even > .sorting_1,
table.dataTable.display tbody tr.even > .sorting_2,
table.dataTable.display tbody tr.even > .sorting_3,
table.dataTable.display tbody tr:hover > .sorting_1,
table.dataTable.display tbody tr:hover > .sorting_2,
table.dataTable.display tbody tr:hover > .sorting_3 {
  background-color: inherit !important;
}

.dataTables_wrapper .top,
.dataTables_wrapper .bottom {
  background-color: color-mix(in srgb, var(--theme-panel-bg) 92%, var(--theme-muted-fg)) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface) !important;
}

.dataTables_empty,
.dataTables_wrapper .dataTables_empty {
  background: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
}

.dataTables_scrollHead,
.dataTables_scrollBody,
.dataTables_scrollFoot,
.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner table,
.dataTables_scrollBody table {
  background: var(--theme-panel-bg) !important;
}

.table-responsive {
  background: transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--theme-on-surface) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--theme-primary) !important;
  color: var(--theme-primary-fg) !important;
  border-color: var(--theme-primary) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: color-mix(in srgb, var(--theme-panel-bg) 85%, var(--theme-muted-fg)) !important;
  background-image: none !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: color-mix(in srgb, var(--theme-panel-bg) 70%, var(--theme-primary)) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

[data-bs-theme="dark"] table.dataTable.row-border tbody td,
[data-bs-theme="dark"] table.dataTable.row-border tbody th,
[data-bs-theme="dark"] table.dataTable.display tbody td,
[data-bs-theme="dark"] table.dataTable.display tbody th,
[data-bs-theme="dark"] table.dataTable.cell-border tbody td,
[data-bs-theme="dark"] table.dataTable.cell-border tbody th {
  border-top-color: var(--theme-border) !important;
  border-right-color: var(--theme-border) !important;
  border-left-color: var(--theme-border) !important;
}

/* ── Select2 (when used on forms) ── */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--theme-on-surface) !important;
}

.select2-dropdown {
  background-color: var(--theme-panel-bg) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--theme-primary) !important;
  color: var(--theme-primary-fg) !important;
}

/* ── Dashboard cards ── */
.dashboard-card-resources {
  background-color: color-mix(in srgb, var(--theme-content-strip) 50%, var(--theme-panel-bg)) !important;
}

.dashboard-card-personal {
  background-color: color-mix(in srgb, var(--theme-primary) 14%, var(--theme-panel-bg)) !important;
}

.dashboard-card-patients {
  background-color: color-mix(in srgb, var(--theme-secondary) 18%, var(--theme-panel-bg)) !important;
}

.dashboard-stat-primary {
  color: var(--theme-primary) !important;
}

.dashboard-stat-accent {
  color: color-mix(in srgb, var(--theme-primary) 65%, var(--theme-on-surface)) !important;
}

.dashboard-stat-warn {
  color: color-mix(in srgb, var(--theme-primary) 80%, #b8860b) !important;
}

.dashboard-stat-danger {
  color: color-mix(in srgb, var(--theme-secondary) 40%, #c0005a) !important;
}

.dashboard-muted {
  color: var(--theme-muted-fg) !important;
}

.dashboard-heading {
  color: var(--theme-on-surface) !important;
  font-weight: bold;
}

.dashboard-divider {
  border-color: var(--theme-border) !important;
}

.custom-card {
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface);
}

.custom-card .card-title {
  border-bottom-color: var(--theme-border) !important;
  color: var(--theme-on-surface);
}

.custom-card .b-card {
  border-bottom-color: var(--theme-border) !important;
}

/* ── Accordion ── */
.accordion-item {
  background-color: var(--theme-panel-bg) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-on-surface);
}

.accordion-button {
  background-color: var(--theme-content-strip) !important;
  color: var(--theme-on-surface) !important;
  border-radius: 10px !important;
}

.accordion-button:not(.collapsed) {
  background-color: color-mix(in srgb, var(--theme-primary) 18%, var(--theme-content-strip)) !important;
  color: var(--theme-on-surface) !important;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.accordion-body {
  background-color: var(--theme-panel-bg) !important;
  color: var(--theme-on-surface) !important;
}

.accordion-body .table td,
.accordion-button .table td {
  background-color: transparent !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

[data-bs-theme="dark"] .select_normal {
  background-color: transparent !important;
  color: var(--theme-primary) !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .smart-form .input input:focus,
[data-bs-theme="dark"] .smart-form .textarea textarea:focus {
  background-color: var(--theme-surface) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-primary) !important;
}

[data-bs-theme="dark"] #div_objectives textarea {
  background: var(--theme-surface) !important;
  color: var(--theme-on-surface) !important;
  border-color: var(--theme-border) !important;
}

[data-bs-theme="dark"] #div_objectives textarea:focus,
[data-bs-theme="dark"] #div_objectives textarea:hover {
  background: color-mix(in srgb, var(--theme-panel-bg) 90%, var(--theme-primary)) !important;
}

@media (max-width: 979px) {
  #header {
    background: var(--theme-header-bg) !important;
  }

  #hide-menu > :first-child > a {
    border-color: #bfbfbf !important;
  }

  :not(.menu-on-top) #left-panel {
    margin-top: 0 !important;
  }

  #project-context > :first-child,
  #project-selector,
  .btn-header.transparent a,
  .header-dropdown-list > li > .dropdown-toggle,
  .project-context > :first-child,
  .project-selector {
    color: var(--theme-on-surface) !important;
    text-shadow: none;
  }
}

/* ── Legacy SmartAdmin overrides (formerly smartadmin-skins.css) ── */
ul hr {
  border: solid 1px #444444;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

#div_objectives textarea {
  border-color: white !important;
}

#div_objectives textarea:focus,
#div_objectives textarea:hover {
  border-bottom-color: rgb(65, 126, 178) !important;
  background: #f7f7f7 !important;
}

.select_normal {
  background-color: white !important;
  border: none !important;
  font-weight: bold !important;
  font-size: 13px !important;
  padding-left: 0px !important;
  margin-left: -5px !important;
  margin-top: -2px !important;
}

div[class*=formset] {
  border-bottom: dotted 1px #dedede;
}

div[class*=Formset] .note,
div[class*=formset] .note {
  font-weight: normal;
  background: #f7f7f7 !important;
}

div[class*=Formset] a.delete-row .note,
div[class*=formset] a.delete-row .note {
  background: none !important;
}
