/* Gestion des kourels : logiciel de travail sur tablette, sobre et rapide (pas d'effets), aux couleurs du daara.
   Formes : boutons et champs 12 px, blocs 16 px. Cibles tactiles de 48 px au minimum. */
:root { color-scheme: light dark;
  --vert: #0B6E3B; --vert-f: #064A27; --vert-p: #E8F2EA; --or: #C9962F; --or-c: #E4B85C; --or-p: #FBF3E0;
  --fond: #F6F4EE; --surface: #FFFDF9; --surface-2: #F0ECE2; --texte: #1E1B14; --doux: #5F594B; --bord: #E4DDCC;
  --rouge: #B3261E; --rouge-p: #FDECEA; --orange: #A55508; --orange-p: #FBEBD8; --bleu: #23408F; --bleu-p: #E6ECF9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --fond: #0F1310; --surface: #171C18; --surface-2: #202721; --texte: #EEF1EC; --doux: #A3AC9F; --bord: #2C352D;
  --vert-p: #133222; --or-p: #3A2E12; --rouge-p: #3E1715; --orange-p: #3A2610; --bleu-p: #18244A; --vert: #3FA86B; --vert-f: #8FD3A9; --rouge: #FF8A7F; --orange: #F2A659; --bleu: #9DB4FF; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 700 28px/1.15 Georgia, "Times New Roman", serif; color: var(--vert-f); }
h2 { font: 700 21px/1.2 Georgia, serif; color: var(--vert-f); }
h3 { font-size: 16px; }
.doux { color: var(--doux); }
.bandeau-maquette { background: var(--or); color: #241a05; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent; background: var(--vert); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-2 { background: var(--surface); color: var(--vert); border-color: var(--vert); }
.btn-or { background: var(--or); color: #241a05; }
.btn-wa { background: #1FA855; color: #fff; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ic { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--bord); background: var(--surface); }
textarea { min-height: 110px; resize: vertical; }
label.lib { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 6px; }
:focus-visible { outline: 3px solid rgba(11,110,59,.45); outline-offset: 2px; }

/* Connexion */
.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0B6E3B, #064A27); }
.connexion form { width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.connexion img { width: 72px; height: 72px; border-radius: 50%; background: #fff; display: block; margin: 0 auto 10px; }
.connexion h1 { text-align: center; font-size: 24px; }
.comptes { margin-top: 16px; font-size: 13.5px; background: var(--or-p); border-radius: 12px; padding: 10px 12px; }
.comptes button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--texte); }
.erreur { color: var(--rouge); font-weight: 600; font-size: 14px; margin-top: 8px; }

/* Coquille : menu à gauche (tablette en paysage), barre en bas en portrait */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.menu { background: var(--vert-f); color: #E8F2EA; padding: 16px 10px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .menu { background: #0A2416; } }
.menu .marque { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.menu .marque img { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.menu .marque b { display: block; font-family: Georgia, serif; font-size: 16px; color: #fff; }
.menu .marque small { color: var(--or-c); font-size: 12.5px; }
.menu a { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 12px; border-radius: 12px; color: #E8F2EA; text-decoration: none; font-weight: 600; }
.menu a[aria-current] { background: rgba(255,255,255,.14); color: #fff; }
.menu a .pastille { margin-left: auto; background: var(--or); color: #241a05; border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 800; }
.menu .bas { margin-top: auto; font-size: 13px; color: #B9D7C4; padding: 8px; }
.menu .bas button { margin-top: 8px; width: 100%; }
.vue { padding: 22px 26px 60px; min-width: 0; }
.tete-vue { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.tete-vue p { margin: 4px 0 0; }
.tete-vue .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.bloc { background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 18px; min-width: 0; }
.bloc + .bloc { margin-top: 14px; }
.grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.chiffre { background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 14px 16px; }
.chiffre span { font-size: 13px; color: var(--doux); }
.chiffre b { display: block; font: 700 30px/1.1 Georgia, serif; color: var(--vert-f); font-variant-numeric: tabular-nums; }
.chiffre.alerte b { color: var(--rouge); }
.deux { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.deux > .bloc + .bloc { margin-top: 0; }
.prochaine { background: var(--vert-f); color: #fff; border: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prochaine { background: #0F3A22; } }
.prochaine h2 { color: #fff; }
.prochaine .quand { font-size: 18px; color: var(--or-c); font-weight: 700; margin-top: 6px; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--bord); }
.ligne:first-child { border-top: 0; }
.ligne .droite { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ligne small { display: block; color: var(--doux); font-size: 13.5px; }
.date { flex: none; width: 54px; text-align: center; border-radius: 12px; background: var(--vert-p); color: var(--vert-f); padding: 6px 0; font-size: 12px; line-height: 1.15; font-weight: 600; }
.date b { display: block; font: 700 21px Georgia, serif; }
.rond { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--vert-p); color: var(--vert-f); font-weight: 800; font-size: 15px; border: 2px solid var(--or-c); }
.rond img { width: 100%; height: 100%; object-fit: cover; }
.puce { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--doux); white-space: nowrap; }
.puce.P { background: var(--vert-p); color: var(--vert-f); }
.puce.R { background: var(--orange-p); color: var(--orange); }
.puce.A { background: var(--rouge-p); color: var(--rouge); }
.puce.bleu { background: var(--bleu-p); color: var(--bleu); }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtres button { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--bord); background: var(--surface); font-weight: 600; cursor: pointer; }
.filtres button[aria-pressed="true"] { background: var(--vert-f); border-color: var(--vert-f); color: #fff; }

/* Appel : une tuile par membre, on touche pour pointer */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tuile { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 16px; border: 2px solid var(--bord); background: var(--surface); cursor: pointer; text-align: center; min-height: 150px; }
.tuile .rond { width: 64px; height: 64px; font-size: 20px; }
.tuile b { font-size: 14.5px; line-height: 1.2; }
.tuile small { font-size: 12.5px; color: var(--doux); }
.tuile.P { border-color: var(--vert); background: var(--vert-p); }
.tuile.R { border-color: var(--orange); background: var(--orange-p); }
.tuile.A { border-color: var(--rouge); background: var(--rouge-p); }
.tuile .etat { position: absolute; top: 8px; right: 8px; }
.compteurs { display: flex; gap: 8px; flex-wrap: wrap; }
.scan { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
video.camera { width: 100%; max-width: 420px; border-radius: 14px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }

/* Historique : membres en lignes, rencontres en colonnes */
.tableau-hist { overflow-x: auto; border: 1px solid var(--bord); border-radius: 16px; background: var(--surface); }
.tableau-hist table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14px; }
.tableau-hist th, .tableau-hist td { padding: 8px 10px; border-bottom: 1px solid var(--bord); text-align: center; white-space: nowrap; }
.tableau-hist th { background: var(--surface-2); font-size: 12.5px; color: var(--doux); position: sticky; top: 0; }
.tableau-hist th:first-child, .tableau-hist td:first-child { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; min-width: 190px; }
.tableau-hist th:first-child { background: var(--surface-2); z-index: 2; }
.c { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-weight: 800; font-size: 13px; }
.c.P { background: var(--vert-p); color: var(--vert-f); }
.c.R { background: var(--orange-p); color: var(--orange); }
.c.A { background: var(--rouge-p); color: var(--rouge); }
.c.vide { color: var(--bord); }
.tableau-hist tfoot td { font-weight: 700; color: var(--vert-f); background: var(--surface-2); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--doux); margin: 10px 0 0; }

/* Fenêtre */
.modale { position: fixed; inset: 0; background: rgba(6,20,12,.55); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modale .bloc { width: min(560px, 100%); max-height: 92dvh; overflow-y: auto; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.champs .plein { grid-column: 1 / -1; }
.motifs { display: flex; gap: 8px; flex-wrap: wrap; }
.motifs button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--bord); background: var(--surface); cursor: pointer; font-weight: 600; }
.motifs button[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.apercu-msg { white-space: pre-wrap; background: #D9FDD3; color: #111b21; border-radius: 12px 12px 4px 12px; padding: 12px 14px; font-size: 15px; margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--vert-f); color: #fff; padding: 13px 18px; border-radius: 14px; font-weight: 600; z-index: 60; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 12px 30px rgba(0,0,0,.25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #0F3A22; } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .menu { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; z-index: 30; overflow-x: auto; gap: 2px; }
  .menu .marque, .menu .bas { display: none; }
  .menu a { flex-direction: column; gap: 2px; min-height: 58px; min-width: 72px; font-size: 11.5px; justify-content: center; padding: 4px 6px; }
  .menu a .pastille { position: absolute; margin: -34px 0 0 30px; }
  .vue { padding: 16px 14px 96px; }
  .grille { grid-template-columns: 1fr 1fr; }
  .deux, .champs { grid-template-columns: 1fr; }
}
@media print { .menu, .bandeau-maquette, .actions, .filtres { display: none !important; } .app { display: block; } .vue { padding: 0; } }
.menu a { position: relative; }

/* Page Scanner : la caméra en grand, le résultat de chaque carte, les derniers pointés */
.choix-rencontre { max-width: 560px; margin-bottom: 14px; }
.pointage { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.viseur-k { position: relative; border-radius: 20px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #1d3a2a, #050c08); aspect-ratio: 4 / 3; }
.viseur-k video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cadre-k { position: absolute; inset: 16% 24%; border: 4px solid var(--or-c); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.viseur-k p { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; text-align: center; color: #fff; font-weight: 600; font-size: 14px; }
.resultat-k { display: flex; align-items: center; gap: 12px; margin-top: 12px; min-height: 76px; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 2px solid var(--bord); font-size: 18px; font-weight: 700; }
.resultat-k.ok { border-color: var(--vert); background: var(--vert-p); color: var(--vert-f); }
.resultat-k.ko { border-color: var(--orange); background: var(--orange-p); color: var(--orange); }
.pointage__suivi { background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 16px; }
.pointage__suivi h2 { margin: 14px 0 4px; font-size: 18px; }
.compteurs-k { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ck { border-radius: 14px; padding: 10px; text-align: center; background: var(--surface-2); }
.ck b { display: block; font: 700 30px/1.1 Georgia, serif; }
.ck span { font-size: 13px; color: var(--doux); }
.ck.P { background: var(--vert-p); color: var(--vert-f); } .ck.R { background: var(--orange-p); color: var(--orange); }
@media (max-width: 900px) { .pointage { grid-template-columns: 1fr; } }
