/* style.css */

/* ================================================
   SAFE AREA - Support appareils avec encoche
   ================================================ */
@supports (padding: env(safe-area-inset-top)) {
    /* Navbar avec espace pour l'encoche */
    nav.navbar {
        padding-top: env(safe-area-inset-top);
    }

    /* Contenu principal avec marges safe area */
    #page-content-wrapper {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Footer/bottom navigation avec safe area */
    .fixed-bottom,
    .modal-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Sidebar mobile avec safe area */
    .custom-mobile-sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Display: none */

@media (min-width: 992px) {
    nav.navbar.navbar-expand-lg.navbar-light.bg-light.border-bottom {
        display: none;
    }
}

/* ================================================
   NAVBAR MOBILE
   ================================================ */
@media (max-width: 991.98px) {
    nav.navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        padding: 0.75rem 1rem;
        border-bottom: none !important;
    }

    /* Espace pour compenser la navbar fixed */
    #page-content-wrapper > .container-fluid.mt-4 {
        margin-top: 70px !important;
    }

    #menu-toggle {
        background: var(--light-purple);
        border: none;
        border-radius: 10px;
        width: 44px;
        height: 44px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(88, 82, 242, 0.3);
    }

    #menu-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(88, 82, 242, 0.4);
    }

    #menu-toggle:active {
        transform: scale(0.95);
    }

    #menu-toggle i {
        font-size: 1.25rem;
        color: #fff;
    }

    .navbar-brand {
        font-weight: 600;
        color: var(--light-purple) !important;
        font-size: 1.1rem;
    }
}



.no-padding {
    padding: 0px !important;
}

/* variable */
:root {
    --light-purple: #5852F2;
    --light-green: #D4F265;
    --forest-green: #008C73;
}

body {
    background-color: #F0F0FF;
}

p {
    font-family: "Roboto", sans-serif;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    font-style: normal;
}

h2 {
    font-weight: 200;
    font-size: 22px;
}

/* Wrapper pour la sidebar */
#wrapper, #wrapper-mobile {
    display: flex;
    align-items: stretch;
    width: 100%;
}

/* Layout desktop : sidebar fixe, contenu scrollable */
@media (min-width: 992px) {
    #wrapper {
        height: 100vh;
        overflow: hidden;
    }
}

.row.g-3 {
    margin-top: .5rem;
}

/* Tableau style */
th, td {
    color: #7E7E7E;
}


.table>:not(:first-child) {
    border-top: 2px solid #7E7E7E;
}

.table>:not(caption)>*>* {
    padding: 0.75rem 1rem;
    background-color: var(--bs-table-bg);
    border-bottom-width: 0px;
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

/* Sidebar Desktop */
#sidebar-wrapper {
    min-width: 280px;
    max-width: 280px;
    width: 280px;
    transition: all 0.3s;
    height: 100vh;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    flex-shrink: 0;
    background-color: #fff;
    border-right: 1px solid #f0f0f0;
}

#sidebar-wrapper .list-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Desktop : sidebar fixe */
@media (min-width: 992px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        overflow-y: auto;
    }

    #page-content-wrapper {
        margin-left: 280px;
    }
}

a.list-group-item.list-group-item-action.bg-light.active-menu {
    background: #E5E3FD !important;
    padding: .5rem 1.5rem;
    color: #5852F2 !important;
    font-weight: 600;
    border-radius: 0px 10px 10px 0px;
    width: auto;
    margin-top: 0;
    border-left: 3px solid var(--light-purple);
}

.pdp {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center center !important;
    border-radius: 50%;
}

.profil-access {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    margin-left: 0px;
    border-top: 1px solid #F4F4F4;
    border-bottom: 1px solid #F4F4F4;
    padding: 18px 15px 18px 18px;
    margin-bottom: 15px;
}

sub {
    color: #7E7E7E !important;
}

i.bi.bi-chevron-right.chevron-pdp {
    padding: 10px !important;
    color: var(--light-purple);
    margin-left: auto;
}

a.list-group-item.list-group-item-action.bg-light.profil {
    padding-left: 12px !important;
    padding-right: 0 !important;
    color: #2D2D2D !important;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    margin-top: 0;
    margin-right: 0 !important;
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SIDEBAR SECTIONS - NOUVEAU DESIGN                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

.sidebar-section {
    padding: 8px 0;
}

.sidebar-section:first-of-type {
    padding-top: 0;
}

.sub-cat-menu {
    color: #6b7280;
    margin-left: 18px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
    margin-top: 8px;
}

/* Sections dépliables (catégories + Paramètres) */
.sidebar-cat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    padding: 0 12px 0 0;
    border: none;
    background: none;
}

.sidebar-cat-toggle .sub-cat-menu {
    margin-bottom: 0;
}

.sidebar-cat-toggle:hover .sub-cat-menu {
    color: var(--light-purple);
}

.sidebar-section-collapsible .collapse-icon {
    transition: transform 0.2s ease;
    font-size: 12px;
    color: #6b7280;
}

.sidebar-section-collapsible [aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

.sidebar-section-collapsible [aria-expanded="false"] .collapse-icon {
    transform: rotate(0deg);
}

.sidebar-section-collapsible .submenu-item {
    padding-left: 2.8rem !important;
    font-size: 0.9rem;
    color: #6b7280 !important;
    background: #fafafa !important;
    border-left: 2px solid transparent;
    margin-right: 15px;
}

.sidebar-section-collapsible .submenu-item:hover {
    background: #f3f4f6 !important;
    border-left-color: var(--light-purple);
}

.sidebar-section-collapsible .submenu-item.active-menu {
    background: #E5E3FD !important;
    color: var(--light-purple) !important;
    border-left-color: var(--light-purple);
    font-weight: 600;
    border-radius: 0 8px 8px 0;
    margin-top: 0 !important;
}

/* Footer sidebar (déconnexion) */
.sidebar-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px !important;
    margin-top: auto !important;
}

.sidebar-footer .logout-btn {
    position: relative !important;
    width: auto !important;
    left: auto !important;
    bottom: auto !important;
    border-top: none !important;
    padding: 0.5rem 1.5rem !important;
    text-align: left !important;
    color: #6b7280 !important;
}

.sidebar-footer .logout-btn:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* Icons dans la sidebar */
#sidebar-wrapper .list-group-item i.bi {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    padding: 0;
    font-size: 1rem;
    color: #6b7280;
}

#sidebar-wrapper .list-group-item:hover i.bi,
#sidebar-wrapper .list-group-item.active-menu i.bi {
    color: var(--light-purple);
}

/* Legacy classes - garder pour compatibilité */
.gestion, .rh {
    padding: 15px 0px;
}

.input-group {
    position: relative;
    display: flex;
    /* width: 300px !important;
    height: 45px !important; */
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: white !important;
    border: transparent;
    border-radius: 20.25rem;
    height: 45px !important;

}

.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-radius: 0 100px 100px 0px;
    border-color: transparent;
}

i.bi.bi-gear {
    background: white;
    border-radius: 50%;
    height: 45px;
    width: 45px;
    display: flex;
    font-size: 20px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    color: #7E7E7E;
    display: none !important;
}

.btn-success {
    background: var(--light-purple) !important;
    color: #E5E3FD !important;
    font-weight: 600;
    border-color: transparent !important;
}

.btn-success:hover {
    background: #E5E3FD !important;
    color: var(--light-purple) !important;
    font-weight: 600;
    border-color: var(--light-purple) !important;
}

button.btn.btn-primary.add-task {
    position: absolute;
    bottom: 1rem;
    background: #E5E3FD !important;
    color: #5852F2 !important;
    font-weight: 600;
    border-color: transparent !important;
}

/* Blague */
div#page-content-wrapper {
    background: #F0F0FF;
}

button.btn.btn-primary.add-task > .bi-plus::before{
    background: #E5E3FD !important;
    color: #5852F2 !important;
    border-color: #5852F2 !important;
    border-radius: 50%;
    font-weight: 600;
}

/* icon task */

.card-task {
    overflow-y: scroll !important;
    height: 450px;
    margin-bottom:3rem;
}

.list-task > .container {
    margin-top: 0 !important;
}

.icons-tasks > form {
    margin-right:1rem !important;
}

.icons-tasks > form > button > i,
li.task-inline > form > button > i,
.icons-tasks > span > i, 
.icons-tasks > a > i {
    margin: 0 auto !important;
    padding: 0 !important;
    display: block !important; 
}
.icons-tasks {
    display: flex;
}

.task-inline {
    padding-left: 0 !important;
}

.table-chantier {
    background: white;
    border-radius: .25rem;
    border: 1px solid rgba(0, 0, 0, .125);
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.05);
}

a.cust-link {
    color: #7E7E7E;
    text-decoration: underline;
    font-weight: 400;
    transition: .3s;
}

a.cust-link:hover {
    color: var(--light-purple);
    transition: .3s;
    font-weight: 600;
}

/* Contenu de la page quand la sidebar est affichée */
#page-content-wrapper {
    width: 100%;
    transition: all 0.3s;
    flex: 1;
    min-width: 0; /* Fix pour flexbox overflow */
}

@media (min-width: 992px) {
    #page-content-wrapper {
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Sidebar masquée */
/* #wrapper.toggled #sidebar-wrapper {
    margin-left: 0px;
} */

#wrapper-mobile.toggled #sidebar-wrapper {
    margin-left: 0px;
}

/* Contenu de la page quand la sidebar est masquée */
#wrapper-mobile.toggled #page-content-wrapper {
    padding-left: 0;
}

/* Style de la sidebar */
.bg-light {
    /* background-color: #f8f9fa !important; */
    background-color: #fff !important;
    color: #7E7E7E;
}



/* Style de la sidebar heading */
.sidebar-heading {
    padding: 1.8rem 1.5rem 1.2rem;
    font-size: 1.5rem;
    text-align: center;
}

/* Style des liens de la sidebar */
.list-group-item {
    border: none;
    padding: .5rem 1.5rem;
    transition: .3s;

}

/* Changer la couleur des liens au survol */
.list-group-item:hover {
    color: var(--light-purple);
    font-weight: 600;
    transition: .3s;
}

button.list-group-item.list-group-item-action.bg-light {
    /* Reset absolute positioning - now uses flexbox flow */
    position: relative;
    bottom: auto;
    width: auto;
    border-top: none;
    padding: .5rem 1.5rem;
    text-align: left;
    left: auto;
}

.logo-heading {
    width: 150px;
}

i.bi {
    padding: 15px;
}

/* Override padding for sidebar icons */
#sidebar-wrapper i.bi {
    padding: 0 !important;
}

a.list-group-item {
    margin-right: 15px;
}

/* Cards chantiers */

.bg-chantiers {
    background-color: var(--light-purple);
    border-radius: 10px;

}

/* Page header — style unifié pour toutes les pages */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header h1 i {
    color: #5852F2;
}

.page-header .subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.header-dashboard {
    background: linear-gradient(90deg, #695DF6 49.5%, #E5E3FD 100%);
    padding: 1.5rem;
    border-radius: .25rem;
    color: white;
}

.title-header-dashboard {
    font-weight: 400;
    font-size: 26px;
}

.subtitle-header-dashboard {
    font-size: 16px;
}


.card {
    border-color: transparent;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: white;
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    border-bottom: none;
    font-size: 20px;
    text-align: left;
    color: #7E7E7E;
}

.card-body {
    bottom: 0;
    /* position: absolute; */
}

button.fc-today-button.fc-button.fc-button-primary {
    display: none;
}

.fc-button-group {
    display: none !important;
}

div#calendar {
  height: 450px;
  overflow-y: scroll;
}

a.fc-col-header-cell-cushion {
    color: black;
    text-decoration: none;
}

div#page-content-wrapper {
    background: #F0F0FF;
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: #EAEAF1 !important;
}

/* .row {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
} */

.welcome {
    padding: 2rem 2rem 0rem 2rem;
}

.container {
    width: 100% !important;
}

.row.g-4 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* <-- ajout pour que ça passe bien sur mobile */
    justify-content: space-between;
}

.container-cust {
    padding: 2.5rem;
}

.dummy-card {
    height: 18rem;
    width: 30rem;
    background: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .15);
    border-radius: 10px;
}

.dummy-title {
    font-size: 30px;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
    padding: .5rem 1rem;
}

.mes-chantiers-card {
    background: white;
    width: 100%;
    max-width: 680px;
    height: 250px;
    border-radius: 10px;
    background-image: url(/static/core/assets/mes-chantiers.png);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
}

.mes-chantiers-title {
    color: white;
}

a.edit {
    text-align: right;
    padding: 20px;
}

.card-footer {
    padding: 1rem 1rem;
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, .125);
    height: 120px;
}

.add-new {
    border-radius: 20px;
    border: #5852F2 2px dashed;
}

.add-new>a>.card-body {
    bottom: 0;
    top: 0;
    position: absolute;
    left: 0;
    right: 0;
}

.bi-plus::before {
    content: "\f4fe";
    background: #D4F265;
    border-radius: 50%;
}

i.bi.bi-person-circle {
    padding-left: 0;
}


/* btn-primary unifié en bas du fichier */

.header-mes-chantiers {
    padding: 2rem;
}

.fiche-contact {
    width: 100%;
    display: flex;
    flex-direction: row;
}

i.bi.bi-person.contact {
    background: #D8D7FF;
    width: 6rem;
    height: 6rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border-radius: 10px;
    color: #17163F;
}

.contact-infos {
    margin-left: 30px;
}

a.acces-chantiers {
    top: 80%;
    position: relative;
    display: block;
    margin: 0 auto;
    height: 30px;
    background: #D4F265;
    padding: 10px 20px;
    color: #17163F;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mes-chantiers-title {
    color: white;
    top: 40%;
    position: relative;
    width: 65%;
    height: 0;
    left: 10px;
}

