* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f5f5f5; }
.header { background-color: #0066cc; color: white; padding: 0 20px; height: 50px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: bold; }
.nav-menu { display: flex; gap: 20px; align-items: center; }
.nav-item { cursor: pointer; padding: 5px 10px; position: relative; font-weight: 500; }
.nav-item:hover { background-color: rgba(255,255,255,0.1); border-radius: 4px; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background-color: white; color: #333; min-width: 250px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; border-radius: 4px; overflow: hidden; }
.nav-item:hover .dropdown { display: block; }
.dropdown-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item.active { background-color: #0066cc; color: white; }
.main-content { padding: 20px; }
.page-title { background-color: #f8f9fa; padding: 15px; margin-bottom: 20px; border-left: 4px solid #0066cc; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
.btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.3s; }
.btn-primary { background-color: #0066cc; color: white; } .btn-primary:hover { background-color: #004d99; }
.btn-warning { background-color: #ffc107; color: #000; }
.btn-danger { background-color: #dc3545; color: white; } .btn-danger:hover { background-color: #c82333; }
.btn-success { background-color: #28a745; color: white; }
.btn-info { background-color: #17a2b8; color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.table-container { background-color: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background-color: #f8f9fa; }
th { padding: 12px; text-align: left; font-weight: 600; color: #0066cc; border-bottom: 2px solid #dee2e6; cursor: pointer; user-select: none; }
th:hover { background-color: #e9ecef; }
td { padding: 12px; border-bottom: 1px solid #dee2e6; }
tbody tr:hover { background-color: #f8f9fa; }
.checkbox { width: 18px; height: 18px; cursor: pointer; vertical-align: middle; }
.id-cell { color: #0066cc; font-weight: 500; }
.actions { display: flex; gap: 5px; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background-color: white; padding: 30px; border-radius: 8px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #0066cc; }
.modal-title { font-size: 20px; color: #0066cc; }
.close { font-size: 28px; cursor: pointer; color: #999; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #333; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #ddd; }
.badge { padding: 3px 8px; border-radius: 3px; font-size: 12px; }
.badge-success { background-color: #d4edda; color: #155724; }
.badge-warning { background-color: #fff3cd; color: #856404; }
.badge-danger { background-color: #f8d7da; color: #721c24; }
.section { display: none; }
.section.active { display: block; }
.ie-container, .chart-filters, .batiment-selector, .chart-card { background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 20px; }
.ie-grid, .charts-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ie-card, .chart-card { padding: 15px; border: 1px solid #dee2e6; border-radius: 6px; background-color: #f8f9fa; }
.ie-card h4, .chart-card h3, .batiment-selector h4 { color: #0066cc; margin-bottom: 10px; font-size: 16px; border-bottom: 2px solid #0066cc; padding-bottom: 5px; }
.ie-options { display: flex; flex-direction: column; gap: 5px; margin-bottom: 15px; }
.ie-option { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 4px; }
.ie-option:hover { background-color: #e9ecef; }
.ie-option label { cursor: pointer; flex: 1; font-size: 14px; }
.ie-desc { font-size: 11px; color: #666; margin-left: 26px; font-style: italic; margin-bottom: 8px; }
.ie-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ie-select-all { font-size: 12px; color: #0066cc; cursor: pointer; text-decoration: underline; margin-bottom: 5px; display: inline-block; }

.chart-card.full-width { grid-column: 1 / -1; }
.chart-wrapper { position: relative; height: 300px; }
.chart-filters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; align-items: end; }
.chart-filters-grid .form-group { margin-bottom: 0; }
.chart-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card { background-color: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-left: 4px solid #0066cc; }
.stat-card .stat-label { font-size: 12px; color: #666; text-transform: uppercase; margin-bottom: 5px; }
.stat-card .stat-value { font-size: 24px; font-weight: bold; color: #0066cc; }
.stat-card .stat-sub { font-size: 11px; color: #999; margin-top: 3px; }
.stat-card.warning { border-left-color: #ffc107; } .stat-card.warning .stat-value { color: #ffc107; }
.stat-card.info { border-left-color: #17a2b8; } .stat-card.info .stat-value { color: #17a2b8; }
.stat-card.danger { border-left-color: #dc3545; } .stat-card.danger .stat-value { color: #dc3545; }

.batiment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 15px; }
.batiment-checkbox { display: flex; align-items: center; gap: 8px; padding: 10px; border: 2px solid #dee2e6; border-radius: 6px; cursor: pointer; transition: all 0.2s; background-color: #f8f9fa; }
.batiment-checkbox:hover { border-color: #0066cc; background-color: #e7f3ff; }
.batiment-checkbox.selected { border-color: #0066cc; background-color: #d4edda; font-weight: 600; }
.batiment-checkbox input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.batiment-checkbox label { cursor: pointer; flex: 1; font-size: 14px; }
.batiment-color { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

.comparison-table { width: 100%; margin-top: 15px; border-collapse: collapse; }
.comparison-table th { background-color: #0066cc; color: white; padding: 10px; text-align: center; }
.comparison-table td { padding: 10px; text-align: center; border: 1px solid #dee2e6; }
.comparison-table tr:nth-child(even) { background-color: #f8f9fa; }
.comparison-table .best-value { background-color: #d4edda; font-weight: bold; }
.comparison-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; flex-wrap: wrap; }

@media (max-width: 768px) { 
    .form-row, .ie-grid, .charts-container, .chart-filters-grid, .chart-stats, .batiment-grid { grid-template-columns: 1fr; }
    .nav-menu { display: none; } 
}
.search-input {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    width: 220px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}
.search-input::placeholder { color: rgba(255,255,255,0.6); }
.search-input:focus { 
    background: rgba(255,255,255,0.2); 
    border-color: rgba(255,255,255,0.6); 
    outline: none; 
    width: 280px; 
    box-shadow: 0 0 0 3px rgba(0,102,204,0.2);
}
.search-input::-webkit-search-cancel-button { cursor: pointer; opacity: 0.7; }
.search-input::-webkit-search-cancel-button:hover { opacity: 1; }

@media (max-width: 768px) { 
    .search-input { width: 100%; margin: 10px 0; }
    .header { flex-wrap: wrap; height: auto; padding: 10px 20px; }
}
.search-summary {
    background-color: #e7f3ff;
    color: #004d99;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid #0066cc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}
.search-summary em {
    font-style: italic;
    color: #0066cc;
    font-weight: 600;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Empêche le défilement de toute la page, on va gérer le défilement uniquement dans le contenu */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #f5f5f5; 
    height: 100dvh; /* 100dvh est plus fiable que 100vh sur mobile */
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    margin: 0;
}

/* === EN-TÊTE COMPACT ET OPTIMISÉ === */
.header {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: white;
    padding: 8px 15px; /* Réduit pour gagner de la place verticale */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    gap: 10px; /* Espacement global réduit */
    flex-wrap: nowrap; /* Force tout à rester sur une seule ligne */
}

.header-left .logo {
    font-size: 18px; /* Légèrement plus compact */
    font-weight: 800;
    white-space: nowrap;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0; /* Permet au conteneur de rétrécir si nécessaire */
}

.search-container {
    display: flex;
    align-items: center;
    gap: 5px; /* Espacement réduit entre les champs */
}

.search-date-input, .search-input {
    padding: 5px 10px; /* Padding réduit */
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 12px; /* Police légèrement plus petite */
    transition: all 0.3s ease;
}
.search-date-input { width: 110px; } /* Largeur réduite */
.search-input { width: 140px; max-width: 180px; } /* Largeur réduite et plafonnée */

.search-date-input::placeholder, .search-input::placeholder { color: rgba(255,255,255,0.7); }
.search-date-input:focus, .search-input:focus { 
    background: rgba(255,255,255,0.25); 
    border-color: rgba(255,255,255,0.6); 
    outline: none; 
}
.search-date-input::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

/* 🛡️ CRUCIAL : Empêche le bloc de droite d'être écrasé */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Interdit au bloc utilisateur de rétrécir */
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
}

.nav-menu { 
    display: flex; 
    gap: 2px; /* Espacement minimal entre les éléments du menu */
}

.nav-item {
    position: relative;
    padding: 6px 10px; /* Padding réduit */
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px; /* Police compacte */
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.15); }

/* Zone Utilisateur à droite */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.username-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(220, 53, 69, 0.8);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-logout:hover { background: #dc3545; transform: scale(1.1); }

/* Menus déroulants */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    color: #333;
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    padding: 5px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.nav-item:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover { 
    background: #f0f7f4; 
    color: #0066cc; 
    padding-left: 16px;
}

/* Adaptation Mobile/Tablette : empile proprement si l'écran est vraiment trop petit */
@media (max-width: 900px) {
    .header { flex-wrap: wrap; padding: 10px; }
    .header-center { order: 3; width: 100%; margin-top: 10px; justify-content: flex-start; }
    .search-container { width: 100%; }
    .search-date-input, .search-input { flex: 1; min-width: 100px; }
    .user-info { padding-left: 5px; }
    .username-badge { display: none; } /* Cache le nom sur très petit écran, garde juste l'icône de porte */
}

/* La zone de contenu prend tout l'espace restant et défile indépendamment */
.main-content { 
    flex: 1; 
    overflow-y: auto; /* C'est ici que le défilement se produit */
    padding: 20px;
    scroll-behavior: smooth;
}
/* Rend les en-têtes de colonnes collants */
thead th { 
    padding: 12px; 
    text-align: left; 
    font-weight: 600; 
    color: #0066cc; 
    border-bottom: 2px solid #dee2e6; 
    cursor: pointer; 
    user-select: none; 
    position: sticky; /* La magie opère ici */
    top: 0; /* Se colle au haut du conteneur .main-content */
    z-index: 10; /* Reste au-dessus des lignes du tableau */
    background-color: #f8f9fa; /* Fond opaque obligatoire pour cacher les lignes qui passent dessous */
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1); /* Petite ombre pour marquer la séparation */
}

thead th:hover { 
    background-color: #e9ecef; 
}
/* 1. Le conteneur du tableau doit gérer le défilement */
.table-container { 
    background-color: white; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    /* Hauteur max pour forcer le défilement vertical si le tableau est long */
    max-height: calc(100vh - 180px); 
    overflow: auto; /* Active le défilement vertical ET horizontal */
}

/* 2. Correction des bordures pour un rendu propre avec le sticky */
.table-container table { 
    width: 100%; 
    border-collapse: separate; /* Nécessaire pour que le sticky fonctionne bien avec les bordures */
    border-spacing: 0; 
}

/* 3. LA MAGIE : Figer les en-têtes de colonnes */
.table-container thead th { 
    position: sticky; /* Rend l'élément collant */
    top: 0;           /* Se colle au haut du .table-container */
    z-index: 20;      /* Reste AU-DESSUS des lignes du tableau */
    
    /* OBLIGATOIRE : Un fond opaque pour cacher le texte qui défile en dessous */
    background-color: #f8f9fa; 
    
    /* Style existant amélioré */
    padding: 12px; 
    text-align: left; 
    font-weight: 600; 
    color: #0066cc; 
    border-bottom: 2px solid #dee2e6; 
    border-top: none;
    cursor: pointer; 
    user-select: none; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.08); /* Ombre subtile pour marquer la séparation */
}

.table-container thead th:hover { 
    background-color: #e9ecef; 
}

/* 4. Assurer que les cellules normales passent bien en dessous */
.table-container tbody td {
    padding: 12px; 
    border-bottom: 1px solid #dee2e6; 
    background-color: white; /* Fond blanc pour éviter les transparences */
}

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

/* 5. (Optionnel mais recommandé) Jolie barre de défilement */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb {
    background: #0066cc;
    border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb:hover {
    background: #004d99;
}
/* Style pour la liste des feuilles Excel dans la modale */
#excelSheetList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sheet-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s;
}
.sheet-option:hover {
    border-color: #0066cc;
    background-color: #e7f3ff;
}
.sheet-option label {
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
/* Correctif pour les labels vides utilisés pour l'alignement */
.form-spacer {
    display: block;
    height: 1.2em;
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}
/* === PAGINATION === */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: -1px;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 15px;
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

/* Style du champ de saisie libre */
.rows-per-page input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    width: 80px;
    text-align: center;
    transition: all 0.2s;
    -moz-appearance: textfield; /* Enlève les flèches sur Firefox */
}

/* Enlève les flèches du champ nombre sur Chrome/Safari */
.rows-per-page input[type="number"]::-webkit-outer-spin-button,
.rows-per-page input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rows-per-page input[type="number"]:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.15);
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.page-nav {
    display: flex;
    gap: 5px;
}

.btn-page {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #0066cc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.btn-page:hover:not(:disabled) {
    background-color: #e7f3ff;
    border-color: #0066cc;
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #999;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .rows-per-page, .page-info, .page-nav {
        justify-content: center;
    }
}
/* === RECHERCHE GLOBALE AVEC DATES === */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-date-input {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 13px;
    width: 130px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Inverser la couleur de l'icône du calendrier pour qu'elle soit visible sur fond vert */
.search-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.search-date-input:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
    outline: none;
    width: 150px;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.2);
}

.search-input {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    width: 200px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.search-input::placeholder { color: rgba(255,255,255,0.6); }
.search-input:focus { 
    background: rgba(255,255,255,0.2); 
    border-color: rgba(255,255,255,0.6); 
    outline: none; 
    width: 240px; 
   box-shadow: 0 0 0 3px rgba(0,102,204,0.2);
}

/* Adaptation Mobile */
@media (max-width: 768px) { 
    .header { flex-wrap: wrap; height: auto; padding: 10px 20px; gap: 10px; }
    .search-container { width: 100%; justify-content: center; flex-wrap: wrap; }
    .search-date-input, .search-input { width: 100%; max-width: 200px; }
}
/* ✅ MENU ACTIONS EN MASSE */

#bulkActionMenu, .bulk-action-menu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#bulkActionMenu span, .bulk-action-menu span {
    font-weight: bold;
    margin-right: 10px;
}

#bulkActionMenu button, .bulk-action-menu button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: white;
}

.bulk-menu-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.bulk-menu-info {
    font-weight: bold;
    color: #0066cc;
    font-size: 14px;
    white-space: nowrap;
}

.bulk-count {
    font-size: 18px;
    margin-right: 4px;
}

.bulk-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.bulk-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

.bulk-btn-edit { background: #2196F3; color: white; }
.bulk-btn-duplicate { background: #9C27B0; color: white; }
.bulk-btn-validate { background: #4CAF50; color: white; }
.bulk-btn-devalidate { background: #FF9800; color: white; }
.bulk-btn-delete { background: #f44336; color: white; }
.bulk-btn-export { background: #0066cc; color: white; }
.bulk-btn-json { background: #17a2b8; color: white; }
.bulk-btn-import { background: #6f42c1; color: white; }
.bulk-btn-cancel { background: #6c757d; color: white; }
.bulk-btn-json { background: #17a2b8; color: white; }
.bulk-btn-json:hover { background: #138496; }

.bulk-btn-cancel {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}
.bulk-btn-cancel:hover { background-color: rgba(255,255,255,0.3); transform: translateY(-1px); }

.bulk-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Animation du compteur */
.bulk-count { animation: pulseCount 0.3s ease; }
@keyframes pulseCount {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Adaptation Mobile (encore plus compacte) */
@media (max-width: 768px) {
    .bulk-action-menu {
        left: 10px;
        right: 10px;
        transform: none;
        border-radius: 16px;
        padding: 8px 12px;
    }
    .bulk-action-menu.visible { bottom: 10px; }
    .bulk-menu-content { flex-direction: column; gap: 8px; }
    .bulk-menu-info {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.3);
        padding-right: 0;
        padding-bottom: 6px;
        width: 100%;
        justify-content: center;
    }
    .bulk-menu-actions { width: 100%; justify-content: center; }
    .bulk-btn { padding: 6px 10px; font-size: 12px; }
}
/* === ÉCRAN DE CONNEXION === */
.login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #0066cc 0%, #004d26 100%);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}
.login-overlay.hidden { display: none; opacity: 0; pointer-events: none; }
.login-box {
    background: white; padding: 35px; border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    width: 90%; max-width: 380px; text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 10px; }
.login-box h2 { color: #0066cc; margin: 0 0 8px; font-weight: 700; }
.login-box p { color: #666; margin-bottom: 25px; font-size: 14px; }
.login-box .form-group { margin-bottom: 18px; text-align: left; }
.login-box .form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: #333; }
.login-box .form-group input {
    width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px;
    box-sizing: border-box; font-size: 15px; transition: border-color 0.2s;
}
.login-box .form-group input:focus { border-color: #0066cc; outline: none; }
.login-error { color: #dc3545; font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }

/* Bouton de déconnexion dans le header */
.btn-logout {
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.4);
    color: white; padding: 6px 14px; border-radius: 20px; cursor: pointer;
    font-size: 13px; font-weight: 600; transition: all 0.2s; margin-left: 15px;
}
/*  RÈGLE UNIVERSELLE POUR LE MODULE MESURE */
/* Cible tous les tableaux, en-têtes et cellules liés à "mesure" */
div[id*="mesure"] table,
div[id*="mesure"] th,
div[id*="mesure"] td,
table[id*="mesure"],
table[id*="mesure"] th,
table[id*="mesure"] td {
    font-size: 13px !important;
    padding: 7px 9px !important;
    white-space: nowrap;
    line-height: 1.2;
}

/* Réduit encore un peu les nombres pour gagner de la place */
div[id*="mesure"] td:nth-child(n+4):nth-child(-n+12),
table[id*="mesure"] td:nth-child(n+4):nth-child(-n+12) {
    font-size: 12px !important;
    text-align: center;
}

/* ✅ MODALE TRAÇABILITÉ - RÈGLE ULTIME */
#logModal {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

#logModal .modal-content {
    display: block !important;
    background: #fff !important;
    border-radius: 8px !important;
    padding: 0 !important;
    max-width: 1000px !important;
    width: 90% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    margin: auto !important; /* Centre verticalement ET horizontalement */
    pointer-events: auto !important;
    position: relative !important;
}

/* ✅ SÉLECTEURS COMPARAISON - Visibilité améliorée */
#batimentGrid, #lotGrid {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 50px;
    background: #f8f9fa;
    border: 2px solid #0066cc;
    border-radius: 6px;
    padding: 10px;
}

.batiment-checkbox {
    display: inline-block !important;
    margin: 5px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
}

.batiment-checkbox:hover {
    background: #e7f3ff;
    border-color: #0066cc;
}

.batiment-checkbox.selected {
    background: #0066cc !important;
    color: white !important;
    border-color: #0066cc !important;
}

/* ✅ CANVAS COMPARAISON - Dimensions fixes */
#compChartTimeline, #compChartTotals {
    width: 100% !important;
    height: 400px !important;
    min-height: 400px;
    display: block;
}

/* Conteneurs des graphiques */
#compChartTimeline, #compChartTotals {
    position: relative;
}

/* Masquer le menu Guides (utilisé uniquement en arrière-plan) */
.nav-menu [data-section="guides"],
.nav-menu a[href="#guides"],
.nav-menu a[onclick*="'guides'"],
.nav-menu a[onclick*="guides"] {
    display: none !important;
}
/* ============================================================
   📊 TABLEAUX ANALYSE - SURLIGNAGE DE LIGNE
   ============================================================ */

/* Effet de survol sur toutes les lignes du tableau d'analyse */
.data-table tbody tr:hover {
    background-color: #fffde7 !important;
    outline: 2px solid #0066cc;
    outline-offset: -2px;
    cursor: default;
    transition: background-color 0.15s ease, outline 0.15s ease;
}

/* Garder le texte lisible au survol */
.data-table tbody tr:hover td {
    color: #000 !important;
}

/* Indicateur visuel sur la première cellule (numéro de semaine) */
.data-table tbody tr:hover td:first-child {
    background-color: #0066cc !important;
    color: #fff !important;
    font-weight: 700;
}

/* Style alternatif pour les tableaux sans classe data-table */
table tbody tr:hover {
    background-color: #fffde7 !important;
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* ============================================================
   MASQUER TOUS LES BOUTONS D'IMPORT PAR MODULE (IDs commençant par "btnImport")
   ============================================================ */
button[id^="btnImport"] {
    display: none !important;
}
/* ============================================================
   MASQUER LE BOUTON FLOTTANT "Import Global" (en bas à droite)
   ============================================================ */
#globalImportBtn {
    display: none !important;
}
/* ============================================================
   IMPORT-EXPORT : Masquer toutes les checkboxes, garder "Choisir fichier"
   ============================================================ */

/* Masquer toutes les options (checkboxes) d'import et d'export */
#section-import-export .ie-option {
    display: none !important;
}

/* Masquer aussi les boutons "Tout cocher" / "Tout décocher" s'ils existent */
#section-import-export button[onclick*="toggleAllExport"],
#section-import-export button[onclick*="Tout cocher"],
#section-import-export button[onclick*="Tout décocher"] {
    display: none !important;
}

/* Garder VISIBLE uniquement le bouton "📂 Choisir un fichier Excel" */
#section-import-export button[onclick*="excelFileInput"],
#section-import-export button[onclick*="excelInput"] {
    display: inline-block !important;
}
.btn-logout:hover { background: rgba(255,255,255,0.3); transform: translateY(-1px); }
/* 🔧 Taille menu principal (version équilibrée) */
.nav-menu {
    gap: 2px !important;
}

.nav-item {
    font-size: 12px !important;
    padding: 6px 12px !important;
    white-space: nowrap;
}

.nav-item .dropdown {
    font-size: 12px !important;
}

.nav-item .dropdown-item {
    font-size: 11px !important;
    padding: 5px 12px !important;
}

/* Bouton Tableau de bord sans dropdown arrow */
.nav-item-dashboard::after {
    display: none !important;
}

/* Logo et recherche équilibrés */
.logo {
    font-size: 15px !important;
}

.search-container {
    gap: 3px !important;
}

.search-label {
    font-size: 10px !important;
}

.search-date-input, .search-input {
    font-size: 11px !important;
    padding: 5px 8px !important;
}

.search-reset-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
}

/* Header équilibré */
.header {
    padding: 8px 12px !important;
}

.username-badge {
    font-size: 12px !important;
    padding: 5px 10px !important;
}

.btn-logout {
    font-size: 16px !important;
    padding: 5px 10px !important;
}
