/* ======================================================
   Dark Mode – Cabinet Excellence
   Scoped to html[data-theme="dark"]
   ====================================================== */

html[data-theme="dark"] {
  /* ── CSS Variables ── */
  --dark: #e2e8f0;
  --text-dark: #e2e8f0;
  --gray: #475569;
  --text-muted: #8ea0b8;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --light: #1e2a44;
  --card: #16203a;
  --stroke: #26344d;
  --glass: rgba(22, 32, 58, 0.65);
  --bg-glass: rgba(15, 23, 42, 0.85);
  --text-main: #cbd5e1;

  /* ── Body ── */
  background: #0b1220 !important;
  background-image: none !important;
  color: #cbd5e1;
}

html[data-theme="dark"] body,
html[data-theme="dark"] {
  background: #0b1220 !important;
  background-image: none !important;
  color: #cbd5e1;
}

/* ── Selection / Scrollbar ── */
html[data-theme="dark"] ::selection {
  background: rgba(37, 99, 235, 0.3);
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(22, 32, 58, 0.5);
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 6px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ── Divider ── */
html[data-theme="dark"] hr {
  border-color: #26344d;
}

/* ======================================================
   Bootstrap Core Overrides
   ====================================================== */

/* Cards */
html[data-theme="dark"] .card,
html[data-theme="dark"] .cardx,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .login-card {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .card-header {
  background: #1b2745;
  border-color: #26344d;
  color: #cbd5e1;
}

/* Tables */
html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #cbd5e1;
  --bs-table-striped-color: #cbd5e1;
  --bs-table-hover-bg: #1e2a44;
  --bs-table-hover-color: #e2e8f0;
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
  border-color: #26344d;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: rgba(22, 32, 58, 0.25);
  color: #cbd5e1;
}

/* Modals */
html[data-theme="dark"] .modal-content {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .modal-header {
  background: #1b2745;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .modal-body {
  background: #16203a;
  color: #cbd5e1;
}

html[data-theme="dark"] .modal-footer {
  background: #1b2745;
  border-color: #26344d;
}

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

/* List Groups */
html[data-theme="dark"] .list-group-item {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

/* Dropdowns */
html[data-theme="dark"] .dropdown-menu {
  background: #16203a;
  border-color: #26344d;
}

html[data-theme="dark"] .dropdown-item {
  color: #cbd5e1;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
  background: #1e2a44;
  color: #60a5fa;
}

html[data-theme="dark"] .dropdown-item.active {
  background: #1d4ed8;
  color: #fff;
}

html[data-theme="dark"] .dropdown-divider {
  border-color: #26344d;
}

/* Forms */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
  background: #1e2a44;
  border-color: #26344d;
  color: #e2e8f0;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea.form-control::placeholder {
  color: #64748b;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background: #1e2a44;
  border-color: #3b82f6;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

html[data-theme="dark"] .input-group-text {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .form-check-input {
  background-color: #1e2a44;
  border-color: #475569;
}

html[data-theme="dark"] .form-check-input:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

html[data-theme="dark"] .form-label {
  color: #cbd5e1;
}

html[data-theme="dark"] .form-text {
  color: #64748b;
}

/* Accordion */
html[data-theme="dark"] .accordion-item {
  background: #16203a;
  border-color: #26344d;
}

html[data-theme="dark"] .accordion-button {
  background: #16203a;
  color: #cbd5e1;
}

html[data-theme="dark"] .accordion-button:not(.collapsed) {
  background: #1b2745;
  color: #60a5fa;
}

html[data-theme="dark"] .accordion-button::after {
  filter: invert(1);
}

html[data-theme="dark"] .accordion-body {
  background: #16203a;
  color: #cbd5e1;
}

/* Offcanvas */
html[data-theme="dark"] .offcanvas {
  background: #0f172a;
  border-color: #26344d;
}

html[data-theme="dark"] .offcanvas-header {
  background: #1b2745;
  border-bottom-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .offcanvas-body {
  background: #0f172a;
  color: #cbd5e1;
}

/* Nav Tabs & Pills */
html[data-theme="dark"] .nav-tabs {
  border-color: #26344d;
}

html[data-theme="dark"] .nav-tabs .nav-link {
  color: #8ea0b8;
  border-color: transparent;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: #26344d #26344d transparent;
  color: #e2e8f0;
  background: #1e2a44;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
  background: #16203a;
  border-color: #26344d #26344d #16203a;
  color: #60a5fa;
}

html[data-theme="dark"] .nav-pills .nav-link {
  color: #8ea0b8;
}

html[data-theme="dark"] .nav-pills .nav-link.active {
  background: #3b82f6;
  color: #fff;
}

html[data-theme="dark"] .tab-content {
  color: #cbd5e1;
}

/* Breadcrumb */
html[data-theme="dark"] .breadcrumb {
  background: transparent;
}

html[data-theme="dark"] .breadcrumb-item a {
  color: #60a5fa;
}

html[data-theme="dark"] .breadcrumb-item.active {
  color: #8ea0b8;
}

html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: #475569;
}

/* Badges */
html[data-theme="dark"] .badge {
  color: #fff;
}

/* Alerts */
html[data-theme="dark"] .alert {
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

html[data-theme="dark"] .alert-success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

html[data-theme="dark"] .alert-warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}

html[data-theme="dark"] .alert-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

/* Toasts */
html[data-theme="dark"] .toast {
  background: #1b2745;
  border-color: #26344d;
  color: #cbd5e1;
}

/* Popover */
html[data-theme="dark"] .popover {
  background: #1b2745;
  border-color: #26344d;
}

html[data-theme="dark"] .popover-header {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .popover-body {
  color: #cbd5e1;
}

/* Close button */
html[data-theme="dark"] .btn-close {
  filter: invert(1);
}

/* ======================================================
   Buttons
   ====================================================== */

html[data-theme="dark"] .btn-light {
  background: #1e2a44;
  border-color: #26344d;
  color: #e2e8f0;
}

html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-light:focus {
  background: #26344d;
  border-color: #334155;
  color: #fff;
}

html[data-theme="dark"] .btn-outline-secondary {
  background: #1e2a44;
  border-color: #26344d;
  color: #e2e8f0;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
  background: #26344d;
  border-color: #334155;
  color: #fff;
}

html[data-theme="dark"] .btn-outline-dark {
  color: #e2e8f0;
  border-color: #475069;
}

html[data-theme="dark"] .btn-outline-dark:hover {
  background: #1e2a44;
  border-color: #64748b;
  color: #fff;
}

html[data-theme="dark"] .btn-outline-primary {
  color: #60a5fa;
  border-color: #3b82f6;
}

html[data-theme="dark"] .btn-outline-primary:hover {
  background: #3b82f6;
  color: #fff;
}

html[data-theme="dark"] .btn-outline-light {
  color: #cbd5e1;
  border-color: #475569;
}

html[data-theme="dark"] .btn-outline-light:hover {
  background: #1e2a44;
  color: #fff;
}

/* ======================================================
   Text Utilities
   ====================================================== */

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

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

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

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

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

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

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

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

/* ======================================================
   Background Utilities
   ====================================================== */

html[data-theme="dark"] .bg-white {
  background-color: #16203a !important;
}

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

html[data-theme="dark"] .bg-body {
  background-color: #0b1220 !important;
}

html[data-theme="dark"] .bg-body-secondary {
  background-color: #1e2a44 !important;
}

html[data-theme="dark"] .bg-body-tertiary {
  background-color: #1b2745 !important;
}

html[data-theme="dark"] .bg-dark {
  background-color: #0f172a !important;
}

html[data-theme="dark"] .bg-secondary {
  background-color: #334155 !important;
}

/* ======================================================
   Navbar
   ====================================================== */

html[data-theme="dark"] .navbar,
html[data-theme="dark"] #mainNav {
  background: rgba(15, 23, 42, 0.88) !important;
}

html[data-theme="dark"] .navbar-modern {
  background: rgba(15, 23, 42, 0.88);
  border-bottom-color: #26344d;
}

html[data-theme="dark"] .navbar-modern.scrolled {
  background: rgba(13, 20, 36, 0.96);
}

html[data-theme="dark"] .navbar-brand,
html[data-theme="dark"] .navbar .nav-link {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .navbar .nav-link:hover,
html[data-theme="dark"] .navbar .nav-link.active {
  color: #60a5fa !important;
}

/* Notif badge & AI fab */
html[data-theme="dark"] .notif-badge {
  border-color: #0f172a;
}

html[data-theme="dark"] .ai-fab-msg.ai {
  background: var(--bg-white);
}

/* Sidebar */
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar-nav {
  background: #0f172a;
  border-right-color: #26344d;
}

html[data-theme="dark"] .sidebar .nav-link {
  color: #8ea0b8;
}

html[data-theme="dark"] .sidebar .nav-link:hover,
html[data-theme="dark"] .sidebar .nav-link.active {
  color: #e2e8f0;
  background: #1e2a44;
}

/* ======================================================
   Chart boxes & Cards
   ====================================================== */

html[data-theme="dark"] .chart-box {
  background: #121b31;
  border-color: #26344d;
  color: #cbd5e1;
}

/* ======================================================
   Appointments & Lists
   ====================================================== */

html[data-theme="dark"] .appt {
  background: #172237;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .appt .meta {
  color: #8ea0b8;
}

html[data-theme="dark"] .pill {
  background: #1e2a44;
  border-color: #26344d;
  color: #e2e8f0;
}

html[data-theme="dark"] .list-compact .rowline {
  border-bottom-color: #26344d;
}

html[data-theme="dark"] .list-compact .rowline:last-child {
  border-bottom-color: transparent;
}

/* ======================================================
   Login Card
   ====================================================== */

html[data-theme="dark"] .login-card {
  background: #16203a;
}

/* ======================================================
   Portal-specific
   ====================================================== */

html[data-theme="dark"] .glass {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(38, 52, 77, 0.5);
}

html[data-theme="dark"] .glass-strong {
  background: rgba(22, 32, 58, 0.95);
  border-color: rgba(38, 52, 77, 0.3);
}

html[data-theme="dark"] .stat-mini {
  background: #16203a;
}

html[data-theme="dark"] .quick-action {
  background: #16203a;
  color: #e2e8f0;
}

html[data-theme="dark"] .quick-action:hover {
  color: #60a5fa;
}

html[data-theme="dark"] .rdv-item {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .notif-bar {
  background: #16203a;
  border-color: #26344d;
}

html[data-theme="dark"] .form-card {
  background: #16203a;
}

html[data-theme="dark"] .form-card-body {
  background: #16203a;
}

html[data-theme="dark"] .empty-state {
  color: #8ea0b8;
}

html[data-theme="dark"] .hero-topbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-bottom-color: #26344d;
}

html[data-theme="dark"] .portal-tab .nav-link {
  color: #8ea0b8;
}

html[data-theme="dark"] .portal-tab .nav-link.active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

/* ======================================================
   Responsive helpers
   ====================================================== */

html[data-theme="dark"] .shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

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

html[data-theme="dark"] .border {
  border-color: #26344d !important;
}

html[data-theme="dark"] .border-top {
  border-top-color: #26344d !important;
}

html[data-theme="dark"] .border-bottom {
  border-bottom-color: #26344d !important;
}

html[data-theme="dark"] .border-start {
  border-left-color: #26344d !important;
}

html[data-theme="dark"] .border-end {
  border-right-color: #26344d !important;
}

/* Page loader */
html[data-theme="dark"] .page-loader {
  background: #0b1220;
}

/* ======================================================
   Legacy page surfaces (consultations / usagers / medecins / stats / admin)
   ====================================================== */

/* Consultations */
html[data-theme="dark"] .ce-card,
html[data-theme="dark"] .ce-card__body,
html[data-theme="dark"] .consultation-list,
html[data-theme="dark"] .consult-item,
html[data-theme="dark"] .mini-list,
html[data-theme="dark"] .mini-item,
html[data-theme="dark"] .day-preview,
html[data-theme="dark"] .preview-item,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .modal-container,
html[data-theme="dark"] .popup-container,
html[data-theme="dark"] .popup-wrapper,
html[data-theme="dark"] .popup-body {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .ce-card__header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .popup-header,
html[data-theme="dark"] .doc-header {
  background: #1b2745;
  border-color: #26344d;
  color: #e2e8f0;
}

html[data-theme="dark"] .ce-title {
  color: #e2e8f0;
}

html[data-theme="dark"] .kpi-box,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .stat-box {
  background: #16203a;
  border-color: #26344d;
}

html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .popup-wrapper {
  background: rgba(2, 6, 23, 0.75);
}

html[data-theme="dark"] .modal-btn-secondary {
  background: #1e2a44;
  border-color: #26344d;
  color: #e2e8f0;
}

html[data-theme="dark"] .consult-time,
html[data-theme="dark"] .consult-meta,
html[data-theme="dark"] .mini-meta,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .kpi-sub,
html[data-theme="dark"] .modal-message,
html[data-theme="dark"] .popup-tools {
  color: #8ea0b8;
}

html[data-theme="dark"] .consult-patient,
html[data-theme="dark"] .mini-title,
html[data-theme="dark"] .mini-main,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .day-num,
html[data-theme="dark"] .adm-date {
  color: #e2e8f0;
}

html[data-theme="dark"] .calendar-table {
  border-color: #26344d;
  background: #121b31;
}

html[data-theme="dark"] .calendar-header {
  background: #1b2745;
  color: #cbd5e1;
}

html[data-theme="dark"] .day {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .day.empty {
  background: #0f172a;
}

html[data-theme="dark"] .toast {
  background: #1b2745;
  border-color: #26344d;
}

html[data-theme="dark"] .toast.error {
  background: rgba(127, 29, 29, 0.9);
}

html[data-theme="dark"] .toast.info {
  background: rgba(30, 58, 138, 0.9);
}

html[data-theme="dark"] .fab-btn,
html[data-theme="dark"] .action-btn {
  color: #cbd5e1;
}

/* Usagers */
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .ce-usercard,
html[data-theme="dark"] .user-detail-header,
html[data-theme="dark"] .detail-section,
html[data-theme="dark"] .medical-preview,
html[data-theme="dark"] .search-suggestions,
html[data-theme="dark"] .search-suggestion-item,
html[data-theme="dark"] .ce-modal,
html[data-theme="dark"] .bulk-action-bar,
html[data-theme="dark"] .adherence-bar-container {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .detail-value,
html[data-theme="dark"] .ce-usercard h5 {
  color: #e2e8f0;
}

html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .detail-label,
html[data-theme="dark"] .medical-preview,
html[data-theme="dark"] .user-detail-meta,
html[data-theme="dark"] .timeline-item .past {
  color: #8ea0b8;
}

html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .consultation-timeline {
  border-color: #26344d;
}

html[data-theme="dark"] .alphabet-letter {
  color: #8ea0b8;
}

html[data-theme="dark"] .alphabet-letter.active {
  background: #3b82f6;
  color: #fff;
}

html[data-theme="dark"] .alphabet-letter.disabled {
  color: #475569;
}

html[data-theme="dark"] .favorite-btn,
html[data-theme="dark"] .page-link,
html[data-theme="dark"] .bulk-count {
  color: #cbd5e1;
}

/* Medecins */
html[data-theme="dark"] .ce-medcard,
html[data-theme="dark"] .ce-docgrid__item,
html[data-theme="dark"] .ce-mini {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .ce-medcard__name,
html[data-theme="dark"] .ce-mini--edit {
  color: #e2e8f0;
}

html[data-theme="dark"] .ce-medcard__meta,
html[data-theme="dark"] .ce-medcard__footer,
html[data-theme="dark"] .ce-mini--del {
  color: #8ea0b8;
}

/* Stats */
html[data-theme="dark"] .stats-kpi,
html[data-theme="dark"] .chart-panel,
html[data-theme="dark"] .chart-wrap,
html[data-theme="dark"] .chart-wrap--tall {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .stats-kpi__label {
  color: #8ea0b8;
}

html[data-theme="dark"] .stats-kpi__value {
  color: #e2e8f0;
}

/* Admin */
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .admin-card-body {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .admin-card-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
  color: #fff;
}

html[data-theme="dark"] .stat-box {
  background: #16203a;
  border-color: #26344d;
}

html[data-theme="dark"] .stat-box .number {
  color: #e2e8f0;
}

html[data-theme="dark"] .stat-box .label {
  color: #8ea0b8;
}

/* Notifications / Profile */
html[data-theme="dark"] .notif-card,
html[data-theme="dark"] .notif-row,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .card-head,
html[data-theme="dark"] .linked-row,
html[data-theme="dark"] .stat-tile {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
}

html[data-theme="dark"] .notif-row.unread {
  background: #1b2745;
}

html[data-theme="dark"] .page-title,
html[data-theme="dark"] .num {
  color: #e2e8f0;
}

html[data-theme="dark"] .notif-type,
html[data-theme="dark"] .stat-label {
  color: #8ea0b8;
}

/* Misc: code blocks, scroll views */
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
  background: #0f172a;
  color: #a5b4fc;
  border-color: #26344d;
}

html[data-theme="dark"] [class*="table-responsive"] {
  color: #cbd5e1;
}

/* ======================================================
   Legacy page gaps – consultations / usagers / admin-messages / statsmonth
   ====================================================== */

/* Application footer */
html[data-theme="dark"] .app-footer {
  background: #0e1626;
  border-top-color: #26344d;
  color: #8ea0b8;
}
html[data-theme="dark"] .app-footer .footer-brand-name {
  color: #cbd5e1;
}
html[data-theme="dark"] .app-footer h6 {
  color: #cbd5e1;
}
html[data-theme="dark"] .app-footer a {
  color: #8ea0b8;
}
html[data-theme="dark"] .app-footer a:hover {
  color: #60a5fa;
}
html[data-theme="dark"] .app-footer .app-footer-bottom {
  border-top-color: #26344d;
  color: #64748b;
}

/* Table wraps (consultations) */
html[data-theme="dark"] .table-wrap {
  background: #16203a;
  border-color: #26344d;
}

/* Consultation cards detail expandable */
html[data-theme="dark"] .card-details {
  border-top-color: #26344d;
  color: #cbd5e1;
}

/* View toggle buttons (consultations history) */
html[data-theme="dark"] .view-btn {
  background: #1e2a44;
  color: #94a3b8;
}
html[data-theme="dark"] .view-btn.active {
  background: #fff;
  color: #3b82f6;
}

/* Alphabet nav container (usagers) */
html[data-theme="dark"] .alphabet-nav {
  background: #16203a;
  border-color: #26344d;
}

/* Detail items (usagers) */
html[data-theme="dark"] .detail-item {
  background: #1b2745;
}

/* Chart titles (statsmonth) */
html[data-theme="dark"] .chart-title {
  color: #e2e8f0;
}
html[data-theme="dark"] .chart-title small {
  color: #8ea0b8;
}

/* Role badges (root index) */
html[data-theme="dark"] .role-badge {
  background: rgba(30, 42, 68, 0.7);
  color: #cbd5e1;
  border-color: #26344d;
}

/* Admin messages */
html[data-theme="dark"] .mess-item {
  background: #16203a;
  border-color: #26344d;
  color: #cbd5e1;
  border-left-color: transparent;
}
html[data-theme="dark"] .mess-item.unread {
  background: #1b2745;
  border-left-color: #3b82f6;
}
html[data-theme="dark"] .mess-item:hover {
  background: #1e2a44;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Form card & sections (legacy forms) */
html[data-theme="dark"] .ce-formsection {
  background: rgba(30, 42, 68, 0.5);
  border-color: #26344d;
}
html[data-theme="dark"] .ce-formsection__title {
  color: #e2e8f0;
}
html[data-theme="dark"] .ce-uploadarea {
  background: rgba(30, 42, 68, 0.5);
  border-color: rgba(59, 130, 246, 0.35);
  color: #cbd5e1;
}

/* Form card header (mon-espace) */
html[data-theme="dark"] .form-card {
  background: #16203a;
  border-color: #26344d;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .form-card-body {
  background: #16203a;
}
html[data-theme="dark"] .form-card-header {
  background: linear-gradient(135deg, #0b1220 0%, #1e2a44 100%);
}

/* Glass sections in dark */
html[data-theme="dark"] .section-title {
  color: #e2e8f0;
}
html[data-theme="dark"] .section-title i {
  color: #60a5fa;
}
