/*
 * iNSuite - Admin/CRM Layout
 * Style: AdminLTE-inspired, modern, standalone.
 */

:root {
    /* Palette AdminLTE Light & Professional */
    --admin-primary: #3c8dbc; /* Bleu AdminLTE mais plus doux */
    --admin-primary-dark: #2c7aa5;
    
    --admin-bg: #f4f6f9; /* Fond de page clair */
    --admin-text: #495057;
    
    --admin-sidebar-bg: #ffffff; /* Sidebar blanche professionnelle */
    --admin-sidebar-text: #495057; /* Texte gris foncé */
    --admin-sidebar-hover-bg: #f8f9fa; /* Hover très subtil */
    --admin-sidebar-hover-text: #212529;
    --admin-sidebar-active-bg: var(--admin-primary);
    
    --admin-header-bg: var(--admin-primary); /* Header coloré */
    --admin-header-text: #ffffff; /* Texte blanc sur header coloré */
    --admin-header-border: var(--admin-primary-dark);
    
    --admin-content-header-bg: #f4f6f9;
    --admin-card-bg: #ffffff;
    --admin-card-border: #dee2e6;
    
    --admin-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    --admin-radius: 0.25rem;
}

html[data-theme="dark"] {
    /* Palette Dark Mode (ajustée pour le blanc) */
    --admin-primary: #3c8dbc;
    --admin-primary-dark: #2c7aa5;

    --admin-bg: #ffffff;
    --admin-text: #495057;

    --admin-sidebar-bg: #ffffff;
    --admin-sidebar-text: #495057;
    --admin-sidebar-hover-bg: #f8f9fa;
    --admin-sidebar-hover-text: #212529;
    --admin-sidebar-active-bg: var(--admin-primary);

    --admin-header-bg: var(--admin-primary);
    --admin-header-border: var(--admin-primary-dark);
    --admin-content-header-bg: #f4f6f9;
    --admin-card-bg: #ffffff;
    --admin-card-border: #dee2e6;
}


body.admin-layout {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* --- Sidebar --- */
.main-sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--admin-sidebar-bg);
    border-right: 1px solid #dee2e6; /* Bordure subtile */
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    z-index: 1100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Ombre douce */
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.8125rem 1rem;
    height: 57px;
    background: var(--admin-sidebar-bg);
    border-bottom: 1px solid #dee2e6; /* Bordure claire */
    text-decoration: none;
    color: var(--admin-primary); /* Couleur de marque */
    font-size: 1.125rem;
    font-weight: 500; /* Un peu plus épais pour la lisibilité */
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-brand img {
    max-height: 40px;
    margin-right: 10px;
    transition: margin 0.3s;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-sidebar .nav-header {
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600; /* Plus lisible */
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-top: 0.5rem;
}
.main-sidebar .nav-item {
    display: block;
    text-decoration: none;
    color: var(--admin-sidebar-text);
    white-space: nowrap;
}
.main-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px; /* Padding plus généreux */
    margin: 3px 8px; /* Marges ajustées */
    border-radius: 0.375rem; /* Coins plus arrondis */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transition fluide */
    position: relative;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--admin-sidebar-text);
    min-height: 44px; /* Hauteur minimale pour alignement */
}
.main-sidebar .nav-link > span {
    flex: 1; /* Le texte prend l'espace disponible */
    display: flex;
    align-items: center;
    line-height: 1.2;
}
.main-sidebar .nav-link .badge,
.main-sidebar .nav-link .label,
.main-sidebar .nav-link .pull-right {
    margin-left: auto;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
}
.main-sidebar .nav-link:hover {
    background-color: var(--admin-sidebar-hover-bg);
    color: var(--admin-sidebar-hover-text);
    transform: translateX(2px); /* Léger décalage au survol */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* Effet de highlight au survol */
.main-sidebar .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark));
    transition: width 0.3s ease;
    border-radius: 0.375rem 0 0 0.375rem;
}

.main-sidebar .nav-link:hover::after {
    width: 4px;
}
.main-sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark));
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(60, 141, 188, 0.3); /* Ombre colorée */
    transform: translateX(2px);
    border-radius: 0.375rem;
}