.header-chantier {
    font-size: 24px;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.bg-purple {
    background-color: #17163F;
    border-radius: 10px;
    height: 150px;
    width: 100%;
    max-width: 330px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    color: white;
    font-size: 24px;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
    text-decoration: none;
    padding: 15px 20px;
}

.bg-purple:hover {
    color: white;
}

.last-row {
    bottom: -26px;
    position: relative;
}

.bg-purple-long,
.bg-blue-long,
.bg-green-long {
    width: 210px;
    border-radius: 10px;
    color: white;
    font-size: 24px;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
    text-decoration: none;
    padding: 15px 20px;
    background-repeat: no-repeat;
    background-position: 90px 140px;
}

.bg-purple-long:hover,
.bg-blue-long:hover,
.bg-green-long:hover {
    color: white;
}

.bg-purple-long {
    background-color: #17163F;
    background-image: url(/static/core/assets/mes-engins.svg);
}

.bg-green-long {
    background-color: #008C73;
    background-image: url(/static/core/assets/mon-personnel.svg);

}

.bg-blue-long {
    background-color: #02C0FA;
    background-image: url(/static/core/assets/mon-materiel.svg);

}

.first-row {
    /* margin-top: -15px; */
}


/* Tableau BDD ETC */

.white-table {
    background: white;
    border-color: transparent !important;
}

/* === Boutons d'action dans les tableaux (toutes tailles d'écran) === */
.table td:last-child,
.white-table td:last-child {
    white-space: nowrap;
}

.table td:last-child .btn,
.white-table td:last-child .btn {
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
}

.table td:last-child .btn:last-child,
.white-table td:last-child .btn:last-child {
    margin-right: 0;
}

/* Groupe de boutons d'action en ligne */
.action-buttons {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
}

/* Tables responsive pour mobile */
@media (max-width: 767.98px) {
    .white-table,
    table.white-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .white-table thead th,
    .white-table tbody td {
        white-space: nowrap;
    }
}

/* mon-entreprise.html */
.row.justify-content-center.center-middle {
    display: flex !important;
    justify-content: center;
    align-items: center !important;
    height: 94vh !important;
}

img.img-fluid.rounded.shadow-lg.mb-3.center-me {
    display: block;
    margin: 0 auto;
}

/* MODAL EDC AJOUT PRESTA */
.modal-lg, .modal-xl {
    max-width: 90vw !important;
}

/* RESPONSIVE TABLE TO CARD */
@media (max-width: 767.98px) {
    #viewTable {
        display: none !important;
    }
    #viewCards {
        display: flex !important;
        flex-wrap: wrap;
    }
}

/* Tablettes : tables améliorées */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Tables scrollables horizontalement */
    .table-responsive,
    .white-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Colonnes moins importantes cachées sur tablettes */
    .table .d-tablet-none,
    .table th.d-tablet-none,
    .table td.d-tablet-none {
        display: none !important;
    }

    /* Texte plus compact */
    .table td,
    .table th {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    /* Tronquer les textes longs */
    .table td {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Colonnes actions : pas de troncature */
    .table td:last-child {
        max-width: none;
        overflow: visible;
        white-space: nowrap;
    }

    /* Boutons actions compacts mais touch-friendly */
    .table td .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-height: 40px;
    }

    /* Boutons action (icones) : zone tactile suffisante */
    .btn-action {
        width: 40px;
        height: 40px;
    }

    /* Première colonne sticky pour le contexte */
    .table th:first-child,
    .table td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
    }

    .table thead th:first-child {
        background: #f8f9fa;
        z-index: 2;
    }

    /* Ombre pour indiquer le scroll */
    .table th:first-child::after,
    .table td:first-child::after {
        content: '';
        position: absolute;
        top: 0;
        right: -8px;
        bottom: 0;
        width: 8px;
        background: linear-gradient(to right, rgba(0,0,0,0.06), transparent);
        pointer-events: none;
    }

    /* Dark mode : sticky columns */
    [data-theme="dark"] .table th:first-child,
    [data-theme="dark"] .table td:first-child {
        background: #1e293b;
    }
    [data-theme="dark"] .table thead th:first-child {
        background: #334155;
    }
    [data-theme="dark"] .table th:first-child::after,
    [data-theme="dark"] .table td:first-child::after {
        background: linear-gradient(to right, rgba(0,0,0,0.15), transparent);
    }
}

/* Badge */
.cust-badge {
    --bs-bg-opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0) !important;
    color: var(--light-purple) !important;
    border: 1px solid var(--light-purple) !important;
}

.cust-badge-white {
    --bs-bg-opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0) !important;
    color: white !important;
    border: 1px solid white !important;
    text-decoration: none !important;
}

small.small-title {
    font-size: 20px;
    padding-left: 15px;
}

.custom-tab {
    background: white;
    padding: 30px;
    margin-top: 0 !important;
}


/* ================================================
   SIDEBAR MOBILE - Système unifié
   ================================================ */
@media (max-width: 991.98px) {
    /* Ancien sidebar desktop caché sur mobile */
    #sidebar-wrapper {
        display: none !important;
    }

    #page-content-wrapper {
        overflow-y: visible;
        height: auto;
    }

    #main-content {
        overflow-x: hidden;
    }
}

/* Empêcher scroll du body quand menu ouvert */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Menu mobile moderne (drawer) */
.custom-mobile-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background: #fff;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    will-change: left;
}

/* Header fixe du menu mobile */
.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    min-height: 60px;
}

/* Bouton fermer plus grand pour touch */
.mobile-sidebar-header .btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenu scrollable du menu mobile */
.mobile-sidebar-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Menu ouvert */
#wrapper-mobile.toggled .custom-mobile-sidebar {
    left: 0;
}

/* Overlay sombre derrière le menu */
#wrapper-mobile::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

#wrapper-mobile.toggled::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.custom-mobile-sidebar .btn-outline-light {
    border-radius: 10px;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0 !important;
    color: #7E7E7E !important;
    background: #f8f8f8;
    transition: all 0.2s ease;
}

.custom-mobile-sidebar .btn-outline-light:hover {
    background: #f0f0f0;
    color: var(--light-purple) !important;
}

/* Section utilisateur */
.custom-mobile-sidebar .p-3.border-bottom {
    background: linear-gradient(135deg, #f8fafc, #F0F0FF);
    border-color: #eee !important;
    padding: 1.25rem !important;
}

.custom-mobile-sidebar .pdp {
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(88, 82, 242, 0.15);
}

.custom-mobile-sidebar .p-3.border-bottom strong {
    font-size: 1rem;
    color: #333;
}

.custom-mobile-sidebar .p-3.border-bottom .text-muted {
    color: #7E7E7E !important;
    font-size: 0.8rem;
}

/* Navigation */
.custom-mobile-sidebar nav.p-3 {
    padding: 0.75rem 1rem !important;
    background: #fff;
}

.custom-mobile-sidebar .text-uppercase.text-secondary {
    color: #aaa !important;
    font-size: 0.65rem;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 0.85rem !important;
    margin-bottom: 0.35rem !important;
    padding-left: 0.75rem;
}

.custom-mobile-sidebar .text-uppercase.text-secondary:first-child {
    margin-top: 0.25rem !important;
}

/* Liens du menu */
.menu-link {
    display: flex;
    align-items: center;
    padding: 0rem 0.75rem;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.menu-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: #999;
    transition: color 0.15s ease;
}

.menu-link:hover,
.menu-link:active {
    background: #F0F0FF;
    color: var(--light-purple);
}

.menu-link:hover i,
.menu-link:active i {
    color: var(--light-purple);
}

/* Menu link actif */
.menu-link.active {
    background: var(--light-purple);
    color: #fff !important;
}

.menu-link.active i {
    color: #fff !important;
}

.menu-link.active:hover,
.menu-link.active:focus {
    background: #4842e0;
    color: #fff !important;
}

.menu-link.active:hover i,
.menu-link.active:focus i {
    color: #fff !important;
}

/* Toggle catégories menu mobile */
.mobile-cat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none !important;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.mobile-cat-toggle .mobile-collapse-icon {
    transition: transform 0.2s ease;
    font-size: 10px;
    color: #999;
}

.mobile-cat-toggle[aria-expanded="true"] .mobile-collapse-icon {
    transform: rotate(180deg);
}

.mobile-cat-toggle[aria-expanded="false"] .mobile-collapse-icon {
    transform: rotate(0deg);
}

/* Bouton déconnexion mobile */
.custom-mobile-sidebar .btn-outline-light.w-100 {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    border: 1px solid #e0e0e0 !important;
    color: #666 !important;
    background: #f8f8f8;
    transition: all 0.15s ease;
    margin-top: 0.5rem;
}

.custom-mobile-sidebar .btn-outline-light.w-100:hover {
    background: #F0F0FF;
    border-color: var(--light-purple) !important;
    color: var(--light-purple) !important;
}

.custom-mobile-sidebar .btn-outline-light.w-100 i {
    margin-right: 0.5rem;
}

.pdp {
    width: 45px;
    height: 45px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

@media (orientation: portrait) {
    /* Bloc 1 : 3 graphes en colonne */
    .row-graphiques {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem;
    }

    .row-graphiques > .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Bloc 2 : calendrier + tâches en colonne */
    .row-calendrier-taches {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem;
    }

    .row-calendrier-taches > .col-md-8,
    .row-calendrier-taches > .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Graphiques Chart.js */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* FullCalendar responsive */
    .fc,
    .fc .fc-scrollgrid {
        width: 100% !important;
        overflow-x: auto;
    }

    /* Tableau chantier scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .card {
        margin-bottom: 1rem;
    }

    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body, html {
        overflow-x: hidden;
    }

    #viewTable {
        display: none !important;
    }

    #viewCards {
        display: block !important;
    }

    #viewCards .card {
        border-radius: 10px;
        border: 1px solid rgba(0,0,0,0.1);
        background-color: white;
    }
    
    #viewCards .card-title {
        color: var(--light-purple);
        font-weight: 600;
        font-size: 1.25rem;
    }
}

/* .d-flex.gap-2 .bot-abs {
    position: absolute !important;
    bottom: 0 !important;
    z-index: 999 !important;
} */

span.badge.rounded-pill.bg-secondary.text-nowrap {
    background-color: #5852F2 !important;
}

.row.g-3.row-calendrier-taches.mt-4 {
    margin-top: -1rem !important;
}

.param-none {
    display: none !important;
}

span.profil-name {
    font-size: 15px;
    font-weight: 600;
    color: #2D2D2D;
    line-height: 1.3;
}

span.profil-entreprise {
    font-size: 13px !important;
    color: #6b7280;
    line-height: 1.3;
}

/* La carte "ajouter un nouveau chantier" devient un conteneur flex plein hauteur */
.add-new-card {
    display: flex;
  }
  
  /* Le lien prend toute la hauteur de la carte */
  .add-new-card > a {
    flex: 1;
    display: flex;
  }
  
  /* Le card-body se centre verticalement + horizontalement */
  .add-new-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;   /* centre vertical */
    align-items: center;       /* centre horizontal */
  }
  
  .no-padding-add-card {
    padding-right: 0rem !important;
  }

/* ================================================
   EMPTY STATES
   ================================================ */
.empty-state {
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #F0F0FF 100%);
    border-radius: 12px;
    border: 2px dashed #d0d0e0;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(88, 82, 242, 0.1);
}

.empty-state-icon i {
    font-size: 2.5rem;
    color: var(--light-purple);
}

.empty-state-title {
    color: #333;
    font-weight: 600;
}

.empty-state-message {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
}

/* Version compacte pour tableaux */
.empty-state-small {
    background: #fafafa;
    border-radius: 8px;
}

/* ================================================
   HTMX LOADING INDICATOR
   ================================================ */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

/* Spinner pour les recherches */
.search-spinner {
    position: absolute;
    right: 45px;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--light-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Overlay loading pour les conteneurs */
.htmx-request .loading-overlay {
    display: flex;
}

.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading-overlay .spinner-border {
    color: var(--light-purple);
}

/* Container pour loading relatif */
.loading-container {
    position: relative;
}

/* ================================================
   SKELETON LOADING
   ================================================ */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes skeleton-wave {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-wave 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 0.8em;
    width: 60%;
}

.skeleton-title {
    height: 1.5em;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.skeleton-table-row {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-table-cell {
    height: 1em;
    flex: 1;
}

/* Skeleton pour les listes HTMX */
.htmx-request .skeleton-container {
    display: block;
}

.skeleton-container {
    display: none;
}

/* Animation fade-in quand le contenu arrive */
.htmx-settling {
    opacity: 0;
}

.htmx-added {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HTMX loading state */
.htmx-loading {
    position: relative;
    min-height: 100px;
}

.htmx-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--light-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Smooth transitions pour HTMX */
[hx-get], [hx-post] {
    transition: opacity 0.2s ease;
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */

/* Cacher les anciennes alertes Django immédiatement */
.alert.alert-dismissible,
.alert[role="alert"] {
    display: none !important;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

@media (max-width: 576px) {
    #toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #6c757d;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
}

@media (max-width: 576px) {
    .toast-notification {
        transform: translateY(100%);
    }
}

.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 576px) {
    .toast-notification.toast-show {
        transform: translateY(0);
    }
}

.toast-notification.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

@media (max-width: 576px) {
    .toast-notification.toast-hide {
        transform: translateY(100%);
    }
}

.toast-notification i:first-child {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333;
}

/* Toast types */
.toast-success {
    border-left-color: #28a745;
}

.toast-success i:first-child {
    color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-error i:first-child {
    color: #dc3545;
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-warning i:first-child {
    color: #d39e00;
}

.toast-info {
    border-left-color: var(--light-purple);
}

.toast-info i:first-child {
    color: var(--light-purple);
}

/* ================================================
   BREADCRUMBS
   ================================================ */
.breadcrumb-nav {
    padding: 0.5rem 0;
}

.breadcrumb-nav .breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
    overflow: hidden;
}

.breadcrumb-nav .breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-nav .breadcrumb-item a:hover {
    color: var(--light-purple);
}

.breadcrumb-nav .breadcrumb-item.active {
    color: #333;
    font-weight: 500;
}

.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #adb5bd;
    font-weight: 400;
}

/* ================================================
   MICRO-INTERACTIONS
   ================================================ */

/* Boutons - effet hover et click */
.btn {
    transition: all 0.2s ease;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.btn:not(:disabled):active {
    transform: translateY(0) scale(0.98);
}

/* Bouton primary - effet glow */
.btn-primary:not(:disabled):hover {
    box-shadow: 0 4px 15px rgba(88, 82, 242, 0.35);
}

.btn-success:not(:disabled):hover {
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
}

.btn-danger:not(:disabled):hover {
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.35);
}

/* Cards - hover effect */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.card-hover:hover,
.card[onclick]:hover,
a .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Links dans les tables */
table a:not(.btn) {
    transition: color 0.15s ease;
}

table a:not(.btn):hover {
    color: var(--light-purple) !important;
}

/* Badge pulse pour notifications */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.badge-pulse {
    animation: pulse 2s infinite;
}

/* Checkbox/radio animations */
input[type="checkbox"],
input[type="radio"] {
    transition: all 0.15s ease;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Form inputs focus */
.form-control,
.form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--light-purple);
    box-shadow: 0 0 0 3px rgba(88, 82, 242, 0.15);
}

/* Icon buttons rotation */
.btn-icon-rotate:hover i {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

/* Ripple effect class (optional) */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.4s, opacity 0.8s;
}

.btn-ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ================================================
   FORMULAIRES AMÉLIORÉS
   ================================================ */

/* Labels plus visibles */
.form-label {
    font-weight: 500;
    color: #444;
    margin-bottom: 0.4rem;
}

/* Labels requis */
.form-label.required::after,
label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Placeholder style */
.form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Groupes de champs visuels */
.form-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--light-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-purple);
}

/* Help text style */
.form-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.3rem;
}

/* Error state amélioré */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.invalid-feedback {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.3rem;
}

/* Success state */
.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

/* Input groups améliorés */
.input-group .input-group-text {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.input-group:focus-within .input-group-text {
    border-color: var(--light-purple);
    color: var(--light-purple);
}

/* Floating labels */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--light-purple);
}

/* Disabled state */
.form-control:disabled,
.form-select:disabled {
    background-color: #f5f5f5;
    opacity: 0.7;
}

/* ================================================
   ACCESSIBILITÉ
   ================================================ */

/* Meilleur contraste pour les textes gris */
.text-muted {
    color: #5a6268 !important; /* Plus foncé que le défaut Bootstrap #6c757d */
}

/* Focus visible pour navigation clavier */
*:focus-visible {
    outline: 2px solid var(--light-purple);
    outline-offset: 2px;
}

/* Skip link pour navigation clavier */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--light-purple);
    color: #fff;
    padding: 0.75rem 1rem;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Liens avec underline au focus/hover pour meilleure visibilité */
a:not(.btn):not(.nav-link):not(.dropdown-item):hover,
a:not(.btn):not(.nav-link):not(.dropdown-item):focus {
    text-decoration: underline;
}

/* Icônes décoratives - masquer pour lecteurs d'écran */
.bi[aria-hidden="true"],
i.bi:not([aria-label]) {
    speak: none;
}

/* Focus amélioré pour les tableaux interactifs */
table tr:focus-within {
    background-color: rgba(88, 82, 242, 0.05);
}

/* Boutons avec états clairs */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 82, 242, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #000;
    }

    .card {
        border: 2px solid #333;
    }

    .form-control,
    .form-select {
        border: 2px solid #333;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   RESPONSIVE / MOBILE AMÉLIORATIONS
   ================================================ */

/* Zones tactiles minimums (44px recommandé WCAG) - Tablettes et mobiles */
@media (max-width: 991.98px) {
    /* Boutons - hauteur minimum tactile */
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    .btn-sm {
        min-height: 40px;
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Checkboxes et radios plus grands */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
        min-width: 24px;
        cursor: pointer;
    }

    /* Wrapper checkbox cliquable */
    .form-check {
        padding-left: 2rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-check-input {
        margin-left: -2rem;
    }

    /* Select et inputs plus grands */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Évite le zoom auto sur iOS */
    }

    .form-control-sm,
    .form-select-sm {
        min-height: 40px;
        font-size: 15px;
    }

    /* Liens cliquables - padding augmenté */
    .nav-link,
    .dropdown-item,
    .list-group-item-action {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Bouton reset recherche plus gros */
    .reset-btn,
    .searchbar-dashboard .reset-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 0.5rem;
    }

    /* Icônes dans les boutons */
    .btn i.bi {
        font-size: 1.1rem;
    }
}

/* Mobile - ajustements spécifiques */
@media (max-width: 767.98px) {
    /* Boutons d'action dans les tableaux */
    td .btn,
    td .btn-sm {
        min-height: 40px;
        padding: 0.4rem 0.6rem;
    }

    /* Groupe de boutons : wrap autorisé */
    td .d-flex.gap-1,
    td .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    /* Icônes seules dans les boutons - plus de padding */
    .btn-icon-only,
    .btn:has(> i:only-child) {
        min-width: 44px;
        padding: 0.5rem;
    }
}

/* Dropdowns et inputs dans les tableaux - largeurs minimums */
@media (max-width: 991.98px) {
    /* Selects dans les tableaux : largeur minimum lisible */
    table .form-select,
    table select.form-select,
    .table .form-select,
    .tab-content .form-select {
        min-width: 140px;
        font-size: 0.85rem;
    }

    /* Inputs dans les tableaux */
    table .form-control,
    .table .form-control,
    .tab-content .form-control {
        min-width: 80px;
    }

    /* Inputs numériques plus étroits */
    table input[type="number"].form-control,
    .table input[type="number"].form-control {
        min-width: 70px;
        max-width: 100px;
    }

    /* Forcer les tableaux avec formulaires à scroller */
    .tab-content > .table,
    .tab-content table,
    table:has(.form-select),
    table:has(.form-control) {
        min-width: 600px;
    }

    /* Wrapper automatique pour les tableaux dans les onglets */
    .tab-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    /* Encore plus petit écran : largeurs ajustées */
    table .form-select,
    .table .form-select,
    .tab-content .form-select {
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }

    table .form-control,
    .table .form-control {
        min-width: 70px;
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }

    /* Colonnes d'actions : boutons empilés ou en ligne serrée */
    table td:last-child,
    .table td:last-child {
        white-space: nowrap;
    }

    table td:last-child .btn,
    .table td:last-child .btn {
        margin-bottom: 0.25rem;
        margin-right: 0.25rem;
    }

    /* Select2 dans tableaux */
    .select2-container {
        min-width: 130px !important;
    }

    .select2-container .select2-selection--single {
        min-height: 38px;
    }
}

/* Pages avec beaucoup de colonnes : études de coût, prestations */
@media (max-width: 991.98px) {
    /* Tableau des prestations dans étude de coût */
    .etude-prestation-line td {
        vertical-align: middle;
    }

    .etude-prestation-line .form-select {
        min-width: 160px;
    }

    .etude-prestation-line input[type="number"] {
        width: 80px;
        min-width: 70px;
    }

    /* Cellules de prix : pas de retour à la ligne */
    .prestation-ht,
    .prestation-marge,
    .prestation-ttc,
    td.text-end {
        white-space: nowrap;
        min-width: 80px;
    }
}

/* Indicateur de scroll horizontal pour les tableaux */
.table-scroll-indicator {
    position: relative;
}

.table-scroll-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

.table-scroll-indicator.scrolled-end::after {
    opacity: 0;
}

/* Message d'indication scroll - affiché sur mobile */
.scroll-hint {
    display: none;
    background: linear-gradient(135deg, #e8f4fd, #f0f0ff);
    border: 1px solid #d0d8e8;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #5a6268;
    text-align: center;
}

@media (max-width: 991.98px) {
    .scroll-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .scroll-hint i {
        animation: scrollHintBounce 1.5s infinite;
        color: var(--light-purple);
    }

    @keyframes scrollHintBounce {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(5px); }
    }

    /* Indicateur visuel de scroll sur tab-content */
    .tab-content {
        position: relative;
    }

    .tab-content::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(255,255,255,0.95));
        pointer-events: none;
        z-index: 10;
        opacity: 1;
        transition: opacity 0.3s;
    }

    .tab-content.scrolled-end::after {
        opacity: 0;
    }

    /* Hint automatique ajouté par JS */
    .scroll-hint-auto {
        display: flex !important;
        background: linear-gradient(135deg, #fff8e6, #fff3cd);
        border-color: #ffc107;
        color: #856404;
    }

    .scroll-hint-auto i {
        color: #d39e00;
    }
}

