html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar {
    background-color: #2c3e50;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background-color: #1a252f;
    flex-shrink: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
}

.sidebar-header h3 {
    text-align: center;
    padding: 0;
    margin: 0;
    color: white;
    font-size: 1.1rem;
}

.sidebar-nav {
    position: absolute;
    top: 80px;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #34495e #1a252f;
}

/* Webkit (Chrome, Safari, Edge) */
.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #1a252f;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

.sidebar .nav-link {
    color: #ecf0f1;
    padding: 15px 20px;
    display: block;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar .nav-link:hover {
    background-color: #34495e;
}

.sidebar .nav-link.active {
    background-color: #3498db;
}

.sidebar .btn-link {
    color: #ecf0f1;
    text-align: left;
    width: 100%;
    text-decoration: none;
}

.nav-category {
    color: #95a5a6;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px 20px 8px 20px;
    margin-top: 10px;
    border-top: 1px solid #34495e;
}

.nav-category:first-child {
    margin-top: 0;
    border-top: none;
}

/* HSE — Rouge #E74C3C (même style palette que les autres sections) */
.nav-category-hse {
    background-color: #3a1515;
    color: #E74C3C !important;
    border-bottom: 2px solid #E74C3C;
}
.nav-section-hse {
    border-left-color: #E74C3C;
}
.nav-section-hse .nav-link {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.nav-section-hse .nav-link:hover {
    background-color: #3a1515 !important;
    color: #E74C3C !important;
    border-left-color: #E74C3C;
}
.nav-section-hse .nav-link.active {
    background-color: #3a1515 !important;
    color: #E74C3C !important;
    border-left: 3px solid #E74C3C;
    font-weight: 600;
}
.nav-link-hse-night {
    background-color: #1B3A5C !important;
    color: #dc3545 !important;
    border-radius: 6px;
    margin: 2px 8px;
}
.nav-link-hse-night:hover, .nav-link-hse-night:focus {
    background-color: #142d4a !important;
    color: #ff4d5e !important;
}
.nav-link-hse-night.active {
    background-color: #0f2236 !important;
    color: #ff6b78 !important;
}

/* Statistiques & Rapports — Bleu nuit élégant */
.nav-category-stats {
    background-color: #1B3A5C;
    color: #F0C040 !important;
    padding: 8px 16px;
    margin: 8px 0 0 0;
    border-radius: 4px 4px 0 0;
    border-bottom: 2px solid #F0C040;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-stats-section {
    background-color: #162d45;
    border-left: 3px solid #F0C040;
    border-radius: 0 0 4px 4px;
    padding: 6px 0;
    margin: 0 0 4px 0;
}
.nav-stats-section .nav-submenu-toggle {
    background-color: #1e3d5e !important;
    color: #a8c4de !important;
    border-radius: 4px;
    margin: 2px 8px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-stats-section .nav-submenu-toggle:hover {
    background-color: #2E75B6 !important;
    color: #ffffff !important;
    border-left-color: #F0C040;
}
.nav-stats-section .nav-submenu-toggle.open {
    background-color: #244d73 !important;
    color: #F0C040 !important;
    border-left-color: #F0C040;
}
.nav-stats-section .nav-submenu-content {
    background-color: #112538;
    margin: 0 8px 4px 8px;
    border-radius: 0 0 4px 4px;
    border-left: 2px solid #2E75B6;
}
.nav-stats-section .nav-submenu-content .nav-link {
    color: #8bacc8 !important;
    padding: 6px 12px 6px 24px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.nav-stats-section .nav-submenu-content .nav-link:hover {
    background-color: #1a3a56 !important;
    color: #F0C040 !important;
    border-left-color: #F0C040;
}
.nav-stats-section .nav-submenu-content .nav-link.active {
    background-color: #1B3A5C !important;
    color: #F0C040 !important;
    border-left: 3px solid #F0C040;
    font-weight: 600;
}
.nav-stats-section .nav-submenu-arrow {
    color: #5a8ab5;
    transition: transform 0.2s;
}
.nav-stats-section .nav-submenu-toggle.open .nav-submenu-arrow {
    transform: rotate(180deg);
    color: #F0C040;
}

/* ============================================
   SECTIONS NAVIGATION — Palette colorée sobre
   ============================================ */

/* --- Mixin-like : catégorie colorée --- */
.nav-category-colored {
    padding: 8px 16px;
    margin: 8px 0 0 0;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Section wrapper commun --- */
.nav-section {
    border-left: 3px solid transparent;
    padding: 4px 0;
    margin: 0 0 2px 0;
}
.nav-section .nav-link {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

/* 1. Opérations quotidiennes — Bleu vif #3498DB */
.nav-category-operations {
    background-color: #1a3a52;
    color: #3498DB !important;
    border-bottom: 2px solid #3498DB;
}
.nav-section-operations {
    border-left-color: #3498DB;
}
.nav-section-operations .nav-link:hover {
    background-color: #1a3a52 !important;
    color: #3498DB !important;
    border-left-color: #3498DB;
}
.nav-section-operations .nav-link.active {
    background-color: #1a3a52 !important;
    color: #3498DB !important;
    border-left: 3px solid #3498DB;
    font-weight: 600;
}

/* 2. Transport & Expéditions — Orange #E67E22 */
.nav-category-transport {
    background-color: #3a2a10;
    color: #E67E22 !important;
    border-bottom: 2px solid #E67E22;
}
.nav-section-transport {
    border-left-color: #E67E22;
}
.nav-section-transport .nav-submenu-toggle {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.nav-section-transport .nav-submenu-toggle:hover {
    background-color: #3a2a10 !important;
    color: #E67E22 !important;
    border-left-color: #E67E22;
}
.nav-section-transport .nav-submenu-toggle.open {
    color: #E67E22 !important;
    border-left-color: #E67E22;
}
.nav-section-transport .nav-submenu-content .nav-link:hover {
    background-color: #3a2a10 !important;
    color: #E67E22 !important;
    border-left-color: #E67E22;
}
.nav-section-transport .nav-submenu-content .nav-link.active {
    background-color: #3a2a10 !important;
    color: #E67E22 !important;
    border-left: 3px solid #E67E22;
    font-weight: 600;
}

/* 3. Suivi & Contrôle — Cyan #00BCD4 */
.nav-category-suivi {
    background-color: #0a2a2e;
    color: #00BCD4 !important;
    border-bottom: 2px solid #00BCD4;
}
.nav-section-suivi {
    border-left-color: #00BCD4;
}
.nav-section-suivi .nav-link:hover {
    background-color: #0a2a2e !important;
    color: #00BCD4 !important;
    border-left-color: #00BCD4;
}
.nav-section-suivi .nav-link.active {
    background-color: #0a2a2e !important;
    color: #00BCD4 !important;
    border-left: 3px solid #00BCD4;
    font-weight: 600;
}

/* 4. Prévision Opérationnelle — Violet #9B59B6 */
.nav-category-prevision {
    background-color: #2a1a3a;
    color: #9B59B6 !important;
    border-bottom: 2px solid #9B59B6;
}
.nav-section-prevision {
    border-left-color: #9B59B6;
}
.nav-section-prevision .nav-submenu-toggle {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.nav-section-prevision .nav-submenu-toggle:hover {
    background-color: #2a1a3a !important;
    color: #9B59B6 !important;
    border-left-color: #9B59B6;
}
.nav-section-prevision .nav-submenu-toggle.open {
    color: #9B59B6 !important;
    border-left-color: #9B59B6;
}
.nav-section-prevision .nav-submenu-content .nav-link:hover {
    background-color: #2a1a3a !important;
    color: #9B59B6 !important;
    border-left-color: #9B59B6;
}
.nav-section-prevision .nav-submenu-content .nav-link.active {
    background-color: #2a1a3a !important;
    color: #9B59B6 !important;
    border-left: 3px solid #9B59B6;
    font-weight: 600;
}

/* 5. Logistique — Turquoise #1ABC9C */
.nav-category-logistique {
    background-color: #0a2a25;
    color: #1ABC9C !important;
    border-bottom: 2px solid #1ABC9C;
}
.nav-section-logistique {
    border-left-color: #1ABC9C;
}
.nav-section-logistique .nav-link:hover {
    background-color: #0a2a25 !important;
    color: #1ABC9C !important;
    border-left-color: #1ABC9C;
}
.nav-section-logistique .nav-link.active {
    background-color: #0a2a25 !important;
    color: #1ABC9C !important;
    border-left: 3px solid #1ABC9C;
    font-weight: 600;
}

/* 6. Ressources Humaines — Vert #2ECC71 */
.nav-category-rh {
    background-color: #0f2a1a;
    color: #2ECC71 !important;
    border-bottom: 2px solid #2ECC71;
}
.nav-section-rh {
    border-left-color: #2ECC71;
}
.nav-section-rh .nav-link:hover {
    background-color: #0f2a1a !important;
    color: #2ECC71 !important;
    border-left-color: #2ECC71;
}
.nav-section-rh .nav-link.active {
    background-color: #0f2a1a !important;
    color: #2ECC71 !important;
    border-left: 3px solid #2ECC71;
    font-weight: 600;
}

/* 7. Gestion Dépôt — Ambre #F39C12 */
.nav-category-depot {
    background-color: #3a2f0a;
    color: #F39C12 !important;
    border-bottom: 2px solid #F39C12;
}
.nav-section-depot {
    border-left-color: #F39C12;
}
.nav-section-depot .nav-link:hover {
    background-color: #3a2f0a !important;
    color: #F39C12 !important;
    border-left-color: #F39C12;
}
.nav-section-depot .nav-link.active {
    background-color: #3a2f0a !important;
    color: #F39C12 !important;
    border-left: 3px solid #F39C12;
    font-weight: 600;
}

/* 8. Administration — Argent #95A5A6 */
.nav-category-admin {
    background-color: #2a2e30;
    color: #95A5A6 !important;
    border-bottom: 2px solid #95A5A6;
}
.nav-section-admin {
    border-left-color: #95A5A6;
}
.nav-section-admin .nav-link:hover {
    background-color: #2a2e30 !important;
    color: #BDC3C7 !important;
    border-left-color: #95A5A6;
}
.nav-section-admin .nav-link.active {
    background-color: #2a2e30 !important;
    color: #BDC3C7 !important;
    border-left: 3px solid #95A5A6;
    font-weight: 600;
}

main {
    flex: 1;
    margin-left: 250px;
}

.top-row {
    background-color: #f8f9fa;
    border-bottom: 1px solid #d6d5d5;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.content {
    padding-top: 1.1rem;
}

/* Login Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    color: #7f8c8d;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 5px;
    margin-top: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #95a5a6;
}

.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-in;
}

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

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    font-weight: 500;
}

.alert i {
    margin-right: 8px;
}

.validation-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* Dashboard Styles */
.dashboard h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Hamburger button */
.hamburger-btn {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    margin-right: auto;
}

.hamburger-btn:hover {
    color: #3498db;
}

/* Overlay pour mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        width: 280px;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    main {
        margin-left: 0 !important;
    }

    .top-row {
        justify-content: flex-start !important;
    }

    .content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .login-card {
        margin: 20px;
    }

    /* Tables responsives */
    .table-responsive {
        font-size: 0.85rem;
    }

    /* Cards plus compactes */
    .card-body {
        padding: 0.75rem;
    }

    /* Boutons d'action plus compacts et tactiles */
    .btn-group-sm > .btn {
        padding: 0.2rem 0.4rem;
    }

    .table .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-height: 38px;
    }

    /* Formulaires : empêcher le zoom iOS */
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* Filtres en colonnes sur mobile */
    .card-body .row > [class*='col-md-2'],
    .card-body .row > [class*='col-md-3'] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Titres h1 plus compacts */
    h1 {
        font-size: 1.3rem !important;
    }

    h5.mb-0 {
        font-size: 1rem;
    }

    /* KPI cards en grille 2x2 */
    .row > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Tables encore plus compactes */
    .table th, .table td {
        padding: 0.3rem !important;
        font-size: 0.8rem;
    }

    /* Masquer les textes longs dans les badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

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

    /* Charts redimensionnés */
    canvas {
        max-height: 250px !important;
    }
}

/* Tablettes (sm breakpoint) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .row > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .row > .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Styles pour la page Réceptions */
.table-sm th, .table-sm td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.table-bordered th, .table-bordered td {
    border: 1px solid #dee2e6;
}

.table-light {
    background-color: #f8f9fa;
}

.table-secondary {
    background-color: #e9ecef;
}

.alert-sm {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

/* Badges pour les pertes et gains */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Amélioration des cartes */
.card-header.bg-primary {
    background-color: #007bff !important;
}

.card.border-primary {
    border-color: #007bff !important;
}

/* Responsive pour les tableaux */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   STYLES POUR LE DASHBOARD
   ============================================ */

.dashboard-container {
    animation: fadeIn 0.5s ease-in;
}

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

.dashboard-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-title i {
    color: #3498db;
    margin-right: 0.5rem;
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

/* KPI Cards */
.kpi-section,
.charts-section,
.comparison-section,
.performance-section,
.alerts-activity-section,
.metrics-section,
.dispatching-section {
    margin-bottom: 2rem;
}

/* Stat boxes pour les résumés dans dispatching */
.stat-box {
    padding: 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-box .stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0;
}


.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--kpi-color) 0%, var(--kpi-color-light) 100%);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.kpi-primary {
    --kpi-color: #007bff;
    --kpi-color-light: #4dabf7;
}

.kpi-success {
    --kpi-color: #28a745;
    --kpi-color-light: #51cf66;
}

.kpi-info {
    --kpi-color: #17a2b8;
    --kpi-color-light: #22b8cf;
}

.kpi-warning {
    --kpi-color: #ffc107;
    --kpi-color-light: #ffd43b;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--kpi-color) 0%, var(--kpi-color-light) 100%);
    color: white;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-subtitle {
    font-size: 0.813rem;
    color: #6c757d;
}

.kpi-subtitle .text-success i,
.kpi-subtitle .text-danger i {
    font-size: 0.75rem;
}

/* Dashboard Cards */
.dashboard-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
    transition: all 0.3s ease;
    height: 100%;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dashboard-card .card-header {
    background: white;
    border-bottom: 2px solid #f0f0f0;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

.dashboard-card .card-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.dashboard-card .card-title i {
    color: #3498db;
    margin-right: 0.5rem;
}

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

/* Comparison Table */
.comparison-table {
    margin-bottom: 0;
}

.comparison-table thead th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.comparison-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Performance Cards */
.list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Alerts */
.alerts-list .alert {
    margin-bottom: 0.75rem;
}

.alerts-list .alert:last-child {
    margin-bottom: 0;
}

/* Metric Items */
.metric-item {
    margin-bottom: 1rem;
}

.metric-item:last-child {
    margin-bottom: 0;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Score Circle */
.score-circle {
    position: relative;
    display: inline-block;
}

.score-text {
    font-size: 2rem;
    font-weight: 700;
    fill: #2c3e50;
}

.quality-breakdown {
    margin-top: 1rem;
}

.quality-breakdown .badge {
    width: 80px;
    text-align: center;
}

/* Badges personnalisés */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 6px;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Responsive */
@media (max-width: 992px) {
    .kpi-card {
        margin-bottom: 1rem;
    }
    
    .dashboard-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .kpi-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
}

/* Animation des graphiques */
canvas {
    animation: chartFadeIn 0.8s ease-in;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   STYLES POUR L'AFFICHAGE DU NOM D'UTILISATEUR
   ============================================ */

.sidebar .user-info {
    background-color: #1a252f;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.sidebar .user-info:hover {
    background-color: #1a252f;
}

.sidebar .user-info .bi-person-circle {
    font-size: 1.5rem;
    color: #3498db;
}

.sidebar .user-info .user-name {
    font-weight: 600;
    color: #ecf0f1;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   STYLES POUR LA BARRE DE RECHERCHE DU MENU
   ============================================ */

.nav-search-container {
    padding: 12px 15px;
    position: relative;
    background-color: #1a252f;
    border-bottom: 1px solid #34495e;
}

.nav-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    color: #7f8c8d;
    font-size: 0.9rem;
    pointer-events: none;
}

.nav-search-input {
    width: 100%;
    padding: 10px 35px 10px 38px;
    border: 1px solid #34495e;
    border-radius: 8px;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-search-input::placeholder {
    color: #7f8c8d;
}

.nav-search-input:focus {
    outline: none;
    border-color: #3498db;
    background-color: #34495e;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.nav-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-search-clear:hover {
    color: #ecf0f1;
    background-color: #34495e;
}

.nav-search-results {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background-color: #34495e;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 5px;
}

.nav-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.2s ease;
    gap: 10px;
    border-bottom: 1px solid #2c3e50;
}

.nav-search-result-item:last-child {
    border-bottom: none;
}

.nav-search-result-item:hover {
    background-color: #3498db;
    color: white;
}

.nav-search-result-item span:first-child {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-search-result-text {
    flex: 1;
    font-size: 0.9rem;
}

.nav-search-result-category {
    font-size: 0.75rem;
    color: #95a5a6;
    background-color: #2c3e50;
    padding: 3px 8px;
    border-radius: 4px;
}

.nav-search-result-item:hover .nav-search-result-category {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-search-no-results {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.nav-search-no-results .bi {
    margin-right: 8px;
}

/* ============================================
   STYLES POUR LES SOUS-MENUS DÉROULANTS
   ============================================ */

.nav-submenu {
    margin: 0;
}

.nav-submenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-submenu-toggle:hover {
    background-color: #34495e;
}

.nav-submenu-toggle.open {
    background-color: #34495e;
    color: #3498db;
}

.nav-submenu-toggle span:first-child {
    margin-right: 10px;
}

.nav-submenu-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-submenu-toggle.open .nav-submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu-content {
    max-height: 0;
    overflow: hidden;
    background-color: #1a252f;
    transition: max-height 0.3s ease-out;
}

.nav-submenu-content.open {
    max-height: 800px;
}

.nav-submenu-content .nav-link {
    padding: 10px 20px 10px 45px;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}.nav-submenu-content .nav-link:hover {
    background-color: #2c3e50;
    border-left-color: #3498db;
}

.nav-submenu-content .nav-link.active {
    background-color: #3498db;
    border-left-color: #2980b9;
}

.nav-submenu-content .nav-link span {
    margin-right: 8px;
    font-size: 0.85rem;
}

/* ============================================
   STYLES AMÉLIORÉS POUR LE COMPTE UTILISATEUR
   ============================================ */

.sidebar .user-info .user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar .user-info .user-role {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 2px;
}

.sidebar .logout-btn {
    color: #e74c3c !important;
    transition: all 0.2s ease;
}.sidebar .logout-btn:hover {
    background-color: rgba(231, 76, 60, 0.1) !important;
    color: #c0392b !important;
}

/* ============================================
   RESPONSIVE POUR LE NOUVEAU MENU
   ============================================ */

@media (max-width: 768px) {
    .nav-search-container {
        padding: 10px;
    }

    .nav-search-input {
        padding: 8px 30px 8px 35px;
        font-size: 0.8rem;
    }

    .nav-submenu-toggle {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .nav-submenu-content .nav-link {
        padding: 8px 15px 8px 40px;
        font-size: 0.8rem;
    }
}

/* ============================================
   RECONNEXION BLAZOR SERVER
   ============================================ */

#components-reconnect-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background-color: rgba(0, 0, 0, 0.3);
    justify-content: center;
    align-items: center;
}

#components-reconnect-modal.components-reconnect-show {
    display: flex;
}

#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.reconnect-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 40px 50px;
    text-align: center;
    max-width: 360px;
}.reconnect-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: reconnect-spin 1s linear infinite;
}

@keyframes reconnect-spin {
    to { transform: rotate(360deg); }
}

.reconnect-text {
    font-size: 1rem;
    color: #6c757d;
    margin: 0;
}

.reconnect-failed-text {
    display: none;
    font-size: 0.95rem;
    color: #dc3545;
    margin: 0 0 15px;
}.reconnect-reload-btn {
    display: none;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reconnect-reload-btn:hover {
    background-color: #2980b9;
}

/* Echec de reconnexion : cacher spinner, montrer message + bouton */
#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-text,
#components-reconnect-modal.components-reconnect-rejected .reconnect-text {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed-text,
#components-reconnect-modal.components-reconnect-rejected .reconnect-failed-text {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-reload-btn,
#components-reconnect-modal.components-reconnect-rejected .reconnect-reload-btn {
    display: inline-block;
}