* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1d2733;
}

#app {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ---------- Sidebar ---------- */
#sidebar {
    width: 320px;
    flex: 0 0 320px;
    background: #f7f9fb;
    border-right: 1px solid #dfe4ea;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar header {
    padding: 16px 16px 8px;
    border-bottom: 1px solid #e6eaef;
    background: #1d3557;
    color: #fff;
}

#sidebar h1 {
    font-size: 18px;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    margin: 2px 0 8px;
    font-size: 12px;
    opacity: .8;
}

.count {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, .15);
    padding: 6px 8px;
    border-radius: 6px;
}

.filters {
    padding: 12px 16px;
    flex: 1;
}

.field { margin-bottom: 14px; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #5a6b7b;
    margin-bottom: 4px;
}

input[type="search"], select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfd6de;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

input[type="search"]:focus, select:focus {
    outline: none;
    border-color: #1d3557;
    box-shadow: 0 0 0 2px rgba(29, 53, 87, .15);
}

fieldset {
    border: 1px solid #e0e6ec;
    border-radius: 8px;
    margin: 0 0 14px;
    padding: 8px 10px 10px;
}

legend {
    font-size: 12px;
    font-weight: 700;
    color: #1d3557;
    padding: 0 4px;
}

.checks { display: flex; flex-direction: column; gap: 4px; }

.checks label {
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 13px;
    color: #1d2733;
    margin: 0;
    cursor: pointer;
}

.checks input { margin: 0; }

.hint {
    font-size: 11px;
    color: #8a98a6;
    margin: 6px 2px 0;
    line-height: 1.3;
}

.swatch {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .25);
    flex: 0 0 auto;
}

.tag {
    margin-left: auto;
    font-size: 11px;
    color: #8a98a6;
    font-variant-numeric: tabular-nums;
}

#reset {
    width: 100%;
    padding: 9px;
    border: 1px solid #1d3557;
    background: #fff;
    color: #1d3557;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

#reset:hover { background: #1d3557; color: #fff; }

#sidebar footer {
    padding: 10px 16px;
    font-size: 11px;
    color: #7b8794;
    border-top: 1px solid #e6eaef;
}

#sidebar footer a { color: #1d3557; }

/* ---------- Map ---------- */
#map { flex: 1; height: 100%; }

