/* ==========================================================================
   POINTAGE CLUBS — Maquette · Concept pour BASIC-FIT · par KITO
   Charte : design system public de basic-fit.com (variables --flex-*).
   Les tokens sont centralisés dans :root : une autre charte client = un autre bloc :root.
   ========================================================================== */

/* ---------- CHARTE BASIC-FIT (relevée sur basic-fit.com/fr-fr, variables --flex-*) ----------
   Source : variables CSS du site officiel, consultées le 18/11/2026.
   Police officielle : Heading Pro Treble (Regular / ExtraBold / Heavy), sous licence :
   non embarquée ici, remplacée par Montserrat (substitut libre, à valider). */
:root {
  color-scheme: light;
  /* Couleurs officielles */
  --bf-orange:          #FE7000;  /* orange marque (logo, theme-color) */
  --bf-orange-500:      #EB6800;  /* accents, icônes de marque */
  --bf-orange-600:      #BD5400;  /* texte orange sur fond clair (contraste AA) */
  --bf-orange-50:       #FFF6F0;
  --bf-orange-mid:      #FF8712;
  --bf-orange-light:    #FFAB21;
  --bf-interaction:     #592BB2;  /* boutons, liens d'action, focus */
  --bf-interaction-hover:  #3B1480;
  --bf-interaction-active: #2B0961;
  --bf-interaction-soft:   #F8F3FF;
  --bf-interaction-ring:   #E5D7FC;
  --bf-text:            #2D2D2D;
  --bf-text-secondary:  #6B6B6B;
  --bf-white:           #FFFFFF;
  --bf-sand-50:         #FBF7F0;
  --bf-sand-100:        #F2E8D6;
  --bf-sand-200:        #E8D6BF;
  --bf-grey-50:         #F9F9F9;
  --bf-grey-100:        #E8E8E8;
  --bf-grey-200:        #D5D5D5;
  --bf-field-border:    #8F8F92;
  --bf-green:           #0F7036;
  --bf-yellow:          #FFD12E;  /* badge */
  --bf-pill:            #FFE8D6;  /* pill */
  --bf-error:           #C73326;
  --bf-error-soft:      #FBDFDE;
  /* Rayons officiels : 2 / 4 / 6 / 8 / 12 / 16 / 999 */
  --radius:    8px;
  --radius-sm: 4px;
  --font-heading: "Montserrat", "HeadingProTreble-Heavy", Arial, sans-serif;
  --font-body:    "Montserrat", "HeadingProTreble-Regular", Arial, sans-serif;
  --font-mono:    "Montserrat", Arial, sans-serif; /* chiffres tabulaires */

  /* Sémantique utilisée par les composants */
  --bf-bg: var(--bf-sand-50);
  --bf-bg-secondary: var(--bf-sand-100);
  --bf-card: var(--bf-white);
  --bf-border-accent: var(--bf-grey-200);
  --bf-glow: transparent;
  --bf-primary: var(--bf-interaction);
  --bf-accent: var(--bf-orange);
  --page-bg: var(--bf-sand-50);
  --surface:        #FFFFFF;
  --surface-solid:  #FFFFFF;
  --surface-2:      var(--bf-grey-50);
  --surface-3:      var(--bf-grey-100);
  --line:           var(--bf-grey-100);
  --line-strong:    var(--bf-grey-200);
  --primary-text:   var(--bf-interaction);
  --on-primary:     #FFFFFF;
  --btn-primary-bg: var(--bf-interaction);
  --pill-bg:        var(--bf-pill);
  --pill-text:      var(--bf-orange-600);
  --grad-text:      var(--bf-orange);
  --ok:      var(--bf-green);   --ok-soft:     #E3F1E8;
  --warn:    var(--bf-text);    --warn-soft:   var(--bf-yellow);
  --danger:  var(--bf-error);   --danger-soft: var(--bf-error-soft);
  --info:    var(--bf-interaction); --info-soft: var(--bf-interaction-soft);
  --muted-soft: var(--bf-grey-100);
  --blur: 0px;
  --shadow: 0 8px 30px rgba(45, 45, 45, 0.12);
  --phone-frame: #2D2D2D;
  --phone-bg: #FFFFFF;
  --scrim: rgba(45, 45, 45, 0.5);
  --av-l: 88%; --av-s: 45%; --av-text: #2D2D2D;
  --heading-transform: uppercase;
  --heading-tracking: 0;
}