/* Tableaux responsives améliorés */
@media (max-width: 767.98px) {
    /* Conteneur table avec scroll */
    .table-responsive {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
        border-radius: 0;
    }

    /* Première colonne sticky pour contexte */
    .table-sticky-first th:first-child,
    .table-sticky-first td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
        box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    }

    .table-sticky-first thead th:first-child {
        background: #f8f9fa;
        z-index: 2;
    }

    /* Cellules actions toujours visibles */
    .table-sticky-actions td:last-child,
    .table-sticky-actions th:last-child {
        position: sticky;
        right: 0;
        background: #fff;
        box-shadow: -2px 0 5px rgba(0,0,0,0.05);
    }

    /* Headers de tableau plus compacts */
    .table thead th {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    /* Cellules plus compactes */
    .table tbody td {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Empêcher les textes trop longs de casser le layout */
    .table td {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mais garder les colonnes actions flexibles */
    .table td:last-child {
        max-width: none;
        overflow: visible;
    }
}

/* ================================================
   CHAMPS DATE AVEC MASQUE DE SAISIE
   ================================================ */
/* Le bouton calendrier est intégré à l'intérieur du champ */
.input-group:has(> .btn[title="Ouvrir le calendrier"]) {
    position: relative;
}

.input-group:has(> .btn[title="Ouvrir le calendrier"]) > .form-control {
    padding-right: 2.5rem;
    border-radius: 0.375rem !important;
}

.input-group > .btn-outline-secondary.btn[title="Ouvrir le calendrier"] {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 3;
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0 0.6rem;
    display: flex;
    align-items: center;
    border-radius: 0 0.375rem 0.375rem 0;
}
.input-group > .btn-outline-secondary.btn[title="Ouvrir le calendrier"]:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--light-purple);
}

/* ================================================
   GRILLE DE CARDS UNIFIEE
   ================================================ */
/* Grille CSS moderne pour les cards (remplace Bootstrap grid) */
#viewCards,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* Sur grands écrans, limiter la largeur max des cards */
@media (min-width: 1400px) {
    #viewCards,
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

/* Tablettes : 2 colonnes */
@media (max-width: 991.98px) {
    #viewCards,
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
}

/* Mobile : 1 colonne */
@media (max-width: 576px) {
    #viewCards,
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Neutraliser les classes Bootstrap col-* dans la grille */
#viewCards > [class*="col-"],
.cards-grid > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: none;
    padding: 0;
}

/* Cards mobile - meilleur espacement */
@media (max-width: 576px) {
    #viewCards .card,
    .cards-grid .card {
        margin-bottom: 0;
    }

    #viewCards .card-body,
    .cards-grid .card-body {
        padding: 1rem;
    }

    #viewCards .card-footer,
    .cards-grid .card-footer {
        padding: 0.75rem 1rem;
    }

    /* Boutons pleine largeur dans les cards sur très petit écran */
    #viewCards .card-footer .btn,
    .cards-grid .card-footer .btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    /* Footer cards en colonne sur mobile */
    #viewCards .card-footer,
    .cards-grid .card-footer {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    #viewCards .card-footer > .d-flex,
    .cards-grid .card-footer > .d-flex {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
}

/* Onglets (tabs) scrollables sur mobile */
@media (max-width: 767.98px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .nav-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* Formulaires sur mobile - améliorations */
@media (max-width: 767.98px) {
    /* Fieldsets plus compacts */
    fieldset {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    fieldset legend {
        font-size: 1rem;
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }

    /* Labels plus lisibles */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
    }

    /* Espacement des colonnes de formulaire */
    .row.g-2 > [class*="col-"],
    .row.g-3 > [class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Colonnes petites forcées pleine largeur sur mobile */
    .col-md-2,
    .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Groupes code postal/ville côte à côte */
    .row .col-md-2 + .col-md-4,
    .row .col-md-3 + .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    /* Tout devient pleine largeur sur très petit écran */
    .row .col-md-2 + .col-md-4,
    .row .col-md-3 + .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Actions de formulaire empilées */
    .form-actions,
    .d-flex.gap-2.justify-content-end,
    .card-footer .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-actions .btn,
    .d-flex.gap-2.justify-content-end .btn,
    .card-footer .btn {
        width: 100%;
    }

    /* Boutons submit en bas de formulaire */
    form .btn[type="submit"],
    form button[type="submit"] {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Cards formulaires - padding réduit */
    .card-body {
        padding: 1rem;
    }
}

/* Pagination responsive */
.pagination {
    gap: 0.25rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--light-purple, #5852F2);
    border-color: var(--light-purple, #5852F2);
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
    }

    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        border-radius: 8px;
    }

    /* Page courante mise en évidence */
    .pagination .page-item.active .page-link {
        box-shadow: 0 2px 8px rgba(88, 82, 242, 0.3);
        transform: scale(1.1);
    }

    /* Boutons prev/next plus visibles */
    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        background-color: #f8f9fa;
        font-weight: 500;
    }
}

@media (max-width: 576px) {
    /* Sur très petit écran, cacher les numéros intermédiaires */
    .pagination .page-item:not(:first-child):not(:last-child):not(.active):not(.disabled) {
        display: none;
    }

    /* Montrer les ellipses */
    .pagination .page-item.disabled:has(.page-link:contains('...')) {
        display: flex;
    }

    /* Indicateur texte "Page X sur Y" centré */
    .pagination .page-item.disabled .page-link {
        background: transparent;
        border: none;
        font-size: 0.9rem;
        color: #6c757d;
    }
}

/* Modal sur tablettes et petits desktops */
@media (max-width: 1200px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* Modal plein écran sur mobile */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
        align-items: flex-end; /* Modal en bas sur mobile */
    }

    .modal-content {
        border-radius: 1rem 1rem 0 0;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1rem;
        border-radius: 1rem 1rem 0 0;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    /* Modal formulaire - ne pas align en bas */
    .modal-dialog-centered:has(form) {
        align-items: center;
    }

    .modal-dialog-centered:has(form) .modal-content {
        border-radius: 1rem;
    }
}

/* Badge status dans les cards chantier */
@media (max-width: 767.98px) {
    .status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .chantier-card .card-footer {
        flex-direction: column;
        gap: 0.75rem;
        height: auto;
        padding: 1rem;
    }

    .chantier-card .card-footer .d-flex.gap-2 {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .chantier-card .card-footer .btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }
}

/* Header dashboard responsive */
@media (max-width: 576px) {
    .header-dashboard {
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .header-dashboard h1,
    .title-header-dashboard {
        font-size: 1.25rem !important;
    }

    .header-dashboard .badge {
        font-size: 0.7rem;
    }
}

/* Bulk actions sur mobile */
@media (max-width: 576px) {
    .bulk-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bulk-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Barre de recherche responsive */
@media (max-width: 767.98px) {
    .searchbar-dashboard {
        max-width: 100% !important;
        width: 100%;
        flex: 1;
    }

    /* Bouton reset plus grand et accessible */
    .searchbar-dashboard .reset-btn,
    .reset-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.25rem;
        right: 8px !important;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f0f0f0;
        border: none;
    }

    .searchbar-dashboard .reset-btn:hover,
    .reset-btn:hover {
        background: #e0e0e0;
    }

    /* Input de recherche avec plus d'espace pour le bouton */
    .searchbar-dashboard .form-control {
        padding-right: 50px;
    }

    /* Spinner de recherche repositionné */
    .searchbar-dashboard .search-spinner {
        right: 55px;
    }
}

@media (max-width: 576px) {
    /* Layout header avec recherche */
    .d-flex.justify-content-between.align-items-center.mb-4,
    .d-flex.flex-wrap.justify-content-between.align-items-center {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    /* Filtres de statut scrollables */
    .status-filters {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .status-filters .btn {
        flex-shrink: 0;
    }
}

/* ================================================
   MODAL DE CONFIRMATION PERSONNALISÉ
   ================================================ */
#confirmModal .modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#confirmModal .modal-header {
    padding: 1.25rem 1.5rem 0;
}

#confirmModal .modal-title {
    font-weight: 600;
    color: #333;
}

#confirmModal .modal-body {
    padding: 1rem 1.5rem;
}

#confirmModal .modal-body p {
    font-size: 1rem;
    color: #555;
    line-height: 1.5;
}

#confirmModal .modal-footer {
    padding: 0 1.5rem 1.25rem;
    gap: 0.5rem;
}

#confirmModal .modal-footer .btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
}

#confirmModal .confirm-icon {
    flex-shrink: 0;
}

