/* Cotactic BI Dark Mode Overrides */
/* Scoped to [data-bs-theme="dark"] — Bootstrap 5.3 handles everything else */

/* ─── Top navbar ─────────────────────────────────────────── */
[data-bs-theme="dark"] .sb-topnav {
  background: #0d1117 !important;
}

[data-bs-theme="dark"] .nav-part {
  background: #0d1117 !important;
}

/* ─── Main content background ────────────────────────────── */
[data-bs-theme="dark"] body {
  background-color: #1a1d23;
}

[data-bs-theme="dark"] #layoutSidenav_content {
  background-color: #1a1d23;
}

/* ─── Sidebar footer (dark theme toggle lives here) ─────── */
[data-bs-theme="dark"] .sb-sidenav-dark .sb-sidenav-footer {
  background-color: #0d1117;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Cards ──────────────────────────────────────────────── */
[data-bs-theme="dark"] .card {
  background-color: #212529;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .card-header {
  background-color: #2b2f36;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ─── Tables ─────────────────────────────────────────────── */
[data-bs-theme="dark"] .table {
  --bs-table-bg: #212529;
  --bs-table-striped-bg: #2b2f36;
  --bs-table-hover-bg: #2b2f36;
  color: #dee2e6;
}

/* ─── Select / input fields ──────────────────────────────── */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
  background-color: #2b2f36;
  border-color: #495057;
  color: #dee2e6;
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus {
  background-color: #2b2f36;
  color: #dee2e6;
}

/* ─── Plain table rows (views with hardcoded inline row colors) ── */
[data-bs-theme="dark"] tr {
  background-color: #212529;
  color: #dee2e6;
}

[data-bs-theme="dark"] tr:nth-child(even) {
  background-color: #2b2f36 !important;
}

[data-bs-theme="dark"] td,
[data-bs-theme="dark"] th {
  border-color: #495057 !important;
  color: #dee2e6 !important;
}

/* ─── Theme toggle button (light mode state) ─────────────── */
.sb-sidenav-dark .sb-sidenav-footer #theme-toggle {
  color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 0.75rem;
  width: 100%;
  text-align: left;
  text-decoration: none;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
}

.sb-sidenav-dark .sb-sidenav-footer #theme-toggle:hover {
  color: #fff;
}
