/* The existing palette remains the default. Bootstrap components inherit dark mode. */
.theme-toggle { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.theme-toggle:focus-visible { outline: 3px solid var(--erp-primary); outline-offset: 3px; }
.guest-theme-toggle { position: absolute; top: 1rem; right: 1rem; z-index: 1; }
.guest-theme-toggle .theme-toggle { background: var(--erp-surface); }
.guest-body .guest-split-form { padding-top: 5rem; }

[data-bs-theme="dark"] {
  color-scheme: dark;
  --erp-primary: #93bbff;
  --erp-primary-hover: #b5d0ff;
  --erp-primary-light: #203454;
  --erp-primary-muted: #2b4368;
  --erp-primary-subtle: #203454;
  --erp-accent: #5eead4;
  --erp-surface: #182231;
  --erp-bg: #101722;
  --erp-border: #334155;
  --erp-border-strong: #64748b;
  --erp-text: #f1f5f9;
  --erp-text-secondary: #d0d9e6;
  --erp-muted: #a8b6ca;
  --erp-text-muted: #a8b6ca;
  --erp-sidebar-bg: #182231;
  --erp-shadow-sm: 0 1px 2px rgb(0 0 0 / 15%);
  --erp-shadow: 0 2px 6px rgb(0 0 0 / 25%);
  --bs-body-bg: #182231;
  --bs-body-bg-rgb: 24, 34, 49;
  --bs-body-color: #f1f5f9;
  --bs-body-color-rgb: 241, 245, 249;
  --bs-secondary-color: #a8b6ca;
  --bs-secondary-color-rgb: 168, 182, 202;
  --bs-tertiary-bg: #202e40;
  --bs-secondary-bg: #26364b;
  --bs-border-color: #334155;
  --bs-link-color: #93bbff;
  --bs-link-color-rgb: 147, 187, 255;
  --bs-link-hover-color: #b5d0ff;
  --bs-link-hover-color-rgb: 181, 208, 255;
  --bs-emphasis-color: #f1f5f9;
  --bs-emphasis-color-rgb: 241, 245, 249;
}

[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: #101722;
  --bs-btn-hover-color: #101722;
  --bs-btn-active-color: #101722;
  --bs-btn-active-bg: #b5d0ff;
  --bs-btn-active-border-color: #b5d0ff;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: var(--erp-text-secondary);
  --bs-btn-border-color: var(--erp-border);
  --bs-btn-hover-bg: #26364b;
  --bs-btn-hover-color: #f1f5f9;
  --bs-btn-hover-border-color: var(--erp-border-strong);
  --bs-btn-active-bg: #334155;
  --bs-btn-active-color: #f1f5f9;
  --bs-btn-active-border-color: var(--erp-border-strong);
}
[data-bs-theme="dark"] .user-avatar { color: #101722; }
[data-bs-theme="dark"] .pagination .page-item.active .page-link,
[data-bs-theme="dark"] .pagination .page-item.active .page-link:hover,
[data-bs-theme="dark"] .pagination .page-item.active .page-link:focus { color: #101722; }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus { box-shadow: 0 0 0 3px rgb(147 187 255 / 25%); }
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="month"],
[data-bs-theme="dark"] input[type="datetime-local"],
[data-bs-theme="dark"] input[type="time"],
[data-bs-theme="dark"] input[type="week"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator { cursor: pointer; }
[data-bs-theme="dark"] .sidebar-link:hover,
[data-bs-theme="dark"] .btn-ghost:hover,
[data-bs-theme="dark"] .table-card thead th,
[data-bs-theme="dark"] .report-preview-card .card-header,
[data-bs-theme="dark"] .report-preview-section-head,
[data-bs-theme="dark"] .report-data-table thead th,
[data-bs-theme="dark"] .mobile-download-section--muted,
[data-bs-theme="dark"] .audit-json { background: #202e40; }
[data-bs-theme="dark"] .modal-member-create .modal-body { background: var(--erp-bg); }
[data-bs-theme="dark"] .table { --bs-table-bg: var(--erp-surface); --bs-table-color: var(--erp-text-secondary); --bs-table-hover-bg: #26364b; --bs-table-hover-color: var(--erp-text); }
[data-bs-theme="dark"] .table-card tbody tr:hover,
[data-bs-theme="dark"] .report-data-table tbody tr:hover { background: #26364b; }
[data-bs-theme="dark"] .report-data-table tbody tr:nth-child(even) { background: #202e40; }
[data-bs-theme="dark"] .report-data-table tbody td { border-bottom-color: var(--erp-border); }
[data-bs-theme="dark"] .text-bg-light,
[data-bs-theme="dark"] .bg-light { background-color: #26364b !important; }
[data-bs-theme="dark"] .text-bg-light,
[data-bs-theme="dark"] .text-dark { color: var(--erp-text-secondary) !important; }
[data-bs-theme="dark"] .kpi-card.accent-teal .kpi-icon-wrap,
[data-bs-theme="dark"] .kpi-card.accent-green .kpi-icon-wrap { background: #153d39; color: #5eead4; }
[data-bs-theme="dark"] .kpi-card.accent-amber .kpi-icon-wrap { background: #44321e; color: #fcd58b; }

/* Dashboard has its own semantic palette and tinted panels. */
[data-bs-theme="dark"] .dashboard { --dash-muted: #a8b6ca; --dash-blue: #93bbff; --dash-teal: #5eead4; --dash-amber: #fcd58b; --dash-rose: #f9a8d4; }
[data-bs-theme="dark"] .dash-tone-blue { --tint: #203454; }
[data-bs-theme="dark"] .dash-tone-teal { --tint: #153d39; }
[data-bs-theme="dark"] .dash-tone-amber { --tint: #44321e; }
[data-bs-theme="dark"] .dash-tone-rose { --tint: #44263c; }
[data-bs-theme="dark"] .dash-track { background: #334155; }
[data-bs-theme="dark"] .dash-age-1 { --bar: #60a5fa; }
[data-bs-theme="dark"] .dash-age-2 { --bar: #5eead4; }
[data-bs-theme="dark"] .dash-age-3 { --bar: #fcd58b; }
[data-bs-theme="dark"] .dash-age-4 { --bar: #f9a8d4; }
[data-bs-theme="dark"] .dash-participation,
[data-bs-theme="dark"] .dash-status.is-live { background: #153d39; }
[data-bs-theme="dark"] .dash-event-date,
[data-bs-theme="dark"] .dash-status { background: #203454; }
[data-bs-theme="dark"] .dash-finance-grid > div { background: #202e40; }
[data-bs-theme="dark"] .dash-finance-grid .dash-balance { background: var(--erp-primary-light); }
[data-bs-theme="dark"] .dash-filter-panel .btn-check:checked + .btn-outline-primary,
[data-bs-theme="dark"] #dashFiltersModal .btn-check:checked + .btn-outline-primary { color: #101722; background-color: var(--dash-blue); border-color: var(--dash-blue); }
[data-bs-theme="dark"] .dash-filter-panel .btn-outline-primary,
[data-bs-theme="dark"] #dashFiltersModal .btn-outline-primary { --bs-btn-color: var(--dash-blue); --bs-btn-border-color: var(--erp-border); --bs-btn-hover-bg: var(--erp-primary-light); --bs-btn-hover-color: var(--dash-blue); --bs-btn-hover-border-color: var(--dash-blue); }
[data-bs-theme="dark"] .dash-filter-panel .input-group-text,
[data-bs-theme="dark"] #dashFiltersModal .input-group-text { background-color: #202e40; border-color: var(--erp-border); color: var(--dash-muted); }

