/* Boutons & cartes colorées — couleurs Bootstrap préservées (clair + sombre) */

/* --- Cartes stats dashboard (bg-primary, bg-success, etc.) --- */
html[data-theme="dark"] .card.bg-primary,
html[data-theme="light"] .card.bg-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .card.bg-success,
html[data-theme="light"] .card.bg-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .card.bg-info,
html[data-theme="light"] .card.bg-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .card.bg-warning,
html[data-theme="light"] .card.bg-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .card.bg-danger,
html[data-theme="light"] .card.bg-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .card.bg-secondary,
html[data-theme="light"] .card.bg-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .card.bg-primary .card-body,
html[data-theme="dark"] .card.bg-success .card-body,
html[data-theme="dark"] .card.bg-info .card-body,
html[data-theme="dark"] .card.bg-warning .card-body,
html[data-theme="dark"] .card.bg-danger .card-body,
html[data-theme="dark"] .card.bg-secondary .card-body,
html[data-theme="light"] .card.bg-primary .card-body,
html[data-theme="light"] .card.bg-success .card-body,
html[data-theme="light"] .card.bg-info .card-body,
html[data-theme="light"] .card.bg-warning .card-body,
html[data-theme="light"] .card.bg-danger .card-body,
html[data-theme="light"] .card.bg-secondary .card-body {
    background-color: transparent !important;
    color: inherit !important;
}

html[data-theme="dark"] .card.text-white .card-title,
html[data-theme="dark"] .card.text-white .card-text,
html[data-theme="dark"] .card.text-white h2,
html[data-theme="dark"] .card.text-white h5,
html[data-theme="light"] .card.text-white .card-title,
html[data-theme="light"] .card.text-white .card-text,
html[data-theme="light"] .card.text-white h2,
html[data-theme="light"] .card.text-white h5 {
    color: #ffffff !important;
}

html[data-theme="dark"] .card.bg-warning.text-white .card-title,
html[data-theme="dark"] .card.bg-warning.text-white .card-text,
html[data-theme="dark"] .card.bg-warning.text-white h2,
html[data-theme="dark"] .card.bg-warning.text-white h5,
html[data-theme="light"] .card.bg-warning.text-white .card-title,
html[data-theme="light"] .card.bg-warning.text-white .card-text,
html[data-theme="light"] .card.bg-warning.text-white h2,
html[data-theme="light"] .card.bg-warning.text-white h5 {
    color: #ffffff !important;
}

/* En-têtes de cartes colorées */
html[data-theme="dark"] .card-header.bg-primary,
html[data-theme="dark"] .card-header.bg-success,
html[data-theme="dark"] .card-header.bg-info,
html[data-theme="dark"] .card-header.bg-warning,
html[data-theme="dark"] .card-header.bg-danger,
html[data-theme="light"] .card-header.bg-primary,
html[data-theme="light"] .card-header.bg-success,
html[data-theme="light"] .card-header.bg-info,
html[data-theme="light"] .card-header.bg-warning,
html[data-theme="light"] .card-header.bg-danger {
    color: #ffffff !important;
}

html[data-theme="dark"] .card-header.bg-info,
html[data-theme="dark"] .card-header.bg-warning,
html[data-theme="light"] .card-header.bg-info,
html[data-theme="light"] .card-header.bg-warning {
    color: #000000 !important;
}