/* Dark mode confirm/prompt modals */
[data-theme="dark"] #confirmModal .modal-title {
    color: #f1f5f9;
}
[data-theme="dark"] #confirmModal .modal-body p {
    color: #cbd5e1;
}
[data-theme="dark"] #promptModal .modal-title {
    color: #f1f5f9;
}
[data-theme="dark"] #promptModal .modal-body p {
    color: #cbd5e1;
}

/* ================================================
   CONSISTANCE VISUELLE - Variables étendues
   ================================================ */
:root {
    /* Couleurs principales (déjà définies, rappel) */
    /* --light-purple: #5852F2; */
    /* --light-green: #D4F265; */
    /* --forest-green: #008C73; */

    /* Couleurs sémantiques */
    --color-success: #198754;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #0dcaf0;

    /* Couleurs de statut chantier */
    --status-brouillon: #6c757d;
    --status-en-cours: var(--light-purple);
    --status-cloture: var(--color-success);
    --status-archive: #212529;

    /* Couleurs de rôle */
    --role-gestionnaire: var(--color-success);
    --role-conducteur: var(--light-purple);
    --role-chef: #0d6efd;
    --role-ouvrier: #6c757d;
}

/* ================================================
   CARD HEADERS UNIFORMISÉS
   ================================================ */
/* Header principal (violet) */
.card-header-primary {
    background: var(--light-purple) !important;
    color: #fff !important;
    font-weight: 600;
    border-bottom: none;
}

/* Header secondaire (gris clair) */
.card-header-secondary {
    background: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

/* Header info/tips */
.card-header-tips {
    background: #e7f5ff !important;
    color: #1971c2 !important;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Uniformiser les bg-primary sur card-header */
.card-header.bg-primary {
    background: var(--light-purple) !important;
    border-bottom: none;
}

/* ================================================
   BADGES DE STATUT UNIFORMISÉS
   ================================================ */
.badge-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

.badge-status-brouillon {
    background-color: var(--status-brouillon) !important;
    color: #fff !important;
}

.badge-status-en-cours {
    background-color: var(--status-en-cours) !important;
    color: #fff !important;
}

.badge-status-cloture {
    background-color: var(--status-cloture) !important;
    color: #fff !important;
}

.badge-status-archive {
    background-color: var(--status-archive) !important;
    color: #fff !important;
}

/* ================================================
   BADGES DE RÔLE UNIFORMISÉS
   ================================================ */
.badge-role {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

.badge-role-gestionnaire {
    background-color: var(--role-gestionnaire) !important;
    color: #fff !important;
}

.badge-role-conducteur {
    background-color: var(--role-conducteur) !important;
    color: #fff !important;
}

.badge-role-chef {
    background-color: var(--role-chef) !important;
    color: #fff !important;
}

.badge-role-ouvrier {
    background-color: var(--role-ouvrier) !important;
    color: #fff !important;
}

/* ================================================
   BOUTONS UNIFORMISÉS
   ================================================ */
/* Bouton principal - Style cohérent */
.btn-primary {
    background: var(--light-purple) !important;
    color: #fff !important;
    border-color: var(--light-purple) !important;
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #4840d9 !important;
    border-color: #4840d9 !important;
    color: #fff !important;
}

/* Bouton outline primary */
.btn-outline-primary {
    color: var(--light-purple) !important;
    border-color: var(--light-purple) !important;
    background: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--light-purple) !important;
    color: #fff !important;
}

/* ================================================
   ESPACEMENTS UNIFORMISÉS
   ================================================ */
/* Espacement standard entre sections */
.section-spacing {
    margin-bottom: 1.5rem;
}

/* Espacement dans les cards */
.card-body-compact {
    padding: 1rem;
}

.card-body-spacious {
    padding: 1.5rem;
}

/* ================================================
   TEXTES UNIFORMISÉS
   ================================================ */
/* Titres de page */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
}

/* Sous-titres */
.page-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Labels de formulaire */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.375rem;
}

/* ================================================
   LIENS UNIFORMISÉS
   ================================================ */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item) {
    color: var(--light-purple);
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):hover {
    color: #4840d9;
}

/* ================================================
   BOUTONS D'ACTION (icônes)
   ================================================ */
/* Bouton d'action de base (carré avec icône) */
.btn-action {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: none;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.btn-action:focus {
    outline: none;
    box-shadow: none;
}

/* Sauvegarder / Valider (vert) */
.btn-action-save {
    background: #dcfce7;
    color: #16a34a;
}

.btn-action-save:hover {
    background: #16a34a;
    color: #fff;
}

/* Supprimer (rouge) */
.btn-action-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-action-delete:hover {
    background: #dc2626;
    color: #fff;
}

/* Modifier / Éditer (bleu) */
.btn-action-edit {
    background: #dbeafe;
    color: #2563eb;
}

.btn-action-edit:hover {
    background: #2563eb;
    color: #fff;
}

/* Voir / Détail (gris) */
.btn-action-view {
    background: #f1f5f9;
    color: #64748b;
}

.btn-action-view:hover {
    background: #64748b;
    color: #fff;
}

/* Dupliquer (violet) */
.btn-action-duplicate {
    background: #ede9fe;
    color: #7c3aed;
}

.btn-action-duplicate:hover {
    background: #7c3aed;
    color: #fff;
}

/* Télécharger (cyan) */
.btn-action-download {
    background: #cffafe;
    color: #0891b2;
}

.btn-action-download:hover {
    background: #0891b2;
    color: #fff;
}

/* Archiver (orange) */
.btn-action-archive {
    background: #ffedd5;
    color: #ea580c;
}

.btn-action-archive:hover {
    background: #ea580c;
    color: #fff;
}

/* Générer/Créer (vert foncé) */
.btn-action-generate {
    background: #d1fae5;
    color: #059669;
}

.btn-action-generate:hover {
    background: #059669;
    color: #fff;
}

/* Groupe de boutons d'action */
.btn-action-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}
.btn-action-group form {
    display: flex !important;
    flex-shrink: 0;
}
.btn-action-group a {
    flex-shrink: 0;
}


/* ================================================
   PAGE LOGIN
   ================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.login-container {
    width: 100%;
    max-width: 440px;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header .logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(88, 82, 242, 0.25);
}
.login-header .logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}
.login-header p {
    color: #475569;
    font-size: 0.95rem;
}
.login-card {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
    overflow: hidden;
}
.login-card .card-body {
    padding: 2rem;
}
.password-input-container {
    position: relative;
    width: 100%;
}
.password-input-container .form-control {
    padding-right: 45px;
}
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease;
    z-index: 10;
}
.password-toggle:hover {
    color: #5852F2;
}
.forgot-password {
    text-align: right;
    margin-bottom: 1.5rem;
}
.forgot-password a {
    font-size: 0.875rem;
    color: #5852F2;
    text-decoration: none;
}
.forgot-password a:hover {
    text-decoration: underline;
}
.btn-login {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #5852F2, #7c3aed);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(88, 82, 242, 0.3);
}
.btn-login:active {
    transform: translateY(0);
}
.login-footer {
    text-align: center;
    padding: 1.25rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.login-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: #475569;
}
.login-footer a {
    color: #5852F2;
    text-decoration: none;
    font-weight: 500;
}
.login-footer a:hover {
    text-decoration: underline;
}
.alert-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}
.alert-errors i {
    margin-right: 0.5rem;
}


/* ================================================
   PAGE INSCRIPTION
   ================================================ */
.inscription-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.inscription-page #main-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}
.inscription-wrapper {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.inscription-pitch {
    position: sticky;
    top: 2rem;
    padding: 2.5rem 0.5rem;
}
.inscription-pitch .logo {
    width: 56px;
    height: 56px;
    margin-bottom: 1.5rem;
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(88, 82, 242, 0.25);
}
.inscription-pitch .logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.inscription-pitch h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}
.inscription-pitch .subtitle {
    font-size: 1.05rem;
    color: #5852F2;
    font-weight: 600;
    margin-bottom: 2rem;
}
.feature-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 2rem 0 !important;
}
.feature-list li {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.4;
}
.feature-list li .feature-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}
.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.trust-badge i {
    color: #5852F2;
    font-size: 0.95rem;
}
.inscription-card {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
    overflow: hidden;
}
.inscription-card .card-body {
    padding: 2rem;
}
.inscription-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #e2e8f0;
}
.section-title i {
    color: #5852F2;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.form-divider {
    margin: 1.25rem 0;
    border: none;
    border-top: 1px solid #e2e8f0;
}
.consent-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
}
.consent-group input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #5852F2;
}
.consent-group label {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.4;
    cursor: pointer;
}
.btn-submit {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #5852F2, #7c3aed);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.25rem;
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(88, 82, 242, 0.3);
}
.btn-submit:active {
    transform: translateY(0);
}
.inscription-footer {
    text-align: center;
    padding: 1rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.inscription-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
}
.inscription-footer a {
    color: #5852F2;
    text-decoration: none;
    font-weight: 500;
}
.inscription-footer a:hover {
    text-decoration: underline;
}
.legal-text {
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.5;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}
.required {
    color: #ef4444;
    font-weight: 400;
}

@media (max-width: 768px) {
    .inscription-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .inscription-pitch {
        position: static;
        padding: 1.5rem 0.5rem;
        text-align: center;
    }
    .inscription-pitch h1 {
        font-size: 1.5rem;
    }
    .feature-list li {
        justify-content: flex-start;
    }
    .trust-badges {
        justify-content: center;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}


/* ================================================
   SHARED FORM STYLES (login + inscription)
   ================================================ */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.3rem;
}
.form-group .form-control {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}
.form-group .form-control:focus {
    border-color: #5852F2;
    box-shadow: 0 0 0 3px rgba(88, 82, 242, 0.1);
    outline: none;
}
.form-group .form-control.is-invalid {
    border-color: #ef4444;
}
.form-group .form-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.2rem;
}
.form-group .error-text {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}


/* ================================================
   DARK MODE — Palette complète
   bg-body:    #0f172a (slate-900)
   bg-card:    #1e293b (slate-800)
   bg-input:   #334155 (slate-700)
   bg-elevated:#253348 (entre 800 et 700)
   border:     #334155
   text-1:     #f1f5f9 (headings, primary)
   text-2:     #cbd5e1 (body)
   text-3:     #94a3b8 (secondary)
   text-4:     #64748b (muted)
   accent:     #818cf8 (indigo-400, links)
   ================================================ */

/* --- 1. Variables & Base --- */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-input: #334155;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    color-scheme: dark;
}

/* --- 2. Body & conteneurs principaux --- */
[data-theme="dark"] body {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] #page-content-wrapper,
[data-theme="dark"] div#page-content-wrapper {
    background: #0f172a !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] main,