/* ---------- Base ---------- */
body { font-variant-numeric: tabular-nums; }
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--bf-text);
  background: var(--page-bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-transform);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary-text); }
:focus-visible { outline: 2px solid var(--bf-primary); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--bf-text-secondary); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Glass + liseré dégradé ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  padding: 20px;
}
@supports not (backdrop-filter: blur(1px)) {
  .card, .topbar, .demobar { background: var(--surface-solid); }
}

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--pill-bg);
  border: 1px solid var(--bf-border-accent);
  color: var(--pill-text);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  background: var(--muted-soft); color: var(--bf-text-secondary);
}
.badge.ok     { background: var(--ok-soft);     color: var(--ok); }
.badge.warn   { background: var(--warn-soft);   color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info   { background: var(--info-soft);   color: var(--info); }
.badge.outline-danger { background: transparent; border: 1px dashed var(--danger); color: var(--danger); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-weight: 600; font-size: 14px;
  text-decoration: none; color: var(--bf-text);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--btn-primary-bg); color: var(--on-primary);
  border-color: transparent;
  box-shadow: 0 8px 24px var(--bf-glow);
}
.btn-primary:hover { background: var(--btn-primary-bg); filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.08); }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2);
  display: inline-grid; place-items: center; font-size: 20px; line-height: 1;
}
.seg { display: inline-flex; padding: 3px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 600; color: var(--bf-text-secondary);
}
.seg button[aria-pressed="true"] { background: var(--btn-primary-bg); color: var(--on-primary); }
.seg .count { font-family: var(--font-mono); font-size: 11.5px; opacity: 0.8; margin-left: 4px; }

/* ---------- Champs ---------- */
.field { display: grid; gap: 6px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 600; color: var(--bf-text-secondary); padding: 0; }
.field small { color: var(--bf-text-secondary); font-size: 12.5px; }
input[type="text"], input[type="tel"], input[type="search"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 16px; /* évite le zoom iOS */
}
textarea { min-height: 120px; resize: vertical; font-family: var(--font-mono); font-size: 13.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bf-primary); box-shadow: 0 0 0 3px var(--bf-glow); }
input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 12px;
  border-radius: 100px; border: 1px solid var(--line-strong);
  font-size: 13.5px; font-weight: 500; background: var(--surface-2);
}
.chip input:checked + span { background: var(--pill-bg); border-color: var(--bf-primary); color: var(--bf-text); font-weight: 600; }
.chip input:checked + span::before { content: "✓"; font-weight: 700; color: var(--primary-text); }
.chip input:focus-visible + span { outline: 2px solid var(--bf-primary); outline-offset: 2px; }
.chips.days .chip span { min-width: 40px; justify-content: center; padding: 6px 10px; }
.chips.days .chip input:checked + span::before { content: none; }
.dept-group { display: grid; gap: 6px; }
.dept-group + .dept-group { margin-top: 10px; }
.dept-group h5 { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bf-text-secondary); font-family: var(--font-body); font-weight: 600; }

details.more { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); position: relative; overflow: hidden; }
details.more > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; font-family: var(--font-mono); color: var(--primary-text); }
details.more[open] > summary::after { content: "–"; }
details.more[open]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bf-orange); }
details.more .more-body { padding: 0 14px 14px; display: grid; gap: 12px; }

.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; display: grid; gap: 8px; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert strong { font-weight: 700; }
.radio-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface-2); }
.radio-card:has(input:checked) { border-color: var(--bf-primary); background: var(--pill-bg); }
.radio-card input { margin-top: 3px; accent-color: var(--bf-primary); }
.radio-card b { font-weight: 600; }
.radio-card small { grid-column: 2; color: var(--bf-text-secondary); font-size: 13px; }
.radio-card select { grid-column: 2; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--bf-primary); width: 18px; height: 18px; }

