/* ==============================================
   MODE SOMBRE - COMPTA CONCESS APP
   ============================================== */

/* Prévention du flash blanc (FOUC) */
html:not([data-theme]) {
  visibility: hidden;
}

html[data-theme] {
  visibility: visible;
}

/* Application immédiate des couleurs de base */
html[data-theme="dark"] {
  background-color: #1a1d29 !important;
}

html[data-theme="dark"] body {
  background-color: #1a1d29 !important;
  color: #a7acb8 !important;
}

html[data-theme="light"] {
  background-color: #ffffff !important;
}

html[data-theme="light"] body {
  background-color: #ffffff !important;
  color: #566a7f !important;
}

/* Variables CSS pour le mode sombre */
[data-theme="dark"] {
  --bs-body-bg: #1a1d29;
  --bs-body-color: #a7acb8;
  --bs-card-bg: #232837;
  --bs-border-color: #2f3349;
  --bs-primary: #696cff;
  --bs-secondary: #8592a3;
  --bs-success: #71dd37;
  --bs-info: #03c3ec;
  --bs-warning: #ffab00;
  --bs-danger: #ff3e1d;
  --bs-light: #2f3349;
  --bs-dark: #a7acb8;
}

/* Arrière-plan principal */
[data-theme="dark"] body {
  background-color: #1a1d29 !important;
  color: #a7acb8 !important;
}

