/*
 * pages-ereah.css
 * Styles communs aux pages internes d'EREAH : administration.html et referentiel.html.
 * Repris tels quels de l'ancien fichiers.html (30/10/2026), qui réunissait les deux pages.
 */

    .file-manager {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 20px;
        max-width: 1800px;
        margin: 0 auto;
        width: 100%;
    }
    
    *, *::before, *::after {
        box-sizing: border-box;
    }

    .file-toolbar {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .file-toolbar-btn {
        background: white;
        color: #333;
        border: 1px solid #ddd;
        padding: 6px 12px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.2s;
    }
    
    .file-toolbar-btn:hover {
        background: #f0f0f0;
        border-color: #ccc;
    }
    
    .file-toolbar-btn:active {
        background: #333;
        color: white;
        border-color: #333;
    }
    
    .file-toolbar-btn.secondary {
        background: white;
        color: #333;
        border: 1px solid #ddd;
    }
    
    .file-toolbar-btn.secondary:hover {
        background: #f0f0f0;
        border-color: #ccc;
    }
    
    .file-toolbar-btn.secondary:active {
        background: #333;
        color: white;
        border-color: #333;
    }
    
    .file-toolbar-btn.danger {
        background: #dc3545;
    }
    
    .file-toolbar-btn.danger:hover {
        background: #c82333;
    }
    
    .import-dropdown-item {
        display: block;
        width: 100%;
        text-align: left;
        padding: 10px 14px;
        background: white;
        border: none;
        font-size: 13px;
        color: #333;
        cursor: pointer;
    }
    
    .import-dropdown-item:hover {
        background: #f0f0f0;
    }
    
    .breadcrumb {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 16px;
        background: #f5f7fa;
        border-radius: 8px;
        margin-bottom: 20px;
        font-size: 14px;
    }
    
    .breadcrumb-item {
        color: #5994B8;
        cursor: pointer;
        text-decoration: none;
    }
    
    .breadcrumb-item:hover {
        text-decoration: underline;
    }
    
    .breadcrumb-separator {
        color: #888;
    }
    
    .breadcrumb-current {
        color: #333;
        font-weight: 500;
    }
    
    .file-table {
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        flex: 1;
    }

    .file-table table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .file-table th {
        background: #f5f7fa;
        padding: 14px 16px;
        text-align: left;
        font-weight: 600;
        color: #333;
        font-size: 13px;
        border-bottom: 2px solid #e0e0e0;
    }

    .file-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
    }
    
    .file-table tr:hover {
        background: #f9f9f9;
    }

    .sites-toolbar .file-toolbar-btn.danger {
        background: #dc3545;
        color: white;
        border-color: #dc3545;
    }

    .sites-toolbar .file-toolbar-btn.danger:hover {
        background: #c82333;
    }

    .file-table tr.selected {
        background: #e8f4fc;
    }
    
    .file-name {
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
    }
    
    .file-icon {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        font-size: 18px;
    }
    
    .file-icon.folder {
        background: #fff3cd;
    }
    
    .file-icon.file {
        background: #e8f4fc;
    }
    
    .file-actions {
        display: flex;
        gap: 8px;
    }
    
    .file-action-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px;
        border-radius: 4px;
        color: #666;
        transition: all 0.2s;
    }
    
    .file-action-btn:hover {
        background: #f0f0f0;
        color: #333;
    }
    
    .file-action-btn.delete:hover {
        background: #fee;
        color: #c00;
    }
    
    .upload-zone {
        border: 2px dashed #ccc;
        border-radius: 10px;
        padding: 40px;
        text-align: center;
        margin-bottom: 20px;
        transition: all 0.2s;
        cursor: pointer;
    }
    
    .upload-zone:hover, .upload-zone.dragover {
        border-color: #5994B8;
        background: #f0f7fc;
    }
    
    .upload-zone-icon {
        font-size: 48px;
        margin-bottom: 15px;
    }
    
    .upload-zone-text {
        color: #666;
        font-size: 16px;
    }
    
    .upload-zone-hint {
        color: #999;
        font-size: 13px;
        margin-top: 8px;
    }
    
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
    
    .modal {
        background: white;
        border-radius: 12px;
        padding: 30px;
        width: 90%;
        max-width: 400px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    }
    
    .modal h3 {
        margin-bottom: 20px;
        color: #333;
    }
    
    .modal input[type="text"] {
        width: 100%;
        padding: 12px;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .modal input[type="text"]:focus {
        outline: none;
        border-color: #5994B8;
    }
    
    .modal-buttons {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }
    
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: #888;
    }
    
    .empty-state-icon {
        font-size: 64px;
        margin-bottom: 20px;
        opacity: 0.5;
    }
    
    .loading {
        text-align: center;
        padding: 40px;
        color: #888;
    }
    
    .toast {
        position: fixed;
        bottom: 30px;
        right: 30px;
        background: #333;
        color: white;
        padding: 16px 24px;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        z-index: 2000;
        animation: slideIn 0.3s ease;
    }
    
    .toast.success {
        background: #28a745;
    }
    
    .toast.error {
        background: #dc3545;
    }
    
    @keyframes slideIn {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }
    
    .hidden {
        display: none !important;
    }
    
    #fileInput {
        display: none;
    }
    
    /* Styles pour la vue InstrumentationsF */
    .instrumentations-view {
        display: none;
    }
    
    .instrumentations-view.active {
        display: block;
    }
    
    .instrumentations-filters {
        display: flex;
        gap: 15px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        align-items: flex-end;
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .filter-group label {
        font-size: 12px;
        font-weight: 600;
        color: #555;
    }
    
    .filter-group select,
    .filter-group input {
        padding: 10px 12px;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 14px;
        min-width: 180px;
    }
    
    .filter-group select:focus,
    .filter-group input:focus {
        outline: none;
        border-color: #5994B8;
    }
    
    .file-table th.sortable {
        cursor: pointer;
        user-select: none;
    }
    
    .file-table th.sortable:hover {
        background: #e8f0f5;
    }
    
    .file-table th .sort-icon {
        margin-left: 5px;
        font-size: 10px;
        color: #999;
    }
    
    .file-table th .sort-icon::after {
        content: '▲▼';
    }
    
    .file-table th.sorted-asc .sort-icon::after {
        content: '▲';
        color: #5994B8;
    }
    
    .file-table th.sorted-desc .sort-icon::after {
        content: '▼';
        color: #5994B8;
    }
    
    .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 2px 6px;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 500;
    }
    
    .status-badge.present {
        background: #d4edda;
        color: #155724;
    }
    
    .status-badge.absent {
        background: #f8d7da;
        color: #721c24;
    }
    
    .file-view {
        display: block;
    }
    
    .file-view.hidden-view {
        display: none;
    }
    
    .back-btn {
        margin-bottom: 15px;
    }
    
    .filter-row th {
        padding: 4px 3px;
        background: #f0f4f8;
    }
    
    .column-filter-wrapper {
        position: relative;
    }
    
    .column-filter {
        width: 100%;
        padding: 4px 6px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 11px;
        box-sizing: border-box;
    }
    
    .column-filter:focus {
        outline: none;
        border-color: #5994B8;
    }

    .column-filter-select {
        width: 100%;
        padding: 4px 6px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 11px;
        box-sizing: border-box;
    }

    .column-filter-select:focus {
        outline: none;
        border-color: #5994B8;
    }
    
    .autocomplete-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #ddd;
        border-top: none;
        border-radius: 0 0 4px 4px;
        max-height: 150px;
        overflow-y: auto;
        z-index: 100;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .autocomplete-item {
        padding: 5px 8px;
        cursor: pointer;
        font-size: 11px;
    }
    
    .autocomplete-item:hover {
        background: #e8f4fc;
    }
    
    #instrumentationsTable th {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    #instrumentationsTable td {
        padding: 6px;
        font-size: 12px;
    }
    
    .header-row th {
        white-space: nowrap;
    }

    /* Filtre nom fichiers */
    .name-filter-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
    }
    .name-filter-bar input {
        padding: 8px 14px;
        border: 2px solid #e0e0e0;
        border-radius: 20px;
        font-size: 14px;
        width: 280px;
        transition: border-color 0.2s;
    }
    .name-filter-bar input:focus {
        outline: none;
        border-color: #5994B8;
    }
    .name-filter-bar .clear-filter {
        background: none;
        border: none;
        cursor: pointer;
        color: #999;
        font-size: 18px;
        line-height: 1;
        padding: 0 4px;
        display: none;
    }
    .name-filter-bar .clear-filter.visible {
        display: inline;
    }
    .name-filter-bar .filter-count {
        font-size: 12px;
        color: #888;
    }

    /* Filtres externes Instrumentations */
    .ext-filters {
        display: flex;
        gap: 12px;
        margin-bottom: 14px;
        flex-wrap: wrap;
        align-items: flex-end;
    }
    .ext-filter-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .ext-filter-group label {
        font-size: 11px;
        font-weight: 600;
        color: #555;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .ext-filter-group select,
    .ext-filter-group input,
    .ext-filter-group .ext-filter-input {
        padding: 7px 10px;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 13px;
        min-width: 150px;
        background: white;
        width: 100%;
        box-sizing: border-box;
    }
    .ext-filter-group select:focus,
    .ext-filter-group input:focus,
    .ext-filter-group .ext-filter-input:focus {
        outline: none;
        border-color: #5994B8;
    }
    .ext-filters .reset-filters-btn {
        background: none;
        border: 2px solid #ccc;
        border-radius: 6px;
        color: #666;
        padding: 7px 12px;
        cursor: pointer;
        font-size: 13px;
        align-self: flex-end;
        transition: all 0.2s;
    }
    .ext-filters .reset-filters-btn:hover {
        background: #f5f5f5;
        border-color: #999;
    }

    /* Tooltip survol ID_Site */
    .tooltip-trigger {
        position: relative;
        cursor: default;
    }
    .tooltip-trigger .row-tooltip {
        display: none;
        position: fixed;
        background: #1e293b;
        color: white;
        border-radius: 8px;
        padding: 10px 14px;
        font-size: 12px;
        line-height: 1.6;
        white-space: nowrap;
        z-index: 9999;
        box-shadow: 0 6px 20px rgba(0,0,0,0.3);
        pointer-events: none;
    }
    .tooltip-trigger:hover .row-tooltip {
        display: block;
    }
    .row-tooltip .tt-row {
        display: flex;
        gap: 8px;
    }
    .row-tooltip .tt-label {
        color: #94a3b8;
        min-width: 90px;
    }
    .row-tooltip .tt-val {
        color: #f1f5f9;
        font-weight: 500;
    }

    /* Styles pour la vue Journal API */
    .journal-api-view {
        display: none;
    }

    .journal-api-view.active {
        display: block;
    }

    /* Icônes de navigation (style dashboard) */
    .nav-icons {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    .nav-icon-btn {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        font-size: 12px;
        cursor: pointer;
        padding: 6px 10px;
        transition: all 0.2s;
        border-radius: 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 80px;
        width: 80px;
        height: 60px;
        font-family: 'DM Sans', sans-serif;
    }
    .nav-icon-btn svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
    }
    .nav-icon-btn span {
        font-size: 10px;
        white-space: nowrap;
        font-weight: 500;
    }
    .nav-icon-btn:hover {
        background: rgba(78, 142, 200, 0.3);
        border-color: rgba(127, 184, 224, 0.5);
    }
    .nav-icon-btn.selected {
        background: #4e8ec8;
        border-color: #4e8ec8;
        box-shadow: 0 2px 8px rgba(78, 142, 200, 0.4);
    }

    /* Styles pour la vue Sites */
    .contacts-view {
        display: none;
    }

    .contacts-view.active {
        display: block;
    }

    /* Tableau des contacts */
    .contacts-table-wrap {
        background: #fff;
        border: 1px solid #e3e8ec;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        overflow: auto;
        max-height: calc(100vh - 230px);
    }
    .data-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 13px;
        color: #333;
    }
    .data-table thead {
        position: sticky;
        top: 0;
        z-index: 2;
    }
    .data-table thead th {
        background: #f5f7fa;
        text-align: left;
        font-weight: 600;
        font-size: 12px;
        color: #455A64;
        white-space: nowrap;
    }
    .data-table thead tr.header-row th {
        padding: 10px 12px 8px;
    }
    .data-table thead tr.filter-row th {
        padding: 0 12px 8px;
        border-bottom: 2px solid #e0e6eb;
    }
    .data-table tbody td {
        padding: 9px 12px;
        border-bottom: 1px solid #f0f2f4;
        vertical-align: top;
    }
    .data-table tbody tr:nth-child(even) td {
        background: #fafbfc;
    }
    .data-table tbody tr:hover td {
        background: #eef5fb;
    }
    .data-table .col-filter {
        width: 100%;
        min-width: 110px;
        padding: 5px 8px;
        border: 1px solid #d6dde3;
        border-radius: 5px;
        font-size: 12px;
        font-family: inherit;
        font-weight: 400;
        color: #333;
        background: #fff;
    }
    .data-table .col-filter:focus {
        outline: none;
        border-color: #5994B8;
    }
    .data-table .cell-muted {
        color: #9aa5ab;
    }
    .type-badge {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 10px;
        background: #e8f0f5;
        color: #455A64;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Informations générales : sous-titres et grilles */
    .info-subtitle {
        font-size: 12px;
        font-weight: 700;
        color: #333;
        margin: 2px 0 8px;
    }
    .info-subtitle.spaced {
        margin-top: 16px;
    }
    .info-row {
        display: grid;
        gap: 10px;
        margin-bottom: 12px;
    }
    .info-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .info-row.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    /* Pas de trait séparateur (neutralise un éventuel style .info-row externe) */
    #infoTileContent .info-row {
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
    }
    .meteo-id.missing {
        color: #d32f2f !important;
        font-weight: 600;
    }
    /* Édition des informations générales sur toute la largeur */
    .info-edit-layout {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 32px;
        max-width: 1400px;
    }
    .info-edit-layout .tile-actions {
        grid-column: 1 / -1;
    }
    .info-row .info-field {
        margin-bottom: 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    /* Les libellés absorbent la hauteur : valeurs / champs alignés sur une même ligne */
    .info-row .info-field label {
        line-height: 1.25;
        flex: 1 0 auto;
    }

    /* Aperçu d'un site au survol de la carte */
    .site-preview {
        font-size: 13px;
        color: #333;
        line-height: 1.5;
    }
    .site-preview-title {
        font-size: 16px;
        font-weight: 700;
        color: #263238;
        margin-bottom: 12px;
    }
    .site-preview-row {
        margin-bottom: 7px;
    }
    .site-preview-row .lbl {
        color: #9aa5ab;
    }
    .site-preview-section {
        font-size: 13px;
        font-weight: 700;
        color: #333;
        margin: 18px 0 8px;
        padding-top: 12px;
        border-top: 1px solid #eef1f3;
    }
    .site-preview-group {
        font-size: 12px;
        color: #9aa5ab;
        margin: 10px 0 4px;
    }
    .site-preview-sensor {
        margin-bottom: 8px;
    }
    .site-preview-sensor .stats {
        font-size: 12px;
        color: #888;
    }

    .sites-view {
        display: none;
    }

    .sites-view.active {
        display: block;
    }

    /* Vue Sites (30/10/2026) : mise en page de la vue Annuaire (js/annuaire.js, .ann-page, .ann-nav, .ann-liste, .ann-fenetre).
       À gauche l'arbre type d'organisme > organisme (270px), à droite la liste des sites, sur 2 lignes.
       La hauteur de .sit-page est fixée par ajusterHauteurSites() : seules les colonnes défilent. */
    .sit-page, .sit-modal {
        --trait: #d7dde5; --surface-2: #eef2f7; --survol: #e6eef8; --texte: #0e1c2e; --texte-2: #566070; --accent: #4e8ec8;
    }
    .sit-page {
        display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; padding-top: 4px;
        align-items: stretch; min-height: 300px; font-size: 13px; color: #333;
    }
    .sit-nav { overflow: auto; min-height: 0; padding: 2px 10px 12px 0; border-right: 1px solid var(--trait);
               display: flex; flex-direction: column; gap: 1px; }
    .sit-nav button { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left;
                      background: none; border: 0; border-radius: 7px; font-family: inherit; cursor: pointer; }
    .sit-nav .tout, .sit-nav .fam { padding: 6px 12px; color: var(--texte-2); font-size: 13.5px; line-height: 1.35; }
    .sit-nav .tout { color: var(--texte); font-weight: 600; margin-bottom: 4px; }
    .sit-nav .domaine { padding: 9px 12px; margin-top: 4px; color: var(--texte); font-weight: 700; font-size: 14px; line-height: 1.3; }
    .sit-nav button:hover { background: var(--surface-2); color: var(--texte); }
    .sit-nav .fam[aria-current="true"], .sit-nav .tout[aria-current="true"] { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(14, 28, 46, .12); }
    .sit-nav .domaine[aria-current="true"] { color: var(--accent); }
    .sit-nav .nb { font-weight: 400; font-size: 12px; color: var(--texte-2); margin-left: auto; flex: none; }
    .sit-nav .chev { color: var(--texte-2); font-size: 12px; transition: transform .15s; flex: none; }
    .sit-nav .domaine[aria-expanded="true"] .chev { transform: rotate(90deg); }
    .sit-nav .familles-dom { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 12px; padding-left: 8px; border-left: 2px solid var(--trait); }
    .sit-nav .fam .nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sit-colonne { min-width: 0; min-height: 0; overflow-y: auto; padding: 0 4px 24px 0; overscroll-behavior: contain; }
    .sit-groupe { margin-bottom: 18px; }
    .sit-groupe h2 { font: 400 16px "DM Serif Display", Georgia, serif; margin: 0 0 6px; color: var(--accent); }
    .sit-liste { background: #fff; border: 1px solid var(--trait); border-radius: 10px; overflow: hidden; }
    /* Une ligne (31/10/2026) : photo | nom, adresse, maître d'ouvrage puis surfaces | pastilles des instrumentations */
    /* Colonne des pastilles de largeur fixe : nom, adresse et maître d'ouvrage restent alignés d'une ligne à l'autre */
    .sit-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) 270px; gap: 4px 14px; align-items: center;
                padding: 8px 14px; border-top: 1px solid var(--trait); cursor: pointer; }
    .sit-item:first-child { border-top: 0; }
    .sit-item:hover { background: var(--survol); }
    .sit-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
    .sit-item .photo { position: relative; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: #e8f0f5; color: #9aa5ab;
                       display: grid; place-items: center; }
    .sit-item .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    .sit-item .corps { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
    .sit-item .l1 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: baseline; }
    .sit-item .l1 > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sit-item .nom { font-weight: 600; color: var(--texte); }
    .sit-item .adr, .sit-item .moa { color: var(--texte-2); }
    .sit-item .l2 { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--texte); }
    .sit-item .l2 .k { color: #9aa5ab; margin-right: 4px; }
    /* Pastilles : un clic ouvre la fenêtre instrumentations et consommations */
    .sit-item .pastilles { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; justify-self: end; padding: 4px;
                           border: 1px solid transparent; border-radius: 8px; background: none; font-family: inherit; cursor: pointer; }
    .sit-item .pastilles:hover { border-color: var(--accent); background: #fff; }
    .sit-item .pastilles:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
    .pastille { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--texte);
                background: #fff; border: 1px solid var(--trait); border-radius: 999px; padding: 2px 9px 2px 7px; white-space: nowrap; }
    .pastille::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
    .sit-item .pastilles .aucune { font-size: 11.5px; color: #9aa5ab; }
    /* Bascule Liste / Carte (boutons .mode-btn) et carte des sites */
    .sit-vues { display: inline-flex; border-radius: 6px; overflow: hidden; }
    .sit-carte { min-width: 0; min-height: 0; height: 100%; border-radius: 8px; border: 1px solid #ddd; }
    .sit-vide { padding: 24px; text-align: center; color: #666; }
    .sit-erreur { padding: 10px 12px; border-radius: 6px; background: #fdecea; color: #b3261e; margin-bottom: 10px; }
    /* Fenêtre d'un site : instrumentations à gauche, consommations annuelles et mensuelles à droite */
    .sit-modal { position: fixed; inset: 0; z-index: 1500; background: rgba(14, 28, 46, .45); padding: 16px;
                 display: flex; align-items: center; justify-content: center; }
    .sit-modal[hidden] { display: none; }
    .sit-fenetre { background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(14, 28, 46, .22); width: min(1400px, 100%);
                   height: min(820px, calc(100vh - 40px)); display: flex; flex-direction: column; color: var(--texte); font-size: 13px; }
    .sit-fenetre .f-tete { padding: 14px 20px 10px; border-bottom: 1px solid var(--trait); }
    .sit-fenetre .f-ligne { display: flex; align-items: center; gap: 10px; }
    .sit-fenetre .chemin { font-size: 12px; color: var(--texte-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sit-fenetre .fermer { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--texte-2); padding: 2px 6px; margin-left: auto; cursor: pointer; }
    .sit-fenetre .titre { font: 400 22px "DM Serif Display", Georgia, serif; margin: 4px 0 0; flex: 1; min-width: 0; }
    .sit-fenetre .f-corps { flex: 1; min-height: 0; padding: 12px 20px 16px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
    .sit-f-instru { min-height: 0; overflow-y: auto; border-right: 1px solid var(--trait); padding-right: 10px; }
    .sit-f-graphes { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
    .sit-f-infos { display: none; }
    /* Modification des informations : le formulaire prend toute la fenêtre */
    .sit-fenetre.edition-infos .sit-f-infos { display: block; grid-column: 1 / -1; overflow-y: auto; min-height: 0; }
    .sit-fenetre.edition-infos .sit-f-instru, .sit-fenetre.edition-infos .sit-f-graphes { display: none; }
    @media (max-width: 1100px) {
        .sit-item .l1 { grid-template-columns: minmax(0, 1fr); gap: 2px; }
        .sit-item { grid-template-columns: 64px minmax(0, 1fr) 150px; }
    }
    @media (max-width: 820px) {
        /* Écran étroit : une colonne, la page défile normalement */
        .sit-page { grid-template-columns: minmax(0, 1fr); height: auto !important; }
        .sit-nav { border-right: 0; max-height: 320px; }
        .sit-colonne { overflow: visible; }
        .sit-carte { height: 60vh; }
        .sit-fenetre { height: calc(100vh - 32px); }
        .sit-fenetre .f-corps { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(420px, 1fr); overflow-y: auto; }
        .sit-f-instru { border-right: 0; padding-right: 0; }
    }
    @media (prefers-reduced-motion: reduce) { .sit-nav .chev { transition: none; } }

    .site-tile {
        padding: 8px;
    }

    .site-tile-title {
        font-size: 14px;
        font-weight: 600;
        color: #455A64;
        margin-bottom: 10px;
    }

    .site-tile-row {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
        font-size: 13px;
        color: #555;
    }

    .site-tile-row > div {
        line-height: 1.5;
    }

    .instrumentation-section-title {
        font-size: 12px;
        font-weight: 700;
        color: #333;
        margin-bottom: 4px;
    }

    .instrumentation-empty {
        font-size: 13px;
        color: #c0c7cb;
    }

    .instrumentation-item {
        font-size: 13px;
        color: #333;
        padding: 3px 6px;
        margin-left: 12px;
        border-radius: 4px;
        cursor: pointer;
        background: transparent;
        word-break: break-word;
    }

    .instrumentation-item:hover {
        background: #f3f5f7;
    }

    .instrumentation-item.selected {
        font-weight: 400;
    }

    .icon-btn {
        background: transparent;
        border: none;
        cursor: pointer;
        font-size: 14px;
        padding: 4px;
        margin-left: 4px;
    }

    .info-field {
        margin-bottom: 12px;
    }

    .info-field label {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: #9aa5ab;
        margin-bottom: 3px;
    }

    .info-field div,
    .info-field input {
        font-size: 13px;
        color: #333;
        word-break: break-word;
    }

    .info-field .info-input {
        width: 100%;
        padding: 6px 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 13px;
        font-family: inherit;
        color: #333;
        background: #fff;
    }

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

    .info-field .info-input:disabled {
        background: #f5f5f5;
        color: #777;
    }

    /* Crayon accolé au titre d'une tuile, même couleur que le titre */
    .title-edit-btn {
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 2px 4px;
        margin: 0;
        color: #455A64;
        display: inline-flex;
        align-items: center;
        border-radius: 4px;
        line-height: 0;
    }

    .title-edit-btn:hover {
        background: #eceff1;
    }

    .title-edit-btn.active {
        background: #455A64;
        color: #fff;
    }

    .tile-header {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 4px;
        margin-bottom: 10px;
    }

    .tile-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        flex-wrap: wrap;
    }

    .file-toolbar-btn.btn-delete {
        color: #c82333;
        border-color: #e4a1a8;
    }

    .file-toolbar-btn.btn-delete:hover {
        background: #fdecee;
        border-color: #c82333;
    }

    .mode-btn {
        padding: 4px 10px;
        border: none;
        background: #e0e0e0;
        cursor: pointer;
        font-size: 11px;
        color: #333;
        min-width: 80px;
    }

    .mode-btn.active {
        background: #455A64;
        color: #fff;
    }

    /* Styles pour la vue Développement */
    .dev-view {
        display: none;
    }

    .dev-view.active {
        display: block;
    }

    .dev-task {
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 12px;
        background: #fafbfc;
        overflow: hidden;
    }

    .dev-task-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        background: #f0f4f8;
        border-bottom: 1px solid #e0e0e0;
        flex-wrap: wrap;
    }

    .dev-task-title {
        flex: 1;
        font-weight: 600;
        font-size: 14px;
        min-width: 140px;
        border: none;
        background: transparent;
        border-bottom: 1px dashed #999;
        padding: 4px;
    }

    .dev-task-progress {
        width: 120px;
        height: 18px;
        border-radius: 9px;
        background: #e0e0e0;
        overflow: hidden;
        position: relative;
    }

    .dev-task-progress-bar {
        height: 100%;
        background: #5994B8;
        transition: width 0.2s;
    }

    .dev-task-progress-text {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        color: #333;
        font-weight: 600;
    }

    .dev-task-actions {
        display: flex;
        gap: 6px;
    }

    .dev-task-actions button {
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 13px;
    }

    .dev-task-actions .dev-add-sub {
        color: #388e3c;
    }

    .dev-task-actions .dev-add-sub:hover {
        background: #e8f5e9;
    }

    .dev-task-actions .dev-delete {
        color: #dc3545;
    }

    .dev-task-actions .dev-delete:hover {
        background: #fee;
    }

    .dev-subtasks {
        padding: 10px 14px;
    }

    .dev-subtask {
        display: flex;
        gap: 8px;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid #f0f0f0;
        flex-wrap: wrap;
    }

    .dev-subtask input[type="text"] {
        flex: 1;
        min-width: 120px;
        padding: 5px 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 13px;
    }

    .dev-subtask select, .dev-subtask input[type="date"], .dev-subtask input[type="number"] {
        padding: 5px 6px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 13px;
    }

    .dev-subtask .dev-assignee {
        min-width: 130px;
    }

    .dev-subtask .dev-status {
        min-width: 110px;
    }

    .dev-subtask .dev-progress {
        width: 70px;
    }

    .dev-subtask .dev-delete-sub {
        color: #dc3545;
        cursor: pointer;
        background: none;
        border: none;
        padding: 4px;
    }

    .dev-subtask .dev-delete-sub:hover {
        background: #fee;
        border-radius: 4px;
    }

    .dev-empty {
        color: #999;
        font-style: italic;
        padding: 20px 0;
        text-align: center;
    }

    .dev-attachments {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        padding: 8px 10px;
        margin: 6px 0 0 0;
        border: 2px dashed #ccc;
        border-radius: 6px;
        background: #f9f9f9;
        min-height: 42px;
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s;
    }

    .dev-attachments.drag-over {
        background: #e8f4fc;
        border-color: #5994B8;
    }

    .dev-attachments:hover {
        background: #f0f7fb;
        border-color: #5994B8;
    }

    .dev-attach-hint {
        color: #888;
        font-size: 12px;
        pointer-events: none;
    }

    .dev-attach-item {
        display: flex;
        align-items: center;
        gap: 6px;
        background: white;
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 4px 8px;
        font-size: 12px;
        max-width: 100%;
    }

    .dev-attach-preview {
        width: 32px;
        height: 32px;
        object-fit: cover;
        border-radius: 4px;
    }

    .dev-attach-name {
        color: #5994B8;
        text-decoration: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 160px;
    }

    .dev-attach-name:hover {
        text-decoration: underline;
    }

    .dev-attach-delete {
        background: none;
        border: none;
        color: #dc3545;
        cursor: pointer;
        font-size: 12px;
        padding: 2px 4px;
    }

    .dev-attach-delete:hover {
        background: #fee;
        border-radius: 4px;
    }

    /* Styles pour la vue Gestion des utilisateurs */
    .user-management-view {
        display: none;
    }

    .user-management-view.active {
        display: block;
    }

    .user-management-toolbar {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
        align-items: center;
        flex-wrap: wrap;
    }

    .user-table {
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        overflow: hidden;
    }

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

    .user-table th {
        background: #f5f7fa;
        padding: 14px 16px;
        text-align: left;
        font-weight: 600;
        color: #333;
        font-size: 13px;
        border-bottom: 2px solid #e0e0e0;
    }

    .user-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
    }

    .user-table tr:hover {
        background: #f9f9f9;
    }

    .user-role-badge {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .user-role-badge.admin {
        background: #fee;
        color: #c00;
    }

    .user-role-badge.auditor {
        background: #e3f2fd;
        color: #1976d2;
    }

    .user-role-badge.consultant {
        background: #fff3e0;
        color: #f57c00;
    }

    .user-role-badge.viewer {
        background: #e8f5e9;
        color: #388e3c;
    }

    .user-action-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 10px;
        border-radius: 4px;
        font-size: 13px;
        transition: all 0.2s;
    }

    .user-action-btn.edit {
        color: #5994B8;
    }

    .user-action-btn.edit:hover {
        background: #e8f4fc;
    }

    .user-action-btn.delete {
        color: #dc3545;
    }

    .user-action-btn.delete:hover {
        background: #fee;
    }

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

    .user-modal h3 {
        margin-bottom: 20px;
        color: #333;
    }

    .user-form-group {
        margin-bottom: 15px;
    }

    .user-form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        color: #555;
        font-size: 14px;
    }

    .user-form-group input,
    .user-form-group select {
        width: 100%;
        padding: 10px 12px;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 14px;
    }

    .user-form-group input:focus,
    .user-form-group select:focus {
        outline: none;
        border-color: #5994B8;
    }

    .user-form-group .checkbox-wrapper {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .user-form-group .checkbox-wrapper input {
        width: auto;
    }

    .rights-checkboxes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 5px;
    }

    .rights-checkboxes label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 400;
        font-size: 13px;
    }

    .rights-checkboxes input {
        width: auto;
    }

    /* Onglets principaux */
    .tab-btn {
        background: transparent !important;
        color: #333 !important;
        border: 1px solid #ccc !important;
        padding: 8px 20px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        border-radius: 6px !important;
        cursor: pointer;
        transition: all 0.2s;
    }
    .tab-btn:hover {
        background: #e0e0e0 !important;
    }
    .tab-btn.active {
        background: #0e1c2e !important;
        color: white !important;
        border-color: #0e1c2e !important;
    }

    /* Sous-onglets */
    .sub-tab-btn {
        background: transparent !important;
        color: #555 !important;
        border: none !important;
        padding: 6px 14px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        border-radius: 4px !important;
        cursor: pointer;
        transition: all 0.2s;
    }
    .sub-tab-btn:hover {
        background: #e0e0e0 !important;
    }
    .sub-tab-btn.active {
        background: #0e1c2e !important;
        color: white !important;
    }

    /* Cellules déposables des colonnes de fichiers */
    .drop-cell {
        position: relative;
        min-height: 40px;
        cursor: pointer;
        transition: background 0.2s, border 0.2s;
    }
    .drop-cell:hover {
        background: #f0f7fc;
    }
    .drop-cell::after {
        content: '+\A Déposer / insérer un fichier';
        white-space: pre;
        display: none;
        position: absolute;
        inset: 0;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 11px;
        color: #5994B8;
        background: rgba(240, 247, 252, 0.9);
        border: 2px dashed #5994B8;
        pointer-events: none;
    }
    .drop-cell:hover::after,
    .drop-cell.drag-over::after {
        display: flex;
    }
    .drop-cell.drag-over {
        background: #e8f4fc;
    }
