/* Application de gestion d'hébergement, habillée avec la charte OBT Agency.
   Toutes les valeurs viennent de /brand/tokens.css : rien n'est écrit en dur ici. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--c-bg-panel);
  color: var(--c-text);
  font: var(--fw-regular) var(--fs-sm)/var(--body-lh) var(--font-base);
  letter-spacing: 0;
  padding-bottom: var(--kb, 0px);
}
h1, h2, h3 { margin: 0; color: var(--c-text); text-wrap: balance; }
h1 { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--h1-lh); letter-spacing: var(--h1-ls); }
h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--h3-lh); letter-spacing: var(--h3-ls); }
h3 { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--h3-lh); letter-spacing: var(--h3-ls); }
p { margin: 0; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 6px; }
.eyebrow { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--eyebrow-ls); text-transform: uppercase; color: var(--c-accent); }
.muted { color: var(--c-text-muted); }
.small { font-size: var(--fs-xs); }
/* Un champ masqué le reste, même quand sa classe lui donne un affichage (.field, .stack-sm, .row). */
[hidden] { display: none !important; }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
/* Les deux dates de la période d'une option : jour et mois de chaque côté de « jusqu'au », sur une seule ligne quand la place le permet. */
.row[data-period] { flex-wrap: nowrap; }
.row[data-period] > .row { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; gap: var(--sp-2); }
.row[data-period] select { width: 100%; min-width: 0; padding-inline: var(--sp-2); }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--sp-6); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.grid { display: grid; gap: var(--sp-6); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Console : panneau latéral et contenu */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--c-bg); border-right: 1px solid var(--c-border); padding: var(--sp-6) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-6); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
.brand img { height: var(--logo-height); width: auto; align-self: flex-start; display: block; }
.brand small { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--eyebrow-ls); text-transform: uppercase; color: var(--c-accent); }
.nav { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-1); background: var(--nav-track-bg); border: 1px solid var(--nav-track-border); border-radius: var(--radius-md); }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill); color: var(--c-text); font-size: var(--fs-xs); font-weight: var(--fw-medium); transition: background .25s; }
.nav a:hover { background: var(--nav-hover-bg); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--nav-active-bg); box-shadow: var(--nav-active-shadow); }
.count { background: var(--c-alert); color: var(--c-text-on-accent); font-size: var(--fs-2xs); font-weight: var(--fw-bold); padding: 0 var(--sp-2); border-radius: var(--radius-pill); line-height: 1.5; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.content { padding: var(--sp-8) clamp(1rem, 4vw, 3rem) var(--sp-16); max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.page-head .eyebrow { display: block; margin-bottom: var(--sp-2); }
.page-head p { color: var(--c-text-muted); margin-top: var(--sp-2); }

/* Cartes, tableaux, pastilles d'état */
.card { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-6); min-width: 0; }
.card > h2, .card > .row > h2 { margin-bottom: var(--sp-3); }
.kpi { display: flex; flex-direction: column; gap: var(--sp-1); }
.kpi .label { color: var(--c-text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.kpi .value { font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: var(--h1-ls); line-height: var(--h1-lh); font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: var(--fs-2xs); color: var(--c-text-faint); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-faint); font-weight: var(--fw-bold); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
table.data td { padding: var(--sp-3); border-bottom: 1px solid var(--c-border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--c-bg-panel); }
table.data .num { text-align: right; }
.pill { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-pill); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); white-space: nowrap; background: var(--c-bg-elevated); color: var(--c-text); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-text-faint); }
.pill-actif { background: var(--c-ok-a12); }
.pill-actif::before { background: var(--c-ok); }
.pill-en_production { background: var(--c-accent-a12); }
.pill-en_production::before { background: var(--c-accent); }
.pill-impaye, .pill-suspendu { background: var(--c-alert-a12); }
.pill-impaye::before, .pill-suspendu::before { background: var(--c-alert); }
.empty { text-align: center; color: var(--c-text-muted); padding: var(--sp-8) var(--sp-3); }

