/* Nidoo : feuille de style commune (palette verte de la charte graphique, CDC section 18) */

/* Police Lato (licence SIL OFL, voir public/fonts/lato/OFL.txt), hébergée sur le site : aucune requête vers un service tiers */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lato/Lato-Regular.ttf") format("truetype"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/lato/Lato-Italic.ttf") format("truetype"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lato/Lato-Bold.ttf") format("truetype"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/lato/Lato-BoldItalic.ttf") format("truetype"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 800 900; font-display: swap; src: url("../fonts/lato/Lato-Black.ttf") format("truetype"); }

:root {
    --vert-foret: #1B4C38;
    --vert-sauge: #447854;
    --vert-tendre: #A4C586;
    --tilleul: #CBD182;
    --sable: #F8F7F0;
    --sable-fonce: #EFEDE0;
    --caramel: #CDAF82;
    --lien: #386647;
    --brique: #B3392B;
    --blanc: #FFFFFF;
    --texte: #1B4C38;
    --texte-doux: #3F5F50;
    --bord: #DAD7C5;
    --rayon: 12px;
    --ombre: 0 1px 2px rgba(27, 76, 56, .08), 0 4px 12px rgba(27, 76, 56, .06);
    --police: "Lato", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --hauteur-entete: 60px;
    --rouge-automne: #9E2A1D;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--police);
    font-size: 16px;
    line-height: 1.5;
    color: var(--texte);
    background: var(--sable);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--lien); }
a:hover { color: var(--vert-foret); }
:focus-visible { outline: 3px solid var(--tilleul); outline-offset: 2px; }

