/* =========================================
   RESET ET STYLES DE BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: #333;
}

/* =========================================
   PAGE DE CONNEXION
   ========================================= */

body.login-body {
    background-color: #f4f4f4;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-top: 5px solid #d32f2f;
    animation: fadeIn 0.8s ease;
}

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

.logo {
    width: 180px;
    max-width: 100%;
    margin-bottom: 15px;
    object-fit: contain;
}

.login-card h2 {
    color: #222;
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #d32f2f;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}

.btn-login:hover {
    background-color: #b71c1c;
}

.btn-login:active {
    transform: scale(0.98);
}

.error-message {
    margin-top: 15px;
    color: #d32f2f;
    font-size: 0.9rem;
    font-weight: bold;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ffcdd2;
    text-align: center;
}

.hidden {
    display: none;
}

/* =========================================
   PAGES INTERNES (MENU À GAUCHE)
   ========================================= */

.dashboard-body {
     background-color: #e6e6e6; /* Fond gris plus sombre */
    min-height: 100vh;
}

/* MENU LATÉRAL */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;           /* ✅ Pas de scrollbar sur le sidebar global */
}

/* ✅ LOGO FIXE EN HAUT */
.sidebar-logo {
    padding: 20px 20px 15px 20px;
    flex-shrink: 0;             /* ✅ Ne rétrécit pas */
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-logo img {
    width: 100%;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

/* ✅ MENU SCROLLABLE */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;                    /* ✅ Prend tout l'espace restant */
    overflow-y: auto;           /* ✅ Scrollbar interne */
    overflow-x: hidden;
    padding: 15px 20px 20px 20px;
    min-height: 0;              /* ✅ Important pour flex */
}

/* ✅ Scrollbar personnalisée du menu */
.sidebar-menu::-webkit-scrollbar {
    width: 8px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #d32f2f;
    border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #b71c1c;
}

/* Pour Firefox */
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: #d32f2f #f1f1f1;
}

.sidebar-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;             /* ✅ Les liens ne rétrécissent pas */
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #ffebee;
    color: #d32f2f;
}

/* ✅ BOUTON DÉCONNEXION STICKY EN BAS */
.sidebar-menu a.logout-link {
    margin-top: 20px;           /* ✅ Espace avant le bouton */
    color: #d32f2f;
    border: 1px solid #d32f2f;
    flex-shrink: 0;             /* ✅ Ne rétrécit pas */
    background-color: #ffffff;  /* ✅ Fond blanc */
}

.sidebar-menu a.logout-link:hover {
    background-color: #d32f2f;
    color: white;
}

.menu-icon {
    font-size: 1.1rem;
    margin-right: 10px;
}

/* CONTENU PRINCIPAL */
.main-content {
    margin-left: 250px;
    padding: 40px;
    background-color: #e6e6e6; /* Assure que toute la zone est sombre */
    min-height: 100vh;
}

.main-content h1 {
    color: #222;
    margin-bottom: 10px;
}

.main-content > p {
    color: #666;
    margin-bottom: 30px;
}

/* Cartes du Dashboard */
.dashboard-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 250px;
}

.card h2 {
    margin-bottom: 10px;
    color: #333;
}

.card p {
    margin-bottom: 20px;
    color: #666;
}

.btn-card {
    display: inline-block;
    background-color: #d32f2f;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-card:hover {
    background-color: #b71c1c;
}

.btn-card:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   ACTIONS (CATÉGORIES & PRODUITS)
   ========================================= */

/* Conteneur des boutons Modifier/Supprimer */
.category-actions,
.product-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    
    /* ✅ C'est ça qui pousse les boutons tout en bas de la carte */
    margin-top: auto; 
    padding-top: 10px;
    flex-shrink: 0;
}

/* Spécifique aux catégories (aligné à gauche) */
.category-actions {
    justify-content: flex-start; 
    margin-top: 15px;
}

/* Style des petits boutons Modifier/Supprimer */
.btn-edit,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: transparent;
}

.btn-edit {
    color: #1976d2;
}

.btn-edit:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.btn-delete {
    color: #d32f2f;
}

.btn-delete:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

/* =========================================
   PAGE STORE (PRODUITS) - GRILLE ET CARTES
   ========================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    
    /* ✅ Structure en colonne pour pousser le bas vers le bas */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #777;
    font-weight: bold;
    font-size: 0.9rem;
    background-color: #eee;
    flex-shrink: 0;
}