/* Boutons en pilule, formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border: 1px solid var(--c-border-strong); background: transparent; color: var(--c-text); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: var(--body-lh); cursor: pointer; transition: background .25s, border-color .25s, color .25s; }
.btn:hover:not(:disabled) { border-color: var(--c-accent); color: var(--c-accent); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--c-accent-deep); color: var(--c-text-on-accent); border-color: transparent; box-shadow: var(--shadow-glow); }
.btn-primary:hover:not(:disabled) { background: var(--c-accent-light); color: var(--c-text); border-color: transparent; }
.btn-danger { background: var(--c-alert); color: var(--c-text-on-accent); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--c-text); color: var(--c-text-on-accent); border-color: transparent; }
.btn-small { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-2xs); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.field label { font-weight: var(--fw-semibold); font-size: var(--fs-xs); }
.field input, .field select, .field textarea, .row input[type="search"], .row select { background: var(--c-bg-elevated); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); width: 100%; }
.field textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--c-text-faint); font-size: var(--fs-2xs); }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.warn-text { color: var(--c-alert); font-weight: var(--fw-semibold); }
.error-box, .warn-box { background: var(--c-alert-a12); border: 1px solid var(--c-alert-a24); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); font-weight: var(--fw-medium); }
.info-box { background: var(--c-accent-a08); border: 1px solid var(--c-accent-a12); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-xs); }
.codebox { background: var(--c-bg-panel); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); overflow-x: auto; white-space: pre; display: block; }
.secret { font-size: var(--fs-md); letter-spacing: .08em; font-weight: var(--fw-bold); word-break: break-all; white-space: normal; }

/* Onglets */
.tabs { position: relative; display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--c-border); margin-bottom: var(--sp-6); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-text-muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--c-accent); border-bottom-color: var(--c-accent); }

/* Fenêtres et messages */
.overlay { position: fixed; inset: auto; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); background: var(--c-overlay); display: grid; place-items: center; padding: var(--sp-4); z-index: 50; }
.modal { background: var(--c-bg); border-radius: var(--radius-lg); padding: var(--sp-8); width: min(520px, 100%); max-height: min(90vh, 100%); overflow: auto; display: flex; flex-direction: column; gap: var(--sp-4); box-shadow: var(--shadow-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }
#toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 60; }
.toast { background: var(--c-text); color: var(--c-text-on-accent); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: var(--fw-medium); max-width: 360px; box-shadow: var(--shadow-soft); }
.toast-error { background: var(--c-alert); }

/* Connexion : fond de page avec les halos de la marque */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6); position: relative; overflow: hidden; }
.auth::before, .auth::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth::before { width: 640px; height: 640px; background: var(--blob-bright); top: -220px; right: -160px; opacity: .55; }
.auth::after { width: 520px; height: 520px; background: var(--blob-light); bottom: -200px; left: -140px; opacity: .6; }
.auth-card { position: relative; z-index: 1; width: min(460px, 100%); display: flex; flex-direction: column; gap: var(--sp-6); background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: var(--sp-8); box-shadow: var(--shadow-soft); }
.auth-card .brand { padding: 0; }
.auth-card .brand img { height: 32px; }
.qr { width: 200px; max-width: 100%; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--sp-2); background: var(--c-bg); align-self: center; }
.recovery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.recovery code { background: var(--c-bg-panel); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); text-align: center; }