html[data-theme="dark"] .card-header.bg-primary { background-color: #0d6efd !important; }
html[data-theme="dark"] .card-header.bg-success { background-color: #198754 !important; }
html[data-theme="dark"] .card-header.bg-info { background-color: #0dcaf0 !important; }
html[data-theme="dark"] .card-header.bg-warning { background-color: #ffc107 !important; }
html[data-theme="dark"] .card-header.bg-danger { background-color: #dc3545 !important; }
html[data-theme="light"] .card-header.bg-primary { background-color: #0d6efd !important; }
html[data-theme="light"] .card-header.bg-success { background-color: #198754 !important; }
html[data-theme="light"] .card-header.bg-info { background-color: #0dcaf0 !important; }
html[data-theme="light"] .card-header.bg-warning { background-color: #ffc107 !important; }
html[data-theme="light"] .card-header.bg-danger { background-color: #dc3545 !important; }

/* --- Boutons pleins --- */
html[data-theme="dark"] .btn-primary,
html[data-theme="light"] .btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus,
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .btn-primary:focus {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-success,
html[data-theme="light"] .btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-success:hover,
html[data-theme="dark"] .btn-success:focus,
html[data-theme="light"] .btn-success:hover,
html[data-theme="light"] .btn-success:focus {
    background-color: #157347 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-danger,
html[data-theme="light"] .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-danger:hover,
html[data-theme="dark"] .btn-danger:focus,
html[data-theme="light"] .btn-danger:hover,
html[data-theme="light"] .btn-danger:focus {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-warning,
html[data-theme="light"] .btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .btn-warning:hover,
html[data-theme="dark"] .btn-warning:focus,
html[data-theme="light"] .btn-warning:hover,
html[data-theme="light"] .btn-warning:focus {
    background-color: #ffca2c !important;
    border-color: #ffc720 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .btn-info,
html[data-theme="light"] .btn-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .btn-info:hover,
html[data-theme="dark"] .btn-info:focus,
html[data-theme="light"] .btn-info:hover,
html[data-theme="light"] .btn-info:focus {
    background-color: #31d2f2 !important;
    border-color: #25cff2 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="light"] .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-secondary:focus,
html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn-secondary:focus {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
    color: #ffffff !important;
}

/* --- Boutons outline --- */
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="light"] .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="light"] .btn-outline-primary:hover {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-success,
html[data-theme="light"] .btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .btn-outline-success:hover,
html[data-theme="light"] .btn-outline-success:hover {
    background-color: #198754 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-danger,
html[data-theme="light"] .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

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

html[data-theme="dark"] .btn-outline-warning,
html[data-theme="light"] .btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .btn-outline-warning:hover,
html[data-theme="light"] .btn-outline-warning:hover {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .btn-outline-info,
html[data-theme="light"] .btn-outline-info {
    color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .btn-outline-info:hover,
html[data-theme="light"] .btn-outline-info:hover {
    background-color: #0dcaf0 !important;
    color: #000000 !important;
}

html[data-theme="light"] .btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
    background-color: transparent !important;
}

html[data-theme="light"] .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-secondary {
    color: #94A3B8 !important;
    border-color: #475569 !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #F1F5F9 !important;
    border-color: #64748B !important;
}

/* --- Onglets dashboard (nav-tabs colorés) --- */

/* Thème sombre : couleurs de base plus foncées */
html[data-theme="dark"] .nav-tabs .nav-link.bg-primary {
    background-color: #1e3a8a !important;
    border-color: #1e40af !important;
    color: #dbeafe !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-primary.active {
    background-color: #2563eb !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 #60a5fa;
}

html[data-theme="dark"] .nav-tabs .nav-link.bg-info {
    background-color: #0c4a6e !important;
    border-color: #075985 !important;
    color: #e0f2fe !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-info.active {
    background-color: #0369a1 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 #38bdf8;
}

html[data-theme="dark"] .nav-tabs .nav-link.bg-success {
    background-color: #14532d !important;
    border-color: #166534 !important;
    color: #dcfce7 !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-success.active {
    background-color: #15803d !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 #4ade80;
}

html[data-theme="dark"] .nav-tabs .nav-link.bg-warning {
    background-color: #78350f !important;
    border-color: #92400e !important;
    color: #fef3c7 !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-warning.active,
html[data-theme="dark"] .nav-tabs .nav-link.bg-warning.text-dark.active {
    background-color: #b45309 !important;
    border-color: #d97706 !important;
    color: #fffbeb !important;
    box-shadow: inset 0 -3px 0 #fbbf24;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-warning.text-dark {
    color: #fef3c7 !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.bg-danger {
    background-color: #7f1d1d !important;
    border-color: #991b1b !important;
    color: #fecaca !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-danger.active {
    background-color: #b91c1c !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 #f87171;
}

html[data-theme="dark"] .nav-tabs .nav-link.bg-secondary {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-secondary.active {
    background-color: #475569 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 #94a3b8;
}

html[data-theme="dark"] .nav-tabs .nav-link.bg-dark {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .nav-tabs .nav-link.bg-dark.active {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #ffffff !important;
    box-shadow: inset 0 -3px 0 #64748b;
}

html[data-theme="dark"] .nav-tabs .nav-link[class*="bg-"].active {
    font-weight: 600;
}

html[data-theme="dark"] .nav-tabs .nav-link[class*="bg-"] i {
    color: inherit !important;
}

/* Thème clair : couleurs Bootstrap classiques */
html[data-theme="light"] .nav-tabs .nav-link.bg-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}
html[data-theme="light"] .nav-tabs .nav-link.bg-primary.active {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

html[data-theme="light"] .nav-tabs .nav-link.bg-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}
html[data-theme="light"] .nav-tabs .nav-link.bg-info.active {
    background-color: #31d2f2 !important;
}

html[data-theme="light"] .nav-tabs .nav-link.bg-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .nav-tabs .nav-link.bg-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

html[data-theme="light"] .nav-tabs .nav-link.bg-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .nav-tabs .nav-link.bg-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

html[data-theme="light"] .nav-tabs .nav-link.bg-dark {
    background-color: #212529 !important;
    border-color: #212529 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .nav-tabs .nav-link[class*="bg-"] i {
    color: inherit !important;
}

/* En-têtes de cartes colorées (comptabilité Gains/Dépenses, etc.) */
html[data-theme="dark"] .card-header.bg-primary { background-color: #1e3a8a !important; color: #dbeafe !important; border-color: #1e40af !important; }
html[data-theme="dark"] .card-header.bg-success { background-color: #14532d !important; color: #dcfce7 !important; border-color: #166534 !important; }
html[data-theme="dark"] .card-header.bg-danger { background-color: #7f1d1d !important; color: #fecaca !important; border-color: #991b1b !important; }
html[data-theme="dark"] .card-header.bg-info { background-color: #0c4a6e !important; color: #e0f2fe !important; border-color: #075985 !important; }
html[data-theme="dark"] .card-header.bg-warning { background-color: #78350f !important; color: #fef3c7 !important; border-color: #92400e !important; }
html[data-theme="dark"] .card-header.bg-dark { background-color: #0f172a !important; color: #e2e8f0 !important; border-color: #334155 !important; }
html[data-theme="dark"] .card-header.bg-secondary { background-color: #334155 !important; color: #e2e8f0 !important; }

html[data-theme="light"] .card-header.bg-primary { background-color: #0d6efd !important; color: #fff !important; }
html[data-theme="light"] .card-header.bg-success { background-color: #198754 !important; color: #fff !important; }
html[data-theme="light"] .card-header.bg-danger { background-color: #dc3545 !important; color: #fff !important; }
html[data-theme="light"] .card-header.bg-info { background-color: #0dcaf0 !important; color: #000 !important; }
html[data-theme="light"] .card-header.bg-warning { background-color: #ffc107 !important; color: #212529 !important; }
html[data-theme="light"] .card-header.bg-dark { background-color: #212529 !important; color: #fff !important; }

/* Boutons colorés pages comptabilité / véhicules (mêmes teintes que onglets dashboard) */
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-primary,
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) a.btn.bg-primary {
    background-color: #1e3a8a !important; border-color: #1e40af !important; color: #dbeafe !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-primary:hover {
    background-color: #2563eb !important; border-color: #3b82f6 !important; color: #fff !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-info,
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) a.btn.bg-info {
    background-color: #0c4a6e !important; border-color: #075985 !important; color: #e0f2fe !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-info:hover {
    background-color: #0369a1 !important; color: #fff !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-success,
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) a.btn.bg-success {
    background-color: #14532d !important; border-color: #166534 !important; color: #dcfce7 !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-success:hover {
    background-color: #15803d !important; color: #fff !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-warning,
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) a.btn.bg-warning {
    background-color: #78350f !important; border-color: #92400e !important; color: #fef3c7 !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-warning:hover {
    background-color: #b45309 !important; color: #fffbeb !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-danger,
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) a.btn.bg-danger,
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-danger.dropdown-toggle {
    background-color: #7f1d1d !important; border-color: #991b1b !important; color: #fecaca !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-danger:hover {
    background-color: #b91c1c !important; color: #fff !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-secondary {
    background-color: #334155 !important; border-color: #475569 !important; color: #e2e8f0 !important;
}
html[data-theme="dark"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-secondary:hover {
    background-color: #475569 !important; color: #fff !important;
}

html[data-theme="light"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-primary { background-color: #0d6efd !important; border-color: #0d6efd !important; color: #fff !important; }
html[data-theme="light"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-info { background-color: #0dcaf0 !important; border-color: #0dcaf0 !important; color: #000 !important; }
html[data-theme="light"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-success { background-color: #198754 !important; border-color: #198754 !important; color: #fff !important; }
html[data-theme="light"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-warning { background-color: #ffc107 !important; border-color: #ffc107 !important; color: #212529 !important; }
html[data-theme="light"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-danger { background-color: #dc3545 !important; border-color: #dc3545 !important; color: #fff !important; }
html[data-theme="light"] :is(.compta-actions, .veh-actions, .entreprises-actions, .entreprise-card-actions) .btn.bg-secondary { background-color: #6c757d !important; border-color: #6c757d !important; color: #fff !important; }