.product-info {
    padding: 15px;
    text-align: center;
    
    /* ✅ Transforme la zone en colonne flexible */
    display: flex;
    flex-direction: column;
    flex: 1; 
}

.product-info h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    
    /* ✅ Empêche les noms trop longs de casser le design */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem; /* Garde une hauteur fixe */
}

.description {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
    
    /* ✅ Même sécurité pour les descriptions */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* ✅ Bouton En stock (toujours en bas) */
.btn-add {
    width: 100%;
    padding: 10px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0; 
    flex-shrink: 0;
}

.btn-add:hover {
    background-color: #555;
}

/* =========================================
   FORMULAIRE D'AJOUT STORE
   ========================================= */

.form-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-container h3 {
    margin-bottom: 15px;
    color: #333;
}

.alert-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* =========================================
   PAGE STOCK - BOUTON ET MODAL
   ========================================= */

/* =========================================
   PAGE STORE - FORMULAIRE D'AJOUT
   ========================================= */

.form-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-container h3 {
    margin-bottom: 15px;
    color: #333;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.alert-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* =========================================
   PAGE STOCK - BOUTON ET MODAL
   ========================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    margin-bottom: 5px;
}

.page-header p {
    color: #666;
}

.btn-open-modal {
    background-color: #d32f2f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-open-modal:hover {
    background-color: #b71c1c;
}

/* Modal (Fenêtre superposée) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-header h3 {
    color: #333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
}

.btn-close:hover {
    color: #d32f2f;
}

/* =========================================
   BARRE DE RECHERCHE
   ========================================= */

.search-container {
    position: relative;
    margin-top: 15px;
    width: 100%;
    max-width: 350px;
}

.search-container input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: #d32f2f;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #666;
    pointer-events: none;
}

/* =========================================
   PAGE CATEGORIES
   ========================================= */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-info h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

/* =========================================
   SELECT CATÉGORIE ET LABEL
   ========================================= */

.form-group select {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #d32f2f;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

.category-label {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 10px;
}

/* =========================================
   TABLEAU DES SORTIES DE STOCK
   ========================================= */

.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
}

.stock-table th, .stock-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stock-table th {
    background-color: #f9f9f9;
    font-weight: bold;
    color: #333;
}

.stock-table tr:hover {
    background-color: #f5f5f5;
}

.quantity-label {
    font-weight: bold;
    font-size: 0.9rem;
}

.quantity-label.out-of-stock {
    color: #d32f2f;
}

.quantity-label.in-stock {
    color: #2e7d32;
}

/* =========================================
   ACTIONS SUR LES CATÉGORIES
   ========================================= */

.category-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-edit {
    display: inline-block;
    background-color: #2196f3;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-edit:hover {
    background-color: #1976d2;
}

.btn-delete {
    display: inline-block;
    background-color: #d32f2f;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-delete:hover {
    background-color: #b71c1c;
}



/* =========================================
   MODALES AVEC :TARGET (100% HTML/CSS)
   ========================================= */

