/* ===== MODE SOMBRE ===== */

/* RÈGLE UNIVERSELLE - Force le mode sombre partout */
body.dark-mode * {
    background-color: inherit !important;
    color: inherit !important;
}

/* Exception : préserver les styles inline pour les afficheurs de couleur */
body.dark-mode .preserve-color {
    background-color: var(--preserve-bg) !important;
}

/* Pointeuse - Améliorer la lisibilité en mode sombre */
body.dark-mode .pointeuse-card,
body.dark-mode .pointeuse-active-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #222222 100%) !important;
    border-color: rgba(231, 76, 60, 0.2) !important;
}

body.dark-mode .pointeuse-card h2,
body.dark-mode .pointeuse-active-card h2 {
    color: #ffffff !important;
}

body.dark-mode .pointeuse-date {
    color: #aaaaaa !important;
}

body.dark-mode .pointeuse-heure {
    color: #ff6b6b !important;
}

body.dark-mode .pointeuse-label {
    color: #999999 !important;
}

body.dark-mode .pointeuse-value {
    color: #e0e0e0 !important;
}

body.dark-mode .pointeuse-time {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(220, 10, 10, 0.15) 100%) !important;
    border-color: rgba(231, 76, 60, 0.2) !important;
}

body.dark-mode .pointeuse-info {
    background: linear-gradient(135deg, #222222 0%, #1a1a1a 100%) !important;
    border-color: rgba(231, 76, 60, 0.1) !important;
}

body.dark-mode .pointeuse-info-item {
    border-bottom-color: rgba(231, 76, 60, 0.1) !important;
}

body.dark-mode .historique-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #222222 100%) !important;
    border-color: rgba(231, 76, 60, 0.1) !important;
}

body.dark-mode .historique-header h3 {
    color: #ffffff !important;
}

body.dark-mode .historique-item {
    background: #1a1a1a !important;
    border-color: rgba(231, 76, 60, 0.1) !important;
}

body.dark-mode .historique-item h4 {
    color: #e0e0e0 !important;
}

body.dark-mode .historique-time,
body.dark-mode .historique-date {
    color: #aaaaaa !important;
}

body.dark-mode .historique-duree {
    background: rgba(231, 76, 60, 0.2) !important;
    color: #ff6b6b !important;
}

/* Affectation Véhicules - Mode sombre */
body.dark-mode .vehicule-affectation-card {
    background: #242629 !important;
    border-color: rgba(231, 76, 60, 0.2) !important;
}

body.dark-mode .vehicule-affectation-header {
    background: linear-gradient(135deg, #dc0a0a 0%, #e74c3c 100%) !important;
}

body.dark-mode .vehicule-affectation-body {
    background: #242629 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .vehicule-affectation-table {
    background: #242629 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .vehicule-affectation-table thead {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%) !important;
    color: #d4d4d4 !important;
}

body.dark-mode .vehicule-affectation-table thead th {
    color: #d4d4d4 !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%) !important;
}

body.dark-mode .vehicule-affectation-table thead th i {
    color: #ff6b6b !important;
}

body.dark-mode .vehicule-affectation-table tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .vehicule-affectation-table tbody tr:hover {
    background-color: #2a2a2a !important;
}

body.dark-mode .vehicule-affectation-table tbody tr:nth-child(even) {
    background-color: #252a2d !important;
}

body.dark-mode .vehicule-affectation-table tbody tr:nth-child(even):hover {
    background-color: #2a2a2a !important;
}

body.dark-mode .vehicule-affectation-table tbody td {
    color: #e0e0e0 !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .vehicule-affectation-table tbody td strong {
    color: #ffffff !important;
}

body.dark-mode .vehicules-affectation-wrapper .no-data {
    background: linear-gradient(135deg, #242629 0%, #1a1a1a 100%) !important;
    color: #aaaaaa !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .arme-badge,
body.dark-mode .assure-badge,
body.dark-mode .plaque-badge {
    filter: brightness(0.95) !important;
}

/* Mode sombre activé */
body.dark-mode {
    background: #0f0f0f !important;
    color: #e0e0e0 !important;
}

/* Force tous les éléments en mode sombre */
body.dark-mode,
body.dark-mode div,
body.dark-mode section,
body.dark-mode article,
body.dark-mode main,
body.dark-mode nav,
body.dark-mode aside,
body.dark-mode header,
body.dark-mode footer,
body.dark-mode p,
body.dark-mode span,
body.dark-mode li,
body.dark-mode tr,
body.dark-mode td,
body.dark-mode form {
    background-color: transparent !important;
    color: #e0e0e0 !important;
}

/* Page de Login - Mode Sombre */
body.dark-mode .login-container {
    background-image: url('../images/raw-2.jpg');
    background-size: cover;
}

body.dark-mode .login-card {
    background: #1e1e1e !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    color: #e0e0e0 !important;
}

body.dark-mode .login-header h1 {
    color: #ff6b6b;
}

body.dark-mode .login-header p {
    color: #a0a0a0;
}

body.dark-mode .form-group i {
    color: #707070;
}

body.dark-mode .form-group input {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 2px solid #404040 !important;
}

body.dark-mode .form-group input::placeholder {
    color: #808080;
}

body.dark-mode .form-group input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    background: #333333;
}

body.dark-mode .login-btn {
    background: #ff6b6b;
    color: white;
}

body.dark-mode .login-btn:hover {
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.4);
}

body.dark-mode .error-message {
    background: #3d1a1a;
    color: #ff6b6b;
}

/* Application principale - Mode Sombre */
body.dark-mode .app-container {
    background: #1a1a1a;
}

body.dark-mode .main-nav {
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%) !important;
    background-color: #0d0d0d !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

body.dark-mode .main-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .main-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.2);
}