[data-theme="dark"] main.container-fluid {
    background: transparent !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .container-fluid {
    background-color: transparent !important;
}

/* --- 2b. CATCH-ALL — Override des <style> inline (58 templates) ---
   Sélecteurs EXPLICITES pour chaque classe custom identifiée. */

/* A. Page wrappers → fond body */
[data-theme="dark"] .chantiers-page,
[data-theme="dark"] .prestations-page,
[data-theme="dark"] .etude-edit-page,
[data-theme="dark"] .factures-page,
[data-theme="dark"] .clients-page,
[data-theme="dark"] .etudes-page,
[data-theme="dark"] .devis-detail-page,
[data-theme="dark"] .bdd-prix-page,
[data-theme="dark"] .personnel-page,
[data-theme="dark"] .choix-saisie-page,
[data-theme="dark"] .modifier-saisie-page,
[data-theme="dark"] .ressources-page,
[data-theme="dark"] .prestation-page,
[data-theme="dark"] .archive-page,
[data-theme="dark"] .chantier-detail-page,
[data-theme="dark"] .devis-page,
[data-theme="dark"] .facture-page,
[data-theme="dark"] .chantier-create-page,
[data-theme="dark"] .personnel-detail-page,
[data-theme="dark"] .entreprise-page,
[data-theme="dark"] .personnel-form-page,
[data-theme="dark"] .client-form-page,
[data-theme="dark"] .categories-page,
[data-theme="dark"] .units-page,
[data-theme="dark"] .bug-report-page {
    background: #0f172a !important;
}

/* B. Table wrappers (divs avec background: white) */
[data-theme="dark"] .chantiers-table,
[data-theme="dark"] .prestations-table,
[data-theme="dark"] .clients-table,
[data-theme="dark"] .etudes-table,
[data-theme="dark"] .devis-table,
[data-theme="dark"] .factures-table,
[data-theme="dark"] .facture-lignes-table,
[data-theme="dark"] .table-container,
[data-theme="dark"] .table-modern,
[data-theme="dark"] .table-custom,
[data-theme="dark"] .table-archive,
[data-theme="dark"] .categories-card,
[data-theme="dark"] .units-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* C. TOUS les thead */
[data-theme="dark"] thead,
[data-theme="dark"] thead th,
[data-theme="dark"] thead td {
    background: #253348 !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

/* D. TOUS les tbody td border + hover */
[data-theme="dark"] tbody td {
    border-color: #334155 !important;
}

[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] tbody tr:hover td {
    background: rgba(88, 82, 242, 0.06) !important;
}

/* E. Card variants — TOUTES les classes explicites */
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .action-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .alerts-card,
[data-theme="dark"] .dash-planning-card,
[data-theme="dark"] .chantier-card,
[data-theme="dark"] .add-chantier-card,
[data-theme="dark"] .note-card,
[data-theme="dark"] .note-form-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .devis-preview-card,
[data-theme="dark"] .tab-content-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .tasks-card,
[data-theme="dark"] .archive-card,
[data-theme="dark"] .option-card,
[data-theme="dark"] .equipe-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .apercu-card,
[data-theme="dark"] .totaux-card,
[data-theme="dark"] .add-new-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* F. Card/section headers inline */
[data-theme="dark"] .info-card-header,
[data-theme="dark"] .devis-preview-header,
[data-theme="dark"] .resource-header,
[data-theme="dark"] .month-grid-header,
[data-theme="dark"] .planning-nav,
[data-theme="dark"] .category-header td,
[data-theme="dark"] .cat-header td {
    background: #253348 !important;
    border-color: #334155 !important;
}

/* G. Summary/preview */
[data-theme="dark"] .summary-body,
[data-theme="dark"] .devis-preview-body,
[data-theme="dark"] .devis-preview-wrapper {
    background: #1e293b !important;
}

/* H. Search boxes — toutes variantes */
[data-theme="dark"] [class*="searchbar"] .input-group-text,
[data-theme="dark"] [class*="searchbar"] .form-control,
[data-theme="dark"] .search-box,
[data-theme="dark"] .search-box .form-control,
[data-theme="dark"] .search-archive,
[data-theme="dark"] .search-wrapper input {
    background: #334155 !important;
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .search-wrapper input:focus {
    border-color: #5852F2 !important;
}

[data-theme="dark"] .search-wrapper i,
[data-theme="dark"] .search-wrapper .clear-btn {
    color: #64748b !important;
}

/* I. Filtres */
[data-theme="dark"] .filters-bar {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .filters-bar select,
[data-theme="dark"] .filters-bar input,
[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .filter-group label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .status-chip {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .status-chip:hover {
    background: #475569 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .status-chip.active {
    background: #5852F2 !important;
    color: #fff !important;
    border-color: #5852F2 !important;
}

[data-theme="dark"] .filters-advanced-toggle {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .filters-advanced-toggle:hover {
    background: #475569 !important;
    color: #cbd5e1 !important;
}

/* J. View toggle */
[data-theme="dark"] .view-toggle {
    background: #253348 !important;
}

[data-theme="dark"] .view-toggle-btn {
    color: #94a3b8 !important;
    background: transparent !important;
}

[data-theme="dark"] .view-toggle-btn:hover {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .view-toggle-btn.active {
    background: #5852F2 !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* K. Boutons export/back */
[data-theme="dark"] .btn-export,
[data-theme="dark"] .btn-back {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .btn-export:hover,
[data-theme="dark"] .btn-back:hover {
    border-color: #5852F2 !important;
    color: #818cf8 !important;
    background: #253348 !important;
}

/* L. Nav tabs custom (BDDP, etc.) */
[data-theme="dark"] .nav-tabs-custom .nav-link {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .nav-tabs-custom .nav-link:hover {
    background: #253348 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .nav-tabs-custom .nav-link.active {
    background: #5852F2 !important;
    color: #fff !important;
}

/* M. Add row / Resource table */
[data-theme="dark"] .add-row td {
    background: #253348 !important;
}

[data-theme="dark"] .resource-table {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .resource-table .form-control,
[data-theme="dark"] .resource-table .form-select {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .resource-row {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .resource-row:hover {
    background: #253348 !important;
}

[data-theme="dark"] .resource-row.new-row {
    background: rgba(88, 82, 242, .08) !important;
    border-top-color: #475569 !important;
}

[data-theme="dark"] .resource-header {
    background: #253348 !important;
    border-bottom-color: #475569 !important;
}

[data-theme="dark"] .resource-header-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .section-header {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .section-header h6 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .empty-state-inline {
    color: #64748b !important;
}

/* Summary/preview cards */
[data-theme="dark"] .summary-body,
[data-theme="dark"] .devis-preview-card,
[data-theme="dark"] .devis-preview-body {
    background: #1e293b !important;
}

[data-theme="dark"] .summary-row {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .summary-row.total {
    border-top-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .summary-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .summary-value {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .summary-section-title {
    color: #64748b !important;
}

[data-theme="dark"] .devis-preview-header,
[data-theme="dark"] .info-card-header {
    background: #253348 !important;
}

/* Tab content cards */
[data-theme="dark"] .tab-content-card,
[data-theme="dark"] .tab-content-custom {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Stat labels */
[data-theme="dark"] .stat-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .stat-value {
    opacity: 0.9;
}

/* Add new card */
[data-theme="dark"] .add-new-card,
[data-theme="dark"] .add-chantier-card {
    background: #1e293b !important;
    border-color: #475569 !important;
}

/* Option cards */
[data-theme="dark"] .option-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .option-card:hover {
    background: #253348 !important;
}

/* Table light rows */
[data-theme="dark"] .table-light,
[data-theme="dark"] tr.table-light,
[data-theme="dark"] tr.table-light td {
    background: #253348 !important;
    --bs-table-bg: #253348 !important;
    color: #cbd5e1 !important;
}

/* Btn outline-dark — très utilisé comme filtre inactif */
[data-theme="dark"] .btn-outline-dark {
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-outline-dark:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

/* Chantier detail — CSS variables custom */
[data-theme="dark"] .chantier-detail-page {
    --bg-light: #0f172a;
    --bg-card: #1e293b;
}

[data-theme="dark"] .chantier-hero {
    background: #1e293b !important;
}

[data-theme="dark"] .nav-pills-custom {
    background: #1e293b !important;
}

/* Page header dark mode */
[data-theme="dark"] .page-header h1 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .page-header h1 i {
    color: #818cf8 !important;
}

[data-theme="dark"] .page-header .subtitle {
    color: #94a3b8 !important;
}

/* N. Global search modal */
[data-theme="dark"] .gs-modal {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .gs-modal input,
[data-theme="dark"] .gs-modal .gs-input {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .gs-kbd,
[data-theme="dark"] .gs-modal kbd {
    background: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .gs-item:hover,
[data-theme="dark"] .gs-item.gs-active {
    background: #253348 !important;
}

[data-theme="dark"] .gs-item-icon.chantier {
    background: rgba(124, 58, 237, 0.15) !important;
}

[data-theme="dark"] .gs-item-icon.client {
    background: rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .gs-item-icon.devis {
    background: rgba(217, 119, 6, 0.15) !important;
}

[data-theme="dark"] .gs-item-icon.facture {
    background: rgba(22, 163, 74, 0.15) !important;
}

[data-theme="dark"] .gs-item-icon.edc {
    background: rgba(236, 72, 153, 0.15) !important;
}

[data-theme="dark"] .gs-item-icon.personnel {
    background: rgba(99, 102, 241, 0.15) !important;
}

[data-theme="dark"] .gs-item-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .gs-item-subtitle,
[data-theme="dark"] .gs-item-meta {
    color: #94a3b8 !important;
}

[data-theme="dark"] .gs-section-title {
    color: #64748b !important;
}

[data-theme="dark"] .gs-empty {
    color: #64748b !important;
}

/* O. Ma journée */
[data-theme="dark"] .journee-card,
[data-theme="dark"] .fallback-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .journee-equipe .badge-equipe,
[data-theme="dark"] .periode-badge {
    background: #334155 !important;
    color: #94a3b8 !important;
}

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

[data-theme="dark"] .journee-secondary a:hover {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #818cf8 !important;
}

/* P. Saisie rapide */
[data-theme="dark"] .sr-card,
[data-theme="dark"] .sr-choix-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .sr-back {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .sr-back:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .sr-form-group select,
[data-theme="dark"] .sr-form-group input {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .sr-static-val {
    background: #253348 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .sr-history {
    background: #253348 !important;
    border-color: #334155 !important;
}

/* Q. Abonnement — démarrer + mon abonnement */
[data-theme="dark"] .pack-card,
[data-theme="dark"] .role-config,
[data-theme="dark"] .total-section,
[data-theme="dark"] .abo-status-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-pack-secondary {
    background: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-pack-secondary:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .cadence-toggle {
    background: #334155 !important;
}

[data-theme="dark"] .cadence-btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .cadence-btn.active {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .trial-info {
    background: rgba(88, 82, 242, 0.1) !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .siege-table th {
    background: #253348 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .siege-bar {
    background: #334155 !important;
}

[data-theme="dark"] .abo-badge-active {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .abo-badge-trialing {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .abo-badge-past_due,
[data-theme="dark"] .abo-badge-unpaid {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .abo-badge-canceled,
[data-theme="dark"] .abo-badge-none {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .abo-badge-incomplete {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fbbf24 !important;
}

/* R. Formulaire validation (fieldset) */
[data-theme="dark"] fieldset {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* S. Personnel detail header */
[data-theme="dark"] .personnel-header {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* T. Facture badges */
[data-theme="dark"] .badge-brouillon {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .badge-emise {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .badge-payee {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge-annulee {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .paiement-row {
    background: rgba(22, 163, 74, 0.08) !important;
}

/* T2. Facture detail — totaux-box, info-card h5, cat-subtotal, sidebar */
[data-theme="dark"] .totaux-box {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .info-card h5 {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .cat-subtotal td {
    border-top-color: #475569 !important;
}

[data-theme="dark"] .facture-sidebar {
    border-top-color: #334155 !important;
}

/* U. Keyboard shortcut kbd global */
[data-theme="dark"] kbd {
    background: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

/* V. Bootstrap bg-white / bg-light overrides */
[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

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

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

/* W. Devis preview wrapper (EDC) */
[data-theme="dark"] .devis-preview-wrapper {
    background: #1e293b !important;
}

/* X. Searchbar clients specifics */
[data-theme="dark"] .searchbar-clients .input-group-text,
[data-theme="dark"] .searchbar-clients .form-control {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

/* Y. btn-load-more */
[data-theme="dark"] .btn-load-more {
    background: #334155 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-load-more:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

/* --- 3. Textes — héritage global --- */
[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: #f1f5f9 !important;
}

/* Icônes violettes des headers → variante claire en dark */
[data-theme="dark"] h1 > i[style*="color: #5852F2"],
[data-theme="dark"] h2 > i[style*="color: #5852F2"] {
    color: #818cf8 !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span:not(.badge):not([class*="btn"]),
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] label,
[data-theme="dark"] small,
[data-theme="dark"] strong,
[data-theme="dark"] div:not(.badge):not([class*="btn"]):not(.progress-bar) {
    color: inherit;
}

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

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

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

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

/* Liens */
[data-theme="dark"] a:not(.btn):not(.nav-link):not(.list-group-item):not(.menu-link):not(.dropdown-item):not(.btn-portal) {
    color: #818cf8;
}

/* --- 4. Sidebar desktop --- */
[data-theme="dark"] #sidebar-wrapper {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #sidebar-wrapper .list-group-item {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] #sidebar-wrapper .list-group-item:hover {
    background: #334155 !important;
}

[data-theme="dark"] #sidebar-wrapper .active-menu {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .profil-access {
    border-color: #334155 !important;
}

[data-theme="dark"] .profil-name {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .profil-entreprise {
    color: #94a3b8 !important;
}

[data-theme="dark"] .sidebar-heading {
    border-color: #334155 !important;
}

[data-theme="dark"] .sub-cat-menu {
    color: #64748b !important;
}

[data-theme="dark"] .sidebar-cat-toggle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .submenu-item {
    background: #253348 !important;
}

[data-theme="dark"] .sidebar-footer {
    border-color: #334155 !important;
}

[data-theme="dark"] .sidebar-footer .logout-btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .sidebar-footer .logout-btn:hover {
    color: #fca5a5 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* --- 5. Sidebar mobile --- */
[data-theme="dark"] .custom-mobile-sidebar {
    background: #1e293b !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .mobile-sidebar-header {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .p-3.border-bottom {
    background: linear-gradient(135deg, #1e293b, #1e1b4b) !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .p-3.border-bottom strong {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .p-3.border-bottom .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .pdp {
    border-color: #475569 !important;
}

[data-theme="dark"] .custom-mobile-sidebar nav.p-3 {
    background: #1e293b !important;
}

[data-theme="dark"] .custom-mobile-sidebar .btn-outline-light {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .btn-outline-light:hover {
    background: #475569 !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .custom-mobile-sidebar .text-uppercase.text-secondary {
    color: #64748b !important;
}

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

[data-theme="dark"] .menu-link i {
    color: #94a3b8 !important;
}

[data-theme="dark"] .menu-link:hover,
[data-theme="dark"] .menu-link:active {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .menu-link:hover i,
[data-theme="dark"] .menu-link:active i {
    color: #a5b4fc !important;
}

[data-theme="dark"] .menu-link.active {
    background: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .menu-link.active i {
    color: #fff !important;
}

[data-theme="dark"] .menu-link.active:hover {
    background: #4842e0 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .border-top.border-secondary {
    border-color: #334155 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .btn-outline-light.w-100 {
    background: transparent !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .custom-mobile-sidebar .btn-outline-light.w-100:hover {
    background: rgba(88, 82, 242, 0.15) !important;
    border-color: #818cf8 !important;
    color: #a5b4fc !important;
}

/* --- 6. Navbar --- */
[data-theme="dark"] .navbar,
[data-theme="dark"] nav.navbar {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .navbar-brand {
    color: #f1f5f9 !important;
}

/* --- 7. Cards — toutes variantes --- */
[data-theme="dark"] .card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .inscription-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .action-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .alerts-card,
[data-theme="dark"] .tasks-card,
[data-theme="dark"] .dash-planning-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .chantier-card,
[data-theme="dark"] .apercu-card,
[data-theme="dark"] .totaux-card,
[data-theme="dark"] .add-new-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .card-title,
[data-theme="dark"] .card-header {
    color: #f1f5f9 !important;
    background: #1e293b !important;
    border-color: #334155 !important;
}

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

[data-theme="dark"] .card-footer {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Cards génériques dans le contenu */
[data-theme="dark"] #page-content-wrapper .card,
[data-theme="dark"] #page-content-wrapper [class*="-card"],
[data-theme="dark"] #page-content-wrapper .shadow,
[data-theme="dark"] #page-content-wrapper .shadow-sm {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Reset pour les icônes Bootstrap qui matchent [class*="-card"] (bi-credit-card, etc.) */
[data-theme="dark"] #page-content-wrapper i.bi {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

[data-theme="dark"] #page-content-wrapper .rounded {
    border-color: #334155 !important;
}

/* --- 8. Tables --- */
[data-theme="dark"] .table,
[data-theme="dark"] .white-table,
[data-theme="dark"] .table-chantier {
    color: #cbd5e1 !important;
    border-color: #334155 !important;
    background: #1e293b !important;
    --bs-table-bg: transparent;
}

[data-theme="dark"] .table thead th,
[data-theme="dark"] .white-table thead th {
    background: #253348 !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .table tbody tr {
    border-color: #334155 !important;
}

[data-theme="dark"] .table tbody tr:hover,
[data-theme="dark"] .table-hover tbody tr:hover {
    --bs-table-hover-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    background: rgba(148, 163, 184, 0.08) !important;
}
[data-theme="dark"] .table tbody tr:hover > td,
[data-theme="dark"] .table-hover tbody tr:hover > td {
    --bs-table-accent-bg: transparent !important;
    background: inherit !important;
}

[data-theme="dark"] .table tbody td {
    border-color: #334155 !important;
}

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

[data-theme="dark"] .table-responsive {
    border-color: #334155 !important;
}

/* Colonnes sticky dans les tables */
[data-theme="dark"] .table-sticky-first th:first-child,
[data-theme="dark"] .table-sticky-first td:first-child,
[data-theme="dark"] .col-resource {
    background: #1e293b !important;
}

/* Section rows planning */
[data-theme="dark"] .dash-planning-section {
    background: #253348 !important;
}

/* --- 9. Formulaires --- */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    border-color: #5852F2 !important;
    box-shadow: 0 0 0 3px rgba(88, 82, 242, 0.2) !important;
}

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

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] input:disabled,
[data-theme="dark"] select:disabled {
    background-color: #253348 !important;
    color: #94a3b8 !important;
}

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

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

[data-theme="dark"] .form-section {
    background: #253348 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .form-section-title {
    color: #a5b4fc !important;
}

[data-theme="dark"] .input-group-text {
    background-color: #253348 !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

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

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

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

/* Select2 — toutes variantes (bootstrap-5 et default) */
[data-theme="dark"] .select2-container .select2-selection,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection,
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

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

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #94a3b8 transparent transparent transparent !important;
}

[data-theme="dark"] .select2-container .select2-dropdown,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown,
[data-theme="dark"] .select2-container--default .select2-dropdown {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .select2-container .select2-results__option,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option,
[data-theme="dark"] .select2-container--default .select2-results__option {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .select2-container .select2-results__option--highlighted,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted,
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #5852F2 !important;
    color: white !important;
}

[data-theme="dark"] .select2-container .select2-search__field,
[data-theme="dark"] .select2-container--bootstrap-5 .select2-search__field,
[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

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

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

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

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-light {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-light:hover {
    background-color: #475569 !important;
    color: #f1f5f9 !important;
}

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

[data-theme="dark"] .btn-chart-export {
    color: #94a3b8 !important;
}

[data-theme="dark"] .btn-chart-export:hover {
    background: #334155 !important;
}

/* Boutons d'action colorés — fonds assombris pour dark mode */
[data-theme="dark"] .btn-action-delete {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .btn-action-delete:hover {
    background: #dc2626 !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-action-view {
    background: rgba(100, 116, 139, 0.15) !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .btn-action-view:hover {
    background: #64748b !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-action-edit {
    background: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .btn-action-edit:hover {
    background: #2563eb !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-action-duplicate {
    background: rgba(124, 58, 237, 0.15) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .btn-action-download {
    background: rgba(8, 145, 178, 0.15) !important;
    color: #22d3ee !important;
}

[data-theme="dark"] .btn-action-archive {
    background: rgba(234, 88, 12, 0.15) !important;
    color: #fb923c !important;
}

[data-theme="dark"] .btn-action-generate,
[data-theme="dark"] .btn-action-save {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #6ee7b7 !important;
}

/* --- 11. Badges --- */
[data-theme="dark"] .badge {
    opacity: 0.9;
}

[data-theme="dark"] .cust-badge {
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .cust-badge-white {
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* Badges statut — fond subtil pour lisibilité sur fond sombre */
[data-theme="dark"] .badge-status-brouillon {
    background: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .badge-status-en-cours {
    background: rgba(88, 82, 242, 0.25) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .badge-status-cloture {
    background: rgba(25, 135, 84, 0.25) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge-status-archive {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* Alert badges */
[data-theme="dark"] .alert-badge-danger {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .alert-badge-warning {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .alert-badge-success {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .alert-badge-secondary {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* KPI trends */
[data-theme="dark"] .kpi-trend.trend-up {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .kpi-trend.trend-down {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #fca5a5 !important;
}

/* --- 12. Alertes & notifications --- */
[data-theme="dark"] .alert-errors {
    background: rgba(127, 29, 29, 0.3) !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .alert-item {
    background: transparent !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .alert-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .alert-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .alert-meta {
    color: #94a3b8 !important;
}

/* Icônes alertes — fond assombri pour ne pas "pop" */
[data-theme="dark"] .alert-icon.danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .alert-icon.warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .alert-icon.info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

/* Alert badges — fond subtil */
[data-theme="dark"] .alert-badge-danger {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .alert-badge-warning {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .alert-badge-success {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .alert-badge-secondary {
    background: rgba(71, 85, 105, 0.4) !important;
    color: #94a3b8 !important;
}

/* Filtres alertes */
[data-theme="dark"] .alert-filter-btn {
    border-color: #475569 !important;
    color: #94a3b8 !important;
    background: transparent !important;
}

[data-theme="dark"] .alert-filter-btn:hover {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .alert-filter-btn.active {
    background: #5852F2 !important;
    border-color: #5852F2 !important;
    color: #fff !important;
}

/* Toasts */
[data-theme="dark"] .toast-notification {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .toast-message {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .toast-close {
    color: #64748b !important;
}

[data-theme="dark"] .toast-close:hover {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .toast-success {
    border-left-color: #22c55e !important;
}

[data-theme="dark"] .toast-success i:first-child {
    color: #4ade80 !important;
}

[data-theme="dark"] .toast-error {
    border-left-color: #ef4444 !important;
}

[data-theme="dark"] .toast-error i:first-child {
    color: #f87171 !important;
}

[data-theme="dark"] .toast-warning {
    border-left-color: #f59e0b !important;
}

[data-theme="dark"] .toast-warning i:first-child {
    color: #fbbf24 !important;
}

[data-theme="dark"] .toast-info {
    border-left-color: #818cf8 !important;
}

[data-theme="dark"] .toast-info i:first-child {
    color: #818cf8 !important;
}

/* Bootstrap Toast (dark) — utilisé par saisie_heures, EDC, chantier_detail */
[data-theme="dark"] .toast {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

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

[data-theme="dark"] .toast.text-bg-success {
    background: rgba(22, 163, 74, 0.9) !important;
    color: #fff !important;
}

[data-theme="dark"] .toast.text-bg-danger {
    background: rgba(220, 38, 38, 0.9) !important;
    color: #fff !important;
}

[data-theme="dark"] .toast.text-bg-warning {
    background: rgba(217, 119, 6, 0.9) !important;
    color: #fff !important;
}

[data-theme="dark"] .toast.text-bg-info {
    background: rgba(59, 130, 246, 0.9) !important;
    color: #fff !important;
}

/* Loading overlay (dark) */
[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.8) !important;
}

[data-theme="dark"] .search-spinner {
    border-color: #475569 !important;
    border-top-color: #818cf8 !important;
}

/* Dual input (base de prix / saisie libre) — dark mode */
[data-theme="dark"] .saisie-dual-input {
    background: transparent !important;
    border-color: #475569 !important;
}
[data-theme="dark"] .saisie-dual-input .helper-label {
    color: #818cf8 !important;
}
[data-theme="dark"] .saisie-dual-separator::before {
    background: #475569 !important;
}
[data-theme="dark"] .saisie-dual-separator span {
    background: #1e293b !important;
    color: #64748b !important;
}
/* Mobile cards saisie — dark mode */
@media (max-width: 768px) {
    [data-theme="dark"] .saisie-heures-row,
    [data-theme="dark"] .fourniture-row,
    [data-theme="dark"] .materiel-row {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
    [data-theme="dark"] .saisie-heures-row > td[data-label]:before,
    [data-theme="dark"] .fourniture-row > td[data-label]:before,
    [data-theme="dark"] .materiel-row > td[data-label]:before {
        color: #94a3b8 !important;
    }
    [data-theme="dark"] .saisie-heures-row > td.td-actions,
    [data-theme="dark"] .fourniture-row > td.td-actions,
    [data-theme="dark"] .materiel-row > td.td-actions {
        border-top-color: #334155 !important;
    }
    /* Recap semaines cards — dark mode */
    [data-theme="dark"] #recap-semaines-table > tbody > tr {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
    [data-theme="dark"] #recap-semaines-table > tbody > tr[data-current="true"] {
        border-color: #818cf8 !important;
    }
    [data-theme="dark"] #recap-semaines-table > tbody > tr > td[data-label]:before {
        color: #94a3b8 !important;
    }
    [data-theme="dark"] #recap-semaines-table > tbody > tr > td.td-actions {
        border-top-color: #334155 !important;
    }
    [data-theme="dark"] #recap-semaines-table > tfoot {
        border-top-color: #334155 !important;
    }
    [data-theme="dark"] #recap-semaines-table > tfoot > tr > td:first-child {
        color: #94a3b8 !important;
    }
}

/* Bootstrap alerts */
[data-theme="dark"] .alert-success {
    background: rgba(22, 163, 74, 0.15) !important;
    border-color: rgba(22, 163, 74, 0.3) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .alert-danger {
    background: rgba(220, 38, 38, 0.15) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .alert-warning {
    background: rgba(217, 119, 6, 0.15) !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
    color: #fcd34d !important;
}

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

/* --- 13. Modales --- */
[data-theme="dark"] .modal-content {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #334155 !important;
}

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

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

/* --- 14. Dropdowns --- */
[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

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

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

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

/* --- 15. Pagination --- */
[data-theme="dark"] .page-link {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .page-link:hover {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: #5852F2 !important;
    border-color: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #1e293b !important;
    color: #475569 !important;
}

/* --- 16. Breadcrumbs --- */
[data-theme="dark"] .breadcrumb-nav .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item {
    color: #94a3b8;
}

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

[data-theme="dark"] .breadcrumb-item a {
    color: #818cf8 !important;
}

/* --- 17. Bootstrap utility overrides --- */
[data-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}

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

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

[data-theme="dark"] .list-group-item {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .list-group-item:hover {
    background-color: #253348 !important;
}

/* Bordures Bootstrap */
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end,
[data-theme="dark"] [class*="border-"] {
    border-color: #334155 !important;
}

/* Exceptions: ne pas écraser les border-color des badges/alertes/boutons */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-info,
[data-theme="dark"] .progress-bar {
    border-color: inherit !important;
}

/* --- 18. Inline style overrides --- */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background: #F0F0FF"],
[data-theme="dark"] [style*="background: #f0f0ff"],
[data-theme="dark"] [style*="background-color: #F0F0FF"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background-color: #f8fafc"],
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background-color: #f8f9fa"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background: #fafafa"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background-color: #f3f4f6"] {
    background: #1e293b !important;
}

[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background-color: #f1f5f9"],
[data-theme="dark"] [style*="background: #f0f0f0"],
[data-theme="dark"] [style*="background-color: #f0f0f0"],
[data-theme="dark"] [style*="background: #f8f8f8"],
[data-theme="dark"] [style*="background-color: #f8f8f8"],
[data-theme="dark"] [style*="background: #e2e8f0"],
[data-theme="dark"] [style*="background-color: #e2e8f0"],
[data-theme="dark"] [style*="background: #e9ecef"],
[data-theme="dark"] [style*="background-color: #e9ecef"],
[data-theme="dark"] [style*="background: #e5e7eb"],
[data-theme="dark"] [style*="background-color: #e5e7eb"] {
    background: #253348 !important;
}

[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background-color: #f9fafb"],
[data-theme="dark"] [style*="background: #fafaff"],
[data-theme="dark"] [style*="background-color: #fafaff"],
[data-theme="dark"] [style*="background:#fafaff"] {
    background: #1e293b !important;
}

/* Pastels inline → rgba dark (complément section 34) */
[data-theme="dark"] [style*="background: #eef2ff"],
[data-theme="dark"] [style*="background-color: #eef2ff"],
[data-theme="dark"] [style*="background: #e0e7ff"],
[data-theme="dark"] [style*="background-color: #e0e7ff"] {
    background: rgba(99, 102, 241, 0.12) !important;
}

[data-theme="dark"] [style*="background: #ecfdf5"],
[data-theme="dark"] [style*="background-color: #ecfdf5"] {
    background: rgba(22, 163, 74, 0.12) !important;
}

[data-theme="dark"] [style*="background: #fce7f3"],
[data-theme="dark"] [style*="background-color: #fce7f3"] {
    background: rgba(236, 72, 153, 0.12) !important;
}

/* Gradients inline clairs → dark */
[data-theme="dark"] [style*="linear-gradient(135deg, #f8fafc"],
[data-theme="dark"] [style*="linear-gradient(135deg, #f8f9fa"] {
    background: #1e293b !important;
}

/* Couleur texte inline */
[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color: #2D2D2D"],
[data-theme="dark"] [style*="color: #212529"],
[data-theme="dark"] [style*="color: #1e293b"] {
    color: #f1f5f9 !important;
}

[data-theme="dark"] [style*="color: #555"],
[data-theme="dark"] [style*="color:#555"],
[data-theme="dark"] [style*="color: #444"],
[data-theme="dark"] [style*="color: #495057"],
[data-theme="dark"] [style*="color: #475569"] {
    color: #cbd5e1 !important;
}

[data-theme="dark"] [style*="color: #6c757d"],
[data-theme="dark"] [style*="color:#6c757d"],
[data-theme="dark"] [style*="color: #5a6268"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color: #7E7E7E"] {
    color: #94a3b8 !important;
}

/* Bordures inline */
[data-theme="dark"] [style*="border-color: #e2e8f0"],
[data-theme="dark"] [style*="border-color: #f0f0f0"],
[data-theme="dark"] [style*="border-color: #e9ecef"],
[data-theme="dark"] [style*="border-color: #dee2e6"],
[data-theme="dark"] [style*="border-color: #F4F4F4"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #eee"] {
    border-color: #334155 !important;
}

/* --- 19. Page Login & Inscription --- */
[data-theme="dark"] .login-page,
[data-theme="dark"] .inscription-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%) !important;
}

[data-theme="dark"] .login-header h1,
[data-theme="dark"] .inscription-pitch h1 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .login-header p,
[data-theme="dark"] .inscription-pitch .subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .login-footer,
[data-theme="dark"] .inscription-footer {
    background: #253348 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .login-footer p,
[data-theme="dark"] .inscription-footer p {
    color: #94a3b8 !important;
}

[data-theme="dark"] .trust-badge {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .section-title {
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .feature-list li {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .legal-text {
    color: #64748b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .consent-group label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-divider {
    border-color: #334155 !important;
}

/* --- 20. Page Dashboard --- */
[data-theme="dark"] .dashboard-page {
    background: linear-gradient(135deg, #1e293b, #1e1b4b) !important;
}

[data-theme="dark"] .period-selector {
    background: #334155 !important;
    box-shadow: none !important;
}

[data-theme="dark"] .period-selector .btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .period-selector .btn.active,
[data-theme="dark"] .period-selector .btn-primary {
    color: #fff !important;
    background: #5852F2 !important;
}

[data-theme="dark"] .kpi-value {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .kpi-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .action-icon {
    opacity: 0.75;
}

/* Action icons — réduire la saturation */
[data-theme="dark"] .action-icon.primary {
    background: rgba(88, 82, 242, 0.8) !important;
}

[data-theme="dark"] .action-icon.success {
    background: rgba(34, 197, 94, 0.7) !important;
}

[data-theme="dark"] .action-icon.secondary {
    background: rgba(100, 116, 139, 0.7) !important;
}

/* Period selector — date inputs & dividers */
[data-theme="dark"] .period-selector .btn:hover {
    background: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .period-selector .divider {
    background: #475569 !important;
}

[data-theme="dark"] .custom-period-form input[type="date"] {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .custom-period-form input[type="date"]:focus {
    border-color: #5852F2 !important;
}

[data-theme="dark"] .custom-period-form.active input[type="date"] {
    background: #3b3680 !important;
    border-color: #5852F2 !important;
}

/* Date picker — icône calendrier native (webkit/chrome) — voir aussi section 21d */

/* Btn-group planning (< Aujourd'hui >) */
[data-theme="dark"] .btn-group .btn-outline-secondary {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .btn-group .btn-outline-secondary:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

/* Btn outline-primary dans le planning (Planning complet) */
[data-theme="dark"] .btn-sm.btn-outline-primary {
    background: transparent !important;
    color: #818cf8 !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .btn-sm.btn-outline-primary:hover {
    background: #5852F2 !important;
    color: #fff !important;
}

/* --- 21. Planning --- */
[data-theme="dark"] .dash-planning-wrapper {
    background: #1e293b !important;
}

[data-theme="dark"] .dash-planning-table thead th {
    background: #253348 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .dash-planning-table td,
[data-theme="dark"] .dash-planning-table th {
    border-color: #334155 !important;
}

[data-theme="dark"] .dash-planning-cell {
    border-color: #334155 !important;
}

[data-theme="dark"] .dash-planning-cell.is-today {
    background: rgba(88, 82, 242, 0.12) !important;
}

[data-theme="dark"] .dash-planning-cell.is-past {
    background: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="dark"] .dash-planning-block {
    opacity: 0.85;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .dash-planning-section td {
    background: #253348 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .dash-planning-table td.col-resource {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .dash-planning-table thead th.col-resource {
    background: #253348 !important;
}

/* --- 21b. KPI icons (BDDP, dashboard) — fonds pastel assombris --- */
[data-theme="dark"] .kpi-icon.purple {
    background: rgba(124, 58, 237, 0.2) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .kpi-icon.blue {
    background: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .kpi-icon.green {
    background: rgba(22, 163, 74, 0.2) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .kpi-icon.amber {
    background: rgba(217, 119, 6, 0.2) !important;
    color: #fbbf24 !important;
}

/* Stat icons (clients_list, etc.) */
[data-theme="dark"] .stat-icon {
    opacity: 0.85;
}

/* --- 21c. Tables spécifiques (devis, prestations, etc.) --- */
[data-theme="dark"] .prestations-table,
[data-theme="dark"] .clients-table,
[data-theme="dark"] .etudes-table,
[data-theme="dark"] .chantiers-table {
    background: #1e293b !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .prestations-table thead,
[data-theme="dark"] .clients-table thead,
[data-theme="dark"] .etudes-table thead,
[data-theme="dark"] .chantiers-table thead {
    background: #253348 !important;
}

[data-theme="dark"] .prestations-table td,
[data-theme="dark"] .clients-table td,
[data-theme="dark"] .etudes-table td,
[data-theme="dark"] .chantiers-table td {
    border-color: #334155 !important;
}

/* Totaux card (devis detail) */
[data-theme="dark"] .totaux-card {
    background: linear-gradient(135deg, #1e293b, #253348) !important;
}

[data-theme="dark"] .total-ttc {
    color: #6ee7b7 !important;
}

/* --- 21d. Date/time picker — dark mode --- */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark !important;
}

/* Bouton "Ouvrir le calendrier" créé par date-input.js */
[data-theme="dark"] .input-group > .btn[title="Ouvrir le calendrier"] {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
}

[data-theme="dark"] .input-group > .btn[title="Ouvrir le calendrier"]:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #818cf8 !important;
}

/* --- 21e. Input file natif — bouton "Choisir un fichier" --- */
[data-theme="dark"] input[type="file"] {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] input[type="file"]::file-selector-button {
    background-color: #475569 !important;
    color: #f1f5f9 !important;
    border-color: #5a6578 !important;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

[data-theme="dark"] input[type="file"]::file-selector-button:hover {
    background-color: #5a6578 !important;
}

/* Compatibilité WebKit (Safari, anciens Chrome) */
[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
    background-color: #475569 !important;
    color: #f1f5f9 !important;
    border-color: #5a6578 !important;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}

/* --- 22. Empty states & skeletons --- */
[data-theme="dark"] .empty-state {
    background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 100%) !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .empty-state-icon {
    background: #334155 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .empty-state-small {
    background: #253348 !important;
}

[data-theme="dark"] .skeleton,
[data-theme="dark"] .skeleton-card,
[data-theme="dark"] .skeleton-text,
[data-theme="dark"] .skeleton-title,
[data-theme="dark"] .skeleton-avatar,
[data-theme="dark"] .skeleton-badge,
[data-theme="dark"] .skeleton-table-row {
    background: #253348 !important;
}

@keyframes dark-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #253348 25%, #334155 50%, #253348 75%) !important;
    background-size: 200% 100%;
    animation: dark-shimmer 1.5s infinite;
}

/* --- 23. Progress bars & hr --- */
[data-theme="dark"] .progress {
    background-color: #334155 !important;
}

[data-theme="dark"] hr {
    border-color: #334155 !important;
    opacity: 0.5;
}

/* --- 24. Filtres & recherche --- */
[data-theme="dark"] .filter-badge,
[data-theme="dark"] .badge-filter {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .search-bar {
    background: #334155 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .search-bar input {
    background: transparent !important;
    color: #f1f5f9 !important;
}

/* --- 25. Calendrier (FullCalendar) --- */
[data-theme="dark"] .fc .fc-daygrid-day {
    background: #1e293b !important;
}

[data-theme="dark"] .fc .fc-daygrid-day.fc-day-today {
    background: rgba(88, 82, 242, 0.1) !important;
}

[data-theme="dark"] .fc .fc-col-header-cell {
    background: #253348 !important;
    color: #94a3b8 !important;
}

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

/* --- 26. Onglets (nav-tabs, nav-pills) --- */
[data-theme="dark"] .nav-tabs {
    border-color: #334155 !important;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8 !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background: #1e293b !important;
    border-color: #334155 #334155 #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .nav-pills .nav-link {
    color: #94a3b8 !important;
}

[data-theme="dark"] .nav-pills .nav-link.active {
    background: #5852F2 !important;
    color: #fff !important;
}

/* --- 27. Accordions --- */
[data-theme="dark"] .accordion-item {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .accordion-button {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: none !important;
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #253348 !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .accordion-body {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

/* --- 28. Popover & Tooltip --- */
[data-theme="dark"] .popover {
    background: #1e293b !important;
    border-color: #334155 !important;
}

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

[data-theme="dark"] .tooltip-inner {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* --- 29. Client avatars — garder les gradients, ajuster l'opacité --- */
[data-theme="dark"] [class*="avatar"] {
    opacity: 0.9;
}

/* --- 30. Onboarding --- */
[data-theme="dark"] .onboarding-checklist {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* --- 31. Images & icônes — ajustements --- */
[data-theme="dark"] img[src*="empty"],
[data-theme="dark"] img[src*="illustration"] {
    opacity: 0.85;
}

/* --- 32. Scroll hints --- */
[data-theme="dark"] [style*="linear-gradient(135deg, #e8f4fd"] {
    background: linear-gradient(135deg, #1e293b, #253348) !important;
}

[data-theme="dark"] [style*="linear-gradient(135deg, #fff8e6"] {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(217, 119, 6, 0.05)) !important;
}

/* --- 33. Tags et labels colorés — réduire la saturation --- */
[data-theme="dark"] .tag-badge {
    opacity: 0.85;
}

[data-theme="dark"] .equipe-membre-badge {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .heures-badge,
[data-theme="dark"] .periode-badge,
[data-theme="dark"] .count-badge {
    opacity: 0.9;
}

/* --- 34. Couleurs pastel des cartes colorées — assombrir --- */
[data-theme="dark"] [style*="background: #fef2f2"],
[data-theme="dark"] [style*="background-color: #fef2f2"],
[data-theme="dark"] [style*="background: #fee2e2"] {
    background: rgba(220, 38, 38, 0.12) !important;
}

[data-theme="dark"] [style*="background: #dcfce7"],
[data-theme="dark"] [style*="background-color: #dcfce7"],
[data-theme="dark"] [style*="background: #d1fae5"],
[data-theme="dark"] [style*="background: #f0fdf4"] {
    background: rgba(22, 163, 74, 0.12) !important;
}

[data-theme="dark"] [style*="background: #dbeafe"],
[data-theme="dark"] [style*="background-color: #dbeafe"],
[data-theme="dark"] [style*="background: #eff6ff"] {
    background: rgba(59, 130, 246, 0.12) !important;
}

[data-theme="dark"] [style*="background: #fef3c7"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background-color: #fef3c7"],
[data-theme="dark"] [style*="background: #fffbeb"] {
    background: rgba(217, 119, 6, 0.12) !important;
}

[data-theme="dark"] [style*="background: #ede9fe"],
[data-theme="dark"] [style*="background-color: #ede9fe"],
[data-theme="dark"] [style*="background: #f3e8ff"] {
    background: rgba(124, 58, 237, 0.12) !important;
}

[data-theme="dark"] [style*="background: #cffafe"],
[data-theme="dark"] [style*="background-color: #cffafe"] {
    background: rgba(8, 145, 178, 0.12) !important;
}

[data-theme="dark"] [style*="background: #ffedd5"],
[data-theme="dark"] [style*="background-color: #ffedd5"] {
    background: rgba(234, 88, 12, 0.12) !important;
}

/* --- 35. Saisie heures — highlight sans saisie --- */
[data-theme="dark"] [style*="linear-gradient(90deg, #fffbeb"] {
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.08) 0%, transparent 8%) !important;
}

/* --- 36. Couleurs spécifiques fond D8D7FF, E5E3FD --- */
[data-theme="dark"] [style*="background: #D8D7FF"],
[data-theme="dark"] [style*="background-color: #D8D7FF"],
[data-theme="dark"] [style*="background: #E5E3FD"],
[data-theme="dark"] [style*="background-color: #E5E3FD"] {
    background: rgba(88, 82, 242, 0.15) !important;
}

/* --- 37. Saisie heures par chantier --- */
[data-theme="dark"] .saisie-page,
[data-theme="dark"] .saisie-heures-page {
    background: #0f172a !important;
}

[data-theme="dark"] .week-header {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .form-footer {
    background: #1e293b !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .accordion-saisie .accordion-button {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .accordion-saisie .accordion-button:not(.collapsed) {
    background: rgba(88, 82, 242, 0.12) !important;
    color: #818cf8 !important;
}

/* Badges statut saisie heures */
[data-theme="dark"] .badge-statut.en_cours {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .badge-statut.termine {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge-statut.en_attente {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .badge-statut.annule {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

/* Heures badges */
[data-theme="dark"] .heures-badge {
    background: rgba(14, 165, 233, 0.15) !important;
    color: #38bdf8 !important;
}

[data-theme="dark"] .heures-badge.has-hours {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .heures-badge.no-hours {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fbbf24 !important;
}

/* Filter buttons (saisie choix) */
[data-theme="dark"] .filter-btn {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .filter-btn:hover {
    background: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .filter-btn.active {
    background: #5852F2 !important;
    border-color: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .sort-select {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

/* Table mobile cards (saisie responsive) */
[data-theme="dark"] .table-mobile-cards tbody tr {
    background: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .table-mobile-cards tbody td.td-actions {
    border-color: #334155 !important;
}

[data-theme="dark"] .table-mobile-cards tbody td:before {
    color: #64748b !important;
}

/* Card headers bootstrap opacity */
[data-theme="dark"] .card-header.bg-primary.bg-opacity-10 {
    background-color: rgba(88, 82, 242, 0.12) !important;
}

[data-theme="dark"] .card-header.bg-success.bg-opacity-10 {
    background-color: rgba(22, 163, 74, 0.12) !important;
}

[data-theme="dark"] #collapseHistorique .alert-light {
    background: #253348 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* --- 38. Planning complet --- */
[data-theme="dark"] .planning-nav {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-wrapper {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-table thead th {
    background: #253348 !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .planning-table thead th.col-resource {
    background: #253348 !important;
}

[data-theme="dark"] .planning-table thead th.is-today {
    background: rgba(88, 82, 242, 0.15) !important;
}

[data-theme="dark"] .planning-table td {
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-table td.col-resource {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .planning-section-header td {
    background: #253348 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .planning-totals-row td {
    background: #253348 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .planning-cell:hover {
    background: rgba(88, 82, 242, 0.08) !important;
}

[data-theme="dark"] .planning-cell.is-today {
    background: rgba(88, 82, 242, 0.06) !important;
}

[data-theme="dark"] .planning-cell.is-today:hover {
    background: rgba(88, 82, 242, 0.12) !important;
}

[data-theme="dark"] .planning-cell.is-past {
    background: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dark"] .planning-cell.is-past:hover {
    background: rgba(88, 82, 242, 0.06) !important;
}

[data-theme="dark"] .planning-cell.drag-over {
    background: rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .planning-cell.sidebar-drag-over {
    background: rgba(22, 163, 74, 0.15) !important;
}

/* Planning sidebar */
[data-theme="dark"] .planning-sidebar {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-sidebar-tab {
    background: #1e293b !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .planning-sidebar-tab:hover {
    background: rgba(88, 82, 242, 0.08) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .planning-sidebar-tab.active {
    color: #818cf8 !important;
    border-color: #5852F2 !important;
}

[data-theme="dark"] .planning-sidebar-help {
    background: rgba(124, 58, 237, 0.12) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .planning-sidebar-item {
    background: #253348 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .planning-sidebar-item:hover {
    background: rgba(88, 82, 242, 0.1) !important;
}

[data-theme="dark"] .planning-sidebar-item.active {
    background: rgba(88, 82, 242, 0.15) !important;
}

/* Planning légende */
[data-theme="dark"] .planning-legend-container {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-legend-badge {
    background: #334155 !important;
    color: #cbd5e1 !important;
}

/* Planning actions */
[data-theme="dark"] .planning-actions {
    background: #253348 !important;
    border: none !important;
}
[data-theme="dark"] .planning-actions-mobile {
    background: #253348 !important;
    border: none !important;
}

[data-theme="dark"] .planning-action-btn:hover {
    background: #334155 !important;
}

/* Month grid */
[data-theme="dark"] .month-grid {
    background: #334155 !important;
}

[data-theme="dark"] .month-grid-header {
    background: #253348 !important;
}

[data-theme="dark"] .month-day {
    background: #1e293b !important;
}

[data-theme="dark"] .month-day:hover {
    background: rgba(88, 82, 242, 0.06) !important;
}

[data-theme="dark"] .month-day.is-today {
    background: rgba(88, 82, 242, 0.08) !important;
}

[data-theme="dark"] .month-day.is-past {
    background: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .month-day.is-empty {
    background: #253348 !important;
}

[data-theme="dark"] .month-day.drag-over {
    background: rgba(99, 102, 241, 0.15) !important;
}

[data-theme="dark"] .month-event {
    opacity: 0.9;
}

/* Planning modal info bar */
[data-theme="dark"] .modal-info-bar {
    background: #253348 !important;
    border-color: #334155 !important;
}

/* Periode segment (Semaine/Mois) */
[data-theme="dark"] .periode-segment {
    background: #334155 !important;
}

[data-theme="dark"] .periode-segment-btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .periode-segment-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .periode-segment-btn.active {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Planning mobile */
[data-theme="dark"] .planning-mobile-daybtn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .planning-mobile-daybtn.active {
    background: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .planning-mobile-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-title-icon {
    background: rgba(124, 58, 237, 0.2) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .planning-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .planning-subtitle {
    color: #64748b !important;
}

[data-theme="dark"] .planning-mobile-card-periode {
    background: rgba(124, 58, 237, 0.2) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .planning-mobile-card-chantier {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .planning-mobile-card-details {
    color: #94a3b8 !important;
}

[data-theme="dark"] .planning-mobile-card-note {
    color: #64748b !important;
}

[data-theme="dark"] .planning-mobile-empty {
    color: #64748b !important;
}

/* Planning mobile action buttons (dark) */
[data-theme="dark"] .planning-actions-mobile {
    background: #253348 !important;
}

[data-theme="dark"] .planning-action-btn-mobile {
    color: #cbd5e1 !important;
    background: #253348 !important;
}

[data-theme="dark"] .planning-action-btn-mobile:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
    box-shadow: none !important;
}

[data-theme="dark"] .planning-action-btn-mobile.planning-action-accent {
    background: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .planning-action-btn-mobile.planning-action-accent:hover {
    background: #4a45d4 !important;
}

/* Planning view toggle (dark) */
[data-theme="dark"] .planning-view-toggle {
    background: #253348 !important;
    border: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .planning-view-toggle .btn,
[data-theme="dark"] .planning-view-toggle .btn-outline-secondary {
    color: #94a3b8 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

[data-theme="dark"] .planning-view-toggle .btn:hover {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .planning-view-toggle .btn-primary,
[data-theme="dark"] .planning-view-toggle .btn-primary:hover {
    background: #5852F2 !important;
    color: #fff !important;
}

/* Planning header KPI cards (dark) */
[data-theme="dark"] .planning-page .kpi-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .planning-page .kpi-value {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .planning-page .kpi-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .planning-page .kpi-total {
    color: #64748b !important;
}

/* Planning week label (dark) */
[data-theme="dark"] .planning-week-label {
    color: #f1f5f9 !important;
}

/* Planning KPI icons (dark) — atténuer les fonds pastel inline */
[data-theme="dark"] .planning-page .kpi-icon {
    opacity: 0.85;
}

/* Planning header-bar readonly badge (dark) */
[data-theme="dark"] .planning-header-bar [style*="background: #ede9fe"] {
    background: rgba(124, 58, 237, 0.2) !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
}

[data-theme="dark"] .planning-header-bar [style*="color: #3b0764"] {
    color: #c4b5fd !important;
}

/* Planning nav options labels (dark) */
[data-theme="dark"] .planning-nav-options label {
    color: #94a3b8 !important;
}

/* Planning filter select (dark) */
[data-theme="dark"] .planning-filter-wrap .form-select {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* --- 38b. KPI card icons (chantier_detail) --- */
[data-theme="dark"] .kpi-card-icon.purple {
    background: rgba(88, 82, 242, 0.2) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .kpi-card-icon.green {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .kpi-card-icon.orange {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .kpi-card-icon.blue {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .kpi-card-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .kpi-card-value {
    color: #f1f5f9 !important;
}

/* --- 38c. Lecture seule badge (planning) --- */
[data-theme="dark"] [style*="border: 1px solid #c4b5fd"] {
    border-color: #6d28d9 !important;
}

[data-theme="dark"] [style*="color: #3b0764"] {
    color: #c4b5fd !important;
}

/* --- 39. Chantiers — profitability badges --- */
[data-theme="dark"] .profitability-badge.neutral {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .profitability-badge.ok {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .profitability-badge.danger {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

/* Status badges chantier (inline overrides) */
[data-theme="dark"] .badge-status-brouillon {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .badge-status-en-cours {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .badge-status-cloture {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge-status-archive {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* Card footer chantier */
[data-theme="dark"] .chantier-card .card-footer {
    background: #253348 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .add-chantier-card:hover {
    background: rgba(88, 82, 242, 0.08) !important;
}

/* --- 40. Variables emails (pe-var-tag) & KPI totaux --- */
[data-theme="dark"] .pe-var-tag {
    background: rgba(124, 58, 237, 0.2) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .pe-var-tag:hover {
    background: rgba(124, 58, 237, 0.35) !important;
}

[data-theme="dark"] .kpi-total {
    color: #64748b !important;
}

/* --- 41. Audit complet — overrides manquants --- */

/* Wizard (chantier_form) */
[data-theme="dark"] .wizard-steps {
    background: #1e293b !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .wizard-step .step-num {
    background: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .wizard-step.active .step-num {
    background: #5852F2 !important;
    color: #fff !important;
}

[data-theme="dark"] .wizard-step.completed .step-num {
    background: rgba(22, 163, 74, 0.2) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .wizard-step.completed {
    background: rgba(22, 163, 74, 0.1) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .wizard-step .step-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .wizard-step.active .step-label {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .wizard-connector {
    background: #475569 !important;
}

[data-theme="dark"] .wizard-connector.completed {
    background: rgba(22, 163, 74, 0.4) !important;
}

[data-theme="dark"] .info-banner {
    background: rgba(88, 82, 242, 0.1) !important;
    border-color: rgba(88, 82, 242, 0.3) !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .image-preview-box {
    background: #253348 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .summary-bar,
[data-theme="dark"] .form-actions {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Chantier detail */
[data-theme="dark"] .chantier-hero-image {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
}

[data-theme="dark"] .status-dropdown-menu {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

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

[data-theme="dark"] .status-dropdown-item:hover {
    background: #253348 !important;
}

/* Dashboard greeting */
[data-theme="dark"] .dashboard-header .greeting {
    color: #94a3b8 !important;
}

/* Logo preview (entreprise/personnel) */
[data-theme="dark"] .logo-preview {
    background: linear-gradient(135deg, #334155, #253348) !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .logo-placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .logo-upload-btn {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .logo-upload-btn:hover {
    background: #253348 !important;
    border-color: #818cf8 !important;
}

/* Borders rgba(0,0,0,.05) → visible en dark */
[data-theme="dark"] .activity-item {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .info-row {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .info-empty {
    color: #64748b !important;
}

/* Personnel form — avatar, password toggle */
[data-theme="dark"] .avatar-preview {
    border-color: #475569 !important;
}

[data-theme="dark"] .avatar-upload-btn {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .avatar-upload-btn:hover {
    background: #253348 !important;
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .password-toggle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .password-toggle:hover {
    color: #818cf8 !important;
}

/* Header-dashboard legacy — filet de sécurité */
[data-theme="dark"] .header-dashboard {
    background: linear-gradient(90deg, #4338ca 49.5%, #1e1b4b 100%) !important;
}

/* EDC (etude_de_cout_create_edit) */
[data-theme="dark"] .edc-category-tag {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #a78bfa !important;
    border-color: rgba(88, 82, 242, 0.3) !important;
}

[data-theme="dark"] .edc-slider {
    background: #475569 !important;
}

[data-theme="dark"] .edc-slider::before {
    background: #cbd5e1 !important;
}

[data-theme="dark"] .edc-switch input:checked + .edc-slider {
    background: #5852F2 !important;
}

[data-theme="dark"] .edc-calc-detail {
    color: #64748b !important;
}

[data-theme="dark"] .calc-result {
    color: #94a3b8 !important;
}

/* Catalogue prestations — filter chips */
[data-theme="dark"] .filter-chip {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .filter-chip:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .filter-chip.active {
    background: #818cf8 !important;
    color: #fff !important;
}

[data-theme="dark"] .card-price {
    color: #818cf8 !important;
}

[data-theme="dark"] .card-unit {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* BDDP — add-row, modal confirm */
[data-theme="dark"] .add-row td {
    background: #253348 !important;
}

[data-theme="dark"] .modal-confirm .modal-content {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .confirm-icon {
    color: #f87171 !important;
}

[data-theme="dark"] .confirm-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .confirm-message {
    color: #94a3b8 !important;
}

/* Facture list — badges manquants */
[data-theme="dark"] .badge-avoir {
    background: rgba(217, 119, 6, 0.15) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .badge-retard {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

/* Prestation — summary label */
[data-theme="dark"] .summary-label {
    color: #94a3b8 !important;
}

/* Ressources */
[data-theme="dark"] .status-badge.disponible {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .status-badge.indisponible {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .ressource-link {
    color: #f1f5f9 !important;
}

/* Ajout matériel/fourniture — tfoot */
[data-theme="dark"] tfoot th {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #6ee7b7 !important;
}

/* Paramètres — emails */
[data-theme="dark"] .pe-section {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .pe-section-header {
    background: #253348 !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .pe-section-header:hover {
    background: #2d3f56 !important;
}

[data-theme="dark"] .pe-field input,
[data-theme="dark"] .pe-field textarea {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

/* Paramètres — tab-content */
[data-theme="dark"] .tab-content {
    background: #1e293b !important;
}

/* Form card header border */
[data-theme="dark"] .form-card .card-header {
    border-bottom-color: #334155 !important;
}

/* --- THEME TOGGLE — style ISO sidebar --- */
/* Desktop sidebar: aligné sur .list-group-item */
#sidebar-wrapper .theme-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    padding: .5rem 1.5rem;
    background: transparent;
    border: none !important;
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    font-size: inherit;
    font-weight: inherit;
    width: 100%;
    text-align: left;
    transition: color 0.3s, background 0.3s;
    font-family: inherit;
    outline: none !important;
    box-shadow: none !important;
}

#sidebar-wrapper .theme-toggle i {
    font-size: 1rem;
    width: 28px;
    flex-shrink: 0;
}

#sidebar-wrapper .theme-toggle:hover {
    color: var(--light-purple);
    font-weight: 600;
}

[data-theme="dark"] #sidebar-wrapper .theme-toggle {
    color: #cbd5e1;
}

[data-theme="dark"] #sidebar-wrapper .theme-toggle:hover {
    color: #a5b4fc;
    font-weight: 600;
}

/* Mobile sidebar: hérite de .menu-link */
.theme-toggle {
    background: transparent;
    border: none !important;
    cursor: pointer;
    font-family: inherit;
    outline: none !important;
    box-shadow: none !important;
}

.theme-toggle:focus,
.theme-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* --- 42. Pages catégories EDC, unités, signaler bug, abonnement, prestations tags --- */

/* Catégories EDC + Unités — tables spécifiques */
[data-theme="dark"] .table-categories thead th,
[data-theme="dark"] .table-units thead th {
    background: #253348 !important;
    border-bottom-color: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .table-categories tbody td,
[data-theme="dark"] .table-units tbody td {
    border-bottom-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .table-categories tbody tr:hover,
[data-theme="dark"] .table-units tbody tr:hover {
    background: #253348 !important;
}

/* Catégories archivées */
[data-theme="dark"] .archived-section {
    background: rgba(217, 119, 6, 0.12) !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .archived-section h6 {
    color: #fbbf24 !important;
}

/* Unités — barre de recherche */
[data-theme="dark"] .search-units {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .search-units .input-group-text {
    color: #64748b !important;
}

/* Unités — badge catégorie */
[data-theme="dark"] .badge-category {
    background: #334155 !important;
    color: #94a3b8 !important;
}

/* Signaler bug — info items */
[data-theme="dark"] .info-item {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .priority-hint {
    color: #94a3b8 !important;
}

[data-theme="dark"] .priority-hint strong {
    color: #f1f5f9 !important;
}

/* Abonnement — sièges table td border */
[data-theme="dark"] .siege-table td {
    border-top-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Abonnement — boutons +/- sièges */
[data-theme="dark"] .siege-qty-btn {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .siege-qty-btn:hover:not(:disabled) {
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .siege-qty-input {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

/* Abonnement — modale sièges */
[data-theme="dark"] .siege-modal-change {
    background: #253348 !important;
}

[data-theme="dark"] .siege-modal-change .old {
    color: #94a3b8 !important;
}

[data-theme="dark"] .siege-modal-change .new {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .siege-modal-info.trial {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .siege-modal-info.cost {
    background: rgba(22, 163, 74, 0.12) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .siege-modal-info.refund {
    background: rgba(220, 38, 38, 0.12) !important;
    color: #f87171 !important;
}

/* Prestations — category tags dans le partial */
[data-theme="dark"] .category-tag {
    background: rgba(88, 82, 242, 0.15) !important;
    color: #a5b4fc !important;
    border-color: rgba(129, 140, 248, 0.3) !important;
}

[data-theme="dark"] .category-tag.sans-categorie {
    background: #334155 !important;
    color: #64748b !important;
    border-color: #475569 !important;
}

/* --- 43. Client form dark mode --- */
[data-theme="dark"] .doc-item {
    background: #253348 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .client-avatar-lg {
    border-color: #334155 !important;
}

/* Abonnement — classes dark mode */
[data-theme="dark"] .abo-card-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .siege-td-role {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .siege-td-unlimited {
    color: #4ade80 !important;
}

[data-theme="dark"] .siege-modal-change .arrow,
[data-theme="dark"] .siege-total-arrow {
    color: #818cf8 !important;
}

[data-theme="dark"] .siege-total-old {
    color: #94a3b8 !important;
}

[data-theme="dark"] .siege-total-new {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .siege-modal-header {
    border-bottom-color: #334155 !important;
}

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

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

[data-theme="dark"] .abo-facture-link {
    color: #818cf8 !important;
}

[data-theme="dark"] .abo-facture-link:hover {
    color: #a5b4fc !important;
}

/* ---------- Archives — barre warning dark mode ---------- */
[data-theme="dark"] .archive-warning {
    background: linear-gradient(135deg, #422006, #451a03) !important;
    border-left-color: #b45309 !important;
    color: #fde68a !important;
}
[data-theme="dark"] .archive-warning i {
    color: #f59e0b !important;
}