body.admin { font-size: 15px; --pad: 28px; }

.shell { display: flex; min-height: 100svh; }

.rail {
  width: 216px; flex: none; background: var(--sunk);
  border-right: 1px solid #1C1F22; padding: 24px 0;
  display: flex; flex-direction: column;
}
.rail__brand { padding: 0 var(--pad) 26px; }
.rail__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.rail__nav a {
  min-height: 36px; padding: 0 12px; border-radius: 3px; display: flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-size: 13.5px; text-decoration: none;
}
.rail__nav a[aria-current="page"] { background: var(--raised); color: var(--ink); font-weight: 600; }
.rail__nav i { width: 5px; height: 5px; border-radius: 50%; background: #33373C; flex: none; }
.rail__nav a[aria-current="page"] i { background: var(--brand); }
.rail__foot { margin: 20px 12px 0; padding: 13px 12px; border: 1px solid #1C1F22; border-radius: 3px; }
.rail__out { width: 100%; justify-content: center; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.head {
  padding: 24px var(--pad) 20px; border-bottom: 1px solid #1C1F22;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.pill {
  height: 22px; padding: 0 10px; border-radius: 11px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
}
.pill--open   { background: #16241E; border: 1px solid #204034; color: var(--ok); }
.pill--draft  { background: #221E16; border: 1px solid #3A3226; color: #C9A96A; }
.pill--closed { background: #1B1B1D; border: 1px solid #2C2C30; color: var(--ink-2); }
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: #1C1F22; border-bottom: 1px solid #1C1F22; }
.kpi { background: var(--ground); padding: 18px var(--pad); display: flex; flex-direction: column; gap: 6px; }
.kpi--hi { background: #191712; }
.kpi__lab { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.kpi__val { font-size: 27px; font-weight: 700; letter-spacing: -.028em; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi--hi .kpi__val { color: var(--brand); }
.kpi__sub { font-size: 11.5px; color: var(--ink-3); }
.kpi__sub--ok { color: var(--ok); }

.cols { flex: 1 1 auto; display: flex; gap: 20px; padding: 20px var(--pad) 28px; align-items: flex-start; flex-wrap: wrap; }
.col-main { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 0 1 344px; min-width: 280px; display: flex; flex-direction: column; gap: 16px; }

.panel { border: 1px solid #1C1F22; border-radius: 3px; background: #131518; overflow: hidden; }
.panel__head {
  padding: 14px 16px; border-bottom: 1px solid #1C1F22;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.panel__title { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.panel__body { padding: 16px; }
.panel--brand { border-color: #2E2A24; background: #191712; }
.panel--info  { border-color: #24303C; background: #131A22; }

table.rows { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rows th {
  text-align: left; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: #5C6167; font-weight: 400; padding: 10px 16px; background: #0F1113; border-bottom: 1px solid #1C1F22;
}
table.rows td { padding: 12px 16px; border-bottom: 1px solid #1A1D20; vertical-align: middle; }
table.rows tr:last-child td { border-bottom: 0; }
table.rows .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
table.rows .dim { color: var(--ink-3); font-size: 12.5px; }

.btn-sm {
  min-height: 32px; padding: 0 13px; border-radius: 3px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-sm--go { border: 0; background: var(--brand); color: #14100C; font-weight: 700; }
.btn-sm--ok { border-color: #204034; background: #16241E; color: var(--ok); font-weight: 600; }

.snippet {
  padding: 12px 13px; background: var(--ground); border: 1px solid #2A2620; border-radius: 3px;
  font-size: 12px; line-height: 1.55; color: var(--ink-2);
}
.snippet .ph { color: #5C6167; }

.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.mod-card { display: flex; flex-direction: column; gap: 8px; }
.mod-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 2px; display: block; background: #1A1D20; }
.mod-actions { display: flex; gap: 6px; }
.mod-actions form { flex: 1 1 auto; display: flex; }
.mod-actions .btn-sm { width: 100%; justify-content: center; }
.mod-actions .no { flex: 0 0 34px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.field input {
  min-height: 52px; padding: 0 15px; border-radius: 3px;
  border: 1px solid var(--line-2); background: var(--raised); color: var(--ink);
  font-family: var(--sans); font-size: 15px;
}
.field input:focus { border-color: var(--brand); outline: none; }

.err { padding: 13px 15px; border-radius: 3px; background: #241614; border: 1px solid #46231C; color: #E9A28E; font-size: 13.5px; }
.ok  { padding: 13px 15px; border-radius: 3px; background: #14241E; border: 1px solid #204034; color: var(--ok); font-size: 13.5px; }
.flash { padding: 13px 15px; border-radius: 3px; background: #16241E; border: 1px solid #204034; color: var(--ok); font-size: 13.5px; }

.copy-ok { color: var(--ok) !important; border-color: #204034 !important; }

@media (max-width: 860px) {
  body.admin { --pad: 18px; }
  .shell { flex-direction: column; }
  .rail { width: auto; border-right: 0; border-bottom: 1px solid #1C1F22; padding: 16px 0; }
  .rail__nav { flex-direction: row; overflow-x: auto; padding: 0 calc(var(--pad) - 12px); }
  /* Le pied du rail était masqué en entier : la mention tarifaire n'a rien à
     faire dans une barre étroite, mais se déconnecter doit rester possible. */
  .rail__foot { margin: 14px var(--pad) 0; padding: 0; border: 0; display: flex; justify-content: flex-end; }
  .rail__foot > p { display: none; }
  .rail__out { width: auto; min-height: 38px; }
}

@media (max-width: 640px) {
  /* Empilés plutôt qu'en escalier : trois boutons de largeurs différentes qui
     passent à la ligne donnent une bordure gauche en dents de scie. */
  .head { flex-direction: column; align-items: stretch; gap: 16px; }
  .head-actions { flex-direction: column; }
  .head-actions > .btn-sm { width: 100%; justify-content: center; min-height: 44px; }
  .panel__head { align-items: stretch; }
  .panel__head > div:last-child { display: flex; gap: 8px; }
  .panel__head .btn-sm { flex: 1 1 0; justify-content: center; min-height: 40px; }

  /* 32 px de haut, c'est sous le seuil du pouce. */
  .btn-sm { min-height: 40px; }

  /* Sous 16 px, Safari iOS agrandit la page dès qu'on touche un champ — et on
     se retrouve à faire glisser le formulaire pour voir ce qu'on tape. */
  .field input, .field select, .field textarea { font-size: 16px; }

  /* --- tableaux en cartes ---
     Six colonnes dans 393 px, c'est 560 px de contenu : la dernière colonne,
     celle du bouton, sortait de l'écran et devenait inatteignable. Chaque
     ligne devient une carte, et l'intitulé de colonne passe dans la cellule. */
  table.rows, table.rows tbody, table.rows tr, table.rows td { display: block; width: auto; }
  table.rows thead { display: none; }
  table.rows tr { padding: 15px var(--pad); border-bottom: 1px solid #1A1D20; }
  table.rows tr:last-child { border-bottom: 0; }
  table.rows td { padding: 0; border: 0; }

  table.rows td[data-lab] {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
    text-align: left; margin-top: 8px;
  }
  table.rows td[data-lab]::before {
    content: attr(data-lab); flex: none;
    font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #5C6167;
  }
  table.rows td.num { text-align: right; }
  table.rows td.cle { overflow-wrap: anywhere; }

  table.rows td.act { margin-top: 14px; text-align: left !important; }
  table.rows td.act .btn-sm { width: 100%; justify-content: center; min-height: 42px; }

  /* L'état vide n'a qu'une cellule : elle garde son centrage. */
  table.rows td[colspan] { margin-top: 0; text-align: center; }
}

/* --- Aperçu : l'écran d'arrivée en taille réelle, réduit ---
   On reproduit un 375x812 avec le CSS des invités, puis on le met à l'échelle.
   Régler des tailles miniatures à la main donnait des proportions fausses :
   le contenu était trop petit pour le cadre, d'où un vide en haut. */
.pv-frame {
  width: 236px; height: 511px; margin: 0 auto; overflow: hidden;
  border-radius: 14px; border: 1px solid #2A2D31; background: var(--ground);
}
.pv-screen {
  width: 375px; height: 812px; flex: none;
  transform: scale(.6293); transform-origin: top left;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; background: var(--ground);
}
/* Les unités de fenêtre se réfèrent au navigateur, pas au cadre : on fige. */
.pv-screen .hero__glow { height: 430px; }
.pv-screen .hero__fade { top: 210px; height: 240px; }
.pv-screen .display { font-size: 48px; }
.pv-screen .qrblock { pointer-events: none; }

/* --- panneaux repliables ---
   <details> natif : replié par défaut, ouvrable sans une ligne de script, et
   la touche Entrée le fait comme le clic. */
.panel--pliant > summary {
  cursor: pointer; list-style: none;
  flex-wrap: nowrap; user-select: none;
  border-bottom-color: transparent;
  transition: border-color .15s ease;
}
.panel--pliant > summary::-webkit-details-marker { display: none; }
.panel--pliant > summary:hover .panel__title { color: var(--ink-2); }
.panel--pliant[open] > summary { border-bottom-color: #1C1F22; }
.panel--brand.panel--pliant[open] > summary { border-bottom-color: #2E2A24; }

.panel__chev {
  flex: none; color: var(--ink-3);
  transition: transform .18s ease;
}
.panel--pliant[open] > summary .panel__chev { transform: rotate(180deg); }
.panel--pliant > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* --- questions fréquentes --- */
.faq { border-bottom: 1px solid #1A1D20; }
.faq:last-child { border-bottom: 0; }
.faq > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; cursor: pointer; list-style: none; user-select: none;
  font-size: 14px; line-height: 1.45; color: var(--ink);
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary:hover { background: #16191C; }
.faq > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.faq[open] > summary { color: var(--brand); }
.faq[open] > summary .panel__chev { transform: rotate(180deg); }
.faq__rep {
  padding: 0 16px 16px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
  max-width: 68ch;
}
.faq__rep b { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .panel__chev { transition: none; }
}

/* La console n'avait pas de pied : les mentions doivent y être joignables. */
body.admin .legales {
  justify-content: flex-start;
  padding: 26px var(--pad) 32px;
  border-top: 1px solid #1C1F22;
  margin: 0;
}