/* Fonctionnement : quand on clique sur un lien vers #modal-id, la modale s'affiche */
.modal-overlay {
    display: none; /* Cachée par défaut */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* C'est ici que la magie opère */
.modal-overlay:target {
    display: flex;
}

.btn-close {
    text-decoration: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    display: inline-block;
    padding: 5px;
}

.btn-close:hover {
    color: #d32f2f;
}

/* Petit texte EAD en bas à droite de l'écran */
.ead-badge {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 10px;
    color: #888;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.6;
    z-index: 9999;
    pointer-events: none;
    transform: translateY(-50%);
}

/* =========================================
   MODALES (Version simplifiée 100% CSS)
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

/* Si la modale contient l'attribut style="display: flex", elle s'affiche */
.modal-overlay[style*="display: flex"] {
    display: flex;
}

/* Modales d'ajout qui s'ouvrent via le lien #modal-add */
.modal-overlay:target {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    /* AJOUT POUR LE SCROLL */
    max-height: 90vh;          /* Limite la hauteur à 90% de l'écran */
    overflow-y: auto;          /* Ajoute une barre de défilement si trop haut */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: sticky;   /* L'empêche de défiler */
    top: 0;             /* Reste en haut */
    background: white;  /* Fond blanc pour cacher le contenu derrière */
    padding-bottom: 10px;
    z-index: 10;
}

.btn-close {
    text-decoration: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    display: inline-block;
    padding: 5px;
}

.btn-close:hover {
    color: #d32f2f;
}

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

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-item {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-left: 5px solid #d32f2f;
}

.notification-item p {
    margin-bottom: 5px;
}

.notification-date {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

/* =========================================
   SEUIL D'ALERTE
   ========================================= */

.threshold-label {
    color: #ff9800;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* =========================================
   CLOCHE DE NOTIFICATION
   ========================================= */

.notification-link {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-badge {
    position: absolute;
    right: 15px;
    top: 5px;
    background-color: #d32f2f;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 3px 6px;
    line-height: 1;
}

/* =========================================
   BARRE DU HAUT AVEC CLOCHE
   ========================================= */

.topbar {
    position: fixed;
    top: 0;
    left: 250px; /* Laisser la place au menu latéral */
    right: 0;
    height: 60px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 999;
}

.topbar-title {
    font-weight: bold;
    color: #333;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-notification {
    position: relative;
    text-decoration: none;
    color: #333;
    font-size: 1.5rem;
}

.notification-icon {
    display: inline-block;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    right: -8px;
    top: -5px;
    background-color: #d32f2f;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 3px 6px;
    line-height: 1;
    text-align: center;
}

/* Modifier la hauteur du contenu principal pour laisser la place à la barre du haut */
.main-content {
    margin-left: 250px;
    padding-top: 80px; /* 60px pour la topbar + 20px d'espace */
    padding-right: 30px;
    padding-left: 30px;
}

/* =========================================
   PAGE PARAMÈTRES
   ========================================= */

.settings-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.settings-cards .card {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.settings-cards .card form {
    margin-top: 15px;
}

/



/* =========================================
   CARTE CATÉGORIE : TEXTE ET BOUTONS SUR LA MÊME LIGNE
   ========================================= */

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0;
}

.category-info {
    flex: 1; /* Prend tout l'espace disponible à gauche */
}

.category-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end; /* Aligner les boutons à droite */
}

.btn-edit,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-edit {
    color: #1976d2;
    background-color: transparent;
}

.btn-edit:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.btn-delete {
    color: #d32f2f;
    background-color: transparent;
}

.btn-delete:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

/* =========================================
   CARTES CATÉGORIES (Structure simple)
   ========================================= */

.category-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.category-info h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.category-description {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Boutons alignés à gauche, sous le texte */
.category-actions {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 10px;
}

.btn-edit {
    color: #1976d2;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background-color: #e3f2fd;
    padding: 5px 8px;
    border-radius: 6px;
}

.btn-delete {
    color: #d32f2f;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background-color: #ffebee;
    padding: 5px 8px;
    border-radius: 6px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-import {
    background-color: #1976d2;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.btn-import:hover {
    background-color: #1565c0;
}

/* =========================================
   SUIVI CARBURANT - STYLES
   ========================================= */

/* Statistiques carburant */
.fuel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.fuel-stat {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #d32f2f;
}

.fuel-stat .number {
    font-size: 24px;
    font-weight: 700;
    color: #222;
}

.fuel-stat .label {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}

.fuel-stat.green { border-left-color: #388e3c; }
.fuel-stat.orange { border-left-color: #f57c00; }
.fuel-stat.red { border-left-color: #d32f2f; }

/* Tableau carburant */
.fuel-table {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.fuel-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fuel-table th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #eee;
}

.fuel-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.fuel-table tr:hover {
    background: #fafafa;
}

/* Badge de consommation */
.badge-consommation {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.badge-good {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-medium {
    background: #fff3e0;
    color: #e65100;
}

.badge-bad {
    background: #ffebee;
    color: #c62828;
}

/* Boutons d'action carburant */
.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-edit-sm {
    background: #2196f3;
    color: white;
}

.btn-edit-sm:hover {
    background: #1976d2;
}

.btn-delete-sm {
    background: #d32f2f;
    color: white;
}

.btn-delete-sm:hover {
    background: #b71c1c;
}

/* Boutons d'action dans le header */
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-add-fuel {
    background: #d32f2f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-add-fuel:hover {
    background: #b71c1c;
}

.btn-add-bus {
    background: #1976d2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-add-bus:hover {
    background: #1565c0;
}

.btn-add-chauffeur {
    background: #388e3c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-add-chauffeur:hover {
    background: #2e7d32;
}

/* Formulaire en grille 2 colonnes */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .fuel-stats {
        grid-template-columns: 1fr 1fr;
    }
    .header-actions {
        flex-direction: column;
    }
    .header-actions a {
        text-align: center;
    }
}

/* Alerte personnalisée */
.alert-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #0d47a1;
}

.alert-danger {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* =========================================
   SUIVI CARBURANT - STYLES ADDITIONNELS
   ========================================= */

/* Header actions */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-import-fuel {
    background: #1976d2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
    display: inline-block;
}

.btn-import-fuel:hover {
    background: #1565c0;
}

.btn-add-fuel {
    background: #d32f2f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-add-fuel:hover {
    background: #b71c1c;
}

.btn-add-bus {
    background: #1976d2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-add-bus:hover {
    background: #1565c0;
}

.btn-add-chauffeur {
    background: #388e3c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-add-chauffeur:hover {
    background: #2e7d32;
}

/* Zone de dépôt pour l'import */
.drop-zone {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    margin: 15px 0;
}

.drop-zone:hover {
    border-color: #1976d2;
    background: #e3f2fd;
}

.drop-zone.dragover {
    border-color: #1976d2;
    background: #e3f2fd;
}

.drop-zone .icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.drop-zone .text {
    color: #666;
}

.drop-zone input[type="file"] {
    display: none;
}

/* Import preview */
.import-preview {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 13px;
}

.import-preview strong {
    color: #333;
}

.import-result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.import-result-stats .stat {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.import-result-stats .stat .number {
    font-size: 20px;
    font-weight: 700;
}

.import-result-stats .stat .label {
    font-size: 12px;
    color: #666;
}

/* Alerte spécifique */
.alert-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #0d47a1;
}

.alert-danger {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* Responsive */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    .action-buttons a {
        text-align: center;
    }
}

/* =========================================
   MENU DÉROULANT STORE
   ========================================= */

.menu-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.menu-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: #333;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.menu-dropdown-toggle:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

.menu-dropdown-toggle.active {
    background-color: #ffebee;
    color: #d32f2f;
}

.menu-dropdown-toggle .dropdown-arrow {
    font-size: 0.7rem;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.menu-dropdown.open .menu-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.menu-dropdown-content {
    display: none;
    flex-direction: column;
    padding-left: 15px;
    margin-top: 5px;
    gap: 5px;
    animation: slideDown 0.3s ease;
}

.menu-dropdown.open .menu-dropdown-content {
    display: flex;
}

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

.menu-dropdown-content a {
    display: flex;
    align-items: center;
    padding: 10px 15px !important;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.menu-dropdown-content a:hover {
    background-color: #ffebee;
    color: #d32f2f;
    border-left-color: #d32f2f;
}

.menu-dropdown-content a.active {
    background-color: #ffebee;
    color: #d32f2f;
    border-left-color: #d32f2f;
    font-weight: 600;
}

.menu-dropdown-content a .menu-icon {
    font-size: 0.95rem;
    margin-right: 8px;
}

/* =========================================
   DASHBOARD - HEADER
   ========================================= */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h1 {
    color: #222;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.dashboard-header p {
    color: #666;
    font-size: 0.95rem;
}

.dashboard-role-badge {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

/* =========================================
   DASHBOARD - CARTES KPI
   ========================================= */

.dashboard-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.kpi-icon {
    font-size: 32px;
    line-height: 1;
}

.kpi-info {
    flex: 1;
}

.kpi-number {
    font-size: 26px;
    font-weight: 700;
    color: #222;
    line-height: 1.1;
}

.kpi-label {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}

.kpi-blue { border-left-color: #1976d2; }
.kpi-blue .kpi-icon { color: #1976d2; }

.kpi-orange { border-left-color: #f57c00; }
.kpi-orange .kpi-icon { color: #f57c00; }

.kpi-red { border-left-color: #d32f2f; }
.kpi-red .kpi-icon { color: #d32f2f; }

.kpi-purple { border-left-color: #7b1fa2; }
.kpi-purple .kpi-icon { color: #7b1fa2; }

.kpi-warning { 
    border-left-color: #d32f2f;
    background: linear-gradient(135deg, #fff, #ffebee);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 4px 15px rgba(211, 47, 47, 0.06); }
    50% { box-shadow: 0 4px 25px rgba(211, 47, 47, 0.25); }
}

/* =========================================
   DASHBOARD - SECTIONS
   ========================================= */

.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.section-title {
    font-size: 1.1rem;
    color: #222;
    margin-bottom: 15px;
    font-weight: 600;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-box {
    min-height: 280px;
}

@media (max-width: 992px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   DASHBOARD - ALERTES
   ========================================= */

.alertes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alerte-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
}

.alerte-item:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alerte-warning {
    background: #fff3e0;
    border-left-color: #f57c00;
}

.alerte-warning .alerte-icone {
    color: #f57c00;
}

.alerte-danger {
    background: #ffebee;
    border-left-color: #d32f2f;
}

.alerte-danger .alerte-icone {
    color: #d32f2f;
}

.alerte-icone {
    font-size: 1.3rem;
}

.alerte-message {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.alerte-arrow {
    color: #999;
    font-size: 1.2rem;
}

/* =========================================
   DASHBOARD - TIMELINE
   ========================================= */

.timeline {
    position: relative;
    padding-left: 10px;
}

.timeline-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 3px;
}

.timeline-date {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-kpi {
        grid-template-columns: 1fr 1fr;
    }
    
    .kpi-number {
        font-size: 22px;
    }
    
    .kpi-icon {
        font-size: 26px;
    }
}

/* =========================================
   DASHBOARD - ACCORDÉONS (Alertes & Activité)
   ========================================= */

.dashboard-accordion {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: none;
}

.dashboard-accordion summary {
    list-style: none; /* Enlève la flèche par défaut */
    cursor: pointer;
    user-select: none;
}

.dashboard-accordion summary::-webkit-details-marker {
    display: none; /* Pour Chrome/Safari */
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    transition: background 0.2s;
    border-bottom: 1px solid transparent;
}

.accordion-header:hover {
    background: #fafafa;
}

.accordion-title {
    flex: 1;
}

.accordion-badge {
    background: #d32f2f;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
}

.accordion-arrow {
    font-size: 0.9rem;
    color: #999;
    transition: transform 0.3s ease;
}

/* Rotation de la flèche quand ouvert */
.dashboard-accordion[open] .accordion-arrow {
    transform: rotate(180deg);
}

/* Bordure en bas quand ouvert */
.dashboard-accordion[open] .accordion-header {
    border-bottom: 1px solid #f0f0f0;
}

/* Contenu de l'accordéon */
.accordion-content {
    padding: 15px 20px 20px;
    animation: accordionFadeIn 0.3s ease;
}

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

/* Couleur spécifique pour Alertes */
.accordion-alertes .accordion-badge {
    background: #d32f2f;
}

/* Couleur spécifique pour Activité */
.accordion-activite .accordion-badge {
    background: #1976d2;
}

/* =========================================
   DASHBOARD - HEADER CORPORATE
   ========================================= */

.dashboard-header-corporate {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-left {
    flex: 1;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.header-subtitle {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 5px;
}

.header-subtitle strong {
    color: #222;
    font-weight: 600;
}

.header-date {
    font-size: 0.85rem;
    color: #999;
    text-transform: capitalize;
    font-style: italic;
}

.header-right {
    display: flex;
    align-items: center;
}

.role-badge-corporate {
    background: #222;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header-corporate {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
}

/* =========================================
   CHAMP MOT DE PASSE AVEC ŒIL (style Windows)
   ========================================= */

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

.password-wrapper input {
    width: 100%;
    padding-right: 45px; /* Espace pour l'icône */
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.toggle-password:hover {
    color: #555;
}

.toggle-password svg {
    display: block;
}

.eye-open,
.eye-closed {
    display: block;
}

/* =========================================
   TABLEAU CARBURANT - SCROLL PROPRE
   ========================================= */

.table-scroll-wrapper {
    max-height: 65vh;           /* Hauteur max : 65% de l'écran */
    overflow-y: auto;           /* Scroll vertical */
    overflow-x: auto;           /* Scroll horizontal */
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    background: white;
    position: relative;
}

/* Le tableau ne se compresse plus */
.table-scroll-wrapper table {
    width: 100%;
    min-width: 1600px;          /* Largeur minimum pour que la barre serve à qqchose */
    border-collapse: collapse;
}

/* Header sticky en haut du tableau (reste visible quand on scroll) */
.table-scroll-wrapper thead th {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Barre de scroll plus visible */
.table-scroll-wrapper::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #d32f2f;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #b71c1c;
}

/* Firefox */
.table-scroll-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #d32f2f #f0f0f0;
}

/* =========================================
   PAGE RAPPORT CARBURANT
   ========================================= */

/* -----------------------------------------
   FILTRES DE DATE
   ----------------------------------------- */
.report-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.filter-group input[type="date"] {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #d32f2f;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

.btn-filter {
    padding: 11px 25px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    height: 42px;
}

.btn-filter:hover {
    background: #b71c1c;
}

/* -----------------------------------------
   BOUTONS RACCOURCIS (presets)
   ----------------------------------------- */
.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.preset-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.preset-btn.active {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
    font-weight: 600;
}

/* -----------------------------------------
   ONGLETS
   ----------------------------------------- */
.report-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0;
}

.report-tab {
    padding: 12px 24px;
    background: transparent;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.report-tab:hover {
    color: #d32f2f;
    background: #fafafa;
}

.report-tab.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
    background: #fff;
}

/* -----------------------------------------
   BOUTON EXPORT CSV
   ----------------------------------------- */
.report-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
    cursor: pointer;
}

.btn-export:hover {
    background: #1565c0;
}

/* -----------------------------------------
   TOP 5 BUS
   ----------------------------------------- */
.report-top5 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

.top5-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border-top: 4px solid transparent;
}

.top5-box.top5-bad {
    border-top-color: #d32f2f;
}

.top5-box.top5-good {
    border-top-color: #388e3c;
}

.top5-box h3 {
    font-size: 1rem;
    color: #222;
    margin-bottom: 15px;
    font-weight: 600;
}

.top5-box ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: top5-counter;
}

.top5-box ol li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    counter-increment: top5-counter;
    position: relative;
    padding-left: 40px;
}

.top5-box ol li:last-child {
    border-bottom: none;
}

.top5-box ol li::before {
    content: counter(top5-counter);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.top5-box.top5-bad ol li::before {
    background: #ffebee;
    color: #c62828;
}

.top5-box.top5-good ol li::before {
    background: #e8f5e9;
    color: #2e7d32;
}

.top5-box ol li strong {
    color: #222;
    font-size: 0.95rem;
}

.top5-box ol li span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
    padding: 3px 10px;
    border-radius: 12px;
}

/* -----------------------------------------
   RESPONSIVE
   ----------------------------------------- */
@media (max-width: 992px) {
    .report-top5 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group input[type="date"] {
        width: 100%;
    }
    
    .btn-filter {
        width: 100%;
    }
    
    .report-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .report-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .preset-buttons {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .preset-btn {
        white-space: nowrap;
    }
}

/* =========================================
   COMPTEURS ÉCART (Surconsommation / Économie)
   ========================================= */

.ecart-counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.ecart-counter {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border-left: 4px solid transparent;
    transition: transform 0.2s;
}

.ecart-counter:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.ecart-counter-bad {
    border-left-color: #d32f2f;
    background: linear-gradient(135deg, #fff 0%, #ffebee 100%);
}

.ecart-counter-good {
    border-left-color: #388e3c;
    background: linear-gradient(135deg, #fff 0%, #e8f5e9 100%);
}

.ecart-counter-neutral {
    border-left-color: #f57c00;
    background: linear-gradient(135deg, #fff 0%, #fff3e0 100%);
}

.ecart-counter-icon {
    font-size: 32px;
    line-height: 1;
}

.ecart-counter-info {
    flex: 1;
}

.ecart-counter-number {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    line-height: 1.1;
}

.ecart-counter-label {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ecart-counter-total {
    font-size: 14px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 15px;
    white-space: nowrap;
}

.ecart-counter-bad .ecart-counter-total {
    background: #ffcdd2;
    color: #c62828;
}

.ecart-counter-good .ecart-counter-total {
    background: #c8e6c9;
    color: #2e7d32;
}

/* =========================================
   BOUTONS DE FILTRE ÉCART
   ========================================= */

.ecart-filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ecart-filter-btn {
    padding: 10px 20px;
    border-radius: 25px;
    background: white;
    color: #555;
    border: 2px solid #e0e0e0;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ecart-filter-btn:hover {
    border-color: #d32f2f;
    color: #d32f2f;
    transform: translateY(-2px);
}

.ecart-filter-btn.active {
    background: #222;
    color: white;
    border-color: #222;
}

.ecart-filter-btn.ecart-filter-bad.active {
    background: #d32f2f;
    border-color: #d32f2f;
}

.ecart-filter-btn.ecart-filter-good.active {
    background: #388e3c;
    border-color: #388e3c;
}

/* =========================================
   COLONNE ÉCART - MISE EN ÉVIDENCE
   ========================================= */

.ecart-cell-positive {
    background: #ffebee;
    color: #c62828;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.ecart-cell-negative {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.ecart-cell-neutral {
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .ecart-counters {
        grid-template-columns: 1fr;
    }
    
    .ecart-filter-buttons {
        flex-direction: column;
    }
    
    .ecart-filter-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   COMPTEURS ÉCART INTÉGRÉS AUX KPI
   ========================================= */

.fuel-stat-bad {
    border-left-color: #d32f2f !important;
    background: linear-gradient(135deg, #fff 0%, #ffebee 100%) !important;
}

.fuel-stat-good {
    border-left-color: #388e3c !important;
    background: linear-gradient(135deg, #fff 0%, #e8f5e9 100%) !important;
}

.fuel-stat-neutral {
    border-left-color: #f57c00 !important;
    background: linear-gradient(135deg, #fff 0%, #fff3e0 100%) !important;
}

.stat-extra {
    font-size: 12px;
    font-weight: 700;
    margin-top: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
}

.fuel-stat-bad .stat-extra {
    background: #ffcdd2;
    color: #c62828;
}

.fuel-stat-good .stat-extra {
    background: #c8e6c9;
    color: #2e7d32;
}

/* S'assurer que les KPI s'affichent bien sur plusieurs lignes si besoin */
.fuel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.preset-btn.active.custom {
    background: #1976d2;
    border-color: #1976d2;
    color: white;
}

/* =========================================
   SOUS-MENU IMBRIQUÉ (Catégories dans Store)
   ========================================= */

.menu-dropdown-nested {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 3px 0;
}

.menu-dropdown-nested-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px !important;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    background-color: transparent;
}

.menu-dropdown-nested-toggle:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

.menu-dropdown-nested-toggle.active {
    background-color: #ffebee;
    color: #d32f2f;
    font-weight: 600;
}

.menu-dropdown-nested-toggle .dropdown-arrow {
    font-size: 0.65rem;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.menu-dropdown-nested.open .menu-dropdown-nested-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.menu-dropdown-nested-content {
    display: none;
    flex-direction: column;
    padding-left: 25px; /* Indentation plus profonde */
    margin-top: 3px;
    gap: 3px;
    animation: slideDown 0.3s ease;
}

.menu-dropdown-nested.open .menu-dropdown-nested-content {
    display: flex;
}

.menu-dropdown-nested-content a {
    display: flex;
    align-items: center;
    padding: 8px 15px !important;
    font-size: 0.85rem;
    border-left: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.menu-dropdown-nested-content a:hover {
    background-color: #ffebee;
    color: #d32f2f;
    border-left-color: #d32f2f;
}

.menu-dropdown-nested-content a.active {
    background-color: #ffebee;
    color: #d32f2f;
    border-left-color: #d32f2f;
    font-weight: 600;
}

.menu-dropdown-nested-content a .menu-icon {
    font-size: 0.85rem;
    margin-right: 8px;
}


/* =========================================
   TOP 5 PAR TYPE DE BUS (4 sur une ligne)
   ========================================= */

.top5-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 50px;
    margin-bottom: 25px;
}

.top5-grid-4 .top5-box {
    padding: 15px;
    min-height: auto;
}

.top5-grid-4 .top5-box h3 {
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.top5-grid-4 .top5-box ol li {
    padding: 6px 8px 6px 32px;
    font-size: 0.85rem;
}

.top5-grid-4 .top5-box ol li::before {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
}

.top5-grid-4 .top5-box ol li strong {
    font-size: 0.85rem;
}

.top5-grid-4 .top5-box ol li span {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* Responsive : 2 colonnes sur tablette, 1 sur mobile */
@media (max-width: 1200px) {
    .top5-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top5-grid-4 {
        grid-template-columns: 1fr;
    }
}