/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    color: #565654;
}

/* ==================== LAYOUT ==================== */
.white-banner {
    background: white;
    height: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content {
    padding: 0 20px;
    max-width: 1600px;
    margin: 0 auto;
    /* Espace fixe entre le bandeau et le contenu */
    padding-top: 20px;
}

/* Ajustement pour le visualiseur 3D */
.content:has(#viewer-container) {
    padding: 20px;
    max-width: 100%;
}

/* ==================== MENU PRINCIPAL ==================== */
.top-menu {
    background: #5994B8;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* Bouton retour accueil */
.back-to-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.back-to-home:hover {
    background: rgba(255, 255, 255, 0.3);
}

.menu-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.menu-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-info {
    color: white;
    font-size: 13px;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.menu-1 {
    display: flex;
    align-items: center;
}

.dropdown-menu-container {
    position: relative;
    display: inline-block;
}

.main-menu-select {
    background: white;
    color: #565654;
    border: 2px solid white;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.main-menu-select:hover {
    background: #f0f0f0;
}

.main-menu-select:focus {
    outline: none;
    border-color: #4a7ea0;
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.dropdown-menu-container.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 5px;
    z-index: 1000;
    margin-top: 4px;
    overflow: hidden;
}

.dropdown-menu-container.active .dropdown-content {
    display: block;
}

.dropdown-item {
    color: #565654;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.dropdown-item:hover:not(.disabled) {
    background-color: #f0f0f0;
}

.dropdown-item.disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ==================== MENU 2 (SOUS-MENU) ==================== */
.menu-2 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
}

.menu-2-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid transparent;
    color: white;
    font-size: 15px;
    cursor: pointer;
    padding: 8px 20px;
    transition: all 0.2s;
    border-radius: 5px;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 140px;
}

.menu-2-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
}

.menu-2-btn.selected {
    background: white;
    color: #5994B8;
    border-color: white;
    font-weight: bold;
}

.menu-2-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.15);
}

/* ==================== MENU 3 (ICÔNES) ==================== */
.menu-3 {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.menu-3-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid transparent;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
    border-radius: 5px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.menu-3-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

.menu-3-btn.selected {
    background: white;
    color: #5994B8;
    border-color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.menu-3-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.15);
}

.menu-3-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.menu-3-btn:hover::after {
    opacity: 1;
}

.menu-3-icon-btn {
    background: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.menu-3-icon-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.menu-3-icon-btn:active {
    transform: scale(0.95);
}

.menu-2.hidden, 
.menu-3.hidden {
    display: none;
}

/* ==================== IMPORT SECTION ==================== */
.import-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.file-label {
    background: white;
    color: #565654;
    border: 2px solid #5994B8;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 220px;
    text-align: center;
}

.file-label:hover {
    background: #f0f0f0;
    border-color: #4a7ea0;
}

.file-name {
    color: #565654;
    font-size: 13px;
    min-width: 150px;
}

/* ==================== BUTTONS ==================== */
.action-btn {
    background: #5994B8;
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s;
}

.action-btn:hover:not(:disabled) {
    background: #4a7ea0;
}

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

/* ==================== SPINNER ==================== */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #5994B8;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== TABLES ==================== */
.table-container {
    margin-top: 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

th {
    background: #f5f5f5;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ddd;
    font-size: 14px;
}

td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    overflow: hidden;
    text-overflow: ellipsis;
}

tr:hover {
    background: #f9f9f9;
}

tr.modified {
    background: #fff3cd;
}

tr.modified:hover {
    background: #ffe69c;
}

tr.error-row {
    background: #ffebee;
}

tr.error-row:hover {
    background: #ffcdd2;
}

.correct {
    color: green;
}

.incorrect {
    color: red;
}

/* ==================== STATUS MESSAGES ==================== */
.status-message {
    text-align: center;
    padding: 8px;
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: bold;
}

.status-success {
    color: green;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
}

.status-error {
    color: red;
}

.status-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    color: #856404;
    max-width: 800px;
    margin: 20px auto;
}

.status-warning h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 18px;
}

.status-warning h4 {
    color: #856404;
    margin: 15px 0 10px 0;
    font-size: 14px;
}

.status-warning p {
    margin-bottom: 10px;
    font-size: 14px;
}

.status-warning ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.status-warning li {
    margin-bottom: 5px;
    font-size: 13px;
}

/* ==================== STATISTICS ==================== */
.stats-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 0 0 20px 0;
    flex-wrap: wrap;
    width: 100%;
}