.main-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -8px; /* Déborde de la sidebar */
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: #ffffff;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
/* Effet brillant sur le lien actif */
.main-sidebar .nav-link.active::after {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 0.375rem;
}
.main-sidebar .nav-link i.nav-icon {
    width: 20px; /* Largeur fixe pour alignement */
    margin-right: 12px; /* Espacement plus généreux */
    text-align: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    opacity: 0.8;
    flex-shrink: 0; /* Empêche la compression de l'icône */
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-sidebar .nav-link:hover i.nav-icon {
    opacity: 1;
    transform: scale(1.1); /* Léger agrandissement au survol */
}
.main-sidebar .nav-link.active i.nav-icon {
    opacity: 1;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.main-sidebar .nav-treeview {
    padding-left: 0; /* Suppression du padding gauche */
    margin-left: 20px; /* Indentation par margin */
    border-left: 2px solid rgba(60, 141, 188, 0.2); /* Bordure colorée */
    list-style: none;
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
}

.main-sidebar .nav-treeview .nav-link {
    padding-left: 20px; /* Indentation interne */
    margin: 2px 8px 2px 0; /* Pas de margin gauche */
    font-size: 0.8125rem; /* Légèrement plus petit */
    opacity: 0.9;
}

.main-sidebar .nav-treeview .nav-link::before {
    content: "\f111"; /* Point plein par défaut */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.375rem; /* Plus petit */
    margin-right: 10px;
    color: var(--admin-primary);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.main-sidebar .nav-treeview .nav-link:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

.main-sidebar .nav-treeview .nav-link.active::before {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
/* Indicateur pour les liens avec sous-menu */
.main-sidebar .nav-link i.right {
    margin-left: 8px; /* Espacement avec le texte */
    transition: transform 0.3s ease;
    font-size: 0.75rem;
    opacity: 0.7;
    flex-shrink: 0; /* Empêche la compression */
    width: 12px;
    text-align: center;
}

.main-sidebar .nav-link:hover i.right {
    opacity: 1;
}

.main-sidebar .menu-open > .nav-link i.right {
    transform: rotate(90deg);
}
/* Layout pour les liens avec badges ET flèches */
.main-sidebar .nav-link.has-treeview {
    padding-right: 12px; /* Espace pour la flèche */
}

.main-sidebar .nav-link.has-treeview .badge {
    margin-right: 4px; /* Espace entre badge et flèche */
    margin-left: auto;
}
/* Focus states pour l'accessibilité */
.main-sidebar .nav-link:focus {
    outline: 2px solid var(--admin-primary);
    outline-offset: 2px;
}
/* Animation d'apparition des sous-menus */
.main-sidebar .nav-treeview {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.main-sidebar .menu-open .nav-treeview {
    max-height: 500px; /* Hauteur suffisante pour les sous-menus */
}

/* --- Main Content --- */
.content-wrapper {
    margin-left: 260px;
    width: calc(100% - 260px);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease-in-out;
    min-height: 100vh; /* Assure l'occupation verticale complète */
}

/* --- Header --- */
.main-header {
    height: 60px;
    background: var(--admin-header-bg);
    border-bottom: 1px solid var(--admin-header-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Styles pour les boutons du header */
.header-right .btn-light {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease;
}
.header-right .btn-light:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}
.header-right .btn-light:focus {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
}

/* Force la couleur blanche pour les icônes dans les boutons header */
.header-right .btn-light i {
    color: white !important;
}
.header-right .btn-light:hover i {
    color: white !important;
}
.header-right .btn-light:focus i {
    color: white !important;
}

/* Style pour le theme toggle spécifiquement */
.theme-toggle {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}
.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}
.theme-toggle i {
    color: white !important;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--admin-header-text);
}

/* --- Content Area --- */
.content-header {
    background-color: var(--admin-content-header-bg);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--admin-header-border);
}
.content-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 300;
}
.breadcrumb {
    padding: 0;
    margin: 5px 0 0;
    background: none;
    font-size: 0.9rem;
}
/* Crée un léger espacement sous le header stické */
.content-header + .main-content {
    padding-top: 0.5rem;
}
/* Zone principale de contenu */
.main-content {
    padding: 1.5rem 2rem; /* Padding plus généreux */
    /* Supprime le décalage horizontal redondant (géré par .content-wrapper) */
    min-height: calc(100vh - 60px); /* Hauteur ajustée pour le header */
    background-color: var(--admin-bg);
    flex: 1 1 auto; /* Occupe tout l'espace disponible */
}

/* Éviter les doublons de main-content */
.main-content .main-content {
    padding: 0;
    margin-left: 0;
    min-height: auto;
    background: transparent;
}

/* Style professionnel pour les en-têtes de page */
.page-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-primary-dark));
}