/* Cards et conteneurs */
[data-theme="dark"] .card,
.dark-style .card {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .card-header,
.dark-style .card-header {
  background-color: #2a2e3f !important;
  border-bottom-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .card-body,
.dark-style .card-body {
  color: #a7acb8 !important;
}

/* Cards avec bg-label - neutraliser en mode sombre pour uniformité */
/* SAUF la card "Bénéfice & Taxes" qui doit rester claire */
[data-theme="dark"] .card.bg-label-primary,
[data-theme="dark"] .card.bg-label-warning,
[data-theme="dark"] .card.bg-label-danger,
[data-theme="dark"] .card.bg-label-info,
[data-theme="dark"] .card.bg-label-secondary,
.dark-style .card.bg-label-primary,
.dark-style .card.bg-label-warning,
.dark-style .card.bg-label-danger,
.dark-style .card.bg-label-info,
.dark-style .card.bg-label-secondary {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
}

/* Exception: La card avec .keep-light-mode reste EXACTEMENT comme en mode clair */
/* Annuler TOUTES les règles du mode sombre pour cette card */
[data-theme="dark"] .card.keep-light-mode,
.dark-style .card.keep-light-mode {
  background-color: rgba(113, 221, 55, 0.12) !important;
  border-color: rgba(113, 221, 55, 0.3) !important;
}

/* Désactiver les règles de couleur globales pour .keep-light-mode */
[data-theme="dark"] .keep-light-mode,
[data-theme="dark"] .keep-light-mode *,
.dark-style .keep-light-mode,
.dark-style .keep-light-mode * {
  /* Ne rien forcer, laisser les styles par défaut du mode clair */
}

/* Seulement forcer le fond et les bordures, pas les couleurs de texte */
[data-theme="dark"] .keep-light-mode .card-header,
.dark-style .keep-light-mode .card-header {
  background-color: transparent !important;
  border-bottom-color: transparent !important;
}

[data-theme="dark"] .keep-light-mode .card-body,
.dark-style .keep-light-mode .card-body {
  background-color: transparent !important;
}

[data-theme="dark"] .keep-light-mode .border-top,
.dark-style .keep-light-mode .border-top {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Navigation */
[data-theme="dark"] .navbar {
  background-color: #232837 !important;
  border-bottom-color: #2f3349 !important;
}

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

[data-theme="dark"] .navbar-nav .nav-link:hover {
  color: #696cff !important;
}

/* Sidebar */
[data-theme="dark"] .layout-menu {
  background-color: #232837 !important;
  border-right-color: #2f3349 !important;
}

[data-theme="dark"] .menu-item .menu-link {
  color: #a7acb8 !important;
}

[data-theme="dark"] .menu-item .menu-link:hover,
[data-theme="dark"] .menu-item.active .menu-link {
  background-color: #2a2e3f !important;
  color: #696cff !important;
}

[data-theme="dark"] .menu-header {
  color: #8592a3 !important;
}

/* Formulaires */
[data-theme="dark"] .form-control {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .form-control:focus {
  background-color: #2a2e3f !important;
  border-color: #696cff !important;
  color: #a7acb8 !important;
  box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;
}

[data-theme="dark"] .form-select {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .form-select:focus {
  border-color: #696cff !important;
  box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25) !important;
}

[data-theme="dark"] .form-check-input {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
}

[data-theme="dark"] .form-check-input:checked {
  background-color: #696cff !important;
  border-color: #696cff !important;
}

[data-theme="dark"] .form-label {
  color: #a7acb8 !important;
}

/* Tableaux - Force le mode sombre */
[data-theme="dark"] .table,
.dark-style .table {
  color: #a7acb8 !important;
  background-color: transparent !important;
}

[data-theme="dark"] .table th,
.dark-style .table th {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .table td,
.dark-style .table td {
  border-color: #2f3349 !important;
  background-color: transparent !important;
  color: #a7acb8 !important;
}

/* Override Bootstrap - Toutes les cellules et lignes */
[data-theme="dark"] .table > :not(caption) > * > *,
.dark-style .table > :not(caption) > * > * {
  background-color: transparent !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

/* Forcer le fond sombre pour toutes les lignes du tbody */
[data-theme="dark"] .table tbody,
.dark-style .table tbody {
  background-color: #232837 !important;
}

[data-theme="dark"] .table tbody tr,
.dark-style .table tbody tr {
  background-color: #232837 !important;
}

/* Table striped - TOUTES les lignes même couleur */
[data-theme="dark"] .table-striped > tbody > tr,
.dark-style .table-striped > tbody > tr {
  background-color: #232837 !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even),
.dark-style .table-striped > tbody > tr:nth-of-type(odd),
.dark-style .table-striped > tbody > tr:nth-of-type(even) {
  background-color: #232837 !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > *,
.dark-style .table-striped > tbody > tr:nth-of-type(odd) > *,
.dark-style .table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent !important;
  --bs-table-bg-type: transparent !important;
  --bs-table-striped-bg: transparent !important;
}

/* Hover */
[data-theme="dark"] .table-hover > tbody > tr:hover,
.dark-style .table-hover > tbody > tr:hover {
  background-color: #2a2e3f !important;
  --bs-table-hover-bg: #2a2e3f !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > td,
.dark-style .table-hover > tbody > tr:hover > td {
  background-color: transparent !important;
}

/* Amélioration des espacements dans les cards */
[data-theme="dark"] .card .list-group {
  margin-top: 1rem !important;
}

[data-theme="dark"] .card .list-group-item {
  background-color: transparent !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
  padding: 0.75rem 0 !important;
}

[data-theme="dark"] .card .list-group-item:first-child {
  padding-top: 0.5rem !important;
}

[data-theme="dark"] .card .list-group-item:last-child {
  padding-bottom: 0.5rem !important;
}

/* Espacement pour les éléments de statistiques */
[data-theme="dark"] .card .d-flex.align-items-center {
  margin-bottom: 0.75rem !important;
}

[data-theme="dark"] .card .d-flex.align-items-center:last-child {
  margin-bottom: 0 !important;
}

/* Amélioration des badges et étiquettes */
[data-theme="dark"] .badge {
  font-weight: 500 !important;
}

[data-theme="dark"] .badge.bg-label-primary {
  background-color: rgba(105, 108, 255, 0.2) !important;
  color: #696cff !important;
}

[data-theme="dark"] .badge.bg-label-secondary {
  background-color: rgba(133, 146, 163, 0.2) !important;
  color: #8592a3 !important;
}

[data-theme="dark"] .badge.bg-label-success {
  background-color: rgba(113, 221, 55, 0.2) !important;
  color: #71dd37 !important;
}

[data-theme="dark"] .badge.bg-label-info {
  background-color: rgba(3, 195, 236, 0.2) !important;
  color: #03c3ec !important;
}

[data-theme="dark"] .badge.bg-label-warning {
  background-color: rgba(255, 171, 0, 0.2) !important;
  color: #ffab00 !important;
}

[data-theme="dark"] .badge.bg-label-danger {
  background-color: rgba(255, 62, 29, 0.2) !important;
  color: #ff3e1d !important;
}

/* Boutons */
[data-theme="dark"] .btn-outline-secondary {
  color: #8592a3 !important;
  border-color: #8592a3 !important;
}

[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: #8592a3 !important;
  color: #1a1d29 !important;
}

[data-theme="dark"] .btn-outline-primary {
  color: #696cff !important;
  border-color: #696cff !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
  background-color: #696cff !important;
  color: #ffffff !important;
}

[data-theme="dark"] .btn-outline-success {
  color: #71dd37 !important;
  border-color: #71dd37 !important;
}

[data-theme="dark"] .btn-outline-success:hover {
  background-color: #71dd37 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .btn-outline-danger {
  color: #ff3e1d !important;
  border-color: #ff3e1d !important;
}

[data-theme="dark"] .btn-outline-danger:hover {
  background-color: #ff3e1d !important;
  color: #ffffff !important;
}

[data-theme="dark"] .btn-outline-info {
  color: #03c3ec !important;
  border-color: #03c3ec !important;
}

[data-theme="dark"] .btn-outline-info:hover {
  background-color: #03c3ec !important;
  color: #ffffff !important;
}

[data-theme="dark"] .btn-outline-warning {
  color: #ffab00 !important;
  border-color: #ffab00 !important;
}

[data-theme="dark"] .btn-outline-warning:hover {
  background-color: #ffab00 !important;
  color: #ffffff !important;
}

/* Badges */
[data-theme="dark"] .badge {
  color: #ffffff !important;
}

[data-theme="dark"] .bg-label-primary {
  background-color: rgba(105, 108, 255, 0.16) !important;
  color: #696cff !important;
}

[data-theme="dark"] .bg-label-secondary {
  background-color: rgba(133, 146, 163, 0.16) !important;
  color: #8592a3 !important;
}

[data-theme="dark"] .bg-label-success {
  background-color: rgba(113, 221, 55, 0.16) !important;
  color: #71dd37 !important;
}

[data-theme="dark"] .bg-label-info {
  background-color: rgba(3, 195, 236, 0.16) !important;
  color: #03c3ec !important;
}

[data-theme="dark"] .bg-label-warning {
  background-color: rgba(255, 171, 0, 0.16) !important;
  color: #ffab00 !important;
}

[data-theme="dark"] .bg-label-danger {
  background-color: rgba(255, 62, 29, 0.16) !important;
  color: #ff3e1d !important;
}

/* Alertes */
[data-theme="dark"] .alert {
  border-color: #2f3349 !important;
}

[data-theme="dark"] .alert-primary {
  background-color: rgba(105, 108, 255, 0.16) !important;
  border-color: rgba(105, 108, 255, 0.4) !important;
  color: #696cff !important;
}

[data-theme="dark"] .alert-success {
  background-color: rgba(113, 221, 55, 0.16) !important;
  border-color: rgba(113, 221, 55, 0.4) !important;
  color: #71dd37 !important;
}

[data-theme="dark"] .alert-info {
  background-color: rgba(3, 195, 236, 0.16) !important;
  border-color: rgba(3, 195, 236, 0.4) !important;
  color: #03c3ec !important;
}

[data-theme="dark"] .alert-warning {
  background-color: rgba(255, 171, 0, 0.16) !important;
  border-color: rgba(255, 171, 0, 0.4) !important;
  color: #ffab00 !important;
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(255, 62, 29, 0.16) !important;
  border-color: rgba(255, 62, 29, 0.4) !important;
  color: #ff3e1d !important;
}

/* Modals */
[data-theme="dark"] .modal-content {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
}

[data-theme="dark"] .modal-header {
  background-color: #2a2e3f !important;
  border-bottom-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .modal-footer {
  border-top-color: #2f3349 !important;
}

[data-theme="dark"] .modal-body {
  color: #a7acb8 !important;
}

/* Pagination */
[data-theme="dark"] .page-link {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .page-link:hover {
  background-color: #2a2e3f !important;
  border-color: #696cff !important;
  color: #696cff !important;
}

[data-theme="dark"] .page-item.active .page-link {
  background-color: #696cff !important;
  border-color: #696cff !important;
  color: #ffffff !important;
}

/* Dropdown */
[data-theme="dark"] .dropdown-menu {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
}

[data-theme="dark"] .dropdown-item {
  color: #a7acb8 !important;
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: #2a2e3f !important;
  color: #696cff !important;
}

[data-theme="dark"] .dropdown-divider {
  border-top-color: #2f3349 !important;
}

/* Breadcrumb */
[data-theme="dark"] .breadcrumb-item {
  color: #8592a3 !important;
}

[data-theme="dark"] .breadcrumb-item.active {
  color: #a7acb8 !important;
}

/* Avatar */
[data-theme="dark"] .avatar-initial {
  color: #ffffff !important;
}

/* Text colors */
[data-theme="dark"] .text-muted,
.dark-style .text-muted {
  color: #8592a3 !important;
}

[data-theme="dark"] .text-dark,
.dark-style .text-dark {
  color: #a7acb8 !important;
}

[data-theme="dark"] .text-body,
.dark-style .text-body {
  color: #a7acb8 !important;
}

/* Couleurs de texte - augmentation du contraste */
/* Appliquer PARTOUT sauf dans .keep-light-mode */
[data-theme="dark"] :not(.keep-light-mode) .text-primary,
.dark-style :not(.keep-light-mode) .text-primary {
  color: #8084ff !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-success,
.dark-style :not(.keep-light-mode) .text-success {
  color: #71dd37 !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-warning,
.dark-style :not(.keep-light-mode) .text-warning {
  color: #ffab00 !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-danger,
.dark-style :not(.keep-light-mode) .text-danger {
  color: #ff3e1d !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-info,
.dark-style :not(.keep-light-mode) .text-info {
  color: #03c3ec !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-secondary,
.dark-style :not(.keep-light-mode) .text-secondary {
  color: #8592a3 !important;
}

/* Forcer les enfants (y compris fw-semibold) à hériter de la couleur parente */
[data-theme="dark"] :not(.keep-light-mode) .text-warning *,
.dark-style :not(.keep-light-mode) .text-warning * {
  color: #ffab00 !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-danger *,
.dark-style :not(.keep-light-mode) .text-danger * {
  color: #ff3e1d !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-success *,
.dark-style :not(.keep-light-mode) .text-success * {
  color: #71dd37 !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-primary *,
.dark-style :not(.keep-light-mode) .text-primary * {
  color: #8084ff !important;
}

[data-theme="dark"] :not(.keep-light-mode) .text-info *,
.dark-style :not(.keep-light-mode) .text-info * {
  color: #03c3ec !important;
}

/* Borders */
[data-theme="dark"] .border {
  border-color: #2f3349 !important;
}

[data-theme="dark"] .border-top {
  border-top-color: #2f3349 !important;
}

[data-theme="dark"] .border-bottom {
  border-bottom-color: #2f3349 !important;
}

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

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

/* Background colors */
[data-theme="dark"] .bg-light {
  background-color: #2a2e3f !important;
}

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

/* Toggle switch pour le mode sombre */
.dark-mode-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.dark-mode-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dark-mode-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.dark-mode-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .dark-mode-slider {
  background-color: #696cff;
}

input:checked + .dark-mode-slider:before {
  transform: translateX(26px);
}

/* Styles spécifiques */
[data-theme="dark"] .layout-navbar {
  background-color: #232837 !important;
  border-bottom: 1px solid #2f3349 !important;
}

[data-theme="dark"] .layout-menu {
  background-color: #232837 !important;
  border-right: 1px solid #2f3349 !important;
}

[data-theme="dark"] .content-wrapper {
  background-color: #1a1d29 !important;
}

/* Amélioration des statistiques cards */
[data-theme="dark"] .card.bg-light {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
}

/* Espacement et séparation des cards */
[data-theme="dark"] .card-header {
  background-color: #2a2e3f !important;
  border-bottom: 1px solid #2f3349 !important;
  color: #a7acb8 !important;
  padding-bottom: 1rem !important;
  margin-bottom: 1rem !important;
}

[data-theme="dark"] .card-title {
  color: #ffffff !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  border-bottom: 1px solid #2f3349 !important;
}

[data-theme="dark"] .card-body {
  color: #a7acb8 !important;
  padding-top: 1rem !important;
}

/* Amélioration des contrastes pour les textes */
[data-theme="dark"] .text-muted {
  color: #8592a3 !important;
}

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

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

[data-theme="dark"] .text-body-secondary {
  color: #8592a3 !important;
}

/* Amélioration des titres de sections */
[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
  color: #ffffff !important;
}

[data-theme="dark"] .fw-bold,
[data-theme="dark"] .fw-bolder {
  color: #ffffff !important;
}

[data-theme="dark"] .fw-medium {
  color: #e7e9f1 !important;
}

[data-theme="dark"] .fw-semibold {
  color: #ffffff !important;
}

/* Calendrier FullCalendar */
[data-theme="dark"] .fc {
  background-color: #232837 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .fc-theme-standard .fc-list {
  border-color: #2f3349 !important;
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th {
  border-color: #2f3349 !important;
}

[data-theme="dark"] .fc-button-primary {
  background-color: #696cff !important;
  border-color: #696cff !important;
}

[data-theme="dark"] .fc-event {
  border-color: #2f3349 !important;
}

/* Amélioration des avatars */
[data-theme="dark"] .avatar-initial {
  background-color: rgba(105, 108, 255, 0.16) !important;
  color: #696cff !important;
}

/* Amélioration des input file */
[data-theme="dark"] .form-control[type="file"] {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .form-control[type="file"]::-webkit-file-upload-button {
  background-color: #696cff !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
  margin-right: 10px !important;
}

/* Amélioration du toggle mode sombre */
[data-theme="dark"] .dark-mode-toggle .dark-mode-slider {
  background-color: #2f3349 !important;
}

[data-theme="dark"] .dark-mode-toggle input:checked + .dark-mode-slider {
  background-color: #696cff !important;
}

/* Amélioration des icônes */
[data-theme="dark"] #light-icon {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] #dark-icon {
  opacity: 1;
  transition: opacity 0.3s ease;
}

[data-theme="light"] #light-icon {
  opacity: 1;
  transition: opacity 0.3s ease;
}

[data-theme="light"] #dark-icon {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

/* Animation pour la transition */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Amélioration des éléments de prévisualisation */
[data-theme="dark"] .preview-modal .modal-content {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
}

[data-theme="dark"] .preview-modal .modal-header {
  background-color: #2a2e3f !important;
  border-bottom-color: #2f3349 !important;
}

/* Amélioration des tooltips */
[data-theme="dark"] .tooltip .tooltip-inner {
  background-color: #232837 !important;
  color: #a7acb8 !important;
  border: 1px solid #2f3349 !important;
}

[data-theme="dark"] .tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #2f3349 !important;
}

[data-theme="dark"] .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #2f3349 !important;
}

/* Amélioration des popovers */
[data-theme="dark"] .popover {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
}

[data-theme="dark"] .popover-header {
  background-color: #2a2e3f !important;
  border-bottom-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .popover-body {
  color: #a7acb8 !important;
}

/* Footer */
[data-theme="dark"] .footer,
.dark-style .footer {
  background-color: #232837 !important;
  border-top: 1px solid #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .footer a,
.dark-style .footer a {
  color: #a7acb8 !important;
}

[data-theme="dark"] .footer a:hover,
.dark-style .footer a:hover {
  color: #696cff !important;
}

[data-theme="dark"] .footer .text-muted,
.dark-style .footer .text-muted {
  color: #8592a3 !important;
}

[data-theme="dark"] .content-footer,
.dark-style .content-footer {
  background-color: #232837 !important;
  border-top: 1px solid #2f3349 !important;
}

/* Page d'authentification (login) */
[data-theme="dark"] .authentication-wrapper,
.dark-style .authentication-wrapper {
  background-color: #1a1d29 !important;
}

[data-theme="dark"] .authentication-inner,
.dark-style .authentication-inner {
  background-color: transparent !important;
}

[data-theme="dark"] .authentication-wrapper .card,
.dark-style .authentication-wrapper .card {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .authentication-wrapper .card-body,
.dark-style .authentication-wrapper .card-body {
  color: #a7acb8 !important;
}

[data-theme="dark"] .authentication-wrapper h1,
[data-theme="dark"] .authentication-wrapper h2,
[data-theme="dark"] .authentication-wrapper h3,
.dark-style .authentication-wrapper h1,
.dark-style .authentication-wrapper h2,
.dark-style .authentication-wrapper h3 {
  color: #ffffff !important;
}

[data-theme="dark"] .authentication-wrapper .text-muted,
.dark-style .authentication-wrapper .text-muted {
  color: #8592a3 !important;
}

[data-theme="dark"] .authentication-wrapper .app-brand-text,
.dark-style .authentication-wrapper .app-brand-text {
  color: #a7acb8 !important;
}

/* Input groups */
[data-theme="dark"] .input-group-text,
.dark-style .input-group-text {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

/* Datalist et dropdowns natifs */
[data-theme="dark"] datalist,
.dark-style datalist {
  background-color: #232837 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] option,
.dark-style option {
  background-color: #232837 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] option:hover,
[data-theme="dark"] option:checked,
.dark-style option:hover,
.dark-style option:checked {
  background-color: #2a2e3f !important;
  color: #696cff !important;
}

/* Select2 / Autocomplete dropdowns */
/* Thème par défaut (--default) */
[data-theme="dark"] .select2-container--default .select2-selection--single,
.dark-style .select2-container--default .select2-selection--single {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
.dark-style .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #a7acb8 !important;
}

/* Thème Bootstrap 5 (--bootstrap-5) */
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single,
.dark-style .select2-container--bootstrap-5 .select2-selection,
.dark-style .select2-container--bootstrap-5 .select2-selection--single {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection__rendered,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
.dark-style .select2-container--bootstrap-5 .select2-selection__rendered,
.dark-style .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: #a7acb8 !important;
  line-height: 1.5 !important;
}

[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder,
.dark-style .select2-container--bootstrap-5 .select2-selection__placeholder {
  color: #6c757d !important;
}

[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection__arrow,
.dark-style .select2-container--bootstrap-5 .select2-selection__arrow {
  filter: invert(1) !important;
}

/* Dropdown */
[data-theme="dark"] .select2-dropdown,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown,
.dark-style .select2-dropdown,
.dark-style .select2-container--bootstrap-5 .select2-dropdown {
  background-color: #232837 !important;
  border-color: #2f3349 !important;
}

[data-theme="dark"] .select2-results,
.dark-style .select2-results {
  background-color: #232837 !important;
}

[data-theme="dark"] .select2-results__options,
.dark-style .select2-results__options {
  background-color: #232837 !important;
}

[data-theme="dark"] .select2-results__option,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option,
.dark-style .select2-results__option,
.dark-style .select2-container--bootstrap-5 .select2-results__option {
  background-color: #232837 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .select2-results__option--highlighted,
[data-theme="dark"] .select2-results__option[aria-selected="true"],
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"],
.dark-style .select2-results__option--highlighted,
.dark-style .select2-results__option[aria-selected="true"],
.dark-style .select2-container--bootstrap-5 .select2-results__option--highlighted,
.dark-style .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
  background-color: #2a2e3f !important;
  color: #696cff !important;
}

[data-theme="dark"] .select2-search__field,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-search__field,
.dark-style .select2-search__field,
.dark-style .select2-container--bootstrap-5 .select2-search__field {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

[data-theme="dark"] .select2-search--dropdown,
.dark-style .select2-search--dropdown {
  background-color: #232837 !important;
  padding: 8px !important;
}

[data-theme="dark"] .select2-search--dropdown .select2-search__field,
.dark-style .select2-search--dropdown .select2-search__field {
  background-color: #2a2e3f !important;
  border-color: #2f3349 !important;
  color: #a7acb8 !important;
}

/* Autocomplete général */
[data-theme="dark"] .autocomplete-items,
.dark-style .autocomplete-items {
  background-color: #232837 !important;
  border: 1px solid #2f3349 !important;
}

[data-theme="dark"] .autocomplete-items div,
.dark-style .autocomplete-items div {
  background-color: #232837 !important;
  color: #a7acb8 !important;
  border-bottom: 1px solid #2f3349 !important;
  padding: 10px !important;
  cursor: pointer !important;
}

[data-theme="dark"] .autocomplete-items div:hover,
[data-theme="dark"] .autocomplete-active,
.dark-style .autocomplete-items div:hover,
.dark-style .autocomplete-active {
  background-color: #2a2e3f !important;
  color: #696cff !important;
}

/* Liste déroulante native des navigateurs (datalist) */
[data-theme="dark"] input::-webkit-calendar-picker-indicator,
.dark-style input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

[data-theme="dark"] input[list]::-webkit-list-button,
.dark-style input[list]::-webkit-list-button {
  filter: invert(1);
}
