/* seance.css — l'espace de séance. Palette : la charte UTTOP (tokens recopiés, pas importés :
   l'app doit tenir seule sur le serveur). Polices système : rien à télécharger. */
:root {
  --navy: #0C3C60; --navy-deep: #07294A; --vert: #3DBE8B; --vert-ink: #1d8058;
  --jaune: #F4C20D; --rouge: #E4572E; --indigo: #4A5BD4;
  --fond: #FBF8F2; --surface: #FFFFFF; --surface-2: #F5F0E6; --ligne: #E4DCCC; --ligne-forte: #D8CFBE;
  --encre: #14304A; --encre-2: #40566B; --pale: #7F8E9B;
  --accent: #11a473; --sur-accent: #fff;
  --rayon: 12px; --ombre: 0 1px 2px rgba(20,48,74,.06), 0 4px 16px rgba(20,48,74,.06);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0E1A24; --surface: #142533; --surface-2: #1B2F40; --ligne: #263D50; --ligne-forte: #34506A;
    --encre: #E8EEF3; --encre-2: #B5C3CF; --pale: #7D90A0; --navy: #8FC3EA; --accent: #3DBE8B; --sur-accent: #06150F;
    --ombre: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--police); color: var(--encre); background: var(--fond); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
small, .pale { color: var(--pale); }
code, .mono { font-family: var(--mono); }
[hidden] { display: none !important; }