/* ---------- Topbar + barre de démo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bf-bg) 78%, transparent);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--line);
}
.product { display: grid; line-height: 1.2; }
.product strong { font-family: var(--font-heading); font-weight: 800; font-size: 17px; text-transform: var(--heading-transform); letter-spacing: var(--heading-tracking); }
.product span { font-size: 12.5px; color: var(--bf-text-secondary); }
.topbar .spacer { flex: 1; }
.who { font-size: 13px; color: var(--bf-text-secondary); display: flex; align-items: center; gap: 8px; }
.who .avatar { width: 30px; height: 30px; font-size: 12px; }
.pane-tabs { display: none; }

.demobar {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bf-bg-secondary) 85%, transparent);
  font-size: 13px;
}
.demobar .clock { font-family: var(--font-mono); font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.demobar select { min-height: 34px; padding: 4px 10px; width: auto; font-size: 13px; }
.demobar .grow { flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.toggle input { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bf-text-secondary); transition: transform 0.2s, background 0.2s; }
.toggle input:checked { background: var(--danger-soft); border-color: var(--danger); }
.toggle input:checked::after { transform: translateX(16px); background: var(--danger); }

/* ---------- Layout principal ---------- */
.layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  max-width: 1680px; margin: 0 auto;
}
.pane-phone { position: sticky; top: 84px; align-self: start; display: grid; gap: 12px; justify-items: center; }
.pane-admin { min-width: 0; display: grid; gap: 20px; align-content: start; }