/* ---------- Popup ---------- */
.popup h3 { margin: 0 0 4px; font-size: 15px; color: #1d3557; }
.popup .meta { font-size: 12px; color: #5a6b7b; margin-bottom: 6px; }
.popup .row { font-size: 13px; margin: 2px 0; }
.popup a { color: #1d3557; }
.popup .badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
}
.badge.ouvert { background: #d8f3dc; color: #1b4332; }
.badge.fermer { background: #ffe5d9; color: #9d0208; }
.popup .uai { color: #97a3af; font-size: 11px; margin-top: 6px; }

/* ---------- Legend ---------- */
.legend {
    position: absolute;
    bottom: 18px;
    right: 12px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    z-index: 1000;
}
.legend .row { display: flex; align-items: center; gap: 7px; margin: 2px 0; }

/* Sélecteur de coloration des marqueurs (Type / DPE) en tête de légende */
.legend-mode {
    display: flex; gap: 12px; margin-bottom: 6px;
    padding-bottom: 6px; border-bottom: 1px solid #eef2f6;
}
.legend-mode label { display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* Légende de densité IRIS (contrôle Leaflet, pas en position absolue) */
.iris-legend { position: static; margin: 0 0 10px 10px; max-width: 240px; }
.iris-legend .swatch { border-radius: 2px; }
.iris-mode { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #e6eaef; }
.iris-mode label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; cursor: pointer; text-transform: none; letter-spacing: 0; color: #1d2733; margin: 0; }
.iris-mode input { margin: 0; }

/* Infobulle IRIS */
.iris-popup h3 { margin: 0 0 4px; font-size: 15px; color: #0f4395; }
.iris-popup .meta { font-size: 12px; color: #5a6b7b; margin-bottom: 6px; }
.iris-popup .row { font-size: 13px; margin: 2px 0; }
.iris-popup .uai { color: #97a3af; font-size: 11px; margin-top: 6px; }

/* Marqueur carré (établissements privés) */
.sq-marker { background: transparent; border: none; }
.sq-marker span {
    display: block;
    width: 10px;
    height: 10px;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .3);
}

/* Bouton « Me localiser » */
.locate-ctrl a {
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

/* Message d'aide couche IRIS */
.iris-hint {
    background: rgba(15, 67, 149, .92);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

/* ---------- Bouton fiche dans la popup ---------- */
.popup-fiche {
    margin-top: 10px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    background: #1d3557;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
.popup-fiche:hover { background: #16294a; }

/* ---------- Fiche plein écran (overlay) ---------- */
.fiche {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: #eef2f6;
}
.fiche[hidden] { display: none; }

.fiche-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 20px;
    background: #1d3557;
    color: #fff;
    flex: 0 0 auto;
}

.fiche-back {
    flex: 0 0 auto;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, .55);
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    transition: background .12s, transform .12s;
}
.fiche-back:hover { background: #fff; color: #1d3557; }
.fiche-back:active { transform: translateY(1px); }

.fiche-title { min-width: 0; }
.fiche-title h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fiche-sub { font-size: 13px; opacity: .8; }

/* Onglets */
.fiche-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #dfe4ea;
    flex: 0 0 auto;
}
.fiche-tab {
    padding: 13px 18px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #5a6b7b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.fiche-tab:hover { color: #1d3557; }
.fiche-tab.active { color: #1d3557; border-bottom-color: #1d3557; }

/* Corps + panneaux */
.fiche-body { flex: 1; overflow-y: auto; padding: 20px; }
.tab-panel { display: none; max-width: 1100px; margin: 0 auto; }
.tab-panel.active { display: block; }

.tab-actions { margin-bottom: 16px; }

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #1d3557;
}
.btn-primary { background: #1d3557; color: #fff; }
.btn-primary:hover { background: #16294a; }
.btn-secondary { background: #fff; color: #1d3557; }
.btn-secondary:hover { background: #1d3557; color: #fff; }

/* Informations */
/* Deux colonnes : infos à gauche, commentaires à droite. */
.info-cols { display: flex; gap: 16px; align-items: flex-start; }
.info-main { flex: 2 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.info-side { flex: 1 1 340px; min-width: 300px; max-width: 460px; }
.info-side .comments-block { position: sticky; top: 0; }
@media (max-width: 880px) {
    .info-cols { flex-direction: column; }
    .info-side { max-width: none; width: 100%; }
    .info-side .comments-block { position: static; }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.info-card {
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    padding: 16px 18px;
}
.info-card h3 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #1d3557;
}
.info-card dl { margin: 0; }
.info-row {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    border-top: 1px solid #f0f3f6;
    font-size: 14px;
}
.info-row:first-child { border-top: none; }
.info-row dt { flex: 0 0 130px; color: #7b8794; font-weight: 600; }
.info-row dd { margin: 0; flex: 1; word-break: break-word; }
.info-row a { color: #1d3557; }
.info-row .badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
}
.info-row .badge.ouvert { background: #d8f3dc; color: #1b4332; }
.info-row .badge.fermer { background: #ffe5d9; color: #9d0208; }

/* Gestion documentaire */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    margin-bottom: 8px;
}
.doc-icon { font-size: 18px; }
.doc-name { flex: 1; color: #1d3557; font-weight: 500; text-decoration: none; }
.doc-name:hover { text-decoration: underline; }
.doc-size { font-size: 12px; color: #8a98a6; font-variant-numeric: tabular-nums; }
.doc-del, .photo-del {
    border: none;
    background: #f0f3f6;
    color: #9d0208;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 13px;
    flex: 0 0 auto;
}
.doc-del:hover, .photo-del:hover { background: #ffe5d9; }

.empty { color: #8a98a6; font-style: italic; padding: 8px 2px; }

/* Photothèque */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}
.photo-item {
    position: relative;
    margin: 0;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    overflow: hidden;
}
.photo-item img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    cursor: zoom-in;
}
.photo-item figcaption {
    padding: 7px 10px;
    font-size: 12px;
    color: #5a6b7b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-del {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, .9);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, .85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: zoom-out;
    padding: 30px;
}
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 6px; }
.lightbox .lb-cap { color: #fff; font-size: 14px; }

/* ---------- Onglet Documents : arbre + éléments ---------- */
.docs-layout { display: flex; gap: 18px; align-items: flex-start; }
.folder-tree {
    flex: 0 0 260px;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    padding: 10px;
    max-height: 70vh;
    overflow: auto;
}
.folder-items { flex: 1; min-width: 0; }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; }
.tree-folder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.tree-folder:hover { background: #eef2f6; }
.tree-folder.active { background: #1d3557; color: #fff; }
.tree-count {
    margin-left: auto;
    font-size: 11px;
    background: #e0e6ec;
    color: #1d3557;
    border-radius: 10px;
    padding: 0 7px;
    font-variant-numeric: tabular-nums;
}
.tree-folder.active .tree-count { background: rgba(255, 255, 255, .25); color: #fff; }

.item-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
}
.item-icon { font-size: 18px; }
.item-name { flex: 1; color: #1d3557; font-weight: 500; text-decoration: none; word-break: break-word; }
.item-name:hover { text-decoration: underline; }
.item-size { font-size: 12px; color: #8a98a6; font-variant-numeric: tabular-nums; }

.item-photo {
    margin: 0;
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    overflow: hidden;
}
.item-photo img { display: block; width: 100%; height: 140px; object-fit: cover; cursor: zoom-in; }
.item-photo figcaption {
    padding: 7px 10px; font-size: 12px; color: #5a6b7b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Bloc effectifs */
.effectifs-block { margin-top: 16px; max-width: 640px; }
.eff-latest { font-size: 14px; color: #1d2733; margin-bottom: 8px; }
.eff-num { font-size: 26px; font-weight: 700; color: #1d3557; }
.eff-year { color: #8a98a6; font-size: 13px; }
.eff-spark { width: 100%; height: auto; display: block; }
.eff-axis { font-size: 12px; fill: #8a98a6; }
.eff-evol { font-size: 13px; font-weight: 600; margin-top: 4px; }
.eff-evol.up { color: #1b7a44; }
.eff-evol.down { color: #c1121f; }
.eff-evol.flat { color: #5a6b7b; }
.eff-sub { font-size: 14px; color: #2a9d8f; margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid #eef2f6; }
.eff-sub.pop-sub { color: #577590; }

/* Effectifs et IPS côte à côte (repli en colonne quand c'est étroit). */
.eff-ips-row { display: flex; gap: 16px; flex-wrap: wrap; }
.eff-ips-row > .info-card { flex: 1 1 320px; min-width: 0; }
.ips-legend { display: flex; gap: 16px; font-size: 12px; margin: 2px 0 8px; color: #5a6b7a; }
.ips-k { display: inline-flex; align-items: center; gap: 6px; }
.ips-k::before { content: ''; display: inline-block; width: 16px; border-top: 3px solid; }
.ips-k-etab::before { border-color: #9d4edd; }
.ips-k-dep::before { border-color: #b08968; border-top-style: dashed; }
.ips-note, .pop-note { font-size: 11px; color: #8a98a6; margin: 4px 0 0; font-style: italic; }

/* ---------- DPE (performance énergétique, ADEME) ---------- */
.dpe-block { margin-top: 16px; max-width: 640px; }
.dpe-list { list-style: none; margin: 0; padding: 0; }
.dpe-item { padding: 8px 0; border-top: 1px solid #eef2f6; }
.dpe-item:first-child { border-top: none; padding-top: 0; }
.dpe-badges { display: flex; gap: 8px; margin-bottom: 4px; }
.dpe-badge {
    display: inline-flex; align-items: baseline; gap: 5px;
    font-size: 15px; font-weight: 700; color: #fff;
    padding: 3px 10px; border-radius: 6px; line-height: 1.1;
}
.dpe-badge .dpe-k {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .03em; opacity: .85;
}
/* Échelle officielle A (sobre, vert) → G (énergivore, rouge) */
.dpe-badge.dpe-a { background: #319834; }
.dpe-badge.dpe-b { background: #33cc31; }
.dpe-badge.dpe-c { background: #cbfc34; color: #1d2733; }
.dpe-badge.dpe-d { background: #fbfe06; color: #1d2733; }
.dpe-badge.dpe-e { background: #fbcc05; color: #1d2733; }
.dpe-badge.dpe-f { background: #fc8104; }
.dpe-badge.dpe-g { background: #fc0205; }
.dpe-badge.dpe-na { background: #b8c2cc; color: #1d2733; }
.dpe-metaline { font-size: 13px; color: #1d2733; }
.dpe-addr { font-size: 12px; color: #5a6b7b; margin-top: 2px; }
.dpe-dist { color: #97a3af; }
.dpe-dates { font-size: 12px; color: #8a98a6; margin-top: 2px; }
.dpe-note { font-size: 11px; color: #97a3af; margin: 10px 0 0; line-height: 1.4; }

/* ---------- Onglet « Proposer » ---------- */
.propose-form { max-width: 620px; }
.propose-intro { font-size: 14px; color: #5a6b7b; margin: 0 0 16px; }
.radio-row { display: flex; gap: 18px; }
.radio-row label {
    display: flex; align-items: center; gap: 6px;
    text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; color: #1d2733; cursor: pointer;
}
.field-2 { display: flex; gap: 14px; }
.field-2 .field { flex: 1; }
.field .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: #8a98a6; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="file"] {
    width: 100%; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 6px; font-size: 14px; background: #fff;
}
.propose-msg { font-size: 14px; margin: 12px 0 0; }
.propose-msg.ok { color: #1b7a44; }
.propose-msg.err { color: #9d0208; }

/* ---------- Boutons additionnels ---------- */
.btn-danger {
    display: inline-block; padding: 9px 16px; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: 1px solid #c1121f; background: #fff; color: #c1121f;
}
.btn-danger:hover { background: #c1121f; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.badge {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 1px 8px; border-radius: 10px; background: #e0e6ec; color: #1d3557;
}
.badge.ouvert { background: #d8f3dc; color: #1b4332; }
.badge.fermer { background: #ffe5d9; color: #9d0208; }

/* ---------- Page d'administration ---------- */
.admin-page { background: #eef2f6; }
.admin-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; background: #1d3557; color: #fff;
}
.admin-bar h1 { margin: 0; font-size: 20px; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.admin-user a { text-decoration: none; }

.admin-main, .login-card { max-width: 980px; margin: 22px auto; padding: 0 16px; }
.admin-section {
    background: #fff; border: 1px solid #dfe4ea; border-radius: 12px;
    padding: 18px 20px; margin-bottom: 20px;
}
.admin-section h2 { margin: 0 0 6px; font-size: 17px; color: #1d3557; }
.login-card { max-width: 420px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 160px; }

/* File de validation */
.queue { display: flex; flex-direction: column; gap: 12px; }
.q-item {
    display: flex; gap: 14px; justify-content: space-between;
    border: 1px solid #dfe4ea; border-radius: 10px; padding: 12px 14px; background: #fbfcfd;
}
.q-main { min-width: 0; }
.q-title { font-weight: 600; font-size: 15px; color: #1d3557; }
.q-meta { font-size: 12px; color: #7b8794; margin-top: 2px; }
.q-preview { margin-top: 6px; font-size: 13px; }
.q-preview a { color: #1d3557; }
.q-thumb { max-height: 70px; border-radius: 6px; margin-top: 4px; }
.q-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* Arborescence admin */
.folders-admin .fa-row {
    display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px;
}
.folders-admin .fa-row:hover { background: #eef2f6; }
.fa-name { font-size: 14px; }
.fa-rename, .fa-del {
    border: none; background: none; cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 5px;
}
.fa-rename:hover { background: #e0e6ec; }
.fa-del:hover { background: #ffe5d9; }

/* Admins de périmètre */
.users-admin { display: flex; flex-direction: column; gap: 12px; }
.user-card { border: 1px solid #dfe4ea; border-radius: 10px; padding: 12px 14px; }
.user-head { display: flex; align-items: center; gap: 10px; }
.user-actions { margin-left: auto; display: flex; gap: 6px; }
.user-scopes { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #eef2f6; border: 1px solid #dfe4ea; border-radius: 14px; padding: 2px 6px 2px 10px; font-size: 12px;
}
.chip-x { border: none; background: none; color: #9d0208; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.scope-editor { position: relative; margin-top: 8px; max-width: 360px; }
.scope-results {
    display: flex; flex-direction: column;
    border: 1px solid #dfe4ea; border-radius: 8px; margin-top: 4px; overflow: hidden; background: #fff;
}
.scope-results:empty { display: none; }
.scope-result {
    text-align: left; border: none; background: #fff; padding: 7px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f3f6;
}
.scope-result:hover { background: #eef2f6; }
.muted { color: #8a98a6; font-size: 12px; }

.badge.warn { background: #fff4e5; color: #9a5b00; border: 1px solid #ffd8a8; }
.user-email { margin: 4px 0; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.inline-check input { width: auto; flex: none; min-width: 0; }
.group-members { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.group-members select { padding: 4px 8px; font-size: 13px; }

/* ---------- Commentaires de fiche ---------- */
.comments-block .comment-thread { max-width: 760px; }
.comment-intro { color: #5a6b7a; font-size: 14px; margin: 0 0 14px; }
.comment-login { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.comment-login input { width: auto; flex: 1; min-width: 160px; }
.comment-form { margin-bottom: 18px; }
.comment-form textarea {
    width: 100%; box-sizing: border-box; resize: vertical; padding: 10px;
    border: 1px solid #dfe4ea; border-radius: 8px; font: inherit;
}
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.comment-who { color: #5a6b7a; font-size: 13px; }
.comment-msg { font-size: 13px; }
.comment-msg.err { color: #9d0208; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment-item { border: 1px solid #e6ebf0; border-radius: 10px; padding: 10px 12px; background: #fbfcfd; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.comment-author { font-weight: 600; color: #1d3557; }
.comment-date { color: #8a98a6; font-size: 12px; }
.comment-del { margin-left: auto; border: none; background: none; cursor: pointer; font-size: 14px; opacity: 0.6; }
.comment-del:hover { opacity: 1; }
.comment-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45; }
.comment-forgot { font-size: 12px; margin: 6px 0 0; }

/* ---------- Cartes documents (onglet Documents) ---------- */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-card { border: 1px solid #e6ebf0; border-radius: 10px; padding: 10px 12px; background: #fff; }
.doc-name { font-size: 14px; font-weight: 600; color: #1d3557; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.doc-name .item-name { font-weight: 600; }
.doc-thumb { margin: 0 0 6px; max-width: 220px; }
.doc-thumb img { width: 100%; border-radius: 6px; display: block; cursor: zoom-in; }
.item-desc { font-size: 13px; color: #475663; margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.doc-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.item-date { font-size: 12px; color: #8a98a6; }
.doc-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.doc-edit, .comment-toggle {
    border: 1px solid #dfe4ea; background: #f4f7fa; border-radius: 6px;
    padding: 3px 9px; font-size: 12px; cursor: pointer; color: #1d3557;
}
.doc-edit:hover, .comment-toggle:hover { background: #e9eff5; }
.comment-toggle.open { background: #1d3557; color: #fff; border-color: #1d3557; }
.doc-edit-box { margin-top: 10px; }
.doc-edit-form { display: flex; flex-direction: column; gap: 8px; }
.doc-edit-form input, .doc-edit-form textarea {
    width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid #dfe4ea; border-radius: 8px; font: inherit;
}
.doc-edit-actions { display: flex; align-items: center; gap: 10px; }
.doc-thread { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e1e7ee; }
.photo-date { color: #8a98a6; font-size: 11px; }
.q-desc { font-size: 13px; color: #475663; margin: 2px 0 4px; white-space: pre-wrap; }

/* ---------- Pages d'authentification (forgot / reset / account) ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #eef2f6; }
.auth-card {
    width: 100%; max-width: 420px; background: #fff; border: 1px solid #e1e7ee;
    border-radius: 12px; padding: 26px 26px 20px; box-shadow: 0 6px 24px rgba(20, 40, 60, 0.08);
}
.auth-card h1 { font-size: 20px; margin: 0 0 12px; color: #1d3557; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-primary { width: 100%; }
.auth-foot { margin-top: 16px; font-size: 13px; text-align: center; }
.forced-banner {
    background: #fff4e5; border: 1px solid #ffd8a8; color: #9a5b00;
    border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

/* ---------- Jauge de robustesse de mot de passe ---------- */
.pw-meter { margin-top: 8px; }
.pw-bar { height: 6px; background: #e6ebf0; border-radius: 4px; overflow: hidden; }
.pw-bar-fill { display: block; height: 100%; transition: width 0.2s; background: #fc8104; }
.pw-bar-fill.lvl-0, .pw-bar-fill.lvl-1 { background: #fc0205; }
.pw-bar-fill.lvl-2 { background: #fbcc05; }
.pw-bar-fill.lvl-3 { background: #93d04f; }
.pw-bar-fill.lvl-4 { background: #319834; }
.pw-label { font-size: 12px; color: #5a6b7a; margin-top: 3px; }
.pw-crit { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; }
.pw-crit li { padding-left: 18px; position: relative; color: #9d0208; }
.pw-crit li.ok { color: #1b7a44; }
.pw-crit li::before { content: '✗'; position: absolute; left: 0; }
.pw-crit li.ok::before { content: '✓'; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    #app { flex-direction: column; }
    #sidebar { width: 100%; flex: 0 0 auto; max-height: 45vh; }
    #map { height: 55vh; }

    .fiche-bar { gap: 12px; padding: 10px 14px; }
    .fiche-back { padding: 10px 14px; font-size: 14px; }
    .fiche-title h2 { font-size: 16px; }
    .fiche-tabs { padding: 0 8px; overflow-x: auto; }
    .fiche-tab { padding: 12px 12px; white-space: nowrap; }
    .info-row dt { flex-basis: 100px; }
}