body.dark-mode .main-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.4);
}

body.dark-mode .nav-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .nav-logo {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) brightness(0.9);
}

body.dark-mode .nav-logo:hover {
    filter: drop-shadow(0 0 12px rgba(255, 107, 107, 0.5)) brightness(1);
}

body.dark-mode .nav-link {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .nav-link:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 107, 107, 0.05) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.1);
}

body.dark-mode .nav-link::before {
    background: #ff6b6b;
}

body.dark-mode .nav-link.active {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.2) 0%, rgba(255, 107, 107, 0.1) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.15);
}

body.dark-mode .nav-link i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

body.dark-mode .nav-link:hover i,
body.dark-mode .nav-link.active i {
    color: #ff6b6b;
}

body.dark-mode .nav-dropdown-toggle {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .nav-dropdown-toggle::before {
    background: #ff6b6b;
}

body.dark-mode .nav-dropdown-toggle:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 107, 107, 0.05) 100%);
    color: #d4d4d4;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.1);
}

body.dark-mode .nav-dropdown-toggle.active {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.2) 0%, rgba(255, 107, 107, 0.1) 100%);
    color: #d4d4d4;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.15);
}

body.dark-mode .nav-dropdown-menu {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark-mode .nav-dropdown-link {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .nav-dropdown-link::before {
    background: #ff6b6b;
}

body.dark-mode .nav-dropdown-link:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 107, 107, 0.08) 100%);
    color: #d4d4d4;
}

body.dark-mode .nav-dropdown-link.active {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.25) 0%, rgba(255, 107, 107, 0.1) 100%);
    color: #d4d4d4;
}