/* ---------- Téléphone ---------- */
.phone-who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--bf-text-secondary); width: 375px; }
.phone-who select { flex: 1; min-height: 38px; font-size: 14px; padding: 6px 10px; }
.phone {
  width: 375px; height: 760px;
  border-radius: 48px;
  border: 11px solid var(--phone-frame);
  background: var(--phone-bg);
  box-shadow: var(--shadow), 0 0 0 1px var(--line-strong);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.phone-status { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 26px 0 30px; font-size: 14px; font-weight: 600; position: relative; }
.phone-status::before { content: ""; position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: 110px; height: 30px; background: var(--phone-frame); border-radius: 20px; }
.phone-status .net { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.phone-status .net.off { color: var(--danger); }
.phone-screen { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 16px; font-size: 17px; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-nav { flex: none; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding: 6px 12px 16px; }
.phone-nav button { border: 0; background: transparent; padding: 8px; font-size: 12px; font-weight: 600; color: var(--bf-text-secondary); display: grid; justify-items: center; gap: 2px; border-radius: 12px; }
.phone-nav button[aria-current="page"] { color: var(--primary-text); }
.phone-nav svg { width: 22px; height: 22px; }
.m-app { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--bf-text-secondary); }
.m-app b { font-family: var(--font-heading); font-weight: 800; color: var(--bf-text); font-size: 14px; text-transform: var(--heading-transform); }
.m-date { font-size: 14px; color: var(--bf-text-secondary); text-transform: capitalize; }
.m-hello { font-size: 30px; }
.m-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; position: relative; }
.m-card { background: #F6F6F6; border-color: transparent; }
.m-card .lbl { font-size: 13px; font-weight: 600; color: var(--bf-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.m-card .club { font-family: var(--font-heading); font-weight: 800; font-size: 21px; line-height: 1.2; text-transform: var(--heading-transform); }
.m-card .where { font-size: 15px; color: var(--bf-text-secondary); }
.m-card .when { font-family: var(--font-mono); font-size: 17px; font-weight: 600; }
.m-chrono { font-family: var(--font-mono); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.m-scan {
  width: 100%; min-height: 64px;
  border-radius: 18px; border: 0;
  background: var(--btn-primary-bg); color: var(--on-primary);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  box-shadow: 0 12px 30px var(--bf-glow);
}
.m-scan { border-radius: 100px; text-transform: uppercase; font-family: var(--font-heading); font-size: 18px; letter-spacing: 0.02em; white-space: nowrap; padding: 0 18px; }
.m-scan svg { width: 26px; height: 26px; }
.m-scan.secondary { background: var(--surface-3); color: var(--bf-text); box-shadow: none; }
.m-h2 { font-size: 16px; font-family: var(--font-body); font-weight: 700; text-transform: none; letter-spacing: 0; }
.m-list { display: grid; gap: 2px; }
.m-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.m-row .d { font-weight: 600; text-transform: capitalize; }
.m-row .c { color: var(--bf-text-secondary); font-size: 13.5px; }
.m-row .t { font-family: var(--font-mono); font-size: 14px; text-align: right; }
.m-banner { border-radius: 14px; padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.m-banner.off { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.m-banner.queue { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.m-concept { font-size: 11px; color: var(--bf-text-secondary); text-align: center; line-height: 1.4; margin-top: auto; padding-top: 8px; }

/* Scanner */
.scanner { position: absolute; inset: 0; background: #05070C; color: #fff; display: flex; flex-direction: column; z-index: 5; }
.scanner-view { flex: 1; display: grid; place-items: center; position: relative; background: radial-gradient(circle at 50% 40%, #1d2330 0%, #05070C 70%); }
.viewfinder { width: 230px; height: 230px; position: relative; }
.viewfinder i { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.viewfinder .line { position: absolute; left: 12px; right: 12px; height: 2px; top: 50%; background: var(--bf-primary); box-shadow: 0 0 16px var(--bf-primary); animation: scanline 2s ease-in-out infinite; will-change: transform; }
@keyframes scanline { 0%, 100% { transform: translateY(-95px); } 50% { transform: translateY(95px); } }
.scanner-hint { position: absolute; top: 24px; left: 0; right: 0; text-align: center; font-size: 16px; font-weight: 600; }
.scanner-note { position: absolute; bottom: 14px; left: 20px; right: 20px; text-align: center; font-size: 12px; color: #9aa4b5; }
.scanner-sim { background: #0E121B; padding: 14px 16px 18px; display: grid; gap: 8px; border-top: 1px solid #222a38; }
.scanner-sim p { font-size: 12px; color: #9aa4b5; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.scanner-sim button { text-align: left; border: 1px solid #2a3344; background: #161c28; color: #fff; padding: 10px 12px; border-radius: 12px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.scanner-sim button small { color: #9aa4b5; font-size: 12px; }
.scanner-sim .cancel { background: transparent; border-color: transparent; justify-content: center; color: #cfd6e3; font-weight: 600; }

/* Résultat */
.result { display: grid; gap: 14px; justify-items: center; text-align: center; padding-top: 16px; }
.result-icon { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; animation: pop 0.35s ease-out; }
.result-icon svg { width: 48px; height: 48px; }
.result-icon.ok { background: var(--ok-soft); color: var(--ok); }
.result-icon.warn { background: var(--warn-soft); color: var(--warn); }
.result-icon.danger { background: var(--danger-soft); color: var(--danger); }
.result-icon.info { background: var(--info-soft); color: var(--info); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result h2 { font-size: 26px; }
.result .big-time { font-family: var(--font-mono); font-size: 46px; font-weight: 600; line-height: 1; }
.result-rows { width: 100%; text-align: left; display: grid; gap: 0; background: var(--surface-2); border-radius: var(--radius); padding: 4px 16px; border: 1px solid var(--line); }
.result-rows { background: #F6F6F6; border-color: transparent; }
.result-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.result-rows div:last-child { border-bottom: 0; }
.result-rows dt { color: var(--bf-text-secondary); }
.result-rows dd { font-weight: 600; text-align: right; }
.result .alert { text-align: left; width: 100%; font-size: 14px; }
.result .actions { width: 100%; display: grid; gap: 10px; margin-top: 4px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--bf-primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.otp { font-family: var(--font-mono); font-size: 30px !important; letter-spacing: 0.35em; text-align: center; min-height: 64px !important; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-nav button {
  border: 1px solid transparent; background: transparent;
  padding: 9px 16px; border-radius: 100px; font-weight: 600; font-size: 14px; color: var(--bf-text-secondary);
  display: inline-flex; gap: 8px; align-items: center;
}
.admin-nav button:hover { color: var(--bf-text); background: var(--surface-2); }
.admin-nav button[aria-current="page"] { color: var(--bf-text); background: var(--surface); border-color: var(--bf-border-accent); }
.admin-nav .n { font-family: var(--font-mono); font-size: 11.5px; padding: 1px 7px; border-radius: 100px; background: var(--danger); color: #fff; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.view-head h2 { font-size: 28px; margin-top: 8px; }
.view-head p { margin-top: 6px; max-width: 640px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; }
.kpi .v { font-family: var(--font-mono); font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi .l { font-size: 13px; color: var(--bf-text-secondary); font-weight: 500; }
.kpi.danger .v { color: var(--danger); }
.kpi.warn .v { color: var(--warn); }
.kpi.ok .v { color: var(--ok); }
.kpi.info .v { color: var(--info); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bf-text-secondary); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.t { font-family: var(--font-mono); font-size: 13.5px; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.tbl .sub { font-size: 12.5px; color: var(--bf-text-secondary); }
.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: var(--pill-bg); box-shadow: inset 3px 0 0 var(--bf-primary); } 100% { background: transparent; } }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .n { font-weight: 600; }
.person .sub .mono { white-space: nowrap; }
.person button.linklike { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; color: var(--bf-text); }
.person button.linklike:hover { color: var(--primary-text); text-decoration: underline; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: hsl(var(--h, 260) var(--av-s) var(--av-l));
  color: var(--av-text);
}
.avatar.off { filter: grayscale(1); opacity: 0.55; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 340px; min-height: 40px; font-size: 14px; }
.toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-height: 40px; font-size: 14px; padding: 6px 10px; }

.emp-list { display: grid; }
.emp-row { display: grid; grid-template-columns: minmax(210px, 1.2fr) minmax(220px, 2fr) 120px 170px auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.emp-row:last-child { border-bottom: 0; }
.emp-row.head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bf-text-secondary); font-weight: 600; padding-top: 0; }
.emp-row .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.asg-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.asg { font-size: 12.5px; padding: 3px 10px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.asg .mono { font-size: 11.5px; color: var(--bf-text-secondary); margin-left: 4px; }
.empty { padding: 28px; text-align: center; color: var(--bf-text-secondary); }

.vacant-card { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.vacant-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vacant-row:last-child { border-bottom: 0; }

.list-compact { display: grid; }
.lc-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.lc-row:last-child { border-bottom: 0; }
.lc-row .meta { font-size: 12.5px; color: var(--bf-text-secondary); }
.lc-row .acts { display: flex; gap: 6px; }
.dept-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dept-row:last-child { border-bottom: 0; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bf-orange); border-radius: 6px; }

.clubs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.club-card { display: grid; gap: 12px; align-content: start; }
.club-card h3 { font-size: 18px; }
.club-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.qr-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.qr-row .tok { font-family: var(--font-mono); font-size: 12px; color: var(--bf-text-secondary); }
.qr-row .acts { display: flex; gap: 6px; }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--bf-text); background: var(--surface-solid); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal { margin: auto; border-radius: var(--radius); width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); }
dialog.modal.wide { width: min(820px, calc(100% - 24px)); }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(540px, 100%); border-radius: var(--radius) 0 0 var(--radius); border-left: 1px solid var(--line); }
dialog[open].modal { animation: dlg-in 0.22s ease-out; }
dialog[open].drawer { animation: drawer-in 0.26s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.dlg { display: flex; flex-direction: column; max-height: inherit; height: 100%; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); position: relative; }
.dlg-head h3 { font-size: 22px; margin-top: 8px; }
.dlg-head p { margin-top: 4px; font-size: 14px; }
.dlg-body { padding: 18px 22px; overflow-y: auto; display: grid; gap: 16px; align-content: start; flex: 1; }
.dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.code-big { font-family: var(--font-mono); font-size: 40px; font-weight: 600; letter-spacing: 0.25em; text-align: center; padding: 16px; border-radius: var(--radius); background: var(--pill-bg); border: 1px dashed var(--bf-border-accent); }
.msg-preview { font-size: 14px; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.share { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.section { display: grid; gap: 10px; }
.section > h4 { font-size: 13px; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bf-text-secondary); font-weight: 700; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--bf-text-secondary); }
.audit { display: grid; gap: 0; font-size: 13.5px; }
.audit div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.audit time { font-family: var(--font-mono); font-size: 12px; color: var(--bf-text-secondary); }
.asg-edit { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.add-asg { display: grid; grid-template-columns: 1fr 100px 100px auto; gap: 8px; align-items: end; }
.preview-tbl { min-width: 0 !important; font-size: 13px; }

/* Affiche QR */
.poster { background: #fff; color: #111; border-radius: 16px; padding: 28px; display: grid; gap: 14px; justify-items: center; text-align: center; border: 1px solid #ddd; font-family: var(--font-body); }
.poster h4 { font-family: var(--font-heading); font-size: 22px; color: #111; }
.poster .qr { width: 220px; height: 220px; }
.poster ol { text-align: left; font-size: 14px; padding-left: 20px; display: grid; gap: 4px; }
.poster .foot { font-size: 11px; color: #666; }

/* ---------- Toasts + légende du scénario ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 100; width: min(380px, calc(100% - 40px)); }
.toast { background: var(--surface-solid); border: 1px solid var(--line-strong); border-left: 4px solid var(--bf-primary); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow); animation: dlg-in 0.2s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }
.caption { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; width: min(720px, calc(100% - 32px)); background: var(--surface-solid); border: 1px solid var(--bf-border-accent); border-radius: var(--radius); padding: 14px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow), 0 0 40px var(--bf-glow); }
.caption .step { font-family: var(--font-mono); font-weight: 600; color: var(--primary-text); white-space: nowrap; }
.caption p { font-size: 15px; font-weight: 500; }

/* ---------- Pied de page ---------- */
.site-foot { padding: 24px; text-align: center; font-size: 12.5px; color: var(--bf-text-secondary); border-top: 1px solid var(--line); display: grid; gap: 6px; }
.site-foot strong { color: var(--bf-text); font-weight: 600; }

/* ---------- Composants selon le design system BASIC-FIT ---------- */
h1, h2, h3, h4 { font-weight: 900; }
.card { border-color: var(--bf-grey-100); box-shadow: none; }
.topbar { background: #FFFFFF; border-bottom: 1px solid var(--bf-grey-100); box-shadow: inset 0 4px 0 var(--bf-orange); padding-top: 16px; }
.demobar { background: var(--bf-sand-100); border-bottom-color: var(--bf-sand-200); }
.product strong { font-size: 20px; font-weight: 900; }
.product strong em { font-style: normal; color: var(--bf-orange-600); }
.pill { background: var(--bf-pill); border: 0; color: var(--bf-orange-600); font-weight: 800; border-radius: 999px; }
.badge { border-radius: 4px; padding: 4px 8px; font-weight: 700; }
.badge.warn { background: var(--bf-yellow); color: var(--bf-text); }
.badge.outline-danger { border-radius: 4px; border-style: solid; }
.btn {
  border-radius: 4px; border: 2px solid var(--bf-interaction);
  background: #FFFFFF; color: var(--bf-interaction);
  text-transform: uppercase; font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--bf-interaction-soft); }
.btn:active { background: var(--bf-interaction-ring); transform: none; }
.btn-primary { background: var(--bf-interaction); color: #FFFFFF; border-color: var(--bf-interaction); box-shadow: none; }
.btn-primary:hover { background: var(--bf-interaction-hover); border-color: var(--bf-interaction-hover); filter: none; transform: none; }
.btn-primary:active { background: var(--bf-interaction-active); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: transparent; color: var(--bf-interaction-hover); text-decoration: underline; }
.btn-danger { background: var(--bf-error); border-color: var(--bf-error); color: #FFFFFF; }
.btn-danger:hover { background: #A52A1F; border-color: #A52A1F; filter: none; }
.icon-btn { border-radius: 4px; background: #FFFFFF; border-color: var(--bf-grey-200); color: var(--bf-text); }
.seg { border-radius: 4px; background: #FFFFFF; border-color: var(--bf-grey-200); }
.seg button { border-radius: 2px; text-transform: uppercase; font-weight: 800; font-size: 12px; }
.seg button[aria-pressed="true"] { background: var(--bf-interaction); color: #FFFFFF; }
input[type="text"], input[type="tel"], input[type="search"], input[type="date"], input[type="time"], select, textarea {
  border-radius: 4px; border: 1px solid var(--bf-field-border); background: #FFFFFF; color: var(--bf-text);
}
input:hover, select:hover, textarea:hover { border-color: var(--bf-interaction); box-shadow: inset 0 0 0 1px var(--bf-interaction); }
input:focus, select:focus, textarea:focus { border-color: var(--bf-interaction); box-shadow: inset 0 0 0 1px var(--bf-interaction), 0 0 0 6px var(--bf-interaction-ring); }
input[aria-invalid="true"] { border-color: var(--bf-error); box-shadow: inset 0 0 0 1px var(--bf-error), 0 0 0 6px var(--bf-error-soft); }
::placeholder { color: var(--bf-text-secondary); }
.chip span { border-radius: 4px; background: #FFFFFF; border-color: var(--bf-field-border); }
.chip input:checked + span { background: var(--bf-interaction-soft); border-color: var(--bf-interaction); color: var(--bf-interaction); }
.chip input:checked + span::before { color: var(--bf-interaction); }
details.more { background: #FFFFFF; border-color: var(--bf-grey-200); border-radius: 4px; }
details.more > summary::after { color: var(--bf-interaction); }
.radio-card { border-radius: 4px; background: #FFFFFF; border-color: var(--bf-grey-200); }
.radio-card:has(input:checked) { border-color: var(--bf-interaction); background: var(--bf-interaction-soft); }
.alert { border-radius: 4px; }
.alert.warn { background: #FFF5CC; border-color: var(--bf-yellow); }
.admin-nav button { border-radius: 4px; text-transform: uppercase; font-weight: 800; font-size: 13px; }
.admin-nav button[aria-current="page"] { background: #FFFFFF; border-color: var(--bf-grey-200); box-shadow: inset 0 -3px 0 var(--bf-orange); }
.admin-nav .n { border-radius: 4px; background: var(--bf-error); }
.kpi .v { font-family: var(--font-heading); font-weight: 900; font-size: 32px; }
.kpi.warn .v { color: var(--bf-orange-600); }
.tbl th { color: var(--bf-text-secondary); font-weight: 800; }
.flash { animation-name: flash-bf; }
@keyframes flash-bf { 0%, 30% { background: var(--bf-orange-50); box-shadow: inset 4px 0 0 var(--bf-orange); } 100% { background: transparent; } }
.vacant-card { border-color: var(--bf-error); }
.asg { border-radius: 4px; background: var(--bf-sand-50); border-color: var(--bf-sand-200); }
.code-big { border-radius: 8px; background: var(--bf-sand-100); border: 2px dashed var(--bf-sand-200); color: var(--bf-text); font-weight: 900; }
.msg-preview { background: var(--bf-sand-50); border-color: var(--bf-sand-200); border-radius: 4px; }
.toast { border-radius: 4px; border-left-color: var(--bf-orange); }
.caption { border: 2px solid var(--bf-orange); border-radius: 8px; box-shadow: var(--shadow); }
.caption .step { color: var(--bf-orange-600); font-weight: 900; }
dialog.modal, dialog.drawer { border-color: var(--bf-grey-200); }
.dlg-head { box-shadow: inset 0 4px 0 var(--bf-orange); padding-top: 24px; }
dialog.modal .dlg-head { border-radius: var(--radius) var(--radius) 0 0; }
/* Téléphone */
.phone { box-shadow: var(--shadow); }
.m-app b { font-weight: 900; color: var(--bf-text); }
.m-app b::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--bf-orange); border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.m-hello { font-weight: 900; }
.m-card { background: var(--bf-sand-50); border: 1px solid var(--bf-sand-200); border-radius: 8px; }
.m-card .club { font-weight: 900; }
.m-card .when, .m-chrono { font-family: var(--font-heading); font-weight: 800; }
.m-chrono { font-weight: 900; }
.m-scan { border-radius: 4px; background: var(--bf-interaction); color: #FFFFFF; box-shadow: none; text-transform: uppercase; font-family: var(--font-heading); font-weight: 800; font-size: 16px; letter-spacing: 0.02em; white-space: nowrap; padding: 0 18px; }
.m-scan:active { background: var(--bf-interaction-active); }
.m-scan.secondary { background: #FFFFFF; color: var(--bf-interaction); border: 2px solid var(--bf-interaction); }
.m-banner { border-radius: 4px; }
.m-banner.queue { background: var(--bf-yellow); color: var(--bf-text); }
.phone-nav button[aria-current="page"] { color: var(--bf-orange-600); }
.result h2 { font-weight: 900; }
.result .big-time { font-family: var(--font-heading); font-weight: 900; }
.result-rows { background: var(--bf-sand-50); border: 1px solid var(--bf-sand-200); border-radius: 8px; }
.viewfinder .line { background: var(--bf-orange); box-shadow: 0 0 16px var(--bf-orange); }
.spinner { border-top-color: var(--bf-orange); }
.otp { font-weight: 800; }
.site-foot { background: var(--bf-sand-100); }

/* ---------- Responsive ---------- */
@media (max-height: 900px) { .pane-phone { position: static; } }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .pane-tabs { display: inline-flex; }
  body[data-pane="admin"] .pane-phone { display: none; }
  body[data-pane="phone"] .pane-admin { display: none; }
  .pane-phone { position: static; }
  .who { display: none; }
}
@media (max-width: 760px) {
  .topbar, .demobar { padding-left: 14px; padding-right: 14px; }
  .product span { display: none; }
  .emp-row { grid-template-columns: 1fr auto; }
  .emp-row.head { display: none; }
  .emp-row > :nth-child(2), .emp-row > :nth-child(3) { grid-column: 1 / -1; }
  .emp-row > :nth-child(4) { grid-row: 1; grid-column: 2; }
  .emp-row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .grid2, .add-asg { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .share { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .phone { width: 100%; height: 720px; border-width: 6px; border-radius: 34px; }
  .phone-who { width: 100%; }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .viewfinder .line { animation: none; will-change: auto; }
}

/* ---------- Impression / PDF ---------- */
#print-host { display: none; }
body.pdf-mode * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; animation: none !important; box-shadow: none !important; transition: none !important; }
@media print {
  @page { margin: 14mm; }
  body.is-printing { background: #fff !important; color: #111 !important; }
  body.is-printing > *:not(#print-host) { display: none !important; }
  body.is-printing #print-host { display: block !important; color: #111; }
  #print-host table { width: 100%; border-collapse: collapse; font-size: 11px; font-family: Arial, sans-serif; }
  #print-host th, #print-host td { border-bottom: 1px solid #ccc; padding: 5px 6px; text-align: left; color: #111; }
  #print-host h1 { font-size: 18px; margin-bottom: 4px; color: #111; font-family: Arial, sans-serif; text-transform: none; }
  #print-host .p-meta { font-size: 11px; color: #555; margin-bottom: 12px; }
  #print-host .badge { background: none !important; color: #111 !important; -webkit-text-fill-color: #111; padding: 0; }
  #print-host .poster { border: 0; }
}