/* Graphiques */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--c-border); stroke-width: 1; }
.chart .axis { fill: var(--c-text-faint); font-size: 10.5px; font-family: var(--font-base); }
.chart .bar { fill: var(--c-accent); }
.chart .line { fill: none; stroke: var(--c-accent); stroke-width: 2.5; }
.chart .area { fill: var(--c-accent); opacity: .12; }
.chart .dot { fill: var(--c-accent); }
.progress { height: 8px; background: var(--c-bg-elevated); border-radius: var(--radius-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-accent); border-radius: var(--radius-pill); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border); display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; }
.list li:last-child { border-bottom: 0; }
.entry-detail::before { content: " : "; }
.sev { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sev-haute { background: var(--c-alert); }
.sev-moyenne { background: var(--c-accent-bright); }

/* Production */
.steps-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.steps-bar .arrows { display: flex; gap: var(--sp-2); }
.steps-table { min-width: 1100px; }
.steps-table th.step { text-transform: none; letter-spacing: 0; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-text-muted); white-space: normal; text-align: center; min-width: 112px; vertical-align: bottom; padding: var(--sp-2) var(--sp-2); }
.steps-table td:not(:first-child) { text-align: center; }
.steps-table th:first-child, .steps-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--c-bg); min-width: 170px; }
.steps-table td:not(:first-child) .step-btn { max-width: 112px; }
.steps-table tr.focus td, table.data tr.focus td { background: var(--c-accent-a12); }
.saved-box { border-color: var(--c-ok); background: var(--c-ok-a12); }
.step-btn { width: 100%; min-width: 34px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-bg); cursor: pointer; font-size: var(--fs-2xs); font-weight: var(--fw-bold); }
.step-btn.fait { background: var(--c-ok-a12); border-color: var(--c-ok); color: var(--c-text); }
.step-btn.en_cours { background: var(--c-accent-a12); border-color: var(--c-accent); color: var(--c-accent); }

/* Espace client : barre du haut en pilule, comme le site de l'agence */
.topnav { background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
.topnav-in { max-width: 1080px; margin: 0 auto; padding: var(--sp-4) clamp(1rem, 3vw, 2rem); display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.topnav .brand { padding: 0; flex-direction: row; align-items: center; gap: var(--sp-4); }
.topnav .brand .who { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-text-muted); padding-left: var(--sp-4); border-left: 1px solid var(--c-border); }
/* Le menu tient sur une seule ligne, sous le nom de l'établissement : si les pages ne tiennent pas toutes, une flèche à chaque bout les fait défiler. */
.topnav-in .brand { order: 1; }
.topnav-in .out { order: 2; }
.topnav-in .navbar { order: 3; flex: 1 0 100%; position: relative; display: flex; align-items: center; min-width: 0; }
.topnav nav { display: flex; flex: 1; min-width: 0; gap: var(--sp-1); padding: var(--sp-1); background: var(--nav-track-bg); border: 1px solid var(--nav-track-border); border-radius: var(--radius-pill); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.topnav nav::-webkit-scrollbar { display: none; }
.navbar-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 2rem; height: 2rem; padding: 0; border-radius: 50%; border: 1px solid var(--c-border); background: var(--c-bg-elevated); color: var(--c-text); font-size: 1.25rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(10, 20, 32, 0.15); }
.navbar-arrow-left { left: 6px; }
.navbar-arrow-right { right: 6px; }
.topnav nav a { flex: none; white-space: nowrap; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-pill); color: var(--c-text); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.topnav nav a:hover { background: var(--nav-hover-bg); text-decoration: none; }
.topnav nav a[aria-current="page"] { background: var(--nav-active-bg); box-shadow: var(--nav-active-shadow); }
.topnav .out { margin-left: auto; }
.espace { max-width: 1080px; margin: 0 auto; padding: var(--sp-8) clamp(1rem, 3vw, 2rem) var(--sp-16); display: flex; flex-direction: column; gap: var(--sp-6); }

.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: var(--sp-6); }
.month-title { font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .wd { font-size: var(--fs-2xs); text-align: center; color: var(--c-text-faint); padding: 2px 0; }
.day { border: 0; height: 34px; border-radius: var(--radius-sm); background: var(--c-bg-elevated); cursor: pointer; font-size: var(--fs-xs); color: var(--c-text); font-variant-numeric: tabular-nums; }
.day:hover:not(:disabled) { outline: 2px solid var(--c-accent); }
.day.busy { background: var(--c-alert-a24); }
.day.busy.via { background: repeating-linear-gradient(135deg, var(--c-alert-a24) 0 5px, var(--c-bg-elevated) 5px 10px); }
.day.past { opacity: .4; }
.day.pick { background: var(--c-accent); color: var(--c-text-on-accent); }
.day.range { background: var(--c-accent-a18); }
.blank { height: 34px; }
.legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-xs); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: var(--sp-2); }
.legend .free { background: var(--c-bg-elevated); }
.legend .taken { background: var(--c-alert-a24); }
.legend .via { background: repeating-linear-gradient(135deg, var(--c-alert-a24) 0 3px, var(--c-bg-elevated) 3px 6px); }
.selection { background: var(--c-bg); border: 2px solid var(--c-accent); border-radius: var(--radius-md); padding: var(--sp-4); box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: var(--sp-3); }
.sticky-panel { position: sticky; bottom: var(--sp-3); z-index: 5; }
.pick-tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.pick-tabs button { border: 1px solid var(--c-border-strong); background: transparent; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill); cursor: pointer; font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.pick-tabs button[aria-pressed="true"] { background: var(--c-accent); color: var(--c-text-on-accent); border-color: transparent; }