body.dark-mode .nav-user {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, #0d0d0d 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Contenu principal - Mode Sombre */
body.dark-mode .content {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .header {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .header h1,
body.dark-mode .header h2,
body.dark-mode .header h3 {
    color: #d4d4d4;
}

/* Cartes et conteneurs - Mode Sombre */
body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .modal-content {
    background: #242629;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

body.dark-mode .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .card h3,
body.dark-mode .panel h3,
body.dark-mode .modal-content h2 {
    color: #d4d4d4;
}

/* Formulaires - Mode Sombre */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode input[type="datetime-local"],
body.dark-mode input[type="search"],
body.dark-mode textarea,
body.dark-mode select {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #808080;
}

body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="email"]:focus,
body.dark-mode input[type="password"]:focus,
body.dark-mode input[type="tel"]:focus,
body.dark-mode input[type="number"]:focus,
body.dark-mode input[type="date"]:focus,
body.dark-mode input[type="time"]:focus,
body.dark-mode input[type="datetime-local"]:focus,
body.dark-mode input[type="search"]:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    background: #333333;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    outline: none;
}

body.dark-mode label {
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #ffffff;
}

/* Boutons - Mode Sombre */
body.dark-mode .btn,
body.dark-mode button {
    background: #ff6b6b;
    color: white;
    border: none;
}

body.dark-mode .btn:hover,
body.dark-mode button:hover {
    background: #ff5252;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

body.dark-mode .btn-secondary {
    background: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #4a4a4a;
}

body.dark-mode .btn-danger {
    background: #c33c3c;
}

body.dark-mode .btn-danger:hover {
    background: #b30000;
}

/* Tables - Mode Sombre */
body.dark-mode table {
    background: #242629;
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode thead {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    color: #d4d4d4;
    border-bottom: 2px solid rgba(255, 107, 107, 0.3);
}

body.dark-mode th {
    color: #d4d4d4;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode td {
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode tbody tr:hover {
    background: rgba(255, 107, 107, 0.05);
}

/* Modale - Mode Sombre */
body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-header {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #d4d4d4;
}

body.dark-mode .modal-body {
    background: #242629;
    color: #e0e0e0;
}

body.dark-mode .modal-footer {
    background: #1f1f1f;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Alertes - Mode Sombre */
body.dark-mode .alert-success {
    background: #1a3a1a;
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

body.dark-mode .alert-danger {
    background: #3a1a1a;
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

body.dark-mode .alert-warning {
    background: #3a2a1a;
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

body.dark-mode .alert-info {
    background: #1a2a3a;
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Texte - Mode Sombre */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #d4d4d4;
}

body.dark-mode a {
    color: #ff6b6b;
}

body.dark-mode a:hover {
    color: #ff5252;
}

/* Scrollbar - Mode Sombre */
body.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 5px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Toggle Theme dans la sidebar (gauche sombre, droite clair) */
.dark-mode-toggle-container {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 2px;
    padding: 10px 10px 8px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dark-mode-toggle-label {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
}

.dark-mode-toggle {
    position: relative;
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.45) 0%, rgba(20, 20, 20, 0.25) 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    cursor: pointer;
    padding: 3px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.dark-mode-toggle:hover {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.dark-mode-toggle:active {
    transform: scale(0.992);
}

.dark-mode-toggle-option {
    z-index: 2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    transition: color 0.2s ease;
}

.dark-mode-toggle-option.dark {
    color: #ffffff;
}

.dark-mode-toggle-option.light {
    color: rgba(255, 255, 255, 0.7);
}

.dark-mode-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border-radius: 8px;
    background: linear-gradient(135deg, #dc0a0a 0%, #f24b3a 100%);
    box-shadow: 0 5px 14px rgba(220, 10, 10, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.dark-mode-toggle.is-light .dark-mode-toggle-knob {
    transform: translateX(100%);
}

.dark-mode-toggle.is-light .dark-mode-toggle-option.dark {
    color: rgba(255, 255, 255, 0.75);
}

.dark-mode-toggle.is-light .dark-mode-toggle-option.light {
    color: #ffffff;
}

body.dark-mode .dark-mode-toggle-label {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .dark-mode-toggle {
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(8, 8, 8, 0.55) 0%, rgba(8, 8, 8, 0.3) 100%);
}

body.dark-mode .dark-mode-toggle-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
    border-color: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
    .dark-mode-toggle-container {
        padding: 8px;
        gap: 8px;
    }

    .dark-mode-toggle {
        height: 36px;
        border-radius: 8px;
    }

    .dark-mode-toggle-option {
        font-size: 0.72rem;
    }
}

/* Animation de transition */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Conteneurs génériques - Mode Sombre */
body.dark-mode .content-wrapper,
body.dark-mode .page-content,
body.dark-mode .main-content,
body.dark-mode .container,
body.dark-mode section,
body.dark-mode main {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.dark-mode [class*="section"],
body.dark-mode [class*="page"],
body.dark-mode [class*="content"] {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Tous les panneaux et boîtes */
body.dark-mode .panel-body,
body.dark-mode .panel-heading,
body.dark-mode .box,
body.dark-mode .box-body,
body.dark-mode .form-section,
body.dark-mode .info-section {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .panel-heading,
body.dark-mode .box-header,
body.dark-mode .form-section-header {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%) !important;
    color: #d4d4d4 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* En-têtes de section */
body.dark-mode .section-header,
body.dark-mode .page-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%) !important;
    border-bottom: 2px solid rgba(255, 107, 107, 0.3) !important;
    color: #d4d4d4 !important;
}

/* Fonds blanc qui traînent */
body.dark-mode div[style*="background: white"],
body.dark-mode div[style*="background-color: white"],
body.dark-mode div[style*="background: #fff"],
body.dark-mode div[style*="background-color: #fff"],
body.dark-mode div[style*="background: #ffffff"],
body.dark-mode div[style*="background-color: #ffffff"] {
    background-color: #242629 !important;
    color: #e0e0e0 !important;
}

/* Barres d'outils */
body.dark-mode .toolbar,
body.dark-mode .action-bar,
body.dark-mode .controls {
    background: #1f1f1f !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Listes et éléments */
body.dark-mode li {
    color: #e0e0e0;
}

body.dark-mode dd,
body.dark-mode dt {
    color: #e0e0e0;
}

/* Pages et contenus principaux */
body.dark-mode .page,
body.dark-mode .page.active,
body.dark-mode .dashboard-page {
    background: #1a1a1a !important;
}

body.dark-mode .main-content {
    background: #1a1a1a !important;
}

body.dark-mode .dashboard-wrapper,
body.dark-mode .dashboard-header,
body.dark-mode .dashboard-effectif-section,
body.dark-mode .dashboard-content {
    background: #1a1a1a !important;
}

body.dark-mode .dashboard-background {
    background: #1a1a1a !important;
}

/* Sections de formulaires */
body.dark-mode .form-section,
body.dark-mode .form-grid {
    background: transparent !important;
    color: #e0e0e0 !important;
}

body.dark-mode .form-section h4 {
    color: #d4d4d4 !important;
}

/* Filtres */
body.dark-mode .filters-section {
    background: #242629 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .filter-group {
    color: #e0e0e0 !important;
}

body.dark-mode .filter-group input,
body.dark-mode .filter-group select {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #3a3a3a !important;
}

/* Vue factures */
body.dark-mode .factures-view {
    background: #1a1a1a !important;
}

/* Tables spéciales */
body.dark-mode .table-container {
    background: #242629 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .card-header {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%) !important;
    color: #d4d4d4 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .card-content {
    background: #242629 !important;
    color: #e0e0e0 !important;
}

/* Tous les inputs dans les tables */
body.dark-mode input[readonly] {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .nombre-passages-card {
    background: #1f1f1f !important;
    border: 1px solid rgba(255, 107, 107, 0.2) !important;
}

body.dark-mode .nombre-passages-content {
    color: #e0e0e0 !important;
}

body.dark-mode .client-search-results {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

body.dark-mode .client-search-results > div {
    color: #e0e0e0 !important;
}

body.dark-mode .client-search-results > div:hover {
    background: #333333 !important;
    color: #ffffff !important;
}

/* ===== FORCE TOTALE - TOUS LES ÉLÉMENTS EN SOMBRE ===== */

/* Tous les conteneurs avec fond blanc */
body.dark-mode .bg-white,
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background-color: #ffffff"] {
    background-color: #1a1a1a !important;
    background-image: none !important;
}

/* Tous les éléments texte et paragraphes */
body.dark-mode p,
body.dark-mode span,
body.dark-mode small,
body.dark-mode strong,
body.dark-mode em,
body.dark-mode u,
body.dark-mode s {
    color: #e0e0e0 !important;
}

/* Tous les élements de liste */
body.dark-mode ul,
body.dark-mode ol,
body.dark-mode li,
body.dark-mode dl,
body.dark-mode dt,
body.dark-mode dd {
    color: #e0e0e0 !important;
}

/* Toutes les images et média */
body.dark-mode img {
    opacity: 0.9;
}

/* Tous les éléments de formulaire */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode button,
body.dark-mode [type="button"],
body.dark-mode [type="submit"],
body.dark-mode [type="reset"] {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #3a3a3a !important;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    background: #333333 !important;
    border-color: #ff6b6b !important;
}

/* Styles en ligne qui forcent le blanc */
body.dark-mode [style*="color: white"],
body.dark-mode [style*="color: #fff"],
body.dark-mode [style*="color: #ffffff"] {
    color: #e0e0e0 !important;
}

body.dark-mode [style*="border-color: white"],
body.dark-mode [style*="border-color: #fff"],
body.dark-mode [style*="border-color: #ffffff"] {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dropdown et listes */
body.dark-mode select option {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* Scrollbars personnalisées */
body.dark-mode ::-webkit-input-placeholder {
    color: #808080 !important;
}

body.dark-mode :-moz-placeholder {
    color: #808080 !important;
}

body.dark-mode ::-moz-placeholder {
    color: #808080 !important;
}

body.dark-mode :-ms-input-placeholder {
    color: #808080 !important;
}

/* Sections dynamiques */
body.dark-mode .section,
body.dark-mode article,
body.dark-mode aside,
body.dark-mode header,
body.dark-mode footer,
body.dark-mode nav {
    background: transparent !important;
    color: #e0e0e0 !important;
}

/* Tous les badges et labels */
body.dark-mode .badge,
body.dark-mode .label,
body.dark-mode .tag,
body.dark-mode .chip {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

/* Tous les séparateurs */
body.dark-mode hr,
body.dark-mode [class*="divider"],
body.dark-mode [class*="separator"] {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Code et pre */
body.dark-mode code,
body.dark-mode pre {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* Sélection de texte */
body.dark-mode ::selection {
    background: #ff6b6b;
    color: white;
}

body.dark-mode ::-moz-selection {
    background: #ff6b6b;
    color: white;
}

/* Tous les tableaux */
body.dark-mode table,
body.dark-mode tbody,
body.dark-mode thead,
body.dark-mode tr,
body.dark-mode th,
body.dark-mode td {
    background-color: transparent !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode thead {
    background: #1f1f1f !important;
    color: #d4d4d4 !important;
}

/* Forcer la transparence et hériter pour tous les divs */
body.dark-mode div[class^="col-"],
body.dark-mode div[class^="container"],
body.dark-mode div[class^="row"] {
    background: transparent !important;
}

/* ===== PAGES SPÉCIFIQUES ===== */

/* Clients */
body.dark-mode .clients-section,
body.dark-mode .clients-list,
body.dark-mode .client-item,
body.dark-mode .client-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .client-detail,
body.dark-mode .client-form {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Équipements */
body.dark-mode .equipements-section,
body.dark-mode .equipement-item,
body.dark-mode .equipement-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .equipement-detail,
body.dark-mode .equipement-form {
    background: #1a1a1a !important;
}

/* Véhicules */
body.dark-mode .vehicules-section,
body.dark-mode .vehicule-item,
body.dark-mode .vehicule-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .vehicule-detail,
body.dark-mode .vehicule-form {
    background: #1a1a1a !important;
}

/* Facturation */
body.dark-mode .factures-section,
body.dark-mode .facture-item,
body.dark-mode .facture-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .facture-detail,
body.dark-mode .facture-form,
body.dark-mode .facture-pdf {
    background: #1a1a1a !important;
}

/* Galerie */
body.dark-mode .galerie-section,
body.dark-mode .galerie-grid,
body.dark-mode .galerie-item,
body.dark-mode .photo-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .photo-preview,
body.dark-mode .photo-viewer {
    background: #1a1a1a !important;
}

/* Effectif */
body.dark-mode .effectif-section,
body.dark-mode .effectif-item,
body.dark-mode .effectif-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .effectif-detail,
body.dark-mode .effectif-form {
    background: #1a1a1a !important;
}

/* Finances */
body.dark-mode .finances-section,
body.dark-mode .finance-item,
body.dark-mode .finance-card,
body.dark-mode .bilan-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .finance-detail,
body.dark-mode .finance-form {
    background: #1a1a1a !important;
}

/* Fourrière */
body.dark-mode .fourriere-section,
body.dark-mode .fourriere-item,
body.dark-mode .fourriere-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .fourriere-detail,
body.dark-mode .fourriere-form {
    background: #1a1a1a !important;
}

/* Services */
body.dark-mode .services-section,
body.dark-mode .service-item,
body.dark-mode .service-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .service-detail,
body.dark-mode .service-form {
    background: #1a1a1a !important;
}

/* Contrats */
body.dark-mode .contrats-section,
body.dark-mode .contrat-item,
body.dark-mode .contrat-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .contrat-detail,
body.dark-mode .contrat-form {
    background: #1a1a1a !important;
}

/* Prise Service */
body.dark-mode .prise-service-section,
body.dark-mode .prise-service-item,
body.dark-mode .prise-service-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .prise-service-detail,
body.dark-mode .prise-service-form {
    background: #1a1a1a !important;
}

/* Relever heures */
body.dark-mode .releve-heures-section,
body.dark-mode .releve-item,
body.dark-mode .releve-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .releve-detail,
body.dark-mode .releve-form {
    background: #1a1a1a !important;
}

/* Utilisateurs */
body.dark-mode .users-section,
body.dark-mode .user-item,
body.dark-mode .user-card {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .user-detail,
body.dark-mode .user-form {
    background: #1a1a1a !important;
}

/* Éléments de formulaires spécifiques */
body.dark-mode .form-modal,
body.dark-mode .edit-form,
body.dark-mode .create-form {
    background: #1a1a1a !important;
}

/* Grilles et listes */
body.dark-mode .items-grid,
body.dark-mode .items-list,
body.dark-mode .grid-item {
    background: transparent !important;
}

body.dark-mode .list-item,
body.dark-mode .grid-item-content {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Boîtes de dialogue */
body.dark-mode .dialog,
body.dark-mode .dialog-content {
    background: #242629 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .dialog-header {
    background: #1f1f1f !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .dialog-body {
    background: #242629 !important;
}

body.dark-mode .dialog-footer {
    background: #1f1f1f !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Notifications */
body.dark-mode .toast,
body.dark-mode .notification,
body.dark-mode .alert-box {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

/* Éléments de statut */
body.dark-mode .status-badge,
body.dark-mode .status-label,
body.dark-mode [class*="status-"],
body.dark-mode [class*="badge-"] {
    background: rgba(255, 107, 107, 0.2) !important;
    color: #ff6b6b !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

/* Icons et symboles */
body.dark-mode i,
body.dark-mode .icon,
body.dark-mode [class^="fas fa"],
body.dark-mode [class^="fab fa"],
body.dark-mode [class^="far fa"] {
    color: #ff6b6b !important;
}

/* Tabs et onglets */
body.dark-mode .nav-tabs,
body.dark-mode .tab-content,
body.dark-mode .tab-pane {
    background: transparent !important;
    color: #e0e0e0 !important;
}

body.dark-mode .nav-tabs .nav-link {
    background: #2a2a2a !important;
    color: #aaaaaa !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .nav-tabs .nav-link.active {
    background: #242629 !important;
    color: #ff6b6b !important;
    border: 1px solid #ff6b6b !important;
}

/* Accordéon */
body.dark-mode .accordion,
body.dark-mode .accordion-item {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .accordion-header button {
    background: #242629 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .accordion-header button:not(.collapsed) {
    background: #2a2a2a !important;
    color: #ff6b6b !important;
}

/* Mon Profil - corrections ciblées mode sombre */
body.dark-mode #mon-profil,
body.dark-mode #mon-profil .card,
body.dark-mode #mon-profil .profile-card,
body.dark-mode #mon-profil .card-content,
body.dark-mode #mon-profil .profile-info-item-large,
body.dark-mode #mon-profil .salaire-detail-section {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #mon-profil .profile-info-item-large {
    background: linear-gradient(135deg, #242629 0%, #1f1f1f 100%) !important;
}

body.dark-mode #mon-profil .profile-info-value-large,
body.dark-mode #mon-profil .profile-info-label-large,
body.dark-mode #mon-profil .profile-info-note,
body.dark-mode #mon-profil .profile-info-note span,
body.dark-mode #mon-profil h1,
body.dark-mode #mon-profil h2,
body.dark-mode #mon-profil h3,
body.dark-mode #mon-profil h4,
body.dark-mode #mon-profil p,
body.dark-mode #mon-profil small,
body.dark-mode #mon-profil label {
    color: #e0e0e0 !important;
}

body.dark-mode #mon-profil .profile-info-note {
    background: #1f1f1f !important;
    border-left-color: #ff6b6b !important;
}

body.dark-mode #mon-profil .profile-info-icon {
    background: linear-gradient(135deg, #dc0a0a 0%, #e74c3c 100%) !important;
    box-shadow: 0 4px 12px rgba(220, 10, 10, 0.25) !important;
}

body.dark-mode #mon-profil .form-grid-profile .form-group-modal input,
body.dark-mode #mon-profil .form-grid-profile .form-group-modal input[readonly],
body.dark-mode #mon-profil input[type="date"] {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #3a3a3a !important;
}

body.dark-mode #mon-profil .profile-form-actions {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

/* Corrige les nombreux styles inline clairs injectés dynamiquement */
body.dark-mode #mon-profil [style*="background: #f8f9fa"],
body.dark-mode #mon-profil [style*="background-color: #f8f9fa"],
body.dark-mode #mon-profil [style*="background: #ffffff"],
body.dark-mode #mon-profil [style*="background-color: #ffffff"],
body.dark-mode #mon-profil [style*="color: #2c3e50"],
body.dark-mode #mon-profil [style*="color: #7f8c8d"] {
    background: #1f1f1f !important;
    color: #e0e0e0 !important;
}

body.dark-mode #mon-profil .data-table,
body.dark-mode #mon-profil .data-table thead,
body.dark-mode #mon-profil .data-table tbody,
body.dark-mode #mon-profil .data-table tr,
body.dark-mode #mon-profil .data-table th,
body.dark-mode #mon-profil .data-table td {
    background: transparent !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Carousel et sliders */
body.dark-mode .carousel,
body.dark-mode .carousel-inner {
    background: #1a1a1a !important;
}

body.dark-mode .carousel-control-prev,
body.dark-mode .carousel-control-next {
    background: rgba(0, 0, 0, 0.5) !important;
}

/* Tooltips et popovers */
body.dark-mode .tooltip-inner {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .popover {
    background: #242629 !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .popover-header {
    background: #1f1f1f !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .popover-body {
    background: #242629 !important;
}

/* Breadcrumbs */
body.dark-mode .breadcrumb {
    background: #242629 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .breadcrumb-item {
    color: #aaaaaa !important;
}

body.dark-mode .breadcrumb-item.active {
    color: #ff6b6b !important;
}

body.dark-mode .breadcrumb-item a {
    color: #ff6b6b !important;
}

/* Pagination */
body.dark-mode .pagination {
    background: #242629 !important;
}

body.dark-mode .pagination .page-link {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .pagination .page-link:hover {
    background: #333333 !important;
    border-color: #ff6b6b !important;
}

body.dark-mode .pagination .page-item.active .page-link {
    background: #ff6b6b !important;
    border-color: #ff6b6b !important;
}

/* Progress bars */
body.dark-mode .progress {
    background: #2a2a2a !important;
}

body.dark-mode .progress-bar {
    background: #ff6b6b !important;
}

/* Spinners et loaders */
body.dark-mode .spinner-border,
body.dark-mode .spinner-grow {
    color: #ff6b6b !important;
}

/* Listes de vérification et radios */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
    background: #2a2a2a !important;
    border: 1px solid #3a3a3a !important;
}

body.dark-mode input[type="checkbox"]:checked,
body.dark-mode input[type="radio"]:checked {
    background: #ff6b6b !important;
    border: 1px solid #ff6b6b !important;
}

/* Pointers et éléments interactifs */
body.dark-mode a,
body.dark-mode [role="button"],
body.dark-mode [type="button"],
body.dark-mode [type="submit"],
body.dark-mode button {
    transition: all 0.2s ease !important;
}

body.dark-mode a:hover,
body.dark-mode [role="button"]:hover,
body.dark-mode button:hover {
    filter: brightness(1.1) !important;
}