.page-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.page-header h1 i {
    margin-right: 1rem;
    font-size: 1.8rem;
    color: var(--admin-primary);
}

.page-header p {
    margin: 0;
    font-size: 1rem;
    color: #6c757d;
    font-weight: 400;
}

/* Responsive: adapter le margin quand sidebar collapsed */
/* Supprimé: le décalage en état collapsed est géré par .content-wrapper */

/* Mobile: supprimer le margin quand sidebar est en overlay */
@media (max-width: 991.98px) {
    /* En mobile, .content-wrapper occupe 100%: aucun offset requis ici */
}
/* Dashboard wrapper pour assurer un bon ancrage et une largeur fluide */
.dashboard-container {
    width: 100%;
}

/* --- Cards --- */
.card {
    background-color: var(--admin-card-bg);
    border: 1px solid var(--admin-card-border) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.card-header {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark));
    color: #fff;
    border-bottom: none;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 1rem 1.5rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.card-header h5 i {
    margin-right: 0.75rem;
    font-size: 1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Cards de statistiques */
.card.shadow-sm {
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    transition: all 0.3s ease;
}

.card.shadow-sm:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important;
}

/* Améliorations des badges de statut */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

/* Navigation par onglets */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    transition: all 0.3s ease;
    margin-right: 0.25rem;
    position: relative;
}

.nav-tabs .nav-link:hover {
    background: #f8f9fa;
    color: var(--admin-primary);
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    background: var(--admin-primary);
    color: #fff;
    border-bottom: 2px solid var(--admin-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 141, 188, 0.25);
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--admin-primary);
}

/* Contenu des onglets */
.tab-content {
    background: transparent;
}

.tab-pane {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhance sidebar items */
.main-sidebar .nav-link {
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.main-sidebar .nav-link::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 0; height: 100%;
    background: rgba(255,255,255,0.1);
    transition: width 0.3s ease;
    z-index: -1;
}
.main-sidebar .nav-link:hover::after {
    width: 100%;
}
/* Breadcrumb styling */
.breadcrumb li+li:before {
    content: '\f105'; /* fontawesome chevron-right */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    padding: 0 0.5rem;
    color: var(--admin-text);
}

/* --- Collapsed State --- */
body.sidebar-collapsed .main-sidebar {
    transform: translateX(0);
    width: 80px;
}
body.sidebar-collapsed .content-wrapper {
    margin-left: 80px;
    width: calc(100% - 80px);
}
body.sidebar-collapsed .sidebar-brand span {
    display: none;
}
body.sidebar-collapsed .sidebar-brand img {
    margin-right: 0;
}
body.sidebar-collapsed .main-sidebar .nav-header,
body.sidebar-collapsed .main-sidebar .nav-link span,
body.sidebar-collapsed .main-sidebar .nav-link i.right {
    display: none;
}
body.sidebar-collapsed .main-sidebar .nav-link {
    justify-content: center;
}
body.sidebar-collapsed .main-sidebar .nav-link i.nav-icon {
    margin-right: 0;
    font-size: 1.3rem;
}
body.sidebar-collapsed .main-sidebar .nav-treeview {
    display: none !important;
}


/* --- Responsive --- */
@media (max-width: 992px) {
    .main-sidebar {
        transform: translateX(-100%);
        z-index: 1200;
    }
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    body.sidebar-open .main-sidebar {
        transform: translateX(0);
    }
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1150;
        display: none;
    }
    body.sidebar-open .mobile-overlay {
        display: block;
    }
}

