:root {
  --fond: #f6f3ef; --carte: #fff; --texte: #1d1a17; --discret: #7a716a; --ligne: #e6e0d9;
  --accent: #e0472b; --accent-fonce: #b8361e; --ok: #1f8a4c; --ok-fond: #e5f5ec; --attente: #b7791f; --attente-fond: #fdf3dc;
  --erreur: #c0392b; --erreur-fond: #fbe7e4; --rayon: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font-size: 16px; line-height: 1.45; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
a { color: var(--accent-fonce); }
h1 { font-size: 1.6rem; margin: .4em 0 .6em; } h2 { font-size: 1.15rem; margin: 1.4em 0 .6em; } h3 { margin: 0; font-size: 1.05rem; }
.discret { color: var(--discret); } .petit { font-size: .85rem; } .alerte { color: var(--attente); font-weight: 600; } .erreur { color: var(--erreur); }
.vide { color: var(--discret); padding: 12px 0; }
.cache, [hidden] { display: none !important; }
.inline { display: inline; }
input, select, button { font: inherit; }
input:not([type=hidden]), select { padding: 9px 11px; border: 1px solid var(--ligne); border-radius: 8px; background: #fff; max-width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.bouton { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.bouton:hover { background: var(--accent-fonce); }
.bouton.secondaire { background: #fff; color: var(--texte); border: 1px solid var(--ligne); }
.bouton.danger { background: #fff; color: var(--erreur); border: 1px solid var(--erreur); }
.bouton.petit { padding: 6px 11px; font-size: .88rem; }
.bouton.gros { padding: 16px; font-size: 1.15rem; width: 100%; }
.bouton.whatsapp { background: #25d366; color: #fff; }
.lien { background: none; border: 0; color: var(--accent-fonce); cursor: pointer; padding: 0 4px; text-decoration: underline; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .45em; border-radius: 99px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; font-weight: 700; vertical-align: middle; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; margin-bottom: 14px; }
.carte.etroite { max-width: 420px; margin: 10vh auto; }
.pile { display: flex; flex-direction: column; gap: 14px; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; margin-top: 12px; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.colonnes .carte { margin: 0; } .colonnes h2 { margin-top: 0; }
.gros-chiffre { font-size: 2rem; font-weight: 700; margin: 0; }
.flash { padding: 10px 16px; background: var(--ok-fond); color: var(--ok); border-radius: 8px; margin: 12px auto 0; max-width: 1068px; }
.flash.erreur { background: var(--erreur-fond); color: var(--erreur); }
.puces { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.puces li { background: var(--fond); border: 1px solid var(--ligne); border-radius: 99px; padding: 3px 6px 3px 12px; }
.ajout { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; } .ajout select, .ajout input { flex: 1; min-width: 140px; }
.lien-copie { width: 100%; font-size: .8rem; margin: 6px 0; }
.recherche { width: 100%; margin: 4px 0 12px; }
details summary { cursor: pointer; }

/* Tableaux */
.table-scroll { overflow-x: auto; background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--discret); }
tbody tr:last-child td { border-bottom: 0; }
tfoot th { border-top: 2px solid var(--texte); border-bottom: 0; }
.nombre { text-align: right; white-space: nowrap; }
td.actions { white-space: nowrap; } td.actions form { margin-left: 4px; }
td.actions select { max-width: 160px; padding: 5px; }
.creer input { width: 90px; padding: 5px 7px; margin-right: 4px; }

/* Barre admin */
.barre { display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: #14110f; color: #eee; flex-wrap: wrap; }
.barre a { color: #ddd; text-decoration: none; }
.marque { font-weight: 800; color: #fff !important; }
.barre nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.barre nav a { padding: 6px 10px; border-radius: 6px; font-size: .92rem; }
.barre nav a.actif, .barre nav a:hover { background: #2c2622; color: #fff; }
.qui { font-size: .85rem; color: #aaa; } .qui .lien { color: #aaa; } .qui .bouton { color: var(--texte); }
.nav-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-date h1 { margin: 0 8px; text-transform: capitalize; }
.nav-date form { margin: 0; }

/* Séances (admin) */
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.seance header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.liste-pointage { list-style: none; padding: 0; margin: 0; }
.liste-pointage li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; margin-bottom: 4px; background: var(--fond); }
.liste-pointage li.validee { background: var(--ok-fond); }
.liste-pointage li.en_attente { background: var(--attente-fond); }
.liste-pointage li.refusee { background: var(--erreur-fond); text-decoration: line-through; }
.liste-pointage li.ignore { opacity: .5; }
.liste-pointage li.hors { border: 1px dashed var(--attente); }
.liste-pointage .etat { white-space: nowrap; font-size: .9rem; }

/* Téléphone de l'humoriste */
body.telephone { background: #14110f; color: #fff; min-height: 100vh; }
body.telephone main { max-width: 480px; padding: 24px 18px; }
body.telephone .carte { background: #221d1a; border-color: #3a322d; color: #fff; }
body.telephone .discret { color: #b3a9a2; }
body.telephone a { color: #ff8a70; }
.resultat { text-align: center; padding-top: 10vh; }
.resultat .icone { font-size: 5rem; line-height: 1; margin-bottom: 12px; }
.resultat h1 { font-size: 1.9rem; }
.seance-lib { font-size: 1.1rem; background: rgba(255,255,255,.08); border-radius: 10px; padding: 10px; text-transform: none; }
body.telephone.ok { background: #0f3d25; } body.telephone.attente { background: #4a3510; } body.telephone.alerte { background: #4a1712; }

/* Tablette */
body.tablette { background: #14110f; color: #fff; min-height: 100vh; user-select: none; -webkit-user-select: none; }
body.tablette main { max-width: none; padding: 20px 28px; }
body.tablette .carte { background: #221d1a; border-color: #3a322d; color: #fff; }
body.tablette .discret { color: #b3a9a2; }
.barre-tablette { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: #000; font-size: 1.1rem; text-transform: capitalize; }
.barre-tablette .retour { color: #ff8a70; text-decoration: none; font-size: 1.1rem; }
.horloge { font-variant-numeric: tabular-nums; color: #bbb; }
.titre-tablette { font-size: 2.2rem; text-align: center; margin: 10px 0 20px; }
.consigne { text-align: center; color: #bbb; font-size: 1.1rem; }
.grille-plateaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.tuile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #221d1a; border: 2px solid #3a322d; border-radius: 18px; padding: 34px 16px; color: #fff; text-decoration: none; }
.tuile span { font-size: 2.2rem; font-weight: 800; } .tuile small { color: #aaa; }
.tuile:active, .tuile-seance:active { transform: scale(.98); border-color: var(--accent); }
.liste-seances { display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin: 0 auto; }
.tuile-seance { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 18px; background: #221d1a; border: 2px solid #3a322d; border-radius: 16px; padding: 18px 22px; color: #fff; text-decoration: none; }
.tuile-seance .heure { font-size: 2rem; font-weight: 800; }
.tuile-seance .noms { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 1.05rem; color: #ddd; }
.tuile-seance .noms .pointe { color: #6ee7a0; } .tuile-seance .noms .pointe::before { content: "✓ "; }
.tuile-seance .compte { font-size: 1.2rem; color: #aaa; font-variant-numeric: tabular-nums; }
.ecran-qr { display: grid; grid-template-columns: minmax(300px, 1.2fr) 1fr; gap: 32px; align-items: start; max-width: 1100px; margin: 0 auto; }
.zone-qr { display: flex; flex-direction: column; align-items: center; }
.qr { background: #fff; border-radius: 18px; padding: 14px; width: min(62vh, 100%); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; display: block; }
.jauge { width: min(62vh, 100%); height: 6px; background: #333; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.jauge div { height: 100%; width: 100%; background: var(--accent); }
.zone-liste h2 { color: #bbb; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.tablette .liste-pointage li { background: #221d1a; font-size: 1.25rem; padding: 12px 16px; }
.tablette .liste-pointage li.validee { background: #0f3d25; } .tablette .liste-pointage li.en_attente { background: #4a3510; }
.flash-arrivee { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 18px 30px; border-radius: 14px; font-size: 1.6rem; font-weight: 700; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #1f8a4c; }
.flash-arrivee.en_attente { background: var(--attente); }

body.centre main { padding-top: 0; }

@media (max-width: 760px) {
  .ecran-qr { grid-template-columns: 1fr; }
  .tuile-seance { grid-template-columns: 80px 1fr; } .tuile-seance .compte { display: none; } .tuile-seance .heure { font-size: 1.5rem; }
  .barre { gap: 8px; } .qui { width: 100%; }
}