button, .bouton {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: .55em 1em;
  border: 1px solid var(--ligne-forte); background: var(--surface); color: var(--encre);
  display: inline-flex; align-items: center; gap: .4em; text-decoration: none; min-height: 40px;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
button.primaire, .bouton.primaire { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
button.danger { color: var(--rouge); }
button.mini { min-height: 30px; padding: .2em .6em; font-size: .85rem; font-weight: 500; }
button.lien { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; }
input, textarea, select {
  font: inherit; color: var(--encre); background: var(--surface); width: 100%;
  border: 1px solid var(--ligne-forte); border-radius: 10px; padding: .6em .75em;
}
textarea { min-height: 7em; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
label { display: block; font-weight: 600; margin: .8em 0 .3em; }

.carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem 1.1rem; box-shadow: var(--ombre); }
.pastille { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1em .55em; border-radius: 99px; background: var(--surface-2); color: var(--encre-2); white-space: nowrap; }
.pastille.vert { background: color-mix(in srgb, var(--vert) 20%, transparent); color: var(--vert-ink); }
.pastille.jaune { background: color-mix(in srgb, var(--jaune) 25%, transparent); color: #7a5d00; }
.pastille.rouge { background: color-mix(in srgb, var(--rouge) 18%, transparent); color: var(--rouge); }
.pastille.indigo { background: color-mix(in srgb, var(--indigo) 18%, transparent); color: var(--indigo); }
@media (prefers-color-scheme: dark) { .pastille.vert { color: var(--vert); } .pastille.jaune { color: var(--jaune); } }
.ligne { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.espace { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--navy-deep); color: #fff;
  padding: .6em 1.1em; border-radius: 10px; box-shadow: var(--ombre); z-index: 50; max-width: calc(100% - 32px); }
.toast.erreur { background: var(--rouge); }

/* ── Étudiant ───────────────────────────────────────────────────────────────────────── */
.etudiant { max-width: 680px; margin: 0 auto; padding: 16px 16px 4rem; }
.entete { display: flex; align-items: center; gap: .7rem; padding: .3rem 0 1rem; }
.entete .logo { width: 36px; height: 36px; border-radius: 9px; background: #0C3C60; color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: -.02em; }
.entete .titre { font-weight: 700; line-height: 1.15; }
.entete .titre small { display: block; font-weight: 500; }
.moi { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.moi .id { font: 700 1.35rem var(--mono); color: var(--navy); }
.moi .prenom { font: 700 1.2rem/1 var(--police); color: var(--navy); }
#mon-id { display: inline-flex; align-items: center; gap: .35rem; }
img.photo-ronde { border-radius: 50%; flex: none; object-fit: cover; vertical-align: middle; background: var(--surface-2); }
.fiche-photo { display: flex; gap: .8rem; align-items: center; margin: .8em 0; }
.fiche-photo img, .fiche-photo .vide { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--pale); font-size: 2rem; }
.code-attente { font: 800 clamp(2.4rem, 12vw, 4rem)/1 var(--mono); letter-spacing: .06em; color: var(--navy); text-align: center; margin: 1rem 0; }
.annonce { border-left: 4px solid var(--jaune); }
.question { margin: 0 0 1rem; }
.question .meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.question .aide { color: var(--encre-2); font-size: .92rem; }
.question .etat { font-size: .85rem; color: var(--pale); margin-top: .5rem; min-height: 1.3em; }
.question .etat.ok { color: var(--vert-ink); }
@media (prefers-color-scheme: dark) { .question .etat.ok { color: var(--vert); } }
.question.fermee { opacity: .75; }
.options { display: grid; gap: .4rem; }
.option { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--ligne-forte); border-radius: 10px; cursor: pointer; font-weight: 500; margin: 0; }
.option input { width: auto; margin-top: .25em; }
.option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.echelle { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.echelle button { justify-content: center; font-size: 1.1rem; }
.echelle button.choisi { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }
.depots { display: grid; gap: .4rem; margin: .5rem 0; }
.depot { display: flex; gap: .6rem; align-items: center; padding: .45rem .6rem; border: 1px solid var(--ligne); border-radius: 10px; background: var(--surface-2); font-size: .92rem; }
.depot .nom { flex: 1; overflow-wrap: anywhere; }
.zone-depot { border: 2px dashed var(--ligne-forte); border-radius: var(--rayon); padding: 1rem; text-align: center; color: var(--encre-2); }
.zone-depot.survol { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.vie-privee { font-size: .85rem; color: var(--encre-2); background: var(--surface-2); border-radius: 10px; padding: .7rem .9rem; margin-top: 1rem; }
details > summary { cursor: pointer; font-weight: 600; color: var(--navy); margin: .5rem 0; }

/* ── Admin ──────────────────────────────────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin nav { background: var(--navy-deep); color: #dce6ee; padding: 1rem .7rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .2rem; }
.admin nav .marque { font-weight: 800; color: #fff; padding: .2rem .5rem 1rem; line-height: 1.2; }
.admin nav .marque small { display: block; font-weight: 500; color: #9fb4c6; font-size: .78rem; }
.admin nav button { background: none; border: 0; color: inherit; justify-content: flex-start; font-weight: 500; width: 100%; min-height: 38px; }
.admin nav button.actif { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; }
.admin nav button .compte { margin-left: auto; font-size: .78rem; background: var(--jaune); color: #222; border-radius: 99px; padding: 0 .5em; }
.admin nav .bas { margin-top: auto; font-size: .8rem; color: #9fb4c6; padding: .5rem; }
.admin main { padding: 1.2rem 1.5rem 4rem; min-width: 0; }
.admin .barre { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.attente { display: grid; gap: .5rem; }
.attente .code { font: 800 1.3rem var(--mono); color: var(--navy); }
.chiffres { display: flex; gap: .8rem; flex-wrap: wrap; }
.chiffre { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .6rem 1rem; min-width: 110px; }
.chiffre b { display: block; font-size: 1.6rem; color: var(--navy); line-height: 1.1; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pale); font-weight: 700; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tableau { overflow-x: auto; }
.membres { display: flex; flex-wrap: wrap; gap: .3rem; min-height: 2rem; }
.membre { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .25rem .15rem .55rem; border-radius: 99px; background: var(--surface-2); font-size: .88rem; }
.membre button { min-height: 0; padding: 0 .35em; border: 0; background: none; color: var(--pale); }
.q-admin { display: grid; grid-template-columns: 1fr auto; gap: .4rem .8rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--ligne); }
.q-admin .actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.barres { display: grid; gap: .35rem; }
.barre-l { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 2.5em; gap: .6rem; align-items: center; font-size: .92rem; }
.barre-l .jauge { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.barre-l .jauge i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.textes { display: grid; gap: .5rem; }
.texte { padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.texte .qui { display: block; font-size: .8rem; color: var(--pale); margin-bottom: .2rem; white-space: normal; }
.modale { position: fixed; inset: 0; background: rgba(7,41,74,.55); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modale .carte { max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.code-reprise { font: 800 3rem var(--mono); letter-spacing: .12em; text-align: center; color: var(--navy); margin: .5rem 0; }
.depot-zone-admin { border: 2px dashed var(--ligne-forte); border-radius: var(--rayon); padding: 1rem; text-align: center; }
.depot-zone-admin.survol { border-color: var(--accent); }
.vignette { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; margin-bottom: .4rem; }
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .admin nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: .5rem; }
  .admin nav .marque, .admin nav .bas { display: none; }
  .admin nav button { width: auto; }
  .admin main { padding: 1rem 16px 4rem; }
}

/* ── Projection ─────────────────────────────────────────────────────────────────────── */
.projection { min-height: 100vh; display: grid; place-items: center; padding: 3vh 4vw; text-align: center; background: var(--fond); }
.projection .qr { width: min(46vh, 80vw); height: auto; background: #fff; padding: 14px; border-radius: 16px; }
.projection .url { font: 700 clamp(1.2rem, 3vw, 2.4rem) var(--mono); color: var(--navy); margin: 1.5vh 0; }
.projection .compteur { font-size: clamp(1rem, 2vw, 1.6rem); color: var(--encre-2); }
.projection h1 { font-size: clamp(1.6rem, 4vw, 3.2rem); max-width: 22ch; margin: 0 auto 4vh; }
.projection .barres { width: min(1100px, 92vw); margin: 0 auto; gap: 1.2vh; text-align: left; }
.projection .barre-l { font-size: clamp(1rem, 2.1vw, 1.7rem); grid-template-columns: 40% 1fr 3em; }
.projection .barre-l .jauge { height: 3.2vh; }
.projection .textes { width: min(1200px, 94vw); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); text-align: left; font-size: clamp(1rem, 1.6vw, 1.4rem); }

/* ── Améliorer : poignée ancrée au bord, tiroir, désignation ─────────────────────────── */
.ameliorer-poignee { position: fixed; right: 0; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl;
  border-radius: 10px 0 0 10px; padding: .8rem .35rem; min-height: 0; z-index: 30; background: var(--navy-deep, #07294A); color: #fff;
  border: 0; font-size: .8rem; letter-spacing: .04em; box-shadow: var(--ombre); }
.ameliorer-poignee { transform: translateY(-50%); writing-mode: vertical-rl; border-radius: 10px 0 0 10px; }
.ameliorer-tiroir { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100%); z-index: 35; background: var(--surface);
  border-left: 1px solid var(--ligne); box-shadow: -8px 0 30px rgba(7,41,74,.18); padding: 1rem 1.1rem; overflow-y: auto; }
.ameliorer-natures { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.ameliorer-natures button.choisi, .niveaux-choix button.choisi { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }
.ameliorer-cible { display: flex; gap: .5rem; align-items: center; padding: .45rem .6rem; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.ameliorer-cible span { flex: 1; overflow-wrap: anywhere; }
.ameliorer-anonyme { display: flex; gap: .5rem; align-items: center; font-size: .9rem; margin: .6rem 0 0; font-weight: 500; }
.ameliorer-bandeau { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 45; background: var(--navy-deep, #07294A); color: #fff;
  padding: .5rem .6rem .5rem 1rem; border-radius: 99px; display: flex; gap: .7rem; align-items: center; box-shadow: var(--ombre); }
.ameliorer-survol { outline: 3px solid var(--jaune) !important; outline-offset: 2px; cursor: crosshair !important; }

/* ── Choix : niveau et précision par option cochée ───────────────────────────────────── */
.option-bloc { display: grid; gap: .35rem; }
.sous-option { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: 0 0 .3rem 2rem; }
.sous-option input { flex: 1 1 180px; padding: .4em .6em; font-size: .92rem; }
.niveaux-choix { display: flex; flex-wrap: wrap; gap: .3rem; }
