:root {
  color-scheme: light;
  --fond: #F2F4F3;
  --surface: #FFFFFF;
  --encre: #1E2B2F;
  --encre-douce: #56656A;
  --trait: #D6DEDB;
  --trait-fort: #AEBBB7;
  --accent: #2E6A56;
  --sur-accent: #FFFFFF;
  --c-direct: #2E6A56;
  --c-airbnb: #B04760;
  --c-booking: #2A5794;
  --c-manuel: #6F7A77;
  --c-option: #A8701A;
  --c-conflit: #B3261E;
  --fond-conflit: #FBECEA;
  --fond-weekend: #E9EEEC;
  --fond-succes: #E6F2EC;
  --fond-info: #E9EFF7;
  --rayon: 6px;
  --demi: 17px;
  --hauteur-ligne: 40px;
  --hauteur-interventions: 26px;
  --largeur-nom: 168px;
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fond: #141B1D;
    --surface: #1C2528;
    --encre: #E5ECEA;
    --encre-douce: #9AABA8;
    --trait: #2F3B3E;
    --trait-fort: #4A5A5E;
    --accent: #6FB59A;
    --sur-accent: #0F1A17;
    --c-direct: #3F8A6F;
    --c-airbnb: #B85A72;
    --c-booking: #4A74B5;
    --c-manuel: #6B7774;
    --c-option: #C48A33;
    --c-conflit: #EF6B61;
    --fond-conflit: #3A1F1D;
    --fond-weekend: #192225;
    --fond-succes: #1B3029;
    --fond-info: #1C2738;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-size: 1rem;
  line-height: 1.5;
}
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.aide { color: var(--encre-douce); font-size: .875rem; }

