@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format('woff2'); }

/* ============ Design tokens — Lockium (encre + turquoise) ============ */
:root {
  --ink: #1d1b1c;
  --ink-2: #3a3638;
  --accent: #6DCED6;
  --accent-dark: #23868f;
  --accent-soft: #e9f8f9;
  --accent-line: #c6ebee;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #eaecef;
  --line-2: #d9dde2;
  --muted: #6b7280;
  --danger: #c2412d;
  --danger-soft: #fdeeea;
  --warn: #a86b00;
  --warn-soft: #fff5de;
  --ok: #1f7a4d;
  --ok-soft: #e4f5ec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--accent-dark); text-underline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 30px 0 12px; font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Layout ============ */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 24px; color: var(--ink); }
.brand .logo { width: 30px; height: auto; flex: none; }
.brand .wordmark { height: 16px; width: auto; }
.brand .brandlogo { height: 32px; width: auto; display: block; }
.brand span { color: var(--accent-dark); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding-top: 2px; }
.side a.nav { display: flex; align-items: center; gap: 11px; color: var(--ink-2); text-decoration: none; padding: 9px 10px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.side a.nav .ic { color: #8a9099; }
.side a.nav:hover { background: #f2f4f6; }
.side a.nav.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.side a.nav.active .ic { color: var(--accent-dark); }
.side .navsep { height: 1px; background: var(--line); margin: 10px 6px; }
.side .who { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.side .who .av { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.side .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .who .role { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .who .ver { grid-column: 1 / -1; font-size: 11px; color: #9aa0a8; }
main { padding: 32px 40px 72px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { font-size: 14px; }
.topbar { display: none; }
.side-bg { display: none; }

/* ============ Components ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat { display: flex; gap: 14px; align-items: center; }
.stat .si { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; flex: none; }
.stat .si .ic { width: 20px; height: 20px; }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.alert .si { background: var(--danger-soft); color: var(--danger); }
.stat.alert .n { color: var(--danger); }

.btn { font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 9px 15px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--ink-2); }
.btn:focus-visible { outline: 3px solid #6dced680; outline-offset: 1px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn.accent:hover { background: #5cc4cd; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow); }
.btn.ghost:hover { background: #f4f5f7; }
.btn.danger { background: var(--card); color: var(--danger); border-color: #efc9c1; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 14px 20px; font-size: 16px; width: 100%; }
.btn.icon { padding: 6px; width: 34px; height: 34px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; background: #fbfbfc; }
tr:first-child th:first-child { border-top-left-radius: var(--radius); }
tr:first-child th:last-child { border-top-right-radius: var(--radius); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td, tbody tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
td.act { text-align: right; white-space: nowrap; width: 1%; }
td.act .row { justify-content: flex-end; flex-wrap: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #f0f1f3; color: var(--ink-2); }
.badge.ouvert { background: var(--danger-soft); color: var(--danger); }
.badge.en_cours { background: var(--warn-soft); color: var(--warn); }
.badge.resolu, .badge.actif { background: var(--ok-soft); color: var(--ok); }
.badge.ferme, .badge.termine, .badge.revoque { background: #f0f1f3; color: var(--muted); }
.badge.urgente { background: var(--danger); color: #fff; }
.badge.accent { background: var(--accent-soft); color: var(--accent-dark); }
.battery { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.battery.low { color: var(--danger); font-weight: 700; }

.banner { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; background: var(--warn-soft); border: 1px solid #f3e0b0; font-size: 14px; }
.banner.danger { background: var(--danger-soft); border-color: #f3cbc2; }
.banner.info { background: var(--accent-soft); border-color: var(--accent-line); }
.banner.warn { background: var(--warn-soft); border-color: #f1dcae; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* Menu « ⋯ » des lignes */
.menu-pop { position: fixed; z-index: 40; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu-pop .mi { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu-pop .mi:hover { background: #f3f4f6; }
.menu-pop .mi .ic { color: #8a9099; }
.menu-pop .mi.danger { color: var(--danger); }
.menu-pop .mi.danger .ic { color: var(--danger); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

/* ============ Forms ============ */
label.f { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.f input, label.f select, label.f textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
label.f textarea { min-height: 90px; resize: vertical; }
label.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; }
label.check input { margin-top: 3px; accent-color: var(--accent-dark); width: 16px; height: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dark) !important; box-shadow: 0 0 0 3px #6dced640; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.error { color: var(--danger); font-size: 14px; margin: 6px 0 10px; min-height: 1em; }
div.f { margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
div.f .check span, div.f .seg label { font-weight: 400; color: var(--ink); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.seg.three { grid-template-columns: repeat(3, 1fr); margin: 6px 0 0; }
.seg label { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 12px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 4px; transition: border-color .15s, background .15s; }
.seg input { margin-right: 6px; accent-color: var(--accent-dark); }
.seg label:has(input:checked) { border-color: var(--accent-dark); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-dark) inset; }
.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
label.f select optgroup { font-weight: 600; }

/* ============ Modal & toast ============ */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 20, 24, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px; z-index: 20; overflow-y: auto; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 540px; padding: 26px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal h3 { margin: 0 0 18px; font-size: 19px; letter-spacing: -.01em; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.modal .card { box-shadow: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .modal-bg, .modal { animation: none; } }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); font-size: 14px; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--danger); }

/* ============ Auth pages ============ */
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -10%, #2c3b3d 0%, var(--ink) 60%); }
.auth .card { width: min(420px, calc(100vw - 32px)); padding: 32px; border: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-brand { text-align: center; margin: 0 0 6px; }
.auth-brand img { width: 230px; height: auto; display: block; margin: 0 auto 14px; }
.auth-app { display: inline-block; margin-top: 12px; padding: 3px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.auth-brand + p { text-align: center; margin-bottom: 22px; }
.ver-login { text-align: center; font-size: 12px; color: #8d9294; margin-top: 14px; }
.copy-login { margin: 6px auto 8px; max-width: 560px; line-height: 1.5; padding: 0 12px; font-size: 14px; font-weight: 600; color: #ffffff; letter-spacing: 0.01em; }
.copy-login sup { font-size: 0.7em; color: #6DCED6; }
.cg-login { margin: 0 0 6px; font-size: 11px; }
.cg-login a, .ver a { color: inherit; opacity: .8; text-decoration: underline; }

/* ============ Locataire : cartes de clés ============ */
.keys { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.key { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.key .name { font-weight: 700; font-size: 16px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: 3px; background: var(--accent-soft); color: var(--ink); border-radius: 9px; padding: 6px 11px; display: inline-block; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); max-width: 640px; }
.plan.current { border-color: var(--accent-dark); box-shadow: 0 0 0 2px #6dced640; }
.plan .price { font-size: 28px; font-weight: 700; margin: 6px 0; letter-spacing: -.02em; }
.plan .price span { white-space: nowrap; }

/* ============ Utilisateurs : vue « Accès aux portes » ============ */
.tabs { display: inline-flex; gap: 4px; background: #eceef1; padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tabs a { padding: 7px 16px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 9px; }
.tabs a.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
table.acces td { vertical-align: top; }
.bgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.bgroup > .small { width: 100%; font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 99px; padding: 3px 4px 3px 11px; font-size: 13px; }
.chip .x { border: 0; background: transparent; color: var(--danger); font-size: 16px; line-height: 1; cursor: pointer; padding: 1px 7px 3px; border-radius: 99px; }
.chip .x:hover { background: var(--danger-soft); }
.chip .nm { color: var(--ink); font-weight: 500; }
.chip .nm::before { content: '· '; color: var(--muted); }
.show-m { display: none; }

/* ============ Sélecteur de personne avec recherche ============ */
.picker { position: relative; margin-top: 6px; }
.picker .pk-q { display: block; width: 100%; font: inherit; font-weight: 400; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.pk-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; padding: 6px; }
.pk-g { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 4px; font-weight: 600; }
.pk-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 400; color: var(--ink); }
.pk-item:hover, .pk-item.on { background: var(--accent-soft); }
.pk-av { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.pk-new .pk-av { background: var(--accent); color: var(--ink); font-size: 16px; }
.pk-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pk-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Mobile ============ */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 16; height: 100%; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side-bg.open { display: block; position: fixed; inset: 0; background: rgba(20, 20, 24, .4); z-index: 15; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 16px; position: sticky; top: 0; z-index: 10; }
  .topbar .brand { padding: 0; }
  .topbar .brand .logo { width: 26px; }
  .topbar .brand .brandlogo { height: 28px; }
  .topbar button { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
  .topbar button .ic { width: 24px; height: 24px; }
  main { padding: 20px 16px 72px; }
  h1 { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  th.hide-m, td.hide-m { display: none; }
  th, td { padding: 12px; }
  .show-m { display: inline-flex; }
  .chip { flex-wrap: wrap; }
  .seg.three { grid-template-columns: 1fr; }
  .modal { padding: 20px; border-radius: 16px; }
}
@media (max-width: 860px) {
  div.show-m { display: block; }
  td.act .lbl { display: none; }
  td.act .btn.sm { padding: 6px; width: 34px; height: 34px; }
}
#newver { position: fixed; right: 20px; bottom: 20px; z-index: 45; display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; padding: 10px 10px 10px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; }
@media (max-width: 860px) { #newver { left: 16px; right: 16px; bottom: 16px; justify-content: space-between; } }

/* Invitation */
.invite { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: center; }
.invite .qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; line-height: 0; }
.invite .qr svg { width: 100%; height: auto; }
.invite-r label.f { margin-bottom: 6px; }
details summary { cursor: pointer; }
@media (max-width: 600px) { .invite { grid-template-columns: 1fr; } .invite .qr { max-width: 180px; margin: 0 auto; } }

/* Discussion d'un signalement (chat) */
.chat { padding: 0; overflow: hidden; }
.chat-fil { max-height: 56vh; min-height: 160px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #f7f9fa; }
.chat-b { max-width: 78%; padding: 8px 12px 6px; border-radius: 14px; line-height: 1.4; }
.chat-b.lui { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-b.moi { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--accent-line); border-bottom-right-radius: 4px; }
.chat-nom { font-size: 12px; font-weight: 600; color: var(--accent-dark); margin-bottom: 2px; }
.chat-nom span { font-weight: 400; color: var(--muted); }
.chat-txt { white-space: pre-wrap; word-wrap: break-word; }
.chat-h { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.chat-jour { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px; margin: 8px 0 4px; text-transform: capitalize; }
.chat-sys { align-self: center; font-size: 12px; color: var(--muted); font-style: italic; text-align: center; }
.chat-saisie { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; margin: 0; }
.chat-saisie textarea { font: inherit; flex: 1; resize: none; min-height: 42px; max-height: 160px; border-radius: 20px; padding: 10px 14px; margin: 0; }
.chat + .small, .chat .small.muted { padding: 0 14px 10px; }

/* Signalements résolus / fermés : grisés */
tr.clos td { color: var(--muted); }
tr.clos td b { color: var(--muted); font-weight: 500; }
tr.clos .badge { opacity: .65; filter: grayscale(1); }
tr.clos { background: #fafafa; }

/* ============ Terrains & clubs : réservations ============ */
.daynav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.daynav input[type=date] { width: auto; }
.daynav .dn { margin-left: 4px; }
.courts-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); align-items: start; }
.court-col { padding: 14px; }
.court-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.bk { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; border: 1px solid var(--line); border-left: 3px solid var(--accent-dark); border-radius: var(--radius-sm); padding: 8px 8px 8px 10px; margin-bottom: 6px; background: var(--card); }
.bk.wait { border-left-color: var(--warn); background: var(--warn-soft); }
.bk.free { border-style: dashed; border-left: 1px dashed var(--line-2); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, border-color .15s; }
.bk.free:hover { background: var(--accent-soft); border-color: var(--accent-dark); color: var(--accent-dark); }
.bk-t { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 46px; font-size: 14px; line-height: 1.2; }
.bk-t span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.bk-b { flex: 1; min-width: 0; font-size: 14px; }
.code-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .08em; background: #f0f1f3; border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.code-box { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 16px; text-align: center; margin: 14px 0 8px; }
.code-box .row { text-align: left; }
.code-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 42px; font-weight: 700; letter-spacing: .14em; line-height: 1.2; margin: 4px 0; color: var(--ink); }
.code-med { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: .1em; }
.code-row { padding: 6px 0; border-bottom: 1px solid var(--accent-line); }
.table-wrap.flat { box-shadow: none; }
tr.off td { color: var(--muted); }
.days-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 12px; }
.days-l { width: 100%; font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.days-row label.day-ck { margin: 0; border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; gap: 6px; align-items: center; }
.days-row label.day-ck:has(input:checked) { border-color: var(--accent-dark); background: var(--accent-soft); }
.days-row label.day-ck input { margin: 0; }
input.inp { font: inherit; color: var(--ink); padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
input.inp[readonly] { background: #f6f7f9; font-size: 14px; }

/* Page publique */
.pub { min-height: 100vh; background: var(--bg); padding: 24px 16px 40px; }
.pub-in { max-width: 720px; margin: 0 auto; }
.pub-h { margin-bottom: 16px; }
.pub-h h1 { font-size: 28px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chipbtn { font: inherit; font-size: 14px; border: 1px solid var(--line-2); background: var(--card); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.chipbtn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.daychips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: thin; }
.day { font: inherit; flex: none; width: 58px; border: 1px solid var(--line-2); background: var(--card); border-radius: 12px; padding: 7px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.25; color: var(--ink); }
.day span { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.day b { font-size: 18px; }
.day.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.day.on span { color: #d6d8dc; }
.pub-court { margin-bottom: 12px; padding: 16px; }
.price-tag { font-weight: 700; white-space: nowrap; }
.price-tag span { font-weight: 400; color: var(--muted); font-size: 13px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 12px; }
.slot { font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; border: 1px solid var(--accent-dark); color: var(--accent-dark); background: var(--card); border-radius: var(--radius-sm); padding: 10px 0; cursor: pointer; min-height: 44px; transition: background .15s; }
.slot:hover { background: var(--accent-soft); }
.slot:disabled { border-color: var(--line); color: #b4b8bf; background: #f3f4f6; text-decoration: line-through; cursor: not-allowed; }
.pub-sum { background: #f6f7f9; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; line-height: 1.6; }
.pub-conf { text-align: center; padding: 28px 22px; }
.pub-conf h1 { margin-bottom: 14px; }
.pub-conf .pub-sum { text-align: center; text-transform: none; }
.ok-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 10px; }
.ok-ic .ic { width: 30px; height: 30px; stroke-width: 2.4; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--accent-line); border-top-color: var(--accent-dark); margin: 0 auto 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
@media (max-width: 600px) { .code-big { font-size: 34px; } .pub { padding-top: 16px; } .pub-h h1 { font-size: 24px; } }

/* Intégration sur le site d'un club (iframe) */
html.embed, html.embed body { background: transparent; }
.embed .pub { min-height: 0; background: transparent; padding: 6px 2px 12px; }
.embed .pub-in { max-width: none; }
.embed .modal-bg { align-items: flex-start; overflow: visible; padding: 0 12px; }
.embed .modal { margin-bottom: 24px; }
.vform { display: flex; flex-direction: column; gap: 10px; max-width: 280px; margin: 0 auto 14px; }
.code-in { text-align: center; font-size: 30px; letter-spacing: .4em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; }
.snippet { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #f6f7f9; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical; color: var(--ink); }

/* ---------- Accès par QR code ---------- */
.qr-card { margin-bottom: 14px; }
.qr-card.off { opacity: .65; }
.qr-card .ic { width: 15px; height: 15px; vertical-align: -3px; color: var(--accent-dark); }
.qr-pub { max-width: 460px; margin: 0 auto; }
.qr-pub-h { margin-bottom: 16px; }
.qr-pub-h h1 { margin: 2px 0 4px; font-size: 26px; }
.qform { text-align: left; max-width: 340px; margin: 0 auto 12px; }
.qform .error { margin-bottom: 8px; }
.qr-closed { display: inline-flex; align-items: center; gap: 8px; background: #f6f7f9; border-radius: 99px; padding: 8px 16px; margin: 4px 0 10px; font-size: 16px; }
.qr-closed .ic { width: 20px; height: 20px; color: var(--muted); }
.qr-steps { text-align: left; max-width: 340px; margin: 6px auto 14px; padding-left: 22px; line-height: 1.8; }
/* Feuille à imprimer (aperçu à l'écran et impression A4) */
.qr-preview { background: #f6f7f9; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.qr-preview .qr-sheet { max-width: 360px; margin: 0 auto; background: #fff; box-shadow: 0 1px 6px #0001; border-radius: 8px; padding: 22px 20px; }
.qr-sheet { text-align: center; color: #1d1b1c; }
.qr-sheet .qs-brand { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 14px; }
.qr-sheet .qs-title { font-size: 24px; font-weight: 800; }
.qr-sheet .qs-door { font-size: 17px; color: var(--accent-dark); font-weight: 600; margin: 2px 0 12px; }
.qr-sheet .qs-qr { border: 3px solid #6DCED6; border-radius: 14px; padding: 10px; display: inline-block; line-height: 0; width: 72%; }
.qr-sheet .qs-qr svg { width: 100%; height: auto; }
.qr-sheet .qs-steps { text-align: left; margin: 14px auto 8px; padding-left: 20px; font-size: 13px; line-height: 1.6; max-width: 92%; }
.qr-sheet .qs-hours { font-size: 13px; font-weight: 600; margin-top: 6px; }
.qr-sheet .qs-foot { font-size: 11px; color: #6b7280; margin-top: 10px; }
#print-root { display: none; }
@media print {
  body.printing-qr > *:not(#print-root) { display: none !important; }
  body.printing-qr #print-root { display: block; }
  body.printing-qr { background: #fff; }
  #print-root .qr-sheet { width: 170mm; margin: 12mm auto 0; }
  #print-root .qs-brand img:first-child { width: 48px; height: auto; }
  #print-root .qs-brand img:last-child { width: 170px; height: auto; }
  #print-root .qs-title { font-size: 40pt; }
  #print-root .qs-door { font-size: 22pt; margin-bottom: 8mm; }
  #print-root .qs-qr { width: 110mm; border-width: 4px; padding: 5mm; }
  #print-root .qs-steps { font-size: 14pt; max-width: 150mm; margin-top: 8mm; }
  #print-root .qs-hours { font-size: 15pt; margin-top: 4mm; }
  #print-root .qs-foot { font-size: 10pt; margin-top: 8mm; }
  @page { size: A4; margin: 10mm; }
}
.qr-other { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 8px; }
td.nowrap { white-space: nowrap; }
.qr-sheet .qs-five { display: inline-block; min-width: 1.5em; text-align: center; border: 2px solid #1d1b1c; border-radius: 6px; padding: 0 4px; line-height: 1.3; }

/* iPhone : les champs heure et date gardaient leur largeur native et dépassaient de la fenêtre */
.form-grid > * { min-width: 0; }
label.f input[type="time"], label.f input[type="date"], label.f input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; min-height: 44px; text-align: left;
}
label.f input[type="time"]::-webkit-date-and-time-value, label.f input[type="date"]::-webkit-date-and-time-value { text-align: left; }

/* ============ Neo, le hibou d'aide ============ */
#neo-btn { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 4px; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow-lg); font: 600 13px Inter, system-ui, sans-serif; color: var(--ink); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#neo-btn img { pointer-events: none; -webkit-user-drag: none; }
#neo-btn.neo-drag { cursor: grabbing; transform: scale(1.06); box-shadow: 0 12px 32px rgba(0,0,0,.22); }
#neo-btn img { width: 44px; height: 48px; object-fit: contain; }
#neo-btn:hover { border-color: var(--accent-dark); }
#neo-pan { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 61;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
#neo-pan header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); }
#neo-pan header img { width: 44px; height: 48px; object-fit: contain; }
#neo-pan header div { flex: 1; min-width: 0; } #neo-pan header small { display: block; color: var(--muted); font-size: 12px; }
.neo-fil { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.neo-m { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.neo-a { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.neo-u { background: var(--accent); color: var(--ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.neo-sugg { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.neo-sugg .btn { text-align: left; white-space: normal; }
.neo-raz { align-self: center; background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; margin-top: 4px; }
.neo-att { display: flex; gap: 4px; } .neo-att span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: neoPt 1s infinite ease-in-out; }
.neo-att span:nth-child(2) { animation-delay: .15s; } .neo-att span:nth-child(3) { animation-delay: .3s; }
@keyframes neoPt { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
#neo-pan form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
#neo-pan form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
@media (max-width: 640px) { #neo-btn span { display: none; } #neo-btn { padding: 4px; } #neo-pan { right: 8px; left: 8px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); height: calc(100vh - 140px); } }
@media (prefers-reduced-motion: reduce) { .neo-att span { animation: none; } }
@media print { #neo-btn, #neo-pan { display: none; } }
#neo-pan header .neo-lang { flex: 0 0 auto; min-width: auto; } .neo-lang { display: flex; border: 1px solid var(--accent-line); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.neo-lang button { border: 0; background: var(--card); color: var(--muted); font: 600 11px Inter, system-ui, sans-serif; padding: 5px 7px; cursor: pointer; }
.neo-lang button.on { background: var(--accent-dark); color: #fff; }

/* ============ Choix de la langue ============ */
.lang-sw { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lang-sw button { border: 0; background: transparent; color: var(--muted); font: 600 11px Inter, system-ui, sans-serif; padding: 4px 9px; cursor: pointer; }
.lang-sw button.on { background: var(--ink); color: #fff; }
.lang-sw.ls-auth { display: flex; width: max-content; margin: -14px -14px 6px auto; }
.side .who .lang-sw { grid-column: 1 / -1; justify-self: start; }
.lang-sw.ls-pub { display: flex; width: max-content; margin: 10px auto 0; }
.pub-foot a { color: inherit; }

/* Aide (modes d'emploi) */
.aide-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.aide-guide h2 { font-size: 18px; margin: 22px 0 8px; } .aide-guide h2:first-child { margin-top: 0; }
.aide-guide h3 { font-size: 15px; margin: 16px 0 6px; }
.aide-guide ol, .aide-guide ul { padding-left: 22px; } .aide-guide li { margin-bottom: 4px; line-height: 1.5; }
.aide-guide p { line-height: 1.55; }
.aide-guide code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.aide-guide blockquote { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 6px; }

/* Agence partenaire : choix du compte géré */
.acting { display: block; margin: 4px 12px 12px; }
.acting select { width: 100%; margin-top: 4px; }

.brand-link { display: inline-flex; align-items: center; }
.brand-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

/* Pied de page (pages connectées) */
.app-foot{margin:48px 0 8px;padding-top:16px;border-top:1px solid var(--border, rgba(0,0,0,.08));text-align:center;font-size:12px;line-height:1.7;color:var(--muted, #6b7280)}
.app-foot a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.app-foot sup{font-size:.7em}
@media (max-width:760px){.app-foot{margin-bottom:80px}}   /* place pour Neo en bas à droite */

/* Hors connexion : bandeau d'état et liste des actions en attente */
#netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 46; display: flex; gap: 12px; align-items: center; justify-content: center; padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top)); font-size: 13px; font-weight: 600; color: #fff; background: var(--ink); }
#netbar.wait { background: #2f6f75; }
#netbar.err { background: var(--danger); }
#netbar .btn { padding: 3px 10px; min-height: 0; font-size: 12px; background: rgba(255,255,255,.18); color: #fff; border: 0; }
body.netbar-on { padding-top: calc(34px + env(safe-area-inset-top)); }
.ob-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.ob-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line, #e6e8eb); border-radius: 10px; }
.netbar-on .topbar, .netbar-on .side { top: calc(34px + env(safe-area-inset-top)); }

/* ============ Plans d'installation ============ */
.pl-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 4px 0 12px; }
.pl-tab { font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.pl-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pl-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pl-sp { flex: 1; }
.pl-zoom { display: inline-flex; gap: 4px; align-items: center; }
.pl-zoom .btn.icon { width: 30px; height: 30px; font-size: 18px; }
.pl-hint { background: var(--accent-soft, #e8f7f8); border: 1px solid var(--accent-line, #bfe7ea); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.pl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 980px) { .pl-grid { grid-template-columns: 1fr; } .pl-bar .lbl { display: none; } }
.pl-scroll { overflow: auto; max-height: 78vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; touch-action: pan-x pan-y; }
.pl-stage { position: relative; min-width: 100%; }
.pl-stage.drawn { background-color: #fbfbfc; background-image: linear-gradient(#eef0f2 1px, transparent 1px), linear-gradient(90deg, #eef0f2 1px, transparent 1px); background-size: 5% 5%; }
.pl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.pl-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 20px; text-align: center; }
.pl-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pl-svg text { font-family: inherit; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pl-room { fill: rgba(255,255,255,.75); stroke: #8c96a1; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: move; }
.pl-room.sel { stroke: #2aa9b4; stroke-width: 3; }
.pl-room.drawing { fill: rgba(109,206,214,.15); stroke: #2aa9b4; stroke-dasharray: 6 4; }
.pl-room-t { font-size: calc(var(--k, 1) * 14px); fill: #59636e; font-weight: 600; }
.pl-handle { fill: #2aa9b4; cursor: nwse-resize; }
.pl-range { fill: rgba(109,206,214,.14); stroke: #3bb4bf; stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; pointer-events: none; }
.pl-hit { fill: transparent; }
.pl-svg [data-pl-item] { cursor: pointer; }
.pl-lock .pl-dot { fill: var(--ink); stroke: #fff; stroke-width: calc(var(--k, 1) * 2.5px); }
.pl-lock.warn .pl-dot { fill: #e08a1e; }
.pl-lock.low .pl-dot { fill: var(--danger); }
.pl-bridge .pl-dot { fill: #6dced6; stroke: var(--ink); stroke-width: calc(var(--k, 1) * 2px); }
.pl-bridge .pl-num { fill: var(--ink); }
.pl-note .pl-dot { fill: #f2c94c; stroke: #8a6d12; stroke-width: calc(var(--k, 1) * 1.5px); }
.pl-note .pl-num { fill: #4a3a08; }
.pl-num { font-size: calc(var(--k, 1) * 12px); font-weight: 800; fill: #fff; }
.pl-num.sm { font-size: calc(var(--k, 1) * 9px); }
.pl-cap { font-size: calc(var(--k, 1) * 11px); font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: rgba(255,255,255,.92); stroke-width: calc(var(--k, 1) * 3.5px); stroke-linejoin: round; }
.sel .pl-dot { stroke: #2aa9b4; stroke-width: calc(var(--k, 1) * 4px); }
.pl-side { display: grid; gap: 10px; }
.pl-side .card { padding: 14px; }
.pl-sel .f { margin-top: 8px; }
.pl-locks ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pl-locks li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.pl-chip { display: inline-flex; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 6px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; align-items: center; justify-content: center; }
.pl-warn-t { color: #b8650c; font-weight: 600; }
.banner.warn { background: #fff4e5; border: 1px solid #f3d3a6; color: #8a4b06; border-radius: 10px; padding: 10px 12px; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.pl-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--ink); }
.pl-legend .lg.warn { background: #e08a1e; } .pl-legend .lg.low { background: var(--danger); }
.pl-legend .lg.br { border-radius: 3px; background: #6dced6; border: 1px solid var(--ink); } .pl-legend .lg.nt { background: #f2c94c; }
.pl-empty p { max-width: 640px; }

/* Fiche d'installation imprimée */
@media print {
  body.printing-plan #print-root .pf { font-size: 10pt; color: #000; }
  body.printing-plan .pf-h { display: flex; gap: 12px; align-items: flex-start; border-bottom: 2px solid #231f20; padding-bottom: 6mm; margin-bottom: 5mm; }
  body.printing-plan .pf-h img { width: 34px; height: auto; }
  body.printing-plan .pf-h h1 { font-size: 18pt; margin: 1mm 0; }
  body.printing-plan .pf-h > div:nth-child(2) { flex: 1; }
  body.printing-plan .pf-k { font-size: 9pt; text-transform: uppercase; letter-spacing: .06em; color: #555; }
  body.printing-plan .pf-d { text-align: right; font-size: 9pt; }
  body.printing-plan .pf-floor { page-break-inside: avoid; break-inside: avoid; margin-bottom: 8mm; }
  body.printing-plan .pf-floor + .pf-floor { page-break-before: always; break-before: page; }
  body.printing-plan .pf-floor h2 { font-size: 13pt; margin: 0 0 3mm; } body.printing-plan .pf-floor h2 span { font-weight: 400; font-size: 9pt; color: #555; }
  body.printing-plan .pf-stage { position: relative; width: 100%; max-height: 150mm; border: 1px solid #999; margin-bottom: 4mm; }
  body.printing-plan .pf-stage img, body.printing-plan .pf-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  body.printing-plan .pf-t { width: 100%; border-collapse: collapse; margin-bottom: 3mm; }
  body.printing-plan .pf-t th, body.printing-plan .pf-t td { border: 1px solid #bbb; padding: 1.5mm 2mm; text-align: left; font-size: 9pt; }
  body.printing-plan .pf-t th { background: #eee; } body.printing-plan .pf-t .chk { text-align: center; width: 12mm; }
  body.printing-plan .pf-miss { background: #fff4e5; padding: 2mm 3mm; }
  body.printing-plan .pf-f { margin-top: 6mm; font-size: 8pt; color: #555; }
  body.printing-plan .pl-range { fill: rgba(109,206,214,.18); }
}
.pl-svg, .pf-stage svg { overflow: visible; }

/* Jours fériés et fermetures */
.fer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
@media (max-width: 860px) { .fer-grid { grid-template-columns: 1fr; } }
.fer-list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 2px; }
.fer-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.fer-list li:last-child { border-bottom: 0; }

/* Visite guidée (lancée depuis Neo) */
#visite { position: fixed; inset: 0; z-index: 80; }
#visite .visite-trou { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(8, 12, 24, .62); outline: 2px solid var(--accent); transition: all .25s ease; pointer-events: none; }
#visite .visite-bulle { position: fixed; background: var(--card); color: var(--text, inherit); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 14px; transition: top .25s ease, left .25s ease; }
#visite .visite-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#visite .visite-tete b { flex: 1; }
#visite .visite-tete img { width: 34px; height: 37px; object-fit: contain; }
#visite p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
#visite .visite-bts { gap: 6px; align-items: center; }
.neo-visite { margin-bottom: 4px; }

/* Installer l'app (écran d'accueil) */
.install-side { margin: 10px 12px 0; width: calc(100% - 24px); justify-content: center; }
.install-login { margin-top: 14px; width: 100%; justify-content: center; }
.install-bandeau { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.install-etapes { margin: 6px 0 16px; padding-left: 20px; line-height: 1.7; }

/* Tableau de bord : ouvertures automatiques + calendrier 7 jours */
.auto-portes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.auto-porte { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.ap-tete { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.ap-etat { font-size: 12px; font-weight: 600; border-radius: 20px; padding: 2px 10px; }
.ap-etat.ouvert { background: #dcfce7; color: #166534; }
.ap-etat.ferme { background: #f1f5f9; color: #475569; }
.ap-etat.ferie { background: #fef3c7; color: #92400e; }
.ap-bts { gap: 6px; margin-top: 6px; }
.cal7 { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.cal-jour { padding: 10px 12px; min-height: 110px; display: flex; flex-direction: column; gap: 4px; }
.cal-jour.auj { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-jour.ferie { background: #fffbeb; }
.cal-tete { margin-bottom: 2px; }
.cal-ferie { font-size: 12.5px; font-weight: 600; color: #92400e; }
.cal-l { font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.cal-l.barre { text-decoration: line-through; opacity: .6; }
@media (max-width: 760px) { .cal7 { grid-template-columns: repeat(7, 160px); } }