.today-date { color: var(--c-accent); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wizard-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-xs); }
.wizard-steps li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-pill); border: 1px solid var(--c-border); color: var(--c-text-muted); }
.wizard-steps li .n { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; background: var(--c-bg-elevated); font-weight: var(--fw-semibold); }
.wizard-steps li.done { color: var(--c-text); }
.wizard-steps li[aria-current="step"] { border-color: var(--c-accent); color: var(--c-accent); font-weight: var(--fw-semibold); }
.wizard-steps li[aria-current="step"] .n { background: var(--c-accent); color: var(--c-text-on-accent); }
.choices { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice { text-align: left; border: 1px solid var(--c-border-strong); background: var(--c-bg); border-radius: var(--radius-md); padding: var(--sp-4); cursor: pointer; display: flex; flex-direction: column; gap: var(--sp-2); font: inherit; color: inherit; }
.choice span { font-size: var(--fs-xs); color: var(--c-text-muted); }
.choice[aria-pressed="true"] { border-color: var(--c-accent); box-shadow: inset 0 0 0 2px var(--c-accent); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Case d'import d'image */
.imgfield { position: relative; display: grid; gap: var(--sp-2); overflow: hidden; }
.imgfield-file { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.imgfield-box { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border: 2px dashed var(--c-border); border-radius: var(--radius-sm); background: var(--c-bg-panel); color: inherit; cursor: pointer; overflow: hidden; padding: 0; font: inherit; }
.imgfield-box:hover:not([disabled]) { border-color: var(--c-accent); }
.imgfield-label { font-weight: 600; }
.imgfield-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.imgfield-change { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--sp-2); background: var(--c-overlay); color: var(--c-text-on-accent); font-size: .85rem; text-align: center; }
.logement-card { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: var(--sp-4); align-items: start; }
.logement-card img, .logement-card .logement-noimg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--c-bg-panel); display: grid; place-items: center; color: var(--c-text-muted); font-size: .85rem; }
@media (max-width: 560px) { .logement-card { grid-template-columns: 1fr; } }

