/* Application de réservations — squelette réutilisable SATI Digital */
@font-face { font-family: "Playfair"; src: url("polices/playfair.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("polices/outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --fond: #f5f1e9; --carte: #fff; --encre: #1c1b18; --doux: #6f695f; --pale: #8d867a; --trait: #e8e1d4;
  --or: #b08d57; --or-fonce: #8c6d33; --nuit: #131b25;
  --vert: #2e8a57; --vert-pale: #e3f2e9; --orange: #a86a12; --orange-pale: #fbf0dd; --rouge: #b9442b; --rouge-pale: #f8e4df;
  --ombre: 0 1px 2px rgba(28, 27, 24, .05), 0 4px 14px rgba(28, 27, 24, .05);
  --sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair", Georgia, serif;
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: #ebe5da; color: var(--encre); font: 400 15px/1.4 var(--sans); overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

.app { position: relative; display: flex; flex-direction: column; height: 100%; max-width: 480px; margin: 0 auto; background: var(--fond); overflow: hidden; }
.chargement { margin: auto; color: var(--doux); }

/* En-tête */
.entete { padding: calc(14px + var(--haut)) 20px 8px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.entete .sur { margin: 0; font-size: 13px; color: var(--doux); }
.entete h1 { margin: 2px 0 0; font: 600 26px/1.1 var(--serif); letter-spacing: -.01em; }
.bouton-texte { color: var(--or-fonce); font-weight: 600; font-size: 14px; padding: 8px 2px; white-space: nowrap; }

/* Bande des jours */
.jours { display: grid; grid-template-columns: 30px repeat(7, 1fr) 30px; gap: 3px; padding: 2px 10px 10px; flex: none; align-items: stretch; }
.jours .fleche { font-size: 20px; color: var(--doux); border-radius: 10px; }
.jour { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; border-radius: 12px; min-height: 58px; position: relative; }
.jour .j { font-size: 11px; color: var(--doux); }
.jour .n { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.jour .c { font-size: 10.5px; color: var(--pale); font-variant-numeric: tabular-nums; height: 14px; }
.jour.auj .n { color: var(--or-fonce); }
.jour.actif { background: var(--encre); color: #fff; }
.jour.actif .j, .jour.actif .c { color: rgba(255, 255, 255, .78); }
.jour.actif .n { color: #fff; }
.jour .point { position: absolute; top: 5px; right: calc(50% - 15px); width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

/* Pastilles des établissements */
.puces { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.puces::-webkit-scrollbar { display: none; }
.puce { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--carte); border: 1px solid var(--trait); white-space: nowrap; font-size: 14px; font-weight: 500; }
.puce i { width: 10px; height: 10px; border-radius: 50%; background: var(--teinte, var(--or)); }
.puce.actif { background: var(--encre); color: #fff; border-color: var(--encre); }

/* Contenu */
.contenu { flex: 1; overflow-y: auto; padding: 0 16px calc(96px + var(--bas)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.contenu::-webkit-scrollbar { display: none; }
.section { margin: 16px 4px 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--doux); }
.carte { background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 13px 15px; margin-bottom: 10px; }
.carte.liste { padding: 0; overflow: hidden; }

/* Remplissage du jour */
.etab-tete { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; margin-bottom: 8px; }
.etab-tete i { width: 10px; height: 10px; border-radius: 50%; background: var(--teinte); flex: none; }
.etab-tete span { margin-left: auto; font-weight: 500; color: var(--doux); font-size: 13px; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.service .lib { font-size: 12px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service .val { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.service .val small { font-weight: 400; color: var(--doux); font-size: 12.5px; }
.jauge { height: 5px; border-radius: 3px; background: #efe9de; margin-top: 4px; overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 3px; background: var(--teinte); }
.jauge i.plein { background: var(--rouge); }

/* Résumé compact : tous les établissements */
.carte.resume { padding: 3px 14px; }
.resume-ligne { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 0; min-height: 48px; }
.resume-ligne + .resume-ligne { border-top: 1px solid var(--trait); }
.resume-ligne i { width: 10px; height: 10px; border-radius: 50%; background: var(--teinte); flex: none; }
.resume-ligne .grow { flex: 1; min-width: 0; }
.resume-ligne b { display: block; font-weight: 600; font-size: 14.5px; }
.resume-ligne small { display: block; font-size: 12.5px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.resume-ligne strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Lignes de réservation */
.ligne { display: flex; align-items: center; gap: 10px; padding: 11px 13px 11px 11px; width: 100%; text-align: left; border-left: 4px solid var(--teinte, var(--trait)); }
.carte.liste .ligne + .ligne { border-top: 1px solid var(--trait); }
.ligne .heure { font-weight: 600; font-size: 15px; width: 54px; flex: none; font-variant-numeric: tabular-nums; }
.ligne .grow { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .sous { font-size: 12.5px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne.eteinte .titre, .ligne.eteinte .heure { color: var(--pale); text-decoration: line-through; font-weight: 500; }
.ligne .droite { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ligne .pers { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.etiq { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.etiq.confirmee { background: var(--vert-pale); color: var(--vert); }
.etiq.attente { background: var(--orange-pale); color: var(--orange); }
.etiq.refusee, .etiq.annulee { background: #f0ebe1; color: var(--doux); }

/* Cartes « à confirmer » */
.a-confirmer { border-left: 4px solid var(--teinte); }
.a-confirmer .haut { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.a-confirmer .nom { font-weight: 600; font-size: 15.5px; }
.a-confirmer .quand { font-size: 13px; color: var(--doux); }
.actions { display: flex; gap: 8px; margin-top: 11px; }
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; font-weight: 600; font-size: 14.5px; background: #f1ece2; text-decoration: none; padding: 0 10px; }
.btn.plein { background: var(--encre); color: #fff; }
.btn.vert { background: var(--vert); color: #fff; }
.btn.rouge { background: var(--rouge-pale); color: var(--rouge); }
.btn.large { width: 100%; }
.btn[disabled] { opacity: .55; }
.vide { text-align: center; color: var(--doux); padding: 34px 12px; font-size: 14.5px; }

/* Onglets du bas */
.onglets { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(10px + var(--bas)); background: #fff; border-top: 1px solid var(--trait); z-index: 6; }
.onglet { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--doux); position: relative; min-height: 44px; }
.onglet svg { width: 24px; height: 24px; }
.onglet.actif { color: var(--encre); font-weight: 600; }
.badge { position: absolute; top: -3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rouge); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Feuille du bas */
.voile { position: absolute; inset: 0; background: rgba(20, 18, 14, .4); z-index: 20; }
.feuille { position: absolute; left: 0; right: 0; bottom: 0; background: var(--fond); border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + var(--bas)); z-index: 21; max-height: 90%; overflow-y: auto; }
.feuille .poignee { width: 38px; height: 5px; border-radius: 3px; background: #d6cfc2; margin: 0 auto 12px; }
.feuille h2 { font: 600 21px/1.2 var(--serif); margin: 0 0 12px; }
.fiche { list-style: none; margin: 0 0 12px; padding: 0; }
.fiche li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--trait); font-size: 14.5px; }
.fiche li span { color: var(--doux); flex: none; }
.fiche li b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.contact { display: flex; gap: 8px; margin-bottom: 10px; }

/* Formulaires */
.champ { display: block; margin-bottom: 11px; }
.champ > span { display: block; font-size: 12.5px; color: var(--doux); margin: 0 2px 4px; font-weight: 500; }
.champ input, .champ select { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--trait); background: #fff; padding: 0 12px; font-size: 16px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix { display: flex; flex-wrap: wrap; gap: 7px; }
.choix button { padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--trait); font-size: 14px; min-height: 40px; font-variant-numeric: tabular-nums; }
.choix button.actif { background: var(--encre); color: #fff; border-color: var(--encre); }
.erreur { background: var(--rouge-pale); color: var(--rouge); padding: 10px 12px; border-radius: 12px; font-size: 14px; margin-bottom: 11px; }

/* Réglages */
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; }
.reglage .grow { flex: 1; min-width: 0; }
.reglage b { font-weight: 600; font-size: 14.5px; display: block; }
.reglage small { color: var(--doux); font-size: 12.5px; display: block; }
.sep { height: 1px; background: var(--trait); margin: 9px 0; }
.inter { width: 50px; height: 30px; border-radius: 15px; background: #cfc6b6; position: relative; flex: none; transition: background .2s; }
.inter::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.inter[aria-checked="true"] { background: var(--vert); }
.inter[aria-checked="true"]::after { transform: translateX(20px); }
.fermeture { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14px; }
.fermeture button { color: var(--rouge); font-weight: 600; font-size: 13.5px; padding: 8px 2px; }
.aide { font-size: 13.5px; color: var(--doux); margin: 4px 0 0; }

/* Connexion */
.connexion { margin: auto; width: 100%; padding: 28px 24px calc(28px + var(--bas)); }
.connexion h1 { font: 600 30px/1.1 var(--serif); margin: 0 0 6px; }
.connexion p { color: var(--doux); margin: 0 0 20px; }
.connexion img { width: 64px; height: 64px; border-radius: 15px; display: block; margin-bottom: 18px; }

/* Message bref */
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(88px + var(--bas)); background: var(--encre); color: #fff; border-radius: 14px; padding: 12px 14px; font-size: 14px; z-index: 30; opacity: 0; transform: translateY(14px); transition: all .22s; pointer-events: none; }
.toast.vu { opacity: 1; transform: none; }

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

/* ----- Application large (plan de table sur tablette ou ordinateur) ----- */
.app.large { max-width: 1040px; }

/* ----- Cartes-liens et cases à cocher ----- */
.lien-carte { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 10px; }
.lien-carte small { display: block; color: var(--doux); font-size: 12.5px; margin-top: 2px; }
.lien-carte.eteinte { opacity: .55; }
.coche { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--trait); border-radius: 12px; margin-bottom: 7px; cursor: pointer; }
.coche input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--encre); }
.coche small { display: block; color: var(--doux); font-size: 12.5px; }

/* ----- Plan de table ----- */
.plan-barre { display: flex; align-items: center; gap: 10px; padding: 0 16px 10px; flex-wrap: wrap; }
.plan-barre input[type=date] { height: 40px; border-radius: 10px; border: 1px solid var(--trait); background: #fff; padding: 0 10px; font-size: 15px; }
.plan-choix { margin-bottom: 10px; }
.plan-barre .plan-choix { margin-bottom: 0; }
.plan-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.plan-invite { min-height: 18px; margin: 0 2px 8px; }
.plan-edition { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 8px; }
.plan-scene { position: relative; aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--trait); border-radius: 16px; overflow: hidden; background-image: linear-gradient(var(--trait) 1px, transparent 1px), linear-gradient(90deg, var(--trait) 1px, transparent 1px); background-size: 12.5% 16.66%; }
.table { position: absolute; width: 13%; height: 14%; min-width: 48px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--fond); border: 1.5px solid var(--or); border-radius: 10px; font-size: 13px; line-height: 1.1; overflow: hidden; }
.table.ronde { border-radius: 50%; }
.table b { font-weight: 700; }
.table small { font-size: 10.5px; color: var(--doux); max-width: 96%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table.prise { background: var(--encre); border-color: var(--encre); color: #fff; }
.table.prise small { color: #ded7ca; }
.table.choisie { outline: 3px solid var(--or); outline-offset: 1px; }
.plan-scene.edition .table { cursor: grab; touch-action: none; user-select: none; }
.plan-resa { width: 100%; }
.plan-resa.choisie { background: var(--orange-pale); }
.plan-occupant { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; }
.plan-occupant small { display: block; color: var(--doux); font-size: 12.5px; }
@media (min-width: 760px) {
  .plan-grille { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

/* ----- Fichier clients, liste d'attente, statistiques ----- */
.recherche { padding: 0 16px 10px; }
.recherche input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--trait); background: #fff; padding: 0 12px; font-size: 16px; }
.deux-boutons { display: flex; gap: 8px; margin-bottom: 10px; }
.importer { cursor: pointer; }
.aide.compte { margin: 0 4px 8px; }
.petit-nombre { width: 70px; height: 40px; border-radius: 10px; border: 1px solid var(--trait); background: #fff; text-align: center; font-size: 16px; flex: none; }
.connu { background: var(--vert-pale); color: var(--vert); border-radius: 12px; padding: 9px 12px; margin: -4px 0 12px; font-size: 14px; }
.connu.alerte { background: var(--orange-pale); color: var(--orange); }
.connu small { display: block; margin-top: 3px; color: var(--encre); font-size: 13px; }
.champ textarea { width: 100%; border-radius: 12px; border: 1px solid var(--trait); background: #fff; padding: 10px 12px; font-size: 16px; resize: vertical; }
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.chiffres b { display: block; font: 600 26px/1.1 var(--serif); }
.chiffres small { color: var(--doux); font-size: 12px; line-height: 1.25; display: block; }
.a-confirmer .actions { flex-wrap: wrap; }
.lien-carte .grow { flex: 1; min-width: 0; }

/* ----- Accueil : un bloc par restaurant ----- */
.entete-boutons { display: inline-flex; gap: 14px; }
.resto-alerte { color: var(--orange); margin: 0 0 8px; }
.resto-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.resto-actions .btn { min-width: 120px; }

/* ----- Présence, liens d'accès, administration, impression ----- */
.etiq.arrive { background: var(--vert-pale); color: var(--vert); }
.etiq.no_show { background: var(--rouge-pale); color: var(--rouge); }
.actions.presence { margin-bottom: 8px; }
.carte.eteinte { opacity: .6; }
.lieu { background: var(--carte); border: 1px solid var(--trait); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.imprimer { display: none; }
@media (min-width: 760px) { .imprimer { display: inline; } }
@media print {
  .onglets, .jours, .puces, .entete-boutons, .toast { display: none !important; }
  html, body, .app, .contenu { height: auto !important; overflow: visible !important; background: #fff !important; }
  .carte { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
.bandeau-consultation { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--orange-pale); color: var(--orange); font-size: 13.5px; }
.bandeau-consultation .bouton-texte { white-space: nowrap; }
.bandeau-consultation b { font-weight: 600; }
@media print { .bandeau-consultation { display: none !important; } }
.jours-choix { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 2px; }
.jours-choix label { display: inline-flex; align-items: center; gap: 5px; font-size: 14.5px; }
.jours-choix input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--encre); }
.lien-resa-ligne .grow { flex: 1; }
.lien-resa-ligne { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--trait); }
