:root {
  color-scheme: dark;
  --ink: #111110;
  --panel: #1a1916;
  --line: #36322a;
  --gold: #c9a24a;
  --gold-dim: #8d7a4a;
  --cream: #f3ead8;
  --muted: #a69f8f;
  --ok: #86c596;
  --warn: #e2b660;
  --bad: #e58f80;
  --info: #8fb8e0;
  --gold-fond: #262012;
  --wa: #25d366;
  --wa-ink: #06290f;
  --display: "Newsreader", "Times New Roman", Times, Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html { background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  padding-block: 40px 56px;
  padding-left: 16px;
  padding-right: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
.page { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 36px; }

/* En-tête : le flyer */
.carton { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.carton .invite { font-family: var(--display); font-style: italic; color: var(--gold); font-size: 1.9rem; line-height: 1.1; margin: 0; }
.carton .surprise { color: var(--gold); font-size: .72rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; margin: 0; }
.carton h1 { font-family: var(--display); font-weight: 400; font-size: 2.3rem; line-height: 1.05; margin: 6px 0 0; text-wrap: balance; }
.carton h1 em { display: block; color: var(--gold); font-size: 3.6rem; font-style: italic; line-height: 1; margin-top: 4px; }
.carton .trait { width: 1px; height: 32px; background: var(--gold); margin: 8px 0 4px; }
.carton .quand { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .9rem; margin: 0; }
.carton .ou { color: var(--muted); margin: 0; }

h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
.note { color: var(--muted); font-size: .9rem; }

/* Formulaire */
.bloc { display: flex; flex-direction: column; gap: 20px; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .duo { grid-template-columns: 1fr; } }
label, .legende { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
input[type="text"], input[type="tel"], input[type="number"], input[type="password"], select, textarea {
  font: inherit; font-size: 16px; color: var(--cream); background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; padding: 11px 12px; width: 100%; min-width: 0;
}
input::placeholder, textarea::placeholder { color: #7d7768; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tel { display: grid; grid-template-columns: minmax(0, 11.5rem) minmax(0, 1fr); gap: 8px; }
.tel.autre { grid-template-columns: minmax(0, 8rem) minmax(0, 5rem) minmax(0, 1fr); }
@media (max-width: 420px) { .tel, .tel.autre { grid-template-columns: 1fr; } }
.erreur { color: var(--bad); font-size: .9rem; }

.compteur { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.compteur:last-of-type { border-bottom: 1px solid var(--line); }
.compteur .texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.compteur .texte strong { font-weight: 500; }
.pas { display: flex; align-items: center; gap: 4px; flex: none; }
.pas button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gold-dim); background: transparent; color: var(--gold); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.pas button:hover { background: var(--panel); }
.pas input { width: 3rem; text-align: center; border: 0; background: transparent; padding: 6px 0; font-size: 1.25rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.pas input::-webkit-outer-spin-button, .pas input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .choix { grid-template-columns: 1fr; } }
.choix label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 4px; padding: 12px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .95rem; color: var(--cream); }
.choix label:has(input:checked) { border-color: var(--gold); background: var(--panel); }
.choix input { accent-color: var(--gold); margin-top: 3px; }

.total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.total .montant { font-family: var(--display); font-style: italic; color: var(--gold); font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.total .detail { color: var(--muted); font-size: .9rem; }
.plus { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.puce { font: inherit; font-size: .95rem; border: 1px solid var(--line); background: transparent; color: var(--cream); border-radius: 999px; padding: 9px 14px; cursor: pointer; white-space: nowrap; }
.puce[aria-pressed="true"] { border-color: var(--gold); background: var(--panel); color: var(--gold); }
.euro { display: flex; align-items: center; gap: 8px; flex: 1 1 9rem; min-width: 0; color: var(--muted); }

.btn { font: inherit; font-weight: 600; border-radius: 4px; padding: 14px 18px; cursor: pointer; border: 1px solid var(--gold); background: var(--gold); color: var(--ink); text-align: center; text-decoration: none; display: block; width: 100%; }
.btn:hover { filter: brightness(1.08); }
.btn.discret { background: transparent; color: var(--gold); border-color: var(--gold-dim); font-weight: 500; }
.btn.petit { width: auto; padding: 9px 14px; font-size: .9rem; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: var(--wa-ink); }
.btn.wa small { display: block; font-weight: 400; font-size: .82rem; margin-top: 2px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* Récapitulatif */
.recap { border: 1px solid var(--gold-dim); border-radius: 4px; padding: 22px 18px; }
.recap dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; }
.recap dt { color: var(--muted); font-size: .9rem; }
.recap dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.recap dd.fort { color: var(--gold); font-family: var(--display); font-style: italic; font-size: 1.5rem; line-height: 1.1; }
.etape { border-left: 2px solid var(--wa); padding-left: 12px; }
.secret { font-family: var(--display); font-style: italic; color: var(--gold); font-size: 1.1rem; text-align: center; text-wrap: balance; }
textarea { resize: vertical; font-size: .9rem; line-height: 1.45; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.selectionnable { user-select: all; -webkit-user-select: all; color: var(--cream); font-variant-numeric: tabular-nums; }

.retour { font-size: .9rem; min-height: 1.4em; }
.retour.ok { color: var(--ok); }
.retour.ko { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .btn, .pas button { transition: filter .15s, background-color .15s; } }
[hidden] { display: none !important; }
.confirme { color: var(--ok); font-weight: 500; }

/* ================= Administration ================= */
.page.large { max-width: 1180px; gap: 28px; }
.entete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.entete h1 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; margin: 0; }
.entete h1 em { color: var(--gold); }
.entete .sous { color: var(--muted); font-size: .9rem; }
.connexion { max-width: 380px; margin: 8vh auto 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--ink); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat .lib { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.stat b { font-weight: 500; font-size: 1.55rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.stat.alerte { background: var(--gold-fond); }
.stat.alerte .lib, .stat.alerte b { color: var(--gold); }
.stat.calme b { color: var(--muted); }

.outils { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; }
.outils .cherche { flex: 1 1 14rem; max-width: 22rem; }
.outils .actions { display: flex; gap: 8px; flex-wrap: wrap; }
a.btn.petit { display: inline-block; }

.liste { border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .fort { font-weight: 500; }
td .fin { color: var(--muted); font-size: .82rem; display: block; }
td.invite { min-width: 9.5rem; }
td.contact { white-space: nowrap; }
td.contact .liens { display: flex; gap: 6px; margin-top: 6px; }
td.n .fin { white-space: normal; }
td.total .fin { white-space: nowrap; }
td.note { min-width: 10rem; }
td.note .lien { display: block; margin: 4px 0 0 auto; }
.mini { font: inherit; font-size: .8rem; font-weight: 500; border: 1px solid var(--gold-dim); color: var(--gold); background: transparent; border-radius: 999px; padding: 4px 10px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.mini:hover { background: var(--panel); }
.mini.wa { border-color: var(--wa); color: var(--wa); }
td select { padding: 8px 9px; font-size: .9rem; width: 11.5rem; max-width: 100%; }
td input[type="number"] { width: 5.5rem; padding: 8px 9px; font-size: .9rem; text-align: right; }
td input[type="text"] { padding: 8px 9px; font-size: .9rem; min-width: 0; width: 100%; }
select[data-statut="a_traiter"] { border-color: var(--gold); color: var(--gold); }
select[data-statut="paye"] { border-color: var(--ok); color: var(--ok); }
select[data-statut="sur_place"] { border-color: var(--info); color: var(--info); }
select[data-statut="annule"] { border-color: var(--bad); color: var(--bad); }
select option { color: var(--cream); background: var(--panel); }
tr.a_traiter td { background: var(--gold-fond); }
tr.annule td.invite .fort, tr.annule td.n, tr.annule td.contact .numero { color: var(--muted); text-decoration: line-through; }
.badge { display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; border-radius: 3px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; background: var(--gold); color: var(--ink); }
.vide { padding: 28px 16px; color: var(--muted); text-align: center; }
.etat { color: var(--muted); font-size: .82rem; }
.etat.ko { color: var(--bad); }

/* Sur téléphone : chaque réservation devient une fiche */
@media (max-width: 900px) {
  .liste { border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: flex; flex-direction: column; gap: 12px; }
  tbody tr { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
  tbody tr.a_traiter { border-color: var(--gold-dim); }
  td, tbody tr:last-child td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: right; }
  tbody tr td:last-child { border-bottom: 0; }
  td::before { content: attr(data-titre); color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; flex: none; }
  td.invite { display: block; text-align: left; font-size: 1.05rem; padding-top: 12px; }
  td.invite::before { content: none; }
  td.contact { flex-wrap: wrap; white-space: normal; }
  td.contact .numero { margin-left: auto; }
  td.contact .liens { justify-content: flex-end; margin-top: 0; flex: 1 1 100%; }
  td.n > span:first-of-type { margin-left: auto; }
  td.n .fin { display: inline; }
  td select { width: 13.5rem; }
  td input[type="text"] { min-width: 0; width: 100%; }
  td.note { flex-wrap: wrap; }
  td.note input { flex: 1 1 100%; }
  td.note .lien { margin: 0 0 0 auto; }
}
.lien { background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; padding: 4px; white-space: nowrap; }
.lien.sur { color: var(--bad); }