/* Pour quels logements : une petite case par choix (la coche à gauche, le nom à droite), trois par ligne */
.scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.field .scope-choice, .scope-choice { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-2) var(--sp-3); background: var(--c-bg-elevated); border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: var(--fw-medium); cursor: pointer; }
.field .scope-choice input, .scope-choice input { width: auto; flex: none; margin: 0; padding: 0; border: 0; background: none; }
.scope-choice span { min-width: 0; overflow-wrap: anywhere; }
.scope-choice:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-a08); }
@media (max-width: 560px) { .scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Changer mes tarifs : la case du bas suit l'écran et porte le prix, les nuits minimum puis la vérification */
.sheet { position: sticky; bottom: var(--sp-3); z-index: 5; max-height: 80vh; overflow-y: auto; border-radius: var(--radius-md); }
.sheet .sheet-summary { margin: 0; }
.sheet label.row { flex-wrap: nowrap; align-items: flex-start; }

/* Téléphone : menu à trois barres, carrousel des mois, lignes compactes. Rien de tout cela n'apparaît sur ordinateur. */
.mbar, .mmenu, .cal-nav, .page-help { display: none; }
.mmenu[hidden] { display: none; }
.menu-btn { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--c-border-strong); background: var(--c-bg); cursor: pointer; }
.menu-btn:hover { border-color: var(--c-accent); }
.bars, .cross { position: relative; display: block; width: 18px; height: 14px; }
.bars i { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--c-text); }
.bars i:nth-child(1) { top: 0; }
.bars i:nth-child(2) { top: 6px; }
.bars i:nth-child(3) { top: 12px; }
.cross i { position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: var(--c-text); }
.cross i:nth-child(1) { transform: rotate(45deg); }
.cross i:nth-child(2) { transform: rotate(-45deg); }