/* Barre du haut */
.barre {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
  padding: .75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--trait);
}
.marque { font-weight: 700; color: var(--encre); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; flex: 1; }
.nav a { color: var(--encre-douce); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--encre); }
.nav a[aria-current="page"] { color: var(--encre); border-bottom-color: var(--accent); }
.deconnexion { margin: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
main.etroit { max-width: 440px; padding-top: 3rem; }
main.moyen { max-width: 780px; }
main.large { max-width: none; }

.titre-page { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.titre-page h1 { margin: 0; }
.date-jour { margin: 0; color: var(--encre-douce); }
.titre-connexion { font-size: 1.4rem; margin-bottom: 1.5rem; }
.fil { margin: 0 0 .25rem; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.5rem; padding: .45rem 1rem;
  border: 1px solid var(--accent); border-radius: var(--rayon);
  background: var(--accent); color: var(--sur-accent);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.bouton:hover { filter: brightness(1.08); }
.bouton-secondaire { background: transparent; color: var(--accent); font-weight: 400; }
.bouton-danger { background: transparent; color: var(--c-conflit); border-color: var(--c-conflit); font-weight: 400; }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.deconnexion .lien { color: var(--encre-douce); }

/* Messages */
.message { padding: .75rem 1rem; border-radius: var(--rayon); margin: 0 0 1rem; border-left: 4px solid; }
.message p { margin: .25rem 0; }
.message ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.message-succes { background: var(--fond-succes); border-color: var(--accent); }
.message-erreur { background: var(--fond-conflit); border-color: var(--c-conflit); }
.message-info { background: var(--fond-info); border-color: var(--c-booking); }
.message-erreur, .message-succes, .message-info { border-radius: 0 var(--rayon) var(--rayon) 0; }

/* Blocs */
.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.entete-bloc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.entete-bloc h2 { margin: 0; }
.entete-bloc form { margin: 0; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1.25rem; }
.rien { color: var(--encre-douce); margin: 0; }
.vide { text-align: left; padding: 2rem 0; }

.alertes { list-style: none; margin: 0; padding: 0; }
.alerte { padding: .6rem .75rem; border-left: 4px solid var(--c-option); margin-bottom: .5rem; background: var(--fond); }
.alerte-grave { border-left-color: var(--c-conflit); background: var(--fond-conflit); }
.alerte a { margin-right: .5rem; }

.mouvements { list-style: none; margin: 0; padding: 0; }
.mouvements li {
  display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 0 .75rem; align-items: baseline;
  padding: .5rem 0; border-bottom: 1px solid var(--trait);
}
.mouvements li:last-child { border-bottom: 0; }
.mouvements .quand { color: var(--encre-douce); font-size: .9rem; grid-row: span 2; }
.mouvements .quand.est-aujourdhui { color: var(--encre); font-weight: 700; }
.mouvements .ou { color: var(--encre-douce); font-size: .875rem; grid-column: 2; }
.mouvements .pastille { grid-column: 3; grid-row: 1; }

/* Pastilles */
.pastille {
  display: inline-block; padding: .05rem .5rem; border-radius: 999px;
  font-size: .8rem; color: #fff; background: var(--c-manuel); white-space: nowrap;
}
.pastille.src-direct { background: var(--c-direct); }
.pastille.src-airbnb { background: var(--c-airbnb); }
.pastille.src-booking { background: var(--c-booking); }
.pastille.est-option { background: var(--c-option); }
.pastilles { display: flex; gap: .5rem; flex-wrap: wrap; }
.statut { font-size: .875rem; }
.statut-option { color: var(--c-option); font-weight: 700; }
.statut-annulee { color: var(--encre-douce); text-decoration: line-through; }
.statut-conflit { color: var(--c-conflit); font-weight: 700; }
.texte-alerte { color: var(--c-conflit); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .95rem; }
.bloc .tableau { background: transparent; }
.tableau th, .tableau td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau th { font-size: .85rem; color: var(--encre-douce); font-weight: 700; white-space: nowrap; }
.tableau td { white-space: nowrap; }
.tableau td.texte-long { white-space: normal; min-width: 16rem; }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; }
.est-attenue { opacity: .55; }

/* Formulaires */
.formulaire { display: grid; gap: 1rem; }
.formulaire label { display: grid; gap: .3rem; font-weight: 700; font-size: .95rem; }
.formulaire label .aide { font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 2.5rem; padding: .45rem .6rem;
  font: inherit; font-weight: 400; color: var(--encre); background: var(--surface);
  border: 1px solid var(--trait-fort); border-radius: var(--rayon);
}
input:disabled { background: var(--fond); color: var(--encre-douce); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--trait); border-radius: 10px; padding: 1rem 1.25rem 1.25rem; margin: 0; background: var(--surface); display: grid; gap: 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.rangee { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.rangee > label { flex: 1 1 12rem; }
.rangee > label.grand { flex: 3 1 16rem; }
.rangee > label.petit { flex: 0 1 7rem; }
.formulaire label.case, label.case { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.case input { width: auto; min-height: 0; }
.nuits { margin: 0 0 .6rem; color: var(--encre-douce); min-width: 5rem; }
.filtres { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; margin-bottom: 1.25rem; }
.filtres label { display: grid; gap: .25rem; font-size: .875rem; }
.filtres select { min-width: 10rem; }
.encart { border-left: 4px solid var(--c-booking); background: var(--fond-info); padding: .5rem 1rem; margin-bottom: 1rem; border-radius: 0 var(--rayon) var(--rayon) 0; }
.zone-suppression { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.details-externe { margin-top: 1.5rem; }
.details-externe pre { white-space: pre-wrap; word-break: break-word; font-size: .85rem; background: var(--surface); padding: .75rem; border-radius: var(--rayon); border: 1px solid var(--trait); }
.copie { display: flex; gap: .5rem; align-items: end; margin-bottom: .75rem; }
.copie label { flex: 1; display: grid; gap: .3rem; font-weight: 700; font-size: .95rem; }
.copie input { font-size: .85rem; }

.liste-biens { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; }
.liste-biens li { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; padding: .85rem 1.1rem; border-bottom: 1px solid var(--trait); }
.liste-biens li:last-child { border-bottom: 0; }
.liste-biens a { font-weight: 700; }
.liste-biens span:not(.pastille) { color: var(--encre-douce); font-size: .9rem; }
.liste-biens .sources { margin-left: auto; display: flex; gap: .35rem; }

/* Planning : la frise des séjours */
.navigation-periode { display: flex; flex-wrap: wrap; gap: .5rem; }
.planning {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: 10px;
}
.planning-ligne { display: flex; min-width: max-content; border-bottom: 1px solid var(--trait); }
.planning-ligne:last-child { border-bottom: 0; }
.planning-nom {
  position: sticky; left: 0; z-index: 3;
  flex: 0 0 var(--largeur-nom); width: var(--largeur-nom);
  padding: .5rem .75rem;
  background: var(--surface);
  border-right: 1px solid var(--trait);
  display: flex; flex-direction: column; justify-content: center;
}
.planning-nom a { font-weight: 700; color: var(--encre); text-decoration: none; line-height: 1.2; }
.planning-nom a:hover { text-decoration: underline; }
.planning-nom span { font-size: .8rem; color: var(--encre-douce); }
.planning-grille {
  display: grid;
  grid-template-columns: repeat(var(--colonnes), var(--demi));
  grid-auto-rows: var(--hauteur-ligne);
}
.planning-entete .planning-grille { grid-auto-rows: auto; }
.jour-entete {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  min-height: 3.6rem; padding: 1.35rem 0 .3rem; font-size: .75rem; line-height: 1.25; color: var(--encre-douce);
  border-left: 1px solid var(--trait);
  position: relative;
}
.jour-entete .mois { position: absolute; top: .3rem; left: .35rem; white-space: nowrap; font-weight: 700; color: var(--encre); z-index: 1; }
.jour-entete .numero { font-size: .85rem; color: var(--encre); font-variant-numeric: tabular-nums; }
.jour-entete.est-weekend { background: var(--fond-weekend); }
.jour-entete.est-aujourdhui .numero {
  background: var(--accent); color: var(--sur-accent); border-radius: 999px; padding: 0 .35rem; font-weight: 700;
}
.case-jour { border-left: 1px solid var(--trait); z-index: 0; }
.case-jour.est-weekend { background: var(--fond-weekend); }
.case-jour.est-aujourdhui { box-shadow: inset 2px 0 0 var(--accent); }
.case-jour:hover { background: var(--fond-succes); }

.barre-sejour {
  z-index: 1; position: relative;
  display: flex; align-items: center; min-width: 0;
  padding: 0 .45rem;
  margin: 5px 1px;
  border-radius: 4px;
  background: var(--c-manuel);
  color: #fff;
  font-size: .8rem; font-weight: 700;
  text-decoration: none;
  /* Biseau : l’arrivée se fait l’après-midi, le départ le matin */
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.barre-sejour span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-sejour:hover { filter: brightness(1.12); }
.barre-sejour.coupe-debut { clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%); border-radius: 0 4px 4px 0; }
.barre-sejour.coupe-fin { clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%); border-radius: 4px 0 0 4px; }
.barre-sejour.coupe-debut.coupe-fin { clip-path: none; border-radius: 0; }
.src-direct { background: var(--c-direct); }
.src-airbnb { background: var(--c-airbnb); }
.src-booking { background: var(--c-booking); }
.src-manuel { background: repeating-linear-gradient(-45deg, var(--c-manuel) 0 6px, color-mix(in srgb, var(--c-manuel) 75%, var(--surface)) 6px 12px); }
.est-option { background: repeating-linear-gradient(-45deg, var(--c-option) 0 8px, color-mix(in srgb, var(--c-option) 70%, var(--surface)) 8px 16px); }
.barre-sejour.est-blocage { background: color-mix(in srgb, var(--c-manuel) 35%, var(--surface)); color: var(--encre); }
.barre-sejour.est-reflet { background: transparent; color: var(--encre-douce); outline: 1px dashed var(--trait-fort); outline-offset: -1px; font-weight: 400; clip-path: none; }
.barre-sejour.est-conflit { box-shadow: inset 0 0 0 2px var(--c-conflit), 0 0 0 2px var(--c-conflit); clip-path: none; }

.legende { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin: 1rem 0 .5rem; font-size: .875rem; color: var(--encre-douce); }
.legende span { display: inline-flex; align-items: center; gap: .4rem; }
.echantillon { display: inline-block; width: 1.6rem; height: .9rem; border-radius: 3px; }
.echantillon.est-blocage { background: color-mix(in srgb, var(--c-manuel) 35%, var(--surface)); }
.echantillon.est-conflit { background: transparent; box-shadow: inset 0 0 0 2px var(--c-conflit); }

@media (max-width: 640px) {
  :root { --largeur-nom: 104px; --demi: 15px; }
  h1 { font-size: 1.45rem; }
  main { padding: 1rem .85rem 3rem; }
  .barre { display: grid; grid-template-columns: 1fr auto; padding: .6rem .85rem 0; gap: .4rem 1rem; }
  .deconnexion { grid-row: 1; grid-column: 2; }
  .nav { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; gap: 1.1rem; padding-bottom: .1rem; }
  .nav a { white-space: nowrap; padding-bottom: .5rem; }
  .navigation-periode .bouton { padding: .4rem .7rem; font-size: .9rem; }
  .mouvements li { grid-template-columns: 1fr auto; }
  .mouvements .quand { grid-row: auto; grid-column: 1 / -1; }
  .mouvements .ou { grid-column: 1; }
  .mouvements .pastille { grid-column: 2; grid-row: 2; }
  .tableau td, .tableau th { padding: .45rem .4rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Panneau de détail du planning */
.panneau {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 20;
  width: min(400px, 100%);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border-left: 1px solid var(--trait-fort);
  padding: 1.25rem 1.25rem 2rem;
}
.panneau:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  .panneau:not([hidden]) { animation: panneau-entree .18s ease-out; }
  @keyframes panneau-entree { from { transform: translateX(24px); opacity: .4; } }
}
@media (min-width: 900px) {
  body.panneau-ouvert main.page-planning { margin-right: 400px; }
}
.panneau-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.panneau-entete h2 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 .4rem; }
.panneau-fermer {
  flex: 0 0 auto; width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--trait-fort); border-radius: var(--rayon);
  background: transparent; color: var(--encre); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.panneau-fermer:hover { background: var(--fond); }
.panneau-details { display: grid; grid-template-columns: 6.5rem 1fr; gap: .55rem 1rem; margin: 0 0 1.25rem; }
.panneau-details dt { color: var(--encre-douce); font-size: .9rem; }
.panneau-details dd { margin: 0; overflow-wrap: anywhere; }
.panneau-alerte { background: var(--fond-conflit); border-left: 4px solid var(--c-conflit); padding: .6rem .8rem; margin-bottom: 1rem; border-radius: 0 var(--rayon) var(--rayon) 0; }
.panneau-note { color: var(--encre-douce); font-size: .9rem; margin: 0 0 1rem; }
.panneau-notes { background: var(--fond); padding: .7rem .85rem; border-radius: var(--rayon); margin-bottom: 1.25rem; white-space: normal; }
.panneau-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.panneau-message { margin: 2rem 0; }
.panneau.est-en-chargement .panneau-contenu { opacity: .5; }
.barre-sejour.est-selectionnee {
  clip-path: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--encre);
  z-index: 2;
}

@media (max-width: 899px) {
  .panneau {
    top: auto; width: 100%; max-height: 85vh;
    border-left: 0; border-top: 1px solid var(--trait-fort);
    border-radius: 14px 14px 0 0;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes panneau-entree { from { transform: translateY(32px); opacity: .4; } }
  }
  body.panneau-ouvert::after {
    content: ""; position: fixed; inset: 0; z-index: 19;
    background: rgba(10, 20, 18, .4);
  }
}

/* Interventions */
.pastille-inter {
  z-index: 1; place-self: center;
  display: inline-grid; place-items: center;
  min-width: 22px; height: 20px; padding: 0 3px;
  border: 1.5px solid var(--encre-douce); border-radius: 5px;
  background: var(--surface); color: var(--encre);
  font-size: .72rem; font-weight: 700; font-style: normal; line-height: 1;
  text-decoration: none;
}
a.pastille-inter:hover { border-color: var(--encre); }
.pastille-inter.est-urgente { background: var(--c-option); border-color: var(--c-option); color: #fff; }
.pastille-inter.est-en-alerte { background: var(--c-conflit); border-color: var(--c-conflit); color: #fff; }
.pastille-inter.est-faite { opacity: .45; }
.pastille-inter.est-selectionnee { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--encre); }
.case-jour.est-selectionnee { background: var(--fond-succes); box-shadow: inset 0 0 0 2px var(--accent); }
.pastille-legende { margin-right: .1rem; }
.pastille.est-urgente { background: var(--c-option); }
.pastille.est-intervention { background: var(--encre-douce); }
.petit-texte { display: block; font-size: .85rem; }
.case-alerte { background: var(--fond-conflit); padding: .75rem 1rem; border-radius: var(--rayon); font-weight: 400; }

.panneau-sous-titre { margin: -.6rem 0 1rem; color: var(--encre-douce); }
.panneau-h3 { font-size: 1rem; margin: 0 0 .5rem; }
.panneau-section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--trait); display: grid; gap: .6rem; justify-items: start; }
.panneau-liste { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; width: 100%; }
.panneau-liste li { display: flex; gap: .6rem; align-items: baseline; }
.panneau-liste li > span:last-child { display: grid; }
.panneau-liste .pastille-inter { flex: 0 0 auto; }
.panneau-actions-colonne { flex-direction: column; align-items: stretch; margin-top: 1.25rem; }
.lien-discret { font-size: .9rem; }
.mouvements .pastille-inter { grid-column: 3; grid-row: 1; }
.mouvements .inter-info { grid-column: 2 / -1; }

/* Couleurs des interventions : à faire, faite à payer, faite et payée, à vérifier, annulée */
.pastille-inter.est-prevue, .pastille-inter.est-a-commander { background: var(--surface); border-color: var(--encre-douce); color: var(--encre); }
.pastille-inter.est-payee-avance { border-color: var(--c-direct); color: var(--c-direct); }
.pastille-inter.est-a-payer, .pastille-inter.est-commandee { background: var(--c-option); border-color: var(--c-option); color: #fff; }
.pastille-inter.est-payee { background: var(--c-direct); border-color: var(--c-direct); color: #fff; }
.pastille-inter.est-en-alerte { background: var(--c-conflit); border-color: var(--c-conflit); color: #fff; }
.pastille-inter.est-annulee { border-style: dashed; opacity: .45; background: transparent; }

/* Rappel des prestations à payer dans le menu */
.nav a.rappel-paiement {
  align-self: center; padding: .05rem .6rem; margin-left: -.6rem;
  border: 0; border-radius: 999px;
  background: var(--c-option); color: #fff; font-size: .8rem; font-weight: 700;
}
.nav a.rappel-paiement:hover { color: #fff; filter: brightness(1.08); }
.total-a-payer { margin: 0 0 1rem; }
.bouton-petit { min-height: 2rem; padding: .2rem .65rem; font-size: .85rem; }
form.en-ligne { margin: 0; }

/* Modification dans le panneau */
.panneau.en-edition { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.panneau-cadre { flex: 1; width: 100%; border: 0; display: block; background: var(--surface); }
.panneau-cadre[hidden], .panneau-contenu[hidden] { display: none; }
.bandeau-edition {
  margin: 0; padding: .6rem 1.1rem;
  background: color-mix(in srgb, var(--c-option) 16%, var(--surface));
  border-bottom: 1px solid var(--trait);
  font-size: .9rem; font-weight: 700;
}
@media (prefers-reduced-motion: no-preference) {
  .bandeau-edition.attire-attention { animation: attention .45s ease-in-out; }
  @keyframes attention {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
  }
}
.bandeau-edition.attire-attention { background: color-mix(in srgb, var(--c-option) 35%, var(--surface)); }
.voile-edition {
  position: fixed; inset: 0; z-index: 19;
  background: rgba(20, 30, 28, .2);
  cursor: not-allowed;
}
@media (prefers-color-scheme: dark) { .voile-edition { background: rgba(0, 0, 0, .4); } }
body.edition-en-cours::after { display: none; }

/* Pages affichées dans le panneau */
body.dans-panneau { background: var(--surface); }
main.panneau-page { max-width: none; padding: 1rem 1.1rem 0; }
.dans-panneau h1 { font-size: 1.3rem; margin-bottom: .75rem; }
.dans-panneau .titre-page { margin-bottom: .75rem; }
.dans-panneau fieldset { background: transparent; padding: .75rem .9rem 1rem; }
.dans-panneau .rangee > label { flex-basis: 9rem; }
.dans-panneau .zone-suppression { margin-top: 1.25rem; padding-bottom: 1.5rem; }
.actions-collees {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--surface);
  padding: .75rem 0 1rem; margin-top: .25rem;
  border-top: 1px solid var(--trait);
}
main:not(.panneau-page) .actions-collees { position: static; background: none; border: 0; padding: 0; }

/* Fiche intervention */
.choix-prestation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.choix-prestation legend { grid-column: 1 / -1; }
.carte-choix {
  position: relative;
  display: grid; gap: .15rem; align-content: start;
  padding: .6rem .7rem; cursor: pointer;
  border: 1.5px solid var(--trait-fort); border-radius: var(--rayon);
}
.formulaire .carte-choix { font-weight: 400; }
.carte-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.carte-choix:has(input:checked) { border-color: var(--accent); background: var(--fond-succes); box-shadow: inset 0 0 0 1px var(--accent); }
.carte-choix:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.carte-choix-nom { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.carte-choix-prix { font-size: .85rem; color: var(--encre-douce); }
.total-intervention { margin: 0; font-size: 1.05rem; }
.plage-aide { margin: 0 0 .6rem; }
.champ-euro { display: flex; align-items: center; gap: .35rem; }
.rangee > label.tarif { flex: 1 1 9rem; }

.detail-prix { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0 0 1.25rem; }
.detail-prix td { padding: .3rem 0; border-bottom: 1px solid var(--trait); }
.detail-prix td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.detail-prix-total td { font-weight: 700; border-bottom: 0; }
.panneau-suppression { margin-top: 1.5rem; }
.lien-danger { color: var(--c-conflit); }

@media (max-width: 899px) {
  .panneau.en-edition { height: 88vh; max-height: none; }
}

#panneau-titre:focus { outline: none; }
@media (max-width: 380px) { .choix-prestation { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.carte-choix-nom { hyphens: auto; overflow-wrap: anywhere; }

/* Badges de la liste des interventions */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .1rem .55rem; border-radius: 999px;
  border: 1px solid transparent;
  font-size: .78rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.badge-a-faire { border-color: var(--trait-fort); color: var(--encre); }
.badge-faite { background: var(--fond-succes); color: var(--c-direct); border-color: color-mix(in srgb, var(--c-direct) 35%, transparent); }
.badge-annulee { background: var(--fond); color: var(--encre-douce); text-decoration: line-through; }
.badge-a-payer { background: color-mix(in srgb, var(--c-option) 16%, var(--surface)); color: color-mix(in srgb, var(--c-option) 80%, var(--encre)); border-color: color-mix(in srgb, var(--c-option) 45%, transparent); }
.badge-payee { background: var(--c-direct); color: #fff; }
.badge-alerte { background: var(--c-conflit); color: #fff; }
.badge-retard { background: var(--c-conflit); color: #fff; }
.badge-retard::before, .badge-alerte::before {
  content: "!"; display: inline-grid; place-items: center;
  width: .95rem; height: .95rem; border-radius: 50%;
  background: #fff; color: var(--c-conflit); font-size: .7rem;
}
.tableau td.badges { white-space: normal; }
.tableau td.badges .badge { margin: 0 .2rem .25rem 0; }
.tableau-interventions tr.est-en-retard td { background: color-mix(in srgb, var(--c-conflit) 6%, var(--surface)); }
.tableau-interventions tr.est-en-retard td:first-child { box-shadow: inset 3px 0 0 var(--c-conflit); }
.synthese { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin: 0 0 1rem; color: var(--encre-douce); }
.synthese .badge { margin-right: .3rem; }

/* Sur téléphone, chaque intervention devient une carte lisible sans défilement horizontal */
@media (max-width: 1240px) {
  .tableau-interventions thead { display: none; }
  .tableau-interventions, .tableau-interventions tbody { display: block; }
  .tableau-interventions tr {
    display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .6rem; align-items: baseline;
    padding: .8rem .75rem; border-bottom: 1px solid var(--trait);
  }
  .tableau-interventions td { border: 0; padding: 0; white-space: normal; background: transparent !important; box-shadow: none !important; }
  .tableau-interventions td:nth-child(1) { grid-row: 1 / span 2; align-self: start; }
  .tableau-interventions td:nth-child(2) { grid-column: 2; grid-row: 1; font-weight: 700; }
  .tableau-interventions td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .tableau-interventions td:nth-child(3) { grid-column: 2 / -1; grid-row: 2; color: var(--encre-douce); font-size: .9rem; }
  .tableau-interventions td:nth-child(4), .tableau-interventions td:nth-child(6), .tableau-interventions td:nth-child(7) { grid-column: 1 / -1; }
  .tableau-interventions td:nth-child(4) { margin-top: .3rem; min-width: 0; }
  .tableau-interventions td:nth-child(6) { margin-top: .35rem; }
  .tableau-interventions td:nth-child(7):empty { display: none; }
  .tableau-interventions tr.est-en-retard { background: color-mix(in srgb, var(--c-conflit) 7%, var(--surface)); box-shadow: inset 3px 0 0 var(--c-conflit); }
}

/* Réservation directe : tarif, paiements, contrat */
.rangee > label.moyen { flex: 1 1 11rem; }
.recap-tarif { background: var(--fond); border-radius: var(--rayon); padding: .75rem .9rem; }
.recap-tarif .detail-prix { margin-bottom: .5rem; }
.recap-tarif p { margin: 0; }
.champ-euro span { white-space: nowrap; color: var(--encre-douce); font-weight: 400; }
.detail-prix td .badge { margin-left: .35rem; }
.liste-paiements li { display: block; }
.liste-paiements .aide { display: block; }
.panneau-actions form.en-ligne { display: inline-flex; }
.panneau-section .lien-discret { justify-self: start; }
.signature-actuelle { display: grid; gap: .5rem; justify-items: start; }
.signature-actuelle img { max-height: 70px; max-width: 240px; background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); padding: .3rem; }

.panneau-liens { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .9rem; }
.panneau-liens form { margin: 0; }
.tableau td.actions-ligne { white-space: normal; }
.tableau td.actions-ligne form { margin: 0 .3rem .3rem 0; }

/* Photos du bien */
.photos-bien { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.photo-bien { display: grid; gap: .5rem; align-content: start; justify-items: start; }
.photo-titre { font-weight: 700; font-size: .95rem; }
.photo-titre .aide { display: block; font-weight: 400; }
.photo-bien img { width: 100%; border-radius: var(--rayon); border: 1px solid var(--trait); }
.photo-vide { width: 100%; aspect-ratio: 5 / 2; display: grid; place-items: center; border: 1.5px dashed var(--trait-fort); border-radius: var(--rayon); color: var(--encre-douce); font-size: .9rem; }
.sous-titre-champ { font-weight: 700; margin: .5rem 0 0; }
code { font-size: .85em; background: var(--fond); padding: .05rem .3rem; border-radius: 4px; }
.liste-messages li { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.liste-messages .badge { margin-left: .3rem; }
.historique-messages { font-size: .88rem; margin-top: .25rem; }
.historique-messages ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.historique-messages li { margin-bottom: .3rem; }
.tableau-periodes td { padding: .3rem .3rem .3rem 0; white-space: normal; }
.tableau-periodes input { min-height: 2.2rem; padding: .3rem .45rem; }
.tableau-periodes td:nth-child(4) input, .tableau-periodes td:nth-child(5) input { max-width: 7rem; }
.tableau-periodes td:last-child { text-align: center; }
.tableau-periodes td:last-child input { width: auto; min-height: 0; }
.encart-demande { border-left-color: var(--c-option); background: color-mix(in srgb, var(--c-option) 10%, var(--surface)); }
.encart-demande p { margin: .2rem 0; }
.message-client { font-style: italic; }
[data-zone-linge] > label.petit { flex: 1 1 5.5rem; }
.barre-sejour.est-fermeture, .echantillon.est-fermeture {
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--encre-douce) 18%, var(--surface)) 0 6px, var(--surface) 6px 12px);
  color: var(--encre-douce); font-weight: 400; clip-path: none; outline: 1px solid var(--trait-fort); outline-offset: -1px;
}

/* ---------- Navigation latérale ---------- */
:root { --largeur-menu: 236px; }
.barre-laterale {
  position: fixed; inset: 0 auto 0 0; z-index: 25; width: var(--largeur-menu);
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.25rem .9rem 1rem; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--trait);
}
.barre-laterale .marque { display: block; font-weight: 700; font-size: 1.05rem; color: var(--encre); text-decoration: none; padding: .2rem .6rem 1rem; }
.barre-laterale nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-groupe { margin: 1rem .6rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-douce); }
.nav-groupe:first-child { margin-top: 0; }
.nav-lien {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 8px;
  color: var(--encre); text-decoration: none; font-weight: 500;
}
.nav-lien .icone { width: 20px; height: 20px; flex: 0 0 auto; color: var(--encre-douce); }
.nav-lien:hover { background: var(--fond); }
.nav-lien[aria-current="page"] { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent); font-weight: 700; }
.nav-lien[aria-current="page"] .icone { color: var(--accent); }
.barre-laterale .rappel-paiement {
  align-self: flex-start; margin: .1rem 0 .35rem 2.65rem; padding: .12rem .6rem; border-radius: 999px;
  background: var(--c-option); color: #fff; font-size: .76rem; font-weight: 700; text-decoration: none;
}
.nav-pied { border-top: 1px solid var(--trait); padding: .9rem .6rem 0; display: grid; gap: .2rem; font-size: .88rem; color: var(--encre-douce); }
.nav-pied .deconnexion { margin: 0; }
.nav-pied .lien { color: var(--encre-douce); font-size: .88rem; }
.barre-mobile { display: none; }
.voile-menu { position: fixed; inset: 0; z-index: 24; background: rgba(20, 30, 28, .35); }
body.avec-menu { padding-left: var(--largeur-menu); }
body.avec-menu main { padding-top: 2rem; }
@media (min-width: 900px) { body.avec-menu.panneau-ouvert main.page-planning { margin-right: 400px; } }

@media (max-width: 899px) {
  body.avec-menu { padding-left: 0; }
  body.avec-menu main { padding-top: 1rem; }
  .barre-mobile {
    display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 20;
    padding: .6rem .9rem; background: var(--surface); border-bottom: 1px solid var(--trait);
  }
  .barre-mobile .marque { font-weight: 700; color: var(--encre); text-decoration: none; }
  .bouton-menu { font: inherit; font-weight: 700; padding: .4rem .85rem; border: 1px solid var(--trait-fort); border-radius: 8px; background: var(--surface); color: var(--encre); cursor: pointer; }
  .barre-laterale { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  body.menu-ouvert .barre-laterale { transform: none; visibility: visible; }
  .barre-laterale .marque { display: none; }
}

/* ---------- Onglets des fiches ---------- */
.onglets {
  display: flex; flex-wrap: wrap; gap: 0 .15rem; margin: 0 0 1.25rem;
  border-bottom: 1px solid var(--trait);
}
.onglets button {
  flex: 0 0 auto; font: inherit; font-weight: 600; color: var(--encre-douce);
  padding: .6rem .85rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  background: none; cursor: pointer; white-space: nowrap;
}
.onglets button:hover { color: var(--encre); }
.onglets button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.onglet-panneau { display: grid; gap: 1rem; }
.fiche-onglets.formulaire { gap: 0; }
.barre-enregistrer { position: sticky; bottom: 0; z-index: 5; margin-top: 1.25rem; padding: .85rem 0; background: var(--fond); border-top: 1px solid var(--trait); }
.controle-tarifs .message { margin-bottom: .5rem; }

/* ---------- Aperçu des e-mails ---------- */
dialog.apercu {
  width: min(720px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--trait-fort); border-radius: 12px;
  background: var(--surface); color: var(--encre); display: none; flex-direction: column;
}
dialog.apercu[open] { display: flex; }
dialog.apercu::backdrop { background: rgba(20, 30, 28, .45); }
.apercu-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.2rem .4rem; }
.apercu-tete h2 { margin: 0; font-size: 1.2rem; }
.apercu-etiquette { margin: 0 0 .15rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-option); }
.apercu-entetes { display: grid; grid-template-columns: 4.5rem 1fr; gap: .25rem .8rem; margin: 0; padding: .5rem 1.2rem .8rem; font-size: .92rem; border-bottom: 1px solid var(--trait); }
.apercu-entetes dt { color: var(--encre-douce); }
.apercu-entetes dd { margin: 0; overflow-wrap: anywhere; }
dialog.apercu .message { margin: .8rem 1.2rem 0; }
dialog.apercu iframe { width: 100%; flex: 1; min-height: 420px; border: 0; background: #F2F4F3; }
body.edition-en-cours .barre-laterale { opacity: .5; }

/* ---------- Petits écrans : tableaux en cartes ---------- */
.filtres label.case { display: flex; align-items: center; gap: .45rem; align-self: center; font-size: .9rem; }
.tableau-reservations td:nth-child(5), .tableau-reservations td:nth-child(7) { white-space: normal; }
@media (max-width: 1000px) {
  .tableau-cartes thead { display: none; }
  .tableau-cartes, .tableau-cartes tbody { display: block; }
  .tableau-cartes tr { display: block; padding: .75rem .85rem; border-bottom: 1px solid var(--trait); }
  .tableau-cartes td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; white-space: normal; text-align: right; min-width: 0; }
  .tableau-cartes td::before { content: attr(data-label); color: var(--encre-douce); font-size: .85rem; text-align: left; flex: 0 0 auto; }
  .tableau-cartes td.texte-long { min-width: 0; }
  /* Réservations : la date d’arrivée sert de titre de la carte */
  .tableau-reservations td:first-child { font-weight: 700; font-size: 1.02rem; }
  .tableau-reservations td:first-child::before { content: none; }
  .tableau-reservations tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.25rem; }
  .tableau-reservations td:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .tableau-reservations tr { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .sur-grand-ecran { display: none; }
  .navigation-periode { width: 100%; }
  .navigation-periode .bouton { flex: 1 1 auto; padding: .4rem .6rem; }
  .navigation-periode .bouton:last-child { flex-basis: 100%; }
  /* Périodes tarifaires et fermetures : une carte par ligne */
  .tableau-saisie thead { display: none; }
  .tableau-saisie, .tableau-saisie tbody { display: block; }
  .tableau-saisie tr { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; padding: .75rem 0; border-bottom: 1px solid var(--trait); }
  .tableau-saisie td { display: grid; gap: .2rem; padding: 0; border: 0; }
  .tableau-saisie td::before { content: attr(data-label); font-size: .8rem; font-weight: 700; color: var(--encre-douce); }
  .tableau-saisie td:first-child { grid-column: 1 / -1; }
  .tableau-saisie td:empty, .tableau-saisie td:last-child:not(:has(input)) { display: none; }
  .tableau-saisie td input[type="checkbox"] { justify-self: start; }
  .tableau-periodes td:nth-child(4) input, .tableau-periodes td:nth-child(5) input { max-width: none; }
}
.calendrier-export { padding-bottom: .9rem; margin-bottom: .9rem; border-bottom: 1px solid var(--trait); }
.calendrier-export .copie { margin-bottom: .4rem; }
.etat-lecture { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: 0; font-size: .92rem; }
.resultat-test { margin: .5rem 0 0; }
.aide-calendriers { font-size: .92rem; }
.aide-calendriers summary { cursor: pointer; font-weight: 700; }
.aide-calendriers ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.aide-calendriers li { margin-bottom: .35rem; }
.nav-profil { color: var(--encre); font-weight: 700; text-decoration: none; display: grid; }
.nav-profil span { font-weight: 400; font-size: .8rem; color: var(--encre-douce); }
.nav-profil:hover, .nav-profil[aria-current="page"] { color: var(--accent); }
.lien-oubli { text-align: center; margin-top: 1rem; }
.liste-biens-choix { margin: .6rem 0 0 1.8rem; display: grid; gap: .15rem; }