.stat-card {
    background: #f5f5f5;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
    border: 1px solid #e0e0e0;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #5994B8;
}

.stat-label {
    font-size: 11px;
    color: #565654;
    margin-top: 4px;
}

.stat-card.success .stat-value {
    color: #28a745;
}

.stat-card.warning .stat-value {
    color: #ff9800;
}

.stat-card.error .stat-value {
    color: #dc3545;
}

/* ==================== ZONE SIDEBAR ==================== */
.pieces-layout {
    display: flex;
    gap: 20px;
    margin-top: 0;
    align-items: flex-start;
}

.zone-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: flex-start;
}

.zone-sidebar-title {
    font-size: 14px;
    font-weight: bold;
    color: #5994B8;
    padding: 8px 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #5994B8;
}

.zone-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #565654;
    transition: all 0.2s;
    border-radius: 5px;
    margin-bottom: 4px;
}

.zone-item:hover {
    background: #e9ecef;
    color: #5994B8;
}

.zone-item.selected {
    background: white;
    color: #5994B8;
    font-weight: bold;
    border-left: 3px solid #5994B8;
    padding-left: 9px;
}

.pieces-table {
    flex: 1;
}

/* ==================== ERROR BOX ==================== */
.error-box {
    background: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
}

/* ==================== UTILITY CLASSES ==================== */
.header-line {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Material cell with tooltip */
.material-cell {
    cursor: help;
    position: relative;
}

/* Styles pour les lignes de groupe et détail */
.group-row {
    cursor: pointer;
    font-weight: bold;
    background: #f9f9f9;
}

.group-row:hover {
    background: #f0f0f0;
}

.expand-icon {
    display: inline-block;
    width: 15px;
    font-size: 10px;
    transition: transform 0.2s;
}

.detail-row {
    background: #fafafa;
    font-size: 12px;
}

.detail-row.hidden {
    display: none;
}

.detail-row td {
    padding: 6px 8px;
}

/* Contact select styling */
.contact-select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.contact-select:focus {
    outline: none;
    border-color: #5994B8;
}

/* Psi input styling */
.psi-input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.psi-input:focus {
    outline: none;
    border-color: #5994B8;
}

/* Icônes du menu - les SVG utilisent currentColor donc héritent de la couleur du bouton */
.menu-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* ==================== LOCALISATION ET SITE ==================== */
.location-site-section {
    margin-top: 40px;
}

.location-site-section h3 {
    color: #5994B8;
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid #5994B8;
    padding-bottom: 10px;
}

.site-info-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-card h4 {
    color: #5994B8;
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #495057;
    flex: 1;
}

.info-value {
    flex: 2;
    text-align: right;
    color: #212529;
}

.actions-container {
    text-align: center;
    margin-top: 30px;
}

/* Pour les écrans plus petits */
@media (max-width: 768px) {
    .site-info-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-value {
        text-align: left;
    }
}

/* ==================== VALIDATION DES FICHIERS ==================== */
.validation-section {
    margin-top: 40px;
}

.validation-header {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.validation-title {
    color: #5994B8;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.validation-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-group {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

.stat-group-title {
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.stat-mini-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-mini {
    text-align: center;
    padding: 8px 4px;
    border-radius: 4px;
    background: #f8f9fa;
}

.stat-mini-value {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.stat-mini-label {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.stat-mini.error .stat-mini-value {
    color: #dc3545;
}

.stat-mini.success .stat-mini-value {
    color: #28a745;
}

/* ==================== ONGLETS ==================== */
.tabs-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tabs-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-button.active {
    color: #5994B8;
    background: white;
    border-bottom-color: #5994B8;
    font-weight: 600;
}

.tab-content {
    padding: 20px;
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Responsive pour les onglets */
@media (max-width: 768px) {
    .validation-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-mini-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .tabs-header {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: 1px solid #e9ecef;
        border-right: none;
    }
    
    .tab-button.active {
        border-bottom-color: #5994B8;
        background: #f8f9fa;
    }
}

/* Style pour les lignes de séparation de zones */
.zone-separator {
    border-bottom: 2px solid #333;
}

.zone-separator td {
    background-color: #f8f9fa !important;
    color: #333 !important;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    padding: 12px 8px;
}

/* Styles pour les sections de fichiers */
.file-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.file-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    color: #5994B8;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #5994B8;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.export-table-container {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

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

.export-table th {
    background-color: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.export-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

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

.export-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* Styles pour la section Localisation et site */
.location-site-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.site-info-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.info-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card-full {
    grid-column: 1 / -1;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 30px;
}

.info-title {
    color: #5994B8;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #5994B8;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.info-value {
    color: #666;
    font-size: 14px;
}

/* Section Données météorologiques */
.weather-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.weather-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.weather-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.weather-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Tableau des statistiques météo */
.weather-table-container {
    margin-bottom: 20px;
    overflow-x: auto;
}

.weather-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.weather-table th {
    background-color: #5994B8;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.weather-table td {
    font-size: 13px;
    color: #333;
}

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

.weather-table td:nth-child(2),
.weather-table td:nth-child(3),
.weather-table td:nth-child(4),
.weather-table td:nth-child(5) {
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
}

.weather-table th:nth-child(2),
.weather-table th:nth-child(3),
.weather-table th:nth-child(4),
.weather-table th:nth-child(5) {
    text-align: right;
}

.param-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Filtre temporel météo par étiquettes de mois */
.weather-month-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.month-tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-tag:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.month-tag.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Cartes graphiques météo */
.weather-chart-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.weather-chart-card h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.weather-chart-wrapper {
    width: 100%;
    height: 300px;
    position: relative;
}

.weather-chart-wrapper canvas {
    width: 100%;
    height: 100%;
}

/* Légendes inline */
.weather-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.legend-item-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #5994B8;
}

.stat-unit {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.weather-chart-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.chart-legend {
    flex: 0 0 250px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.legend-item:hover {
    background-color: #e9ecef;
}

.legend-item.active {
    background-color: #e9ecef;
    font-weight: 500;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 10px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-label {
    font-size: 13px;
    color: #333;
}

.chart-area {
    flex: 1;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
}

#weatherChart {
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* Responsive pour les sections */
@media (max-width: 768px) {
    .site-info-container {
        grid-template-columns: 1fr;
    }
    
    .weather-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .weather-chart-container {
        flex-direction: column;
    }
    
    .chart-legend {
        flex: 1;
        order: 2;
    }
    
    .chart-area {
        order: 1;
    }
}

/* ==================== PAGE FICHIER ==================== */
.fichier-page {
    padding: 20px;
}

.fichier-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 0;
}

.fichier-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 30px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.fichier-action-btn:hover {
    border-color: #5994B8;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(89,148,184,0.15);
}

.fichier-action-btn .btn-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.fichier-action-btn .btn-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ==================== POPUP IMPORT ==================== */
.import-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-title {
    margin: 0 0 25px 0;
    color: #5994B8;
    font-size: 20px;
    font-weight: 600;
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.import-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-label {
    display: block;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
}

.import-label:hover {
    border-color: #5994B8;
    background: #e3f2fd;
    color: #5994B8;
}

.import-label-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.import-file-name {
    font-size: 12px;
    color: #888;
    text-align: center;
}

.import-site-input {
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.import-site-input:focus {
    outline: none;
    border-color: #5994B8;
}

.import-site-info {
    font-size: 12px;
    color: #888;
}

.site-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 10;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.site-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.site-suggestion-item:hover {
    background: #f5f5f5;
}

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

.import-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.import-btn {
    background: #5994B8 !important;
}

.cancel-btn {
    background: #6c757d !important;
}

/* Responsive pour la page Fichier */
@media (max-width: 768px) {
    .fichier-buttons-container {
        flex-direction: column;
        align-items: center;
    }

    .fichier-action-btn {
        width: 100%;
        max-width: 200px;
    }

    .import-modal {
        width: 95%;
        padding: 20px;
    }
}

/* Paramètres de simulation */
.simulation-params-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    color: #5994B8;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #5994B8;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.param-select,
.param-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.param-select:focus,
.param-input:focus {
    outline: none;
    border-color: #5994B8;
    box-shadow: 0 0 0 3px rgba(89, 148, 184, 0.1);
}

.param-hint {
    font-size: 12px;
    color: #999;
    margin-top: -4px;
}

/* Sélecteur de fichier EPW */
.weather-file-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Design Days */
.design-days-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.design-days-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.design-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.design-day-card {
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.design-day-card.winter {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.design-day-card.summer {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.design-day-card h5 {
    color: #333;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

.dd-field {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dd-field:last-child {
    border-bottom: none;
}

.dd-label {
    font-weight: 500;
    color: #555;
}

.dd-value {
    font-weight: bold;
    color: #333;
}

.info-text {
    color: #666;
    font-style: italic;
}