@media (max-width: 860px) {
  body { overflow-x: hidden; }
  input, select, textarea { font-size: 16px; }

  /* La barre du haut : le logo à gauche, le bouton rond à droite, à la même hauteur */
  .mbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); height: 64px; padding: 0 var(--sp-4); background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
  .mbar .brand { flex-direction: row; align-items: center; gap: var(--sp-3); padding: 0; min-width: 0; }
  .mbar .brand img { height: 28px; }
  .mbar .who-m { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--c-text-muted); padding-left: var(--sp-3); border-left: 1px solid var(--c-border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .mmenu { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--c-bg); overflow-y: auto; }
  .mmenu[hidden] { display: none; }
  .mmenu-top { display: flex; align-items: center; justify-content: flex-end; height: 64px; padding: 0 var(--sp-4); flex: none; }
  .mmenu-nav { display: flex; flex-direction: column; padding: 0 var(--sp-4); }
  .mmenu-nav a { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-2); border-bottom: 1px solid var(--c-border); color: var(--c-text); font-size: var(--fs-md); font-weight: var(--fw-medium); }
  .mmenu-nav a:hover { text-decoration: none; background: var(--nav-hover-bg); }
  .mmenu-nav a[aria-current="page"] { color: var(--c-accent); font-weight: var(--fw-bold); }
  .mmenu-foot { margin-top: auto; padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--sp-3); align-items: stretch; }
  .mmenu-actions { display: flex; gap: var(--sp-3); }
  .mmenu-actions .btn { flex: 1; padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
  .mmenu-note { text-align: center; overflow-wrap: anywhere; }
  body.menu-open { overflow: hidden; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .topnav { display: none; }
  .content { padding: var(--sp-6) var(--sp-4) var(--sp-12); }
  .espace { padding: var(--sp-6) var(--sp-4) var(--sp-6); }
  .page-help { display: flex; justify-content: center; padding: var(--sp-2) var(--sp-4) var(--sp-8); }
  .page-head { align-items: flex-start; }
  .card { padding: var(--sp-4); }

  /* Tableau de bord : deux cases par ligne, plus petites */
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .cols-4 .kpi.card { padding: var(--sp-3); }
  .cols-4 .kpi .label { font-size: var(--fs-2xs); }
  .cols-4 .kpi .value { font-size: var(--fs-lg); }
  .cols-4 .kpi .sub { font-size: .6875rem; line-height: 1.3; }

  /* Liste des clients : une petite ligne par client, le nom et le statut */
  .hide-m { display: none; }
  table.list-m th, table.list-m td { padding: var(--sp-3) var(--sp-2); }
  table.list-m td:first-child { overflow-wrap: anywhere; }
  table.list-m td:last-child { text-align: right; white-space: nowrap; }

  /* Accès : chaque ligne devient un bloc, une information par ligne */
  table.stack-m, table.stack-m tbody, table.stack-m tr, table.stack-m td { display: block; }
  table.stack-m thead { display: none; }
  table.stack-m tr { padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border); }
  table.stack-m tr:last-child { border-bottom: 0; }
  table.stack-m td { border: 0; padding: var(--sp-1) 0; overflow-wrap: anywhere; }
  table.stack-m td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-faint); }
  table.stack-m td.num { padding-top: var(--sp-3); }
  table.stack-m td.num .row { justify-content: flex-start !important; }
  table.stack-m td.num .btn { flex: 1; }
  /* Les logements d'un client : le nom en tête, puis chaque information sur une ligne (nom à gauche, valeur à droite) */
  table.rows-m td { text-align: left; }
  table.rows-m td:first-child { padding-bottom: var(--sp-2); font-size: var(--fs-sm); }
  table.rows-m td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); text-align: right; }
  table.rows-m td[data-label]::before { margin: 0; text-align: left; flex: none; }
  table.rows-m td.num:last-child { padding-top: var(--sp-3); border-bottom: 0; }
  table.rows-m td[data-label] > span { min-width: 0; text-align: right; overflow-wrap: anywhere; }

  /* Les logements du planning : une seule ligne qu'on fait défiler de côté pour trouver le gîte ou la chambre */
  .pick-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: calc(-1 * var(--sp-4)); padding: var(--sp-1) var(--sp-4); scroll-padding-inline: var(--sp-4); }
  .pick-tabs::-webkit-scrollbar { display: none; }
  .pick-tabs button { flex: none; white-space: nowrap; padding-block: var(--sp-3); }

  /* Le journal : le titre de la modification, puis le détail et la date chacun sur sa ligne */
  .journal-list li { flex-direction: column; align-items: stretch; gap: 0; padding: var(--sp-3) 0; }
  .journal-list li > span:first-child { display: contents; }
  .journal-list li strong { display: block; padding-bottom: var(--sp-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
  .journal-list [data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); padding: var(--sp-2) 0; border-top: 1px solid var(--c-border); text-align: right; font-size: var(--fs-xs); overflow-wrap: anywhere; }
  .journal-list [data-label]::before { content: attr(data-label); flex: none; text-align: left; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-faint); }

  /* Calendriers : un mois à la fois, une flèche de chaque côté du nom du mois */
  .cal-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
  .cal-title { font-weight: var(--fw-semibold); text-transform: capitalize; text-align: center; flex: 1; }
  .cal-arrow { width: 44px; height: 44px; padding: 0; font-size: var(--fs-md); }
  .month-carousel .months { grid-template-columns: minmax(0, 1fr); }
  .month-carousel .month:not(.active) { display: none; }
  .month-carousel .month-title { display: none; }
  .day { height: 42px; }
  .blank { height: 42px; }

  .sheet { max-height: calc(var(--vv-h, 100vh) * .8); }
  /* L'onglet de la page où l'on arrive se place au milieu : il faut un peu de marge de chaque côté pour que même le premier et le dernier puissent y venir */
  .tabs { padding-inline: 35%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

/* La boîte de réception : une ligne par demande, le détail se déplie. */
.requests .request { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-2); }
.request-details { padding: var(--sp-3); background: var(--c-bg-elevated); border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.request-details dl { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: var(--sp-1) var(--sp-4); margin: 0; }
.request-details dt { font-weight: var(--fw-semibold); font-size: var(--fs-xs); color: var(--c-text-muted); }
.request-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) { .request-details dl { grid-template-columns: 1fr; } .request-details dt { margin-top: var(--sp-2); } }
