/* Charte : thème sombre par défaut, thème clair disponible. Contrastes vérifiés (WCAG AA).
   Une seule couleur d'accent ; vert, orange, rouge réservés aux états. */
:root, [data-theme="sombre"] {
  --fond: #0e1116;
  --surface: #161b22;
  --surface-2: #1e252e;
  --surface-3: #262e39;
  --bordure: #313a47;
  --texte: #e9ecf0;
  --texte-2: #aeb6c1;
  --accent: #8ab4ff;
  --accent-fort: #a9c7ff;
  --accent-texte: #0b1220;
  --accent-doux: rgba(138, 180, 255, 0.14);
  --vert: #5ee08f;
  --orange: #fbbf24;
  --rouge: #ff8a8a;
  --vert-fond: rgba(94, 224, 143, 0.13);
  --orange-fond: rgba(251, 191, 36, 0.13);
  --rouge-fond: rgba(255, 138, 138, 0.13);
  --ombre: 0 8px 28px rgba(0, 0, 0, 0.35);
  --rayon: 14px;
  --rayon-petit: 9px;
  color-scheme: dark;
}
[data-theme="clair"] {
  --fond: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --bordure: #d3d8df;
  --texte: #14181f;
  --texte-2: #4a5361;
  --accent: #1d4ed8;
  --accent-fort: #1e40af;
  --accent-texte: #ffffff;
  --accent-doux: rgba(29, 78, 216, 0.09);
  --vert: #166534;
  --orange: #9a4b06;
  --rouge: #b91c1c;
  --vert-fond: #dcf5e4;
  --orange-fond: #fdf0d8;
  --rouge-fond: #fde2e2;
  --ombre: 0 8px 24px rgba(20, 24, 31, 0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
small, .discret { color: var(--texte-2); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: .55em 1.1em; border-radius: var(--rayon-petit);
  border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.bouton:hover { border-color: var(--accent); }
.bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.bouton-principal { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.bouton-principal:hover { background: var(--accent-fort); }
.bouton-danger { background: var(--rouge-fond); color: var(--rouge); border-color: var(--rouge); }
.bouton-discret { background: transparent; border-color: transparent; color: var(--texte-2); }
.bouton-discret:hover { color: var(--texte); background: var(--surface-2); }
.bouton-petit { min-height: 34px; padding: .3em .8em; font-size: .9rem; }
.bouton .icone svg { width: 18px; height: 18px; display: block; }
.bouton-icone { background: transparent; border: 0; color: var(--texte-2); cursor: pointer; padding: 8px; border-radius: 8px; display: inline-flex; }
.bouton-icone:hover { color: var(--texte); background: var(--surface-2); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.champ label { font-weight: 600; font-size: .92rem; }
.aide { color: var(--texte-2); font-size: .85rem; }
input, select, textarea {
  font: inherit; color: var(--texte); background: var(--surface-2); border: 1px solid var(--bordure);
  border-radius: var(--rayon-petit); padding: .6em .75em; min-height: 42px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.case { display: flex; gap: .6rem; align-items: center; margin: .35rem 0; cursor: pointer; }

/* ---------- Structure Direction ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.nav-laterale {
  background: var(--surface); border-right: 1px solid var(--bordure); padding: 1.1rem .8rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .2rem;
}
.marque { display: flex; align-items: center; gap: .6rem; padding: .3rem .6rem 1.1rem; font-weight: 700; font-size: 1.02rem; }
.marque .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-texte); display: grid; place-items: center; }
.marque small { display: block; font-weight: 500; font-size: .78rem; color: var(--texte-2); }
.nav-lien {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px;
  color: var(--texte-2); text-decoration: none; font-weight: 550;
}
.nav-lien svg { width: 20px; height: 20px; flex: none; }
.nav-lien:hover { background: var(--surface-2); color: var(--texte); }
.nav-lien.actif { background: var(--accent-doux); color: var(--texte); box-shadow: inset 3px 0 0 var(--accent); }
.nav-groupe { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-2); margin: .9rem .7rem .3rem; }
.principal { min-width: 0; display: flex; flex-direction: column; }
.barre-haut {
  display: flex; align-items: center; gap: .8rem; padding: .75rem 1.6rem; border-bottom: 1px solid var(--bordure);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.barre-haut .espace { flex: 1; }
.barre-haut select { width: auto; min-width: 230px; max-width: 100%; }
.bouton-menu { display: none; }
.utilisateur { display: flex; align-items: center; gap: .5rem; color: var(--texte-2); font-size: .9rem; }
.contenu { padding: 1.6rem; max-width: 1400px; width: 100%; }
.bandeau-demo { background: var(--accent-doux); color: var(--texte); border-bottom: 1px solid var(--bordure); padding: .4rem 1.6rem; font-size: .86rem; }

.en-tete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.en-tete-page h1 { margin: 0; }
.en-tete-page p { margin: .25rem 0 0; color: var(--texte-2); }
.section-titre { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin: 1.6rem 0 .8rem; }
.section-titre h2 { margin: 0; }

.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1.2rem 1.3rem; }
.carte + .carte { margin-top: 1rem; }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.indicateurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.indicateur { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1rem 1.1rem; }
.indicateur-titre { color: var(--texte-2); font-size: .85rem; font-weight: 600; }
.indicateur-valeur { font-size: 1.75rem; font-weight: 700; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.indicateur-detail { color: var(--texte-2); font-size: .85rem; }
.indicateur-rouge { border-color: var(--rouge); box-shadow: inset 4px 0 0 var(--rouge); }
.indicateur-orange { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.indicateur-vert { box-shadow: inset 4px 0 0 var(--vert); }

/* ---------- Voyants et badges ---------- */
.voyant { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9rem; }
.voyant .pastille { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.voyant-vert { color: var(--vert); } .voyant-vert .pastille { background: var(--vert); }
.voyant-orange { color: var(--orange); } .voyant-orange .pastille { background: var(--orange); }
.voyant-rouge { color: var(--rouge); } .voyant-rouge .pastille { background: var(--rouge); }
.voyant-gris { color: var(--texte-2); } .voyant-gris .pastille { background: var(--texte-2); }
.badge { display: inline-block; padding: .15em .65em; border-radius: 999px; font-size: .8rem; font-weight: 650; border: 1px solid transparent; white-space: nowrap; }
.badge-neutre { background: var(--surface-3); color: var(--texte); }
.badge-accent { background: var(--accent-doux); color: var(--accent); border-color: var(--accent); }
.badge-vert { background: var(--vert-fond); color: var(--vert); }
.badge-orange { background: var(--orange-fond); color: var(--orange); }
.badge-rouge { background: var(--rouge-fond); color: var(--rouge); }

/* ---------- Tableaux ---------- */
.tableau-conteneur { overflow-x: auto; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.tableau { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tableau th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); padding: .75rem .9rem; border-bottom: 1px solid var(--bordure); background: var(--surface-2); white-space: nowrap; }
.tableau td { padding: .75rem .9rem; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--surface-2); }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vide { color: var(--texte-2); padding: 1.2rem; text-align: center; border: 1px dashed var(--bordure); border-radius: var(--rayon); }

/* ---------- Onglets ---------- */
.onglets { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--bordure); margin-bottom: 1.2rem; }
.onglets button { background: none; border: 0; color: var(--texte-2); font: inherit; font-weight: 600; padding: .65rem .9rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets button.actif { color: var(--texte); border-bottom-color: var(--accent); }
.onglets button:hover { color: var(--texte); }

/* ---------- Chambres ---------- */
.plan-chambres { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.carte-chambre { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: .85rem .95rem; cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: .3rem; min-height: 112px; }
.carte-chambre:hover { border-color: var(--accent); }
.carte-chambre .numero { font-size: 1.3rem; font-weight: 750; }
.carte-chambre .occupant { color: var(--texte-2); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statut-occupee { box-shadow: inset 4px 0 0 var(--accent); }
.statut-rav { box-shadow: inset 4px 0 0 var(--texte-2); }
.statut-travaux { box-shadow: inset 4px 0 0 var(--orange); }
.statut-bloquee { box-shadow: inset 4px 0 0 var(--rouge); }
.statut-libre { opacity: .85; }
.legende { display: flex; flex-wrap: wrap; gap: 1rem; margin: .4rem 0 1rem; color: var(--texte-2); font-size: .88rem; }

/* ---------- Modales et notifications ---------- */
.modale-fond { position: fixed; inset: 0; background: rgba(5, 8, 12, 0.66); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.modale { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); width: min(560px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: var(--ombre); }
.modale-large { width: min(920px, 100%); }
.modale-tete { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.modale-tete h2 { margin: 0; }
.modale-corps { padding: .6rem 1.2rem 1rem; overflow-y: auto; }
.modale-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding: .9rem 1.2rem; border-top: 1px solid var(--bordure); }
#notifications { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; max-width: min(420px, calc(100vw - 2rem)); }
.notification { background: var(--surface-3); color: var(--texte); border: 1px solid var(--bordure); border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 10px; box-shadow: var(--ombre); transition: opacity .3s; }
.notification-succes { border-left-color: var(--vert); }
.notification-erreur { border-left-color: var(--rouge); }
.notification-alerte { border-left-color: var(--orange); }
.notification.sortie { opacity: 0; }
.chargement { display: flex; align-items: center; gap: .7rem; color: var(--texte-2); padding: 2rem; justify-content: center; }
.rouet { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--bordure); border-top-color: var(--accent); animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.apercu-mail { background: var(--surface-2); border: 1px solid var(--bordure); border-radius: var(--rayon-petit); padding: 1rem; white-space: pre-wrap; font-size: .93rem; }
.apercu-mail .entete-mail { border-bottom: 1px solid var(--bordure); padding-bottom: .6rem; margin-bottom: .6rem; color: var(--texte-2); white-space: normal; }
.apercu-mail .entete-mail strong { color: var(--texte); }
.vignettes { display: flex; flex-wrap: wrap; gap: .5rem; }
.vignette { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; border: 1px solid var(--bordure); background: var(--surface-2); cursor: zoom-in; }
.liste-simple { list-style: none; padding: 0; margin: 0; }
.liste-simple li { padding: .65rem 0; border-bottom: 1px solid var(--bordure); display: flex; gap: .8rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.liste-simple li:last-child { border-bottom: 0; }
.mention-interne { border: 1px solid var(--orange); background: var(--orange-fond); color: var(--orange); border-radius: var(--rayon-petit); padding: .6rem .9rem; font-weight: 650; margin-bottom: 1rem; }
.encart { background: var(--accent-doux); border: 1px solid var(--bordure); border-radius: var(--rayon-petit); padding: .8rem 1rem; margin-bottom: 1rem; }
.barres { display: flex; flex-direction: column; gap: .45rem; }
.barre-ligne { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 40px; gap: .6rem; align-items: center; font-size: .9rem; }
.barre-ligne .jauge { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.barre-ligne .jauge span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.zone-depot { border: 2px dashed var(--bordure); border-radius: var(--rayon); padding: 2rem 1rem; text-align: center; color: var(--texte-2); cursor: pointer; }
.zone-depot.survol { border-color: var(--accent); background: var(--accent-doux); color: var(--texte); }
.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.calendrier .jour { background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; min-height: 110px; padding: .45rem; font-size: .82rem; min-width: 0; }
.calendrier .jour.aujourdhui { border-color: var(--accent); }
.calendrier .jour.hors-mois { opacity: .45; }
.calendrier .jour-tete { font-weight: 700; margin-bottom: .3rem; color: var(--texte-2); }
.calendrier .evenement { background: var(--accent-doux); border-left: 3px solid var(--accent); border-radius: 6px; padding: .2rem .35rem; margin-bottom: .25rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendrier .evenement.fait { border-left-color: var(--vert); background: var(--vert-fond); }

/* ---------- Connexion ---------- */
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.boite-connexion { width: min(980px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; }
.boite-connexion .carte { padding: 1.6rem; }
.comptes-demo { font-size: .9rem; }
.comptes-demo td, .comptes-demo th { padding: .45rem .5rem; }
.selecteur-profil { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }

/* ---------- Vue Gardien : gros boutons, un geste par écran ---------- */
.gardien { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 96px; }
.g-tete { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; background: var(--surface); border-bottom: 1px solid var(--bordure); position: sticky; top: 0; z-index: 10; }
.g-tete h1 { font-size: 1.15rem; margin: 0; flex: 1; }
.g-corps { padding: 1rem; flex: 1; }
.g-accueil { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.g-bouton {
  background: var(--surface); border: 2px solid var(--bordure); border-radius: 18px; color: var(--texte);
  min-height: 136px; padding: 1rem .6rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  font: inherit; font-size: 1.05rem; font-weight: 700; text-align: center; cursor: pointer; position: relative;
}
.g-bouton svg { width: 52px; height: 52px; color: var(--accent); }
.g-bouton:active { transform: scale(.98); }
.g-bouton:hover { border-color: var(--accent); }
.g-compteur { position: absolute; top: 10px; right: 12px; background: var(--rouge); color: #1b0b0b; border-radius: 99px; font-size: .8rem; padding: .05rem .5rem; font-weight: 800; }
[data-theme="clair"] .g-compteur { color: #fff; }
.g-question { font-size: 1.35rem; font-weight: 750; margin: .3rem 0 1rem; }
.g-chambres { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .6rem; }
.g-chambre { min-height: 72px; border-radius: 14px; border: 2px solid var(--bordure); background: var(--surface); color: var(--texte); font: inherit; font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.g-chambre.choisi, .g-chambre[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-doux); }
.g-choix { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.g-tuile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; text-align: center;
  min-height: 118px; padding: .7rem .5rem; border-radius: 16px; border: 2px solid var(--bordure); background: var(--surface); color: var(--texte);
  font: inherit; font-weight: 650; font-size: .98rem; cursor: pointer; position: relative;
}
.g-tuile svg { width: 42px; height: 42px; color: var(--accent); }
.g-tuile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-doux); }
.g-tuile[aria-pressed="true"]::after { content: ""; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1220' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat; }
.g-tuile.urgence-danger svg { color: var(--rouge); }
.g-tuile.urgence-urgente svg { color: var(--orange); }
.g-tuile.urgence-normale svg { color: var(--vert); }
.g-barre { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--bordure); padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); z-index: 15; }
.g-barre-int { max-width: 640px; margin: 0 auto; display: flex; gap: .7rem; }
.g-barre .bouton { flex: 1; min-height: 58px; font-size: 1.1rem; border-radius: 14px; }
.g-rappel { display: flex; gap: .6rem; align-items: flex-start; background: var(--orange-fond); color: var(--orange); border-radius: 12px; padding: .8rem 1rem; font-weight: 650; margin-bottom: 1rem; }
.g-rappel svg { flex: none; }
.g-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.g-photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--bordure); }
.g-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-photo button { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.g-ajout-photo { aspect-ratio: 1; border-radius: 14px; border: 2px dashed var(--bordure); background: transparent; color: var(--texte); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; font: inherit; font-weight: 650; cursor: pointer; }
.g-ajout-photo svg { width: 38px; height: 38px; color: var(--accent); }
.g-etat-reseau { display: flex; align-items: center; gap: .5rem; background: var(--orange-fond); color: var(--orange); padding: .55rem 1rem; font-weight: 700; font-size: .92rem; }
.g-etat-reseau svg { width: 20px; height: 20px; }
.g-succes { text-align: center; padding: 2rem 1rem; }
.g-succes .rond { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; background: var(--vert-fond); color: var(--vert); }
.g-succes .rond.attente { background: var(--orange-fond); color: var(--orange); }
.g-succes .rond svg { width: 56px; height: 56px; }
.g-succes p { font-size: 1.2rem; font-weight: 700; }
.g-carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px; padding: 1rem; margin-bottom: .8rem; }
.g-carte h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.g-etapes { color: var(--texte-2); font-size: .9rem; font-weight: 600; margin-bottom: .2rem; }
.g-langues { display: flex; gap: .5rem; }
.g-langues button { flex: 1; }
.g-ligne-coche { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 2px solid var(--bordure); border-radius: 14px; margin-bottom: .55rem; background: var(--surface); cursor: pointer; font-weight: 650; }
.g-ligne-coche input { width: 28px; height: 28px; flex: none; }
.g-ligne-coche.coche { border-color: var(--vert); background: var(--vert-fond); }
.pin { display: flex; gap: .7rem; justify-content: center; margin: 1rem 0; }
.pin span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--texte-2); }
.pin span.plein { background: var(--accent); border-color: var(--accent); }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; max-width: 340px; margin: 0 auto; }
.clavier button { min-height: 68px; font-size: 1.6rem; font-weight: 700; border-radius: 16px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); cursor: pointer; font-family: inherit; }
.qr { background: #fff; padding: 14px; border-radius: 14px; width: min(260px, 80vw); margin: .6rem auto; }
.qr svg, .qr img { width: 100%; height: auto; display: block; }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .nav-laterale { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--ombre); }
  .app.menu-ouvert .nav-laterale { transform: none; }
  .app.menu-ouvert::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
  .bouton-menu { display: inline-flex; }
  .barre-haut { padding: .6rem .9rem; flex-wrap: wrap; }
  .barre-haut select { min-width: 0; flex: 1 1 180px; }
  .contenu { padding: 1rem; }
  .deux-colonnes, .boite-connexion { grid-template-columns: 1fr; }
  .utilisateur .nom-utilisateur { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.3rem; }
  .tableau thead { display: none; }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau tr { border-bottom: 1px solid var(--bordure); padding: .5rem 0; }
  .tableau td { border: 0; padding: .3rem .9rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .tableau td::before { content: attr(data-titre); font-weight: 600; color: var(--texte-2); text-align: left; flex: none; max-width: 45%; }
  .tableau td.nombre { text-align: right; }
  .indicateurs { grid-template-columns: 1fr 1fr; }
  .indicateur-valeur { font-size: 1.4rem; }
  .calendrier { grid-template-columns: 1fr; }
  .calendrier .jour { min-height: 0; }
  .calendrier .jour.hors-mois { display: none; }
  .plan-chambres { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .en-tete-page .actions { width: 100%; }
  .barre-ligne { grid-template-columns: 90px 1fr 34px; }
  .g-bouton { min-height: 124px; font-size: 1rem; }
}
@media print {
  .nav-laterale, .barre-haut, .bandeau-demo { display: none; }
  .app { display: block; }
}

/* Thème clair : coche blanche sur l'accent bleu (contraste suffisant). */
[data-theme="clair"] .g-tuile[aria-pressed="true"]::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* Petits écrans : les boutons à libellé long passent à la ligne au lieu de déborder. */
@media (max-width: 640px) {
  .bouton { white-space: normal; text-align: center; max-width: 100%; }
}