/* --- Control Sidebar --- */
.control-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--admin-card-bg);
    border-left: 1px solid var(--admin-card-border);
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1150;
    overflow-y: auto;
    padding: 1rem;
}
body.control-sidebar-open .control-sidebar {
    right: 0;
}
body.control-sidebar-open .control-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1140;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: var(--admin-sidebar-hover-bg);
    border-radius: 3px;
}

/* ===== AMÉLIORATIONS PROFESSIONNELLES TABLEAUX ===== */

/* Tables styling */
.table {
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #495057;
    padding: 1rem 0.75rem;
    border-top: none;
    position: relative;
}

.table thead th:first-child {
    border-top-left-radius: 0.5rem;
}

.table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.table tbody tr:hover {
    background-color: #f8f9fa; /* Hover sobre, sans déplacement ni ombre excessive */
}

.table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #f0f0f0;
}

.table-hover tbody tr:hover td {
    background-color: inherit;
}

/* Amélioration des boutons dans les tables */
.btn-group-sm .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.775rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(60, 141, 188, 0.3);
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Responsive tables */
.table-responsive {
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== AMÉLIORATIONS FORMULAIRES ===== */

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.form-control:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 0.2rem rgba(60, 141, 188, 0.25);
    background-color: #ffffff;
}

.form-select {
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 0.2rem rgba(60, 141, 188, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ===== AMÉLIORATIONS MODALS ===== */

.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark));
    color: #ffffff;
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-header .btn-close {
    opacity: 0.8;
    color: #ffffff;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* ===== ALERTES ET NOTIFICATIONS ===== */

.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    font-weight: 500;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left-color: #2196f3;
}

.alert-warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border-left-color: #ff9800;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left-color: #4caf50;
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

/* ===== UTILITIES PROFESSIONNELLES ===== */

.fw-semibold {
    font-weight: 600 !important;
}

.text-muted {
    color: #6c757d !important;
}

.small {
    font-size: 0.875rem !important;
}

/* Amélioration des espacements */
.mb-4 {
    margin-bottom: 2rem !important;
}

.mb-3 {
    margin-bottom: 1.5rem !important;
}

.mb-2 {
    margin-bottom: 1rem !important;
}

/* ===== ANIMATIONS SUBTILES ===== */

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > * {
    animation: slideInFromTop 0.6s ease;
}

/* Loading states */
.spinner-border {
    color: var(--admin-primary);
}

/* Progress bars */
.progress {
    height: 0.75rem;
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: var(--admin-primary);
    border-radius: 0.5rem;
}

/* User menu */
.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--admin-header-text) !important;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}
.user-menu .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
}
.user-menu img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.user-menu .dropdown-menu {
    border-radius: 0.375rem;
    border: 1px solid var(--admin-header-border);
    box-shadow: var(--admin-shadow);
    margin-top: 10px !important;
}
.user-menu .dropdown-header {
    background-color: var(--admin-primary);
    color: #fff;
    text-align: center;
    padding: 1rem;
    border-radius: 0.375rem 0.375rem 0 0;
}
.user-menu .dropdown-header img {
    width: 90px;
    height: 90px;
    border: 3px solid rgba(255,255,255,0.2);
}
.user-menu .dropdown-footer {
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

/* Badges sur les boutons header */
.header-right .badge {
    border: 2px solid var(--admin-header-bg);
}

/* =============================================================
   Correctif superposition Modals / Sidebar / Control Sidebar
   Objectif: garantir que les modals Bootstrap passent toujours au-dessus
   de la sidebar (z-index:1100/1200) et de la control sidebar (1150).
   Plage réservée modals: 1290–1310.
   ============================================================= */
.modal-backdrop {
    z-index: 1290 !important; /* > sidebar mobile (1200) */
}
.modal {
    z-index: 1300 !important; /* couche supérieure principale */
}
/* Sécurité lorsque transform/transition appliqués au layout */
.modal.show .modal-dialog { position: relative; }

/* Empêcher scroll horizontal résiduel en mobile quand modal ouverte */
@media (max-width: 992px) {
    body.modal-open { overflow: hidden; }
}