.icone { width: 1.5em; height: 1.5em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barre supérieure ---------- */
.entete {
    height: var(--hauteur-entete);
    background: var(--vert-foret);
    color: var(--blanc);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.entete a { color: inherit; text-decoration: none; }
.marque { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; }
.marque img { height: 38px; width: auto; display: block; }
.entete .espace { flex: 1; }
.entete .utilisateur { font-size: .95rem; opacity: .95; }

/* ---------- Boutons ---------- */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 8px 18px;
    border: 0; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 700; text-decoration: none;
    background: var(--vert-foret); color: var(--blanc);
}
.bouton:hover { background: var(--vert-sauge); color: var(--blanc); }
.bouton--secondaire { background: var(--caramel); color: var(--vert-foret); }
.bouton--secondaire:hover { background: #D8BF98; color: var(--vert-foret); }
.bouton--discret { background: transparent; color: inherit; padding: 8px; border-radius: 8px; }
.bouton--discret:hover { background: rgba(255, 255, 255, .15); color: inherit; }

/* ---------- Contenu ---------- */
.conteneur { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.carte { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre); }
.pastille { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--tilleul); color: var(--vert-foret); font-size: .85rem; font-weight: 700; }
.pastille--brique { background: var(--brique); color: var(--blanc); }
.pastille--tendre { background: var(--vert-tendre); }
.accueil { text-align: center; padding: 56px 16px; }
.accueil img { width: 220px; max-width: 60%; height: auto; margin-bottom: 8px; }
.accueil .liens { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Tuiles (invité et famille) ---------- */
.tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0; }
@media (min-width: 720px) { .tuiles { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1100px) { .tuiles { grid-template-columns: repeat(4, 1fr); } }

.tuile {
    position: relative;
    display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
    min-height: 130px; padding: 16px;
    border-radius: var(--rayon);
    text-decoration: none; font-weight: 800; font-size: 1.1rem; line-height: 1.25;
    box-shadow: var(--ombre);
    transition: transform .12s ease;
}
.tuile:hover { transform: translateY(-2px); }
.tuile .icone { width: 2em; height: 2em; }
.tuile .pastille { position: absolute; top: 12px; right: 12px; }
.tuile--sauge { background: var(--vert-sauge); color: var(--blanc); }
.tuile--sauge:hover { color: var(--blanc); }
.tuile--tendre { background: var(--vert-tendre); color: var(--vert-foret); }
.tuile--tilleul { background: var(--tilleul); color: var(--vert-foret); }
.tuile--caramel { background: var(--caramel); color: var(--vert-foret); }
.tuile--tendre:hover, .tuile--tilleul:hover, .tuile--caramel:hover { color: var(--vert-foret); }

/* ---------- Interface de gestion : menu latéral à gauche ---------- */
.gestion { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - var(--hauteur-entete)); }
.menu {
    background: var(--sable-fonce);
    border-right: 1px solid var(--bord);
    padding: 16px 10px;
}
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--vert-foret); text-decoration: none; font-weight: 700;
}
.menu a:hover { background: rgba(68, 120, 84, .12); }
.menu a[aria-current="page"] { background: var(--vert-tendre); }
.menu .titre-groupe { margin: 14px 12px 4px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); font-weight: 800; }
.contenu { padding: 24px; min-width: 0; }
.contenu h1 { margin-bottom: .75em; }
.demande { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.demande strong { display: block; }
.bouton-menu { display: none; }
.voile { display: none; }

@media (max-width: 719.98px) {
    .gestion { grid-template-columns: minmax(0, 1fr); }
    .bouton-menu { display: inline-flex; }
    .menu {
        position: fixed; top: var(--hauteur-entete); bottom: 0; left: 0; z-index: 40;
        width: min(82vw, 300px);
        transform: translateX(-102%); transition: transform .2s ease;
        overflow-y: auto; box-shadow: var(--ombre);
    }
    body.menu-ouvert .menu { transform: translateX(0); }
    body.menu-ouvert .voile {
        display: block; position: fixed; inset: var(--hauteur-entete) 0 0 0; z-index: 35;
        background: rgba(27, 76, 56, .35);
    }
    .contenu { padding: 16px; }
}

/* ---------- Diagnostic ---------- */
.diag table { width: 100%; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; margin-bottom: 20px; }
.diag th, .diag td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.diag th { background: var(--sable-fonce); }
.diag td.detail { word-break: break-word; color: var(--texte-doux); }
.etat { font-weight: 800; white-space: nowrap; }
.etat--ok { color: var(--vert-sauge); }
.etat--warn { color: #8a6a1f; }
.etat--ko { color: var(--brique); }
.diag form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.diag input[type=email] { min-height: 44px; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 10px; font: inherit; min-width: 260px; }
.erreur { color: var(--brique); font-weight: 700; }

/* ---------- Formulaires et messages ---------- */
.boite-formulaire { max-width: 460px; margin: 24px auto; }
.formulaire { display: grid; gap: 14px; }
.champ { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.champ label, .champ legend { font-weight: 700; }
.champ input[type=text], .champ input[type=email], .champ input[type=password], .champ input[type=date], .champ input[type=number], .champ input[type=tel], .champ select {
    min-height: 44px; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 10px; font: inherit;
    background: var(--blanc); color: var(--texte); width: 100%;
}
.case { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; }
.case input { width: 22px; height: 22px; accent-color: var(--vert-sauge); }
.aide { color: var(--texte-doux); font-size: .92rem; margin: 0; }
.alerte { border-radius: var(--rayon); padding: 12px 16px; margin: 0 0 16px; border: 1px solid; }
.alerte ul { margin: 0; padding-left: 18px; }
.alerte--succes { background: #E7F2DE; border-color: var(--vert-tendre); }
.alerte--erreur { background: #FBEAE7; border-color: var(--brique); color: #7d251b; }
.bouton--petit { min-height: 36px; padding: 4px 14px; font-size: .92rem; }
.bouton--inactif { background: var(--sable-fonce); color: var(--texte-doux); cursor: default; }
.bouton--inactif:hover { background: var(--sable-fonce); color: var(--texte-doux); }
.bouton--lien { color: var(--vert-sauge); text-decoration: underline; }
.entete .formulaire-inline .bouton--discret { color: var(--blanc); }
.titre-avec-action { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.titre-avec-action h1 { margin: 0; }
.menu .separateur { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bord); }

/* ---------- Tableaux ---------- */
.defilement { overflow-x: auto; margin-bottom: 16px; }
.tableau { width: 100%; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--bord); }
.tableau th, .tableau td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau th { background: var(--sable-fonce); white-space: nowrap; }
.tableau td.detail { word-break: break-word; color: var(--texte-doux); font-size: .88rem; }
.actions { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.filtres { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filtres .champ { min-width: 160px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.pagination ul { list-style: none; display: flex; gap: 8px; align-items: center; margin: 0; padding: 0; }

/* ---------- Calendrier ---------- */
.navigation-mois { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.navigation-mois strong { font-size: 1.15rem; }
.calendrier { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; min-width: 320px; }
.calendrier th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); padding: 4px 0; }
.calendrier .jour {
    height: 54px; vertical-align: top; text-align: left; padding: 4px 6px;
    background: var(--blanc); border: 1px solid var(--bord); border-radius: 8px; position: relative; cursor: pointer;
}
.jour__numero { font-weight: 800; font-size: .95rem; }
.calendrier .jour--hors-mois { opacity: .45; }
.calendrier .jour--aujourdhui .jour__numero { background: var(--vert-foret); color: var(--blanc); border-radius: 999px; padding: 0 7px; }
.calendrier .jour--confirme { background: var(--vert-sauge); color: var(--blanc); border-color: var(--vert-sauge); }
.calendrier .jour--attente { background: repeating-linear-gradient(135deg, var(--vert-foret), var(--vert-foret) 6px, var(--blanc) 6px, var(--blanc) 12px); border-color: var(--vert-foret); }
.calendrier .jour--attente .jour__numero { background: var(--blanc); color: var(--vert-foret); border-radius: 6px; padding: 0 5px; }
.calendrier .jour--indisponible {
    background: repeating-linear-gradient(135deg, var(--sable-fonce), var(--sable-fonce) 6px, var(--caramel) 6px, var(--caramel) 9px);
    border-color: var(--caramel);
}
.calendrier .jour--moi, .calendrier .jour--moi.jour--attente { background: var(--tilleul); color: var(--vert-foret); border-color: var(--vert-sauge); }
.legende { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 14px 0 6px; font-size: .92rem; }
.legende li { display: flex; align-items: center; gap: 8px; }
.echantillon { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--bord); background: var(--blanc); }
.echantillon.jour--confirme { background: var(--vert-sauge); border-color: var(--vert-sauge); }
.echantillon.jour--attente { background: repeating-linear-gradient(135deg, var(--vert-foret), var(--vert-foret) 4px, var(--blanc) 4px, var(--blanc) 8px); border-color: var(--vert-foret); }
.echantillon.jour--indisponible { background: repeating-linear-gradient(135deg, var(--sable-fonce), var(--sable-fonce) 4px, var(--caramel) 4px, var(--caramel) 7px); border-color: var(--caramel); }
.echantillon.jour--moi { background: var(--tilleul); border-color: var(--vert-sauge); }

/* ---------- Demandes ---------- */
.onglets { display: flex; gap: 8px; margin: 0 0 14px; }
.onglets a { padding: 8px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; background: var(--sable-fonce); color: var(--vert-foret); }
.onglets a[aria-current="page"] { background: var(--vert-foret); color: var(--blanc); }
.avis { font-weight: 700; }
.avis--pour { color: var(--vert-sauge); }
.avis--contre { color: var(--brique); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.details dt { font-weight: 700; }
.details dd { margin: 0; }
@media (max-width: 719.98px) { .details { grid-template-columns: 1fr; gap: 0; } .details dd { margin-bottom: 8px; } }
.actions-vote, .actions-decision { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.actions-decision form { margin: 0; }
.commentaire { border-bottom: 1px solid var(--bord); padding: 6px 0 2px; margin-bottom: 8px; }
.commentaire p { margin: 4px 0 8px; white-space: pre-line; }
details.carte summary { cursor: pointer; font-weight: 700; }
.bouton--brique { background: var(--brique); color: var(--blanc); }
.bouton--brique:hover { background: #8f2c21; color: var(--blanc); }
.pastille--gris { background: var(--sable-fonce); color: var(--texte-doux); border: 1px solid var(--bord); }
.carte--lien { text-decoration: none; color: inherit; display: block; }
.carte--lien:hover { border-color: var(--vert-sauge); }
.champ--large { flex: 1 1 260px; }
.champ textarea { padding: 8px 12px; border: 1px solid var(--bord); border-radius: 10px; font: inherit; background: var(--blanc); color: var(--texte); width: 100%; resize: vertical; }

/* ---------- Invitations et espace invité ---------- */
.lien-invitation { width: 100%; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 10px; font: inherit; background: var(--blanc); }
.actions-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-ligne form { margin: 0; }
.champ--case label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.tuile--bientot { opacity: .6; cursor: default; position: relative; }
.tuile--bientot:hover { transform: none; }
.tuile--bientot small { font-size: .75rem; }
.aide--clair { color: var(--creme, #F8F7F0); }

/* ---------- Notifications ---------- */
.cloche { position: relative; display: inline-flex; align-items: center; padding: 6px; }
.cloche .icone { width: 1.5em; height: 1.5em; }
.cloche__nombre { position: absolute; top: -6px; right: -9px; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--rouge-automne); color: var(--blanc); font-size: .8rem; font-weight: 900; text-align: center; line-height: 22px; box-shadow: 0 0 0 2px var(--vert-foret); }
.notifications { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.notification form { margin: 0; }
.notification__bouton { width: 100%; display: grid; gap: 2px; text-align: left; padding: 10px 14px; background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px; font: inherit; color: inherit; cursor: pointer; }
.notification__bouton small { color: var(--texte-doux); }
.notification--nouvelle .notification__bouton { border-left: 5px solid var(--vert-sauge); background: #fbfbea; }

/* Petits écrans : le nom du compte est masqué dans la barre (il reste accessible via « Mon compte ») */
@media (max-width: 520px) {
    .entete .utilisateur { display: none; }
    /* Barre compacte : burger, logo, cloche et déconnexion tiennent sur 360 px */
    .entete { padding: 0 10px; gap: 6px; }
    .entete .bouton--discret { padding: 8px 6px; }
    .marque { gap: 6px; font-size: 1.1rem; }
    .titre-avec-action h1 { font-size: 1.5rem; }
}

/* ---------- Pastille rouge du menu ---------- */
.menu a .pastille-rouge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--brique); color: var(--blanc); font-size: .8rem; font-weight: 800; text-align: center; line-height: 22px; }

/* ---------- Vote : pouces ---------- */
.actions-vote { gap: 16px; }
.pouce { width: 76px; height: 76px; border-radius: 50%; border: 3px solid; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: var(--blanc); transition: transform .12s; }
.pouce:hover { transform: scale(1.06); }
.pouce .icone { width: 40px; height: 40px; stroke: none; fill: currentColor; }
.pouce--pour { color: #2E8B3D; border-color: #2E8B3D; }
.pouce--contre { color: var(--brique); border-color: var(--brique); }
.pouce--pour.pouce--choisi { background: #2E8B3D; color: var(--blanc); }
.pouce--contre.pouce--choisi { background: var(--brique); color: var(--blanc); }

/* ---------- Demande de séjour : formulaire et calendrier côte à côte ---------- */
.mise-en-page-calendrier { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 899.98px) { .mise-en-page-calendrier { grid-template-columns: 1fr; } }
.calendrier-lateral { padding: 12px; position: sticky; top: calc(var(--hauteur-entete) + 12px); }
.calendrier-lateral .navigation-mois { margin: 0 0 8px; gap: 6px; }
.calendrier-lateral .navigation-mois strong { font-size: .95rem; text-align: center; }
.calendrier-lateral .navigation-mois .bouton { padding: 2px 10px; min-height: 30px; }
.calendrier-lateral .defilement { margin: 0; overflow: visible; }
.calendrier-lateral .calendrier { min-width: 0; border-spacing: 2px; }
.calendrier-lateral .calendrier th { font-size: .66rem; padding: 2px 0; }
.calendrier-lateral .calendrier .jour { height: 34px; padding: 2px 4px; border-radius: 6px; }
.calendrier-lateral .jour__numero { font-size: .78rem; }
.calendrier-lateral .legende { gap: 4px 12px; font-size: .78rem; margin: 10px 0 0; }
.calendrier-lateral .echantillon { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- Sélecteur de date ---------- */
.datepicker { position: relative; }
.datepicker__champ { display: flex; gap: 6px; }
.datepicker__champ input { flex: 1; min-width: 0; }
.datepicker__ouvrir { width: 44px; min-height: 44px; border: 1px solid var(--bord); border-radius: 10px; background: var(--blanc); color: var(--vert-foret); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.datepicker__ouvrir:hover { background: var(--sable-fonce); }
.datepicker__fenetre { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; width: 292px; max-width: calc(100vw - 32px); background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(27, 76, 56, .22); padding: 12px; }
.datepicker__fenetre[hidden] { display: none; }
.datepicker__entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 6px; }
.datepicker__entete strong { text-transform: capitalize; }
.datepicker__nav { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--sable-fonce); color: var(--vert-foret); font-size: 1.1rem; cursor: pointer; }
.datepicker__nav:hover { background: var(--vert-tendre); }
.datepicker__grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.datepicker__jour-nom { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--texte-doux); padding: 4px 0; }
.datepicker__jour { height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--texte); font: inherit; cursor: pointer; }
.datepicker__jour:hover:not(:disabled) { background: var(--vert-tendre); }
.datepicker__jour--hors { color: #667369; }
.datepicker__jour--aujourdhui { box-shadow: inset 0 0 0 2px var(--vert-sauge); }
.datepicker__jour--choisi, .datepicker__jour--choisi:hover { background: var(--vert-foret) !important; color: var(--blanc); }
.datepicker__jour:disabled { color: #c3c9c5; cursor: not-allowed; text-decoration: line-through; }
.datepicker__pied { display: flex; justify-content: space-between; margin-top: 8px; }
.datepicker__pied button { border: 0; background: none; color: var(--vert-sauge); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; }
.calendrier-lateral .nav-texte { display: none; }
.navigation-mois .bouton { white-space: nowrap; }

/* ---------- Vie du logement : carnet, guide, checklists, carte ---------- */
.texte-libre { white-space: pre-line; }
.rubrique h3 { margin-bottom: .3em; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.poi { margin-bottom: 0; scroll-margin-top: 130px; }
.poi--masque { opacity: .65; border-style: dashed; }
.poi__photo { width: 100%; max-height: 190px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.carte-osm { position: relative; overflow: hidden; border: 1px solid var(--bord); border-radius: var(--rayon); background: #dfe8da; touch-action: none; cursor: grab; margin-bottom: 6px; }
.carte-osm:active { cursor: grabbing; }
.carte-osm__couche { position: absolute; left: 0; top: 0; }
.carte-osm__tuile { position: absolute; width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; }
.carte-osm__repere { position: absolute; transform: translate(-50%, -100%); width: 26px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; font-size: 22px; line-height: 26px; text-align: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.carte-osm__repere--logement { font-size: 26px; }
.carte-osm__bulle { position: absolute; transform: translate(-50%, calc(-100% - 30px)); background: var(--blanc); color: var(--texte); border: 1px solid var(--bord); border-radius: 8px; padding: 6px 10px; font-size: .9rem; max-width: 220px; box-shadow: var(--ombre); z-index: 5; }
.carte-osm__zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 4px; z-index: 6; }
.carte-osm__zoom button { width: 34px; height: 34px; border: 1px solid var(--bord); border-radius: 8px; background: var(--blanc); color: var(--vert-foret); font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.carte-osm__mention { font-size: .78rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.checklist__ligne { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--blanc); }

.checklist__ligne--inactif { opacity: .6; }
.checklist__libelle { flex: 1 1 220px; }
.checklist__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 0 0 auto; margin: 0; }
.checklist__actions input[type=text] { flex: 1 1 180px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--bord); border-radius: 8px; font: inherit; }
.checklist__actions--large { flex: 1 1 360px; }

/* ---------- Pastilles de rôles ---------- */
.pastille--role-gestionnaire { background: var(--vert-foret); color: var(--blanc); }
.pastille--role-comptable { background: var(--caramel); color: var(--vert-foret); }
.pastille--role-famille { background: var(--vert-tendre); color: var(--vert-foret); }
.vote-fait { margin: 8px 0; padding: 10px 14px; background: var(--sable-fonce); border-radius: 10px; }

/* ---------- Livre d'or ---------- */
/* Livre d'or : avis en cartes */
.grille--avis { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.grille--avis .avis { margin: 0; }
.photos-avis { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.photos-avis img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); }
.photo-avis { display: grid; gap: 4px; }
.avis .texte-libre { font-style: italic; }

/* ---------- Menu d'administration : groupes dépliables ---------- */
.menu .menu__groupe summary {
    display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer;
    padding: 10px 12px; border-radius: 10px; color: var(--vert-foret); font-weight: 800;
}
.menu .menu__groupe summary::-webkit-details-marker { display: none; }
.menu .menu__groupe summary:hover { background: rgba(68, 120, 84, .12); }
.menu .menu__groupe summary > span:not(.pastille-rouge):not(.menu__chevron) { flex: 1; }
.menu__chevron { margin-left: auto; font-size: 1.3rem; line-height: 1; transition: transform .15s; }
.menu .menu__groupe[open] > summary .menu__chevron { transform: rotate(90deg); }
.menu .menu__groupe > ul { margin: 2px 0 6px 18px; padding-left: 8px; border-left: 2px solid var(--bord); }
.menu .menu__groupe > ul a { padding: 8px 10px; font-weight: 600; }
/* Pastille du titre : visible seulement quand le groupe est replié (sinon elle est sur l'entrée concernée) */
.menu .menu__groupe summary .pastille-rouge--groupe { margin-left: auto; }
.menu .menu__groupe summary .pastille-rouge--groupe + .menu__chevron { margin-left: 8px; }
.menu .menu__groupe[open] > summary .pastille-rouge--groupe { display: none; }
.menu .menu__groupe[open] > summary .pastille-rouge--groupe + .menu__chevron { margin-left: auto; }
.menu summary .pastille-rouge { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--brique); color: var(--blanc); font-size: .8rem; font-weight: 800; text-align: center; line-height: 22px; }

/* ---------- SCI ---------- */
.carte--ok { border-color: var(--vert-sauge); background: #eef6e6; }
.carte--ko { border-color: var(--brique); background: #fbeae7; }
.graphe-bloc { margin: 0; }
.graphe-bloc figcaption { font-weight: 800; margin-bottom: 6px; }
.graphe { width: 100%; height: auto; }
.graphe__grille { stroke: var(--bord); stroke-width: 1; }
.graphe__zero { stroke: var(--texte-doux); stroke-width: 1.2; }
.graphe__axe { font-size: 15px; fill: var(--texte-doux); font-family: var(--police); }
.ligne-annulee td { opacity: .55; text-decoration: line-through; }
.ligne-annulee td .pastille, .ligne-annulee td .aide { text-decoration: none; }
.montant { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.montant--negatif { color: var(--brique); }
.reste-du { color: var(--brique); }

/* ---------- Pied de page ---------- */
.pied { text-align: center; padding: 18px 16px 24px; font-size: .85rem; color: var(--texte-doux); }
.pied a { color: var(--texte-doux); }

/* ---------- Ajustements de recette ---------- */
h2:not(:first-child) { padding-top: 1rem; }
.calendrier .jour--moi.jour--attente, .calendrier .jour--moi.jour--attente:hover {
    background: repeating-linear-gradient(135deg, var(--tilleul), var(--tilleul) 6px, var(--blanc) 6px, var(--blanc) 12px);
    border-color: var(--vert-sauge);
}
.calendrier .jour--moi.jour--attente .jour__numero { background: var(--tilleul); color: var(--vert-foret); border-radius: 6px; padding: 0 5px; }
.echantillon.jour--moi.jour--attente { background: repeating-linear-gradient(135deg, var(--tilleul), var(--tilleul) 4px, var(--blanc) 4px, var(--blanc) 8px); border-color: var(--vert-sauge); }
.calendrier .jour--selection { outline: 3px solid var(--vert-foret); outline-offset: -3px; }
.calendrier-detail { margin: 8px 0; padding: 8px 12px; background: var(--blanc); border: 1px solid var(--bord); border-left: 5px solid var(--vert-sauge); border-radius: 8px; font-weight: 700; }
.aide--tactile { display: none; }
@media (hover: none) { .aide--tactile { display: block; margin-top: 6px; } }

/* ---------- Listes déroulantes stylisées ---------- */
select {
    -webkit-appearance: none; appearance: none; min-height: 40px; padding: 6px 38px 6px 12px;
    border: 1px solid var(--bord); border-radius: 10px; font: inherit; color: var(--texte); cursor: pointer;
    background: var(--blanc) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B4C38' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center / 14px;
}
select:hover { border-color: var(--vert-sauge); }
select:focus-visible { border-color: var(--vert-foret); }
.champ select { min-height: 44px; }

/* ---------- Info-bulles d'aide (survol, focus ou toucher) ---------- */
.aide-bulle {
    display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px;
    border-radius: 50%; background: var(--vert-tendre); color: var(--vert-foret); font-size: .72rem; font-weight: 800;
    cursor: help; position: relative; vertical-align: middle; text-transform: none; letter-spacing: 0;
}
.aide-bulle::after {
    content: attr(data-aide); display: none; position: absolute; z-index: 60; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--vert-foret); color: var(--blanc);
    font-size: .85rem; font-weight: 400; line-height: 1.35; text-align: left; white-space: normal; box-shadow: var(--ombre);
}
.aide-bulle:hover::after, .aide-bulle:focus::after { display: block; }
th:first-child .aide-bulle::after { left: 0; transform: none; }
.defilement:has(.aide-bulle) { min-height: 200px; }

/* ---------- Tableaux à lignes modifiables ---------- */
.tableau--lignes td { vertical-align: middle; }
.champ-ligne { min-height: 38px; padding: 4px 10px; border: 1px solid var(--bord); border-radius: 8px; font: inherit; background: var(--blanc); color: var(--texte); width: 100%; min-width: 130px; }
.champ-couleur { width: 54px; height: 38px; padding: 2px; border: 1px solid var(--bord); border-radius: 8px; background: var(--blanc); cursor: pointer; }
.formulaire-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.statut-ligne { color: var(--vert-sauge); font-weight: 700; font-size: .9rem; }
.erreur-ligne { color: var(--brique); font-size: .9rem; font-weight: 700; margin-top: 4px; max-width: 280px; }
.erreur-ligne[hidden] { display: none; }
.ligne-modifiee td:first-child { box-shadow: inset 4px 0 0 var(--tilleul); }
.ligne-inactive { opacity: .6; }
input[type=date].champ-date-ligne, td > input[type=text] { max-width: 100%; }
td .datepicker { min-width: 170px; }
.pastille-categorie { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.legende-categories { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: .92rem; }

/* ---------- Fenêtres modales ---------- */
dialog.modale { border: 0; border-radius: var(--rayon); padding: 20px; width: min(540px, 94vw); max-height: 92vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); background: var(--sable); color: var(--texte); }
dialog.modale::backdrop { background: rgba(27, 76, 56, .55); }
dialog.modale h2 { padding-top: 0; margin-top: 0; }
dialog.modale .datepicker__fenetre { position: static; box-shadow: none; margin-top: 6px; width: 100%; max-width: 100%; }

/* ---------- Recette n°2 ---------- */

/* Menu d'administration fixe : seule la page défile */
@media (min-width: 720px) {
    .gestion .menu { position: sticky; top: var(--hauteur-entete); align-self: start; height: calc(100vh - var(--hauteur-entete)); overflow-y: auto; }
}


/* Historique : date et heure, action, acteur */
.historique { list-style: none; padding: 0; margin: 0 0 16px; }
.historique li { margin-bottom: 6px; padding: 6px 0; border-bottom: 1px solid var(--bord); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.historique__date { color: var(--texte-doux); font-variant-numeric: tabular-nums; min-width: 8.5em; }
.historique__acteur::before { content: "— "; color: var(--texte-doux); }

/* Carnet : catégories repliables, cartes compactes */
.categorie-pliable { margin: 18px 0 8px; }
.categorie-pliable > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 6px 4px; border-bottom: 2px solid var(--bord); }
.categorie-pliable > summary::-webkit-details-marker { display: none; }
.categorie-pliable > summary h2 { margin: 0; padding-top: 0; font-size: 1.15rem; flex: 1; }
.categorie-pliable__chevron { font-size: 1.5rem; line-height: 1; transition: transform .15s; color: var(--vert-sauge); }
.categorie-pliable[open] > summary .categorie-pliable__chevron { transform: rotate(90deg); }
.cartes-compactes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.carte-compacte { background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; font-size: .92rem; box-shadow: var(--ombre); }
.carte-compacte h3 { font-size: 1rem; margin: 0 0 4px; }
.carte-compacte .texte-libre { color: var(--texte); }

/* Dépôt de photo */
.libelle-champ { font-weight: 700; }
.champ-photo { border: 2px dashed var(--bord); border-radius: var(--rayon); padding: 12px; background: var(--blanc); display: grid; gap: 10px; }
.champ-photo__boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.champ-photo__apercu { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.champ-photo__apercu:empty { display: none; }
.champ-photo__apercu li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.champ-photo__apercu img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); }
.champ-photo__erreur { color: var(--brique); font-weight: 700; }
.champ-photo__erreur[hidden], .champ-photo[hidden] { display: none; }
.bouton--discret-sombre { background: transparent; color: var(--brique); border: 1px solid var(--brique); }

/* Tableaux à lignes modifiables au clic */
.cellule-cliquable { cursor: pointer; }
.cellule-cliquable:hover .lecture { text-decoration: underline dotted; }
.edition { display: none; }
.ligne--edition .lecture { display: none; }
.ligne--edition .edition { display: block; }
.ligne--edition .actions-ligne.edition { display: flex; }
.ligne--edition { background: #fbfbea; }
.tableau .edition input[type=text], .tableau .edition input[type=number], .datepicker__champ input {
    min-height: 40px; padding: 6px 12px; border: 1px solid var(--bord); border-radius: 10px; font: inherit; background: var(--blanc); color: var(--texte); width: 100%;
}
.tableau .edition input:focus, .datepicker__champ input:focus { border-color: var(--vert-sauge); outline: 3px solid var(--tilleul); outline-offset: 0; }
.tableau .edition input[type=text] { min-width: 220px; }
.ligne--edition td .datepicker { min-width: 175px; }

/* ---------- Message flottant ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 100; background: var(--vert-foret); color: var(--blanc); padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); transition: opacity .2s, transform .2s; max-width: 90vw; }
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Carnet (gestion) : titres de catégories réordonnables ---------- */
.titre-categorie { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.titre-categorie h2 { margin: 0; }
.titre-categorie form { margin: 0; }

/* Réorganisation par glisser-déposer, icônes d'action, édition au clic dans les listes */
.bouton--icone { min-height: 34px; width: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.bouton--icone .icone { width: 18px; height: 18px; }
.bouton--icone-danger { background: transparent; color: var(--brique); border: 1px solid transparent; }
.bouton--icone-danger:hover { background: var(--brique); color: var(--blanc); }
.outils-ligne { display: flex; align-items: center; gap: 6px; margin: 0; flex-shrink: 0; }
.outils-ligne form { margin: 0; }

.poignee { display: none; background: transparent; border: 0; padding: 6px; cursor: grab; color: var(--texte-doux); touch-action: none; border-radius: 8px; line-height: 0; flex-shrink: 0; }
.poignee:hover, .poignee:focus-visible { background: var(--sable-fonce); color: var(--vert-foret); }
.poignee .icone { width: 20px; height: 20px; }
.mode-reorganiser .poignee { display: inline-flex; }
.mode-reorganiser .poignee:active { cursor: grabbing; }

.aide--reorganiser { display: none; }
.aide--reorganiser.aide--visible { display: block; }

.liste-tri, .checklist { list-style: none; margin: 0; padding: 0; }
.liste-tri { min-height: 8px; }
.liste-tri:has(> [data-tri-item]) > .vide, .checklist:has(> [data-tri-item]) > .vide { display: none; }
.liste-tri > .vide, .checklist > .vide { padding: 10px 4px; }
.mode-reorganiser .liste-tri { min-height: 44px; border: 2px dashed var(--sable-fonce); border-radius: 10px; padding: 4px; }

.categorie-admin { margin-bottom: 16px; background: var(--blanc); border-radius: 12px; padding: 8px 14px 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.categorie-admin .titre-categorie { margin-top: 0; flex-wrap: nowrap; justify-content: flex-start; }
.categorie-admin .titre-categorie h2 { flex: 1; font-size: 1.15rem; }
.rubrique-admin, .checklist__ligne { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--sable-fonce); }
.rubrique-admin__texte { flex: 1; min-width: 0; }
.rubrique-admin__texte .resume { display: block; }

.checklist__edition { flex: 1; min-width: 0; margin: 0; }
.texte-cliquable { cursor: text; padding: 4px 6px; border-radius: 6px; display: inline-block; }
.texte-cliquable:hover, .texte-cliquable:focus-visible { background: #fbfbea; outline: 1px dashed var(--caramel); }
.mode-reorganiser .texte-cliquable { pointer-events: none; }
.checklist__ligne--inactif .lecture { color: var(--texte-doux); }
.ligne--edition .edition.edition--flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checklist__ligne.ligne--edition { background: #fbfbea; }

.tri-en-cours { opacity: .35; }
.tri-fantome { position: fixed; z-index: 200; pointer-events: none; background: var(--blanc); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); border-radius: 10px; opacity: .95; margin: 0; }
body.reorganisation { user-select: none; -webkit-user-select: none; }

/* Cases à cocher stylisées (toute l'application) */
input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin: 0; flex-shrink: 0; border: 2px solid var(--vert-sauge); border-radius: 6px; background: var(--blanc); cursor: pointer; position: relative; vertical-align: middle; transition: background .15s, border-color .15s; }
input[type="checkbox"]::after { content: ""; box-sizing: border-box; position: absolute; left: 50%; top: 50%; width: 7px; height: 12px; border: solid var(--blanc); border-width: 0 3px 3px 0; transform: translate(-50%, -62%) rotate(45deg) scale(0); transition: transform .12s; }
input[type="checkbox"]:checked { background: var(--vert-sauge); border-color: var(--vert-sauge); }
input[type="checkbox"]:checked::after { transform: translate(-50%, -62%) rotate(45deg) scale(1); }
input[type="checkbox"]:hover:not(:disabled) { border-color: var(--vert-foret); }
input[type="checkbox"]:focus-visible { outline: 3px solid var(--tilleul); outline-offset: 2px; }
input[type="checkbox"]:disabled { opacity: .55; cursor: default; }

/* Checklists des séjours : case au début, contour vert (fait) ou rouge (non effectué) */
.checklist__ligne--fait { border-width: 2px; border-color: var(--vert-tendre); background: #f4f9ee; }
.checklist__ligne--non-fait { border-width: 2px; border-color: var(--brique); background: #fbeae7; }
.checklist__coche { margin: 0; display: flex; align-items: center; }
.checklist__coche input { width: 26px; height: 26px; }
.checklist__coche input::after { width: 8px; height: 14px; }
.checklist__reset { margin: 0; }
.checklist__commentaire { flex: 1 1 100%; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.checklist__commentaire[hidden] { display: none; }
.checklist__commentaire input[type="text"] { flex: 1 1 220px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--bord); border-radius: 8px; font: inherit; }
.calendrier-detail__lien { margin-left: 8px; color: var(--vert-sauge); text-decoration: underline; }

/* Champ d'édition au clic (administration des checklists) */
.edition--flex input[type="text"] { flex: 1; min-width: 180px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--bord); border-radius: 8px; background: var(--blanc); font: inherit; color: var(--texte); box-shadow: inset 0 1px 2px rgba(27, 76, 56, .08); }
.edition--flex input[type="text"]:focus { outline: 3px solid var(--tilleul); outline-offset: 0; border-color: var(--vert-sauge); }
.edition--flex .case { min-height: 40px; }

/* ---------- Audit : blocs consécutifs jamais collés (hors grilles, qui ont leur propre espacement) ---------- */
.carte:has(+ .carte, + .alerte, + .zone-tri, + .defilement):not(.grille > *):not(.grille--graphes > *):not(.mise-en-page-calendrier > *) { margin-bottom: 16px; }
p.aide:has(+ .carte, + .defilement, + .grille) { margin-bottom: 12px; }

/* Tableau de bord d'administration : cartes de statistiques colorées */
.grille--stats .carte { text-align: center; padding: 18px 14px; border-width: 2px; }
.grille--stats .carte h2 { font-size: 3rem; line-height: 1.05; margin: 0 0 6px; font-weight: 900; color: inherit; }
.grille--stats .carte p { margin: 0; font-weight: 700; }
.stat--vert { background: #e3f0d6; border-color: var(--vert-tendre); color: var(--vert-foret); }
.stat--caramel { background: #f5ead6; border-color: var(--caramel); color: #6b4f23; }
.stat--brique { background: #f8e0dc; border-color: var(--brique); color: #8f2c21; }
.stat--tilleul { background: #eff1c6; border-color: var(--tilleul); color: var(--vert-foret); }
.stat--sauge { background: var(--vert-sauge); border-color: var(--vert-sauge); color: var(--blanc); }
.stat--foret { background: var(--vert-foret); border-color: var(--vert-foret); color: var(--blanc); }
a.stat--vert:hover, a.stat--caramel:hover, a.stat--brique:hover { filter: brightness(.97); }

/* Notifications : suppression unitaire */
.notification { display: flex; gap: 8px; align-items: stretch; }
.notification > form:first-child { flex: 1; min-width: 0; }
.notification__suppression { display: flex; align-items: center; }

/* Checklists repliables */
details.checklist-bloc > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
details.checklist-bloc > summary::-webkit-details-marker { display: none; }
details.checklist-bloc > summary h3 { margin: 0; }
details.checklist-bloc > summary::after { content: "›"; font-size: 1.6rem; line-height: 1; margin-left: auto; transition: transform .15s; transform: rotate(90deg); }
details.checklist-bloc:not([open]) > summary::after { transform: rotate(0deg); }
.checklist-bloc__compte { color: var(--texte-doux); font-weight: 700; }
.checklist-bloc__compte--complet { color: var(--vert-sauge); }
details.checklist-bloc[open] > .checklist { margin-top: 8px; }


/* Fil d'Ariane : maison > titre de la page, fixe sous la barre supérieure */
.fil-ariane { display: flex; align-items: center; gap: 4px; flex: none; }
.fil-ariane__accueil { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 10px; color: var(--vert-sauge); }
.fil-ariane__accueil:hover, .fil-ariane__accueil:focus-visible { background: var(--sable-fonce); color: var(--vert-foret); }
.fil-ariane__accueil .icone { width: 26px; height: 26px; }
.fil-ariane__separateur { font-size: 1.6rem; line-height: 1; color: var(--caramel); font-weight: 700; }
.titre-avec-action > :only-child { margin-left: auto; }

/* Calendrier : jour d'arrivée (moitié basse) et jour de départ (moitié haute), séparés par la diagonale */
.calendrier .jour--confirme, .echantillon.jour--confirme { --base: linear-gradient(var(--vert-sauge), var(--vert-sauge)); }
.calendrier .jour--attente, .echantillon.jour--attente { --base: repeating-linear-gradient(135deg, var(--vert-foret), var(--vert-foret) 6px, var(--blanc) 6px, var(--blanc) 12px); }
.calendrier .jour--moi, .echantillon.jour--moi { --base: linear-gradient(var(--tilleul), var(--tilleul)); }
.calendrier .jour--moi.jour--attente, .echantillon.jour--moi.jour--attente { --base: repeating-linear-gradient(135deg, var(--tilleul), var(--tilleul) 6px, var(--blanc) 6px, var(--blanc) 12px); }
.calendrier .jour.jour--arrivee, .echantillon.jour--arrivee, .calendrier .jour.jour--arrivee:hover { background: linear-gradient(to bottom right, var(--blanc) calc(50% - 1px), rgba(255, 255, 255, 0) calc(50% + 1px)), var(--base); background-color: var(--blanc); }
.calendrier .jour.jour--depart, .echantillon.jour--depart, .calendrier .jour.jour--depart:hover { background: linear-gradient(to bottom right, rgba(255, 255, 255, 0) calc(50% - 1px), var(--blanc) calc(50% + 1px)), var(--base); background-color: var(--blanc); }
.calendrier .jour--confirme.jour--arrivee { color: var(--vert-foret); }
.calendrier .jour--confirme.jour--arrivee .jour__numero { color: var(--vert-foret); }

/* Fil d'Ariane : bandeau pleine largeur sous la barre supérieure, fixe au défilement */
.barre-titre { position: sticky; top: var(--hauteur-entete); z-index: 20; background: var(--sable); border-bottom: 1px solid var(--bord); }
.barre-titre__interieur { max-width: 1100px; margin: 0 auto; padding: 4px 16px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.barre-titre h1 { margin: 0; padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.5rem; }
.barre-titre + .conteneur { padding-top: 20px; }

/* Synthèse : quatre graphiques de même format, qui remplissent leur carte ; page plus large */
.conteneur:has(.grille--graphes) { max-width: 1400px; }
.grille--graphes { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.carte--graphe { display: flex; padding: 14px 14px 10px; }
.carte--graphe .graphe-bloc { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.carte--graphe figcaption { min-height: 3em; font-size: 1.05rem; line-height: 1.25; }
.carte--graphe .graphe { flex: 1; width: 100%; height: 100%; }
.legende-categories--colonnes { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; }
body:has(.grille--graphes) .barre-titre__interieur { max-width: 1400px; }

/* Champs côte à côte, bloc de champs */
.champs-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; }
.bloc-champs { border: 1px solid var(--bord); border-radius: 10px; padding: 8px 14px 12px; margin: 12px 0; }
.bloc-champs legend { font-weight: 800; padding: 0 6px; }
.calendrier .jour--aujourdhui.jour--arrivee .jour__numero { color: var(--blanc); }
.carte:has(+ .grille--graphes) { margin-bottom: 16px; }

/* Calendrier : jour avec deux séjours d'états différents (haut = départ, bas = arrivée), tracé net par découpage */
.calendrier .jour--double::before { content: ""; position: absolute; inset: 0; border-radius: inherit; clip-path: polygon(0 0, 100% 0, 0 100%); z-index: 0; background: var(--blanc); }
.calendrier .jour--double.jour--haut-confirme::before { background: var(--vert-sauge); }
.calendrier .jour--double.jour--haut-attente::before { background: repeating-linear-gradient(135deg, var(--vert-foret), var(--vert-foret) 6px, var(--blanc) 6px, var(--blanc) 12px); }
.calendrier .jour--double.jour--haut-moi.jour--haut-confirme::before { background: var(--tilleul); }
.calendrier .jour--double.jour--haut-moi.jour--haut-attente::before { background: repeating-linear-gradient(135deg, var(--tilleul), var(--tilleul) 6px, var(--blanc) 6px, var(--blanc) 12px); }
.calendrier .jour--double .jour__numero { position: relative; z-index: 1; }
.calendrier .jour--double.jour--haut-confirme .jour__numero { color: var(--blanc); background: none; padding: 0; }
.calendrier .jour--double.jour--haut-attente .jour__numero { background: var(--blanc); color: var(--vert-foret); border-radius: 6px; padding: 0 5px; }
.calendrier .jour--double.jour--haut-moi .jour__numero { background: var(--tilleul); color: var(--vert-foret); border-radius: 6px; padding: 0 5px; }
.calendrier .jour--double.jour--haut-moi.jour--haut-confirme .jour__numero { background: none; padding: 0; }

/* Guide : une couleur par catégorie de lieu */
.cat-restaurant { --cat: #B3392B; --cat-fond: #f8e0dc; --cat-texte: #8f2c21; }
.cat-commerce { --cat: #C8A97A; --cat-fond: #f5ead6; --cat-texte: #6b4f23; }
.cat-activite { --cat: #D9822B; --cat-fond: #fbe7cf; --cat-texte: #8a4d0e; }
.cat-promenade { --cat: #447854; --cat-fond: #e3f0d6; --cat-texte: #1B4C38; }
.cat-plage { --cat: #2F7FA8; --cat-fond: #d9ecf6; --cat-texte: #1c5675; }
.cat-transport { --cat: #5B6B8C; --cat-fond: #e1e6f0; --cat-texte: #38445e; }
.cat-service { --cat: #7A5C8E; --cat-fond: #ece3f2; --cat-texte: #523a63; }
.cat-autre { --cat: #8b8b78; --cat-fond: #eeeee6; --cat-texte: #4d4d40; }
.poi[class*="cat-"] { border-top: 5px solid var(--cat); }
.pastille--cat { background: var(--cat-fond); color: var(--cat-texte); font-weight: 700; }
.poi:target { outline: 3px solid var(--cat, var(--vert-sauge)); outline-offset: 2px; }

/* Guide : classes de couleur par nom (palette des catégories modifiables) */
.cat-brique { --cat: #B3392B; --cat-fond: #f8e0dc; --cat-texte: #8f2c21; }
.cat-caramel { --cat: #C8A97A; --cat-fond: #f5ead6; --cat-texte: #6b4f23; }
.cat-orange { --cat: #D9822B; --cat-fond: #fbe7cf; --cat-texte: #8a4d0e; }
.cat-vert { --cat: #447854; --cat-fond: #e3f0d6; --cat-texte: #1B4C38; }
.cat-bleu { --cat: #2F7FA8; --cat-fond: #d9ecf6; --cat-texte: #1c5675; }
.cat-gris { --cat: #5B6B8C; --cat-fond: #e1e6f0; --cat-texte: #38445e; }
.cat-violet { --cat: #7A5C8E; --cat-fond: #ece3f2; --cat-texte: #523a63; }
.cat-rose { --cat: #C45A82; --cat-fond: #f8e1ea; --cat-texte: #7d2c4b; }
.cat-turquoise { --cat: #2A9D8F; --cat-fond: #d6efec; --cat-texte: #17625a; }
.cat-olive { --cat: #8A8F2A; --cat-fond: #eef0c9; --cat-texte: #575b12; }
.modale--large { width: min(760px, 94vw); max-width: 94vw; }
.poi .outils-ligne { margin-top: 8px; }
.puce-categorie { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.outils-ligne.edition { display: none; }
.ligne--edition .outils-ligne.edition { display: flex; }
.ligne--edition .outils-ligne.lecture { display: none; }
.alerte--avertissement { background: #FBF1DC; border-color: var(--caramel); color: #6b4f23; }

/* Import bancaire */
.pastille--caramel { background: #f5ead6; color: #6b4f23; }
.tableau--import td { vertical-align: top; }
.tableau--import select { max-width: 100%; margin-bottom: 4px; }
.tableau--import select[hidden] { display: none; }
.import-libelle { min-width: 220px; word-break: break-word; }
.import-montant { white-space: nowrap; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.import-montant--debit { color: #8f2c21; }
.import-montant--credit { color: var(--vert-foret); }
.import-ligne--doublon { opacity: .6; background: var(--sable-fonce); }
.import-ligne--erreur { background: #fbeae7; }
.import-regle { margin-top: 4px; font-size: .9rem; }
.import-regle summary { cursor: pointer; color: var(--vert-sauge); font-weight: 700; }
.import-regle input[type="text"] { width: 100%; min-height: 36px; padding: 4px 10px; border: 1px solid var(--bord); border-radius: 8px; font: inherit; margin-top: 4px; }
.actions-ligne--bas { margin-top: 16px; }
.champ-ligne--court { max-width: 90px; }

/* Cellule d'actions d'un tableau : reste une cellule de tableau (pas de flex) pour que les lignes restent alignées */
td.actions-ligne { display: table-cell; white-space: nowrap; }
td.actions-ligne > * { display: inline-block; vertical-align: middle; margin: 0 6px 4px 0; }
.tableau td .outils-ligne { flex-wrap: nowrap; }
.import-case { width: 1%; white-space: nowrap; }

/* Guide : titre d'un lieu cliquable (centre la carte) */
.poi__titre { background: none; border: 0; padding: 0; font: inherit; font-weight: inherit; color: var(--vert-foret); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--caramel); text-underline-offset: 3px; }
.poi__titre:hover, .poi__titre:focus-visible { color: var(--vert-sauge); text-decoration-color: currentColor; }

/* Bulle de comptage sur une tuile (demandes en cours), de même style que dans le menu d'administration */
.tuile .pastille-rouge { position: absolute; top: 10px; right: 10px; min-width: 26px; padding: 0 8px; border-radius: 999px; background: var(--brique); color: var(--blanc); font-size: .9rem; font-weight: 800; line-height: 26px; text-align: center; box-shadow: 0 0 0 2px var(--blanc); }
select[hidden] { display: none; }
.pastille--role-administrateur { background: var(--brique); color: var(--blanc); }
.liste-simple { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.liste-simple li { justify-content: space-between; align-items: center; }
.ligne-groupe th { background: var(--sable-fonce); font-weight: 800; }

/* Curseurs de réglage (vert foncé) */
.curseurs { display: grid; gap: 14px; margin-top: 8px; }
.champ--curseur { margin: 0; }
.curseur { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.curseur__borne { color: var(--texte-doux); font-size: .85rem; min-width: 1.5em; text-align: center; font-variant-numeric: tabular-nums; }
.curseur__valeur { min-width: 2.4em; text-align: center; font-weight: 800; font-size: 1.1rem; color: var(--vert-foret); background: var(--sable-fonce); border-radius: 8px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.curseur__unite { color: var(--texte-doux); font-size: .9rem; }
.curseur__entree { -webkit-appearance: none; appearance: none; flex: 1 1 200px; min-width: 160px; max-width: 420px; height: 28px; background: transparent; cursor: pointer; --rempli: 50%; }
.curseur__entree::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--vert-foret) 0, var(--vert-foret) var(--rempli), var(--bord) var(--rempli), var(--bord) 100%); }
.curseur__entree::-moz-range-track { height: 8px; border-radius: 999px; background: var(--bord); }
.curseur__entree::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--vert-foret); }
.curseur__entree::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: var(--vert-foret); border: 3px solid var(--blanc); box-shadow: 0 0 0 1px var(--vert-foret), 0 1px 4px rgba(0, 0, 0, .3); }
.curseur__entree::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--vert-foret); border: 3px solid var(--blanc); box-shadow: 0 0 0 1px var(--vert-foret), 0 1px 4px rgba(0, 0, 0, .3); }
.curseur__entree:focus-visible { outline: 3px solid var(--tilleul); outline-offset: 4px; border-radius: 8px; }

/* Demande de séjour sur petit écran : le calendrier passe au-dessus du formulaire */
@media (max-width: 899.98px) {
    .mise-en-page-calendrier--haut > .calendrier-lateral { order: -1; position: static; }
}

/* Sous-sections d'une page de gestion : onglets (défilables sur petit écran) */
.sous-nav { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.sous-nav a { padding: 8px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; background: var(--sable-fonce); color: var(--vert-foret); white-space: nowrap; }
.sous-nav a[aria-current="page"] { background: var(--vert-foret); color: var(--blanc); }
@media (max-width: 720px) {
    .sous-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 4px; margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px; }
    .sous-nav a { scroll-snap-align: start; }
}
[data-section][hidden] { display: none !important; }

/* Statuts d'une invitation : Active vert, Révoquée rouge, Non-vu jaune, Vu bleu */
.pastille--statut-actif { background: #2E7D32; color: var(--blanc); }
.pastille--statut-revoque { background: #B3261E; color: var(--blanc); }
.pastille--statut-non-vu { background: #F2C94C; color: #4a3b00; }
.pastille--statut-vu { background: #1F5FA8; color: var(--blanc); }

/* Pagination des tableaux : choix du nombre d'éléments puis pages, à droite */
.pagination-tableau { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.pagination-tableau__taille { margin: 0; }
.pagination-tableau__taille label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.pagination-tableau__taille select { min-height: 36px; padding: 2px 30px 2px 10px; }
.pagination-tableau .pagination { margin: 0; }

/* Dépôt de photo : cadre actif pendant un glisser-déposer */
.champ-photo--survol { background: var(--tendre, #eef3ea); border-color: var(--vert-sauge); }

/* Produits de première nécessité : compteur de produits à racheter */
.checklist-bloc__compte--manque { background: var(--brique); color: var(--blanc); }

/* Livre d'or : photos agrandissables (lightbox) */
.photo-agrandir { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; line-height: 0; }
.photo-agrandir:focus-visible { outline: 3px solid var(--vert-sauge); outline-offset: 2px; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(20, 20, 20, .88); }
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.lightbox figure { margin: 0; max-width: 100%; text-align: center; }
dialog.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 8px; object-fit: contain; }
.lightbox__compte { color: var(--blanc); margin-top: 8px; min-height: 1.4em; }
.lightbox__fermer, .lightbox__nav { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #222; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox__fermer { top: 14px; right: 14px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prec { left: 14px; }
.lightbox__nav--suiv { right: 14px; }
.lightbox__fermer:focus-visible, .lightbox__nav:focus-visible { outline: 3px solid var(--vert-sauge); outline-offset: 2px; }

/* Détail d'un incident : statut bien visible, deux blocs (détails à gauche, fichiers à droite) */
.incident-statut { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; padding: 12px 18px; border-radius: var(--rayon); border-left: 8px solid var(--bord); background: var(--sable-fonce); }
.incident-statut__etiquette { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.incident-statut__valeur { font-size: 1.5rem; line-height: 1.2; }
.incident-statut--nouveau { background: var(--brique); color: var(--blanc); border-left-color: #7a2418; }
.incident-statut--pris_en_compte { background: #f5ead6; color: #6b4f23; border-left-color: #c89a4b; }
.incident-statut--en_cours { background: var(--vert-sauge); color: var(--blanc); border-left-color: var(--vert-foret); }
.incident-statut--en_attente { background: #F2C94C; color: #4a3b00; border-left-color: #b8921f; }
.incident-statut--resolu { background: #2E7D32; color: var(--blanc); border-left-color: #1b5e20; }
.incident-statut--cloture { background: var(--vert-tendre); color: var(--vert-foret); border-left-color: var(--vert-sauge); }
.incident-colonnes { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.incident-colonnes h2 { margin-top: 0; font-size: 1.15rem; }
.incident-colonnes h3 { margin: 16px 0 6px; font-size: 1rem; }
.incident-fichiers { margin-bottom: 8px; }
.incident-fichiers__photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); }
.incident-fichiers .photo-agrandir { display: block; width: 100%; }
.lightbox__telecharger { margin-top: 8px; text-decoration: none; }
@media (max-width: 720px) { .incident-colonnes { grid-template-columns: 1fr; } }

/* Page checklists de l'invité : onglets verts (tout est fait) ou rouges (reste à faire) */
.sous-nav a.onglet-liste--complet { background: #2E7D32; color: var(--blanc); }
.sous-nav a.onglet-liste--incomplet { background: var(--brique); color: var(--blanc); }
.sous-nav a.onglet-liste[aria-current="page"] { outline: 3px solid var(--vert-foret); outline-offset: 2px; }
.sous-nav a.onglet-liste:not([aria-current="page"]) { opacity: .8; }

/* Checklists (administration) : encart du mode réorganisation, en haut de page */
.encart-reorganiser { margin: 0 0 16px; padding: 12px 16px; border: 2px solid var(--vert-sauge); border-radius: var(--rayon); background: #e3f0d6; color: var(--vert-foret); font-weight: 700; }

/* Invitations : champ de recherche moins large */
.champ--moyen { flex: 0 1 240px; }

/* Tableau de bord de gestion : deux lignes de cartes (4 puis 3) et bandeau du séjour en cours */
.grille--stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille--stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grille--stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grille--stats-4, .grille--stats-3 { grid-template-columns: 1fr; } }
.bandeau-sejour { margin: 0 0 20px; padding: 14px 18px; border-radius: var(--rayon); background: var(--vert-foret); color: var(--blanc); text-align: center; font-weight: 700; }
.bandeau-sejour a { color: var(--blanc); text-decoration: underline; }

/* Invitations : case « Mes invitations » et boutons de filtre en bout de ligne */
.champ--case { min-width: 0; }
.filtres__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* Page d'un séjour : statut au bout de la ligne d'onglets, icône d'agenda dans le cadre d'informations */
.sous-nav__statut { margin-left: auto; align-self: center; white-space: nowrap; }
.carte--agenda { position: relative; }
.carte--agenda .carte__agenda { position: absolute; top: 12px; right: 12px; }

/* Tableau de bord de gestion : bandeau du séjour en cours plus marquant */
/* même style que la carte « incidents ouverts » (fond caramel clair, texte marron), avec une bordure rouge foncé */
.bandeau-sejour { background: #f5ead6; color: #6b4f23; border: 3px solid #7a1f16; font-size: 1.3rem; padding: 18px 20px; }
.bandeau-sejour a { color: #6b4f23; }

/* Interface de gestion : le pied de page ne provoque plus de défilement inutile.
   La page remplit exactement la hauteur de la fenêtre (en-tête, contenu, pied) ; sur ordinateur, le menu est fixe, de l'en-tête
   au bas de la fenêtre : il ne compte plus dans la hauteur de la page (seul son contenu défile s'il est trop long). */
body:has(.gestion) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:has(.gestion) .gestion { flex: 1 0 auto; min-height: 0; }
@media (min-width: 720px) {
    .gestion .menu { position: fixed; top: var(--hauteur-entete); bottom: 0; left: 0; width: 250px; height: auto; max-height: none; box-sizing: border-box; overflow-y: auto; align-self: auto; z-index: 20; }
    .gestion .contenu { grid-column: 2; }
    body:has(.gestion) .pied { padding-left: 266px; }
}

/* Synthèse de la SCI : écart versements - charges, en petit après le titre de la carte */
.carte__ecart { font-size: .6em; font-weight: 700; white-space: nowrap; }

/* Notifications : panneau (modale) sous la cloche, angle supérieur droit collé au bandeau supérieur */
dialog.notifications-popup { position: fixed; inset: auto; margin: 0; padding: 0; width: min(420px, calc(100vw - 8px)); overflow-y: auto; background: var(--blanc); color: var(--texte); border: 1px solid var(--bord); border-top: 0; border-radius: 0 0 var(--rayon) var(--rayon); box-shadow: var(--ombre); }
dialog.notifications-popup::backdrop { background: rgba(0, 0, 0, .12); }
.notifications-popup__contenu { padding: 12px 14px 10px; }
.notifications-popup__entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.notifications-popup__entete h2 { margin: 0; font-size: 1.15rem; }
.notifications-popup__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.notifications-popup__actions form { margin: 0; }
.notifications-popup__liste { margin-bottom: 8px; }
.notifications-popup__vide { margin: 4px 0 10px; }
.notifications-popup__pied { margin: 0; padding-top: 8px; border-top: 1px solid var(--bord); text-align: center; font-size: .9rem; }

/* Livre d'or : bouton de suppression (administrateur) poussé à droite de la ligne d'actions */
.actions-ligne__droite { margin-left: auto; }

/* Champ de mot de passe avec bouton « œil » (afficher / masquer) */
.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 52px !important; }
.champ-mdp__bascule { position: absolute; top: 0; right: 0; width: 48px; height: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--vert-foret); border-radius: 0 10px 10px 0; cursor: pointer; }
.champ-mdp__bascule[hidden] { display: none; }
.champ-mdp__bascule:hover { color: var(--vert-sauge); }
.champ-mdp__bascule .icone { width: 22px; height: 22px; }
