/* Unity — check-in de la journée d'intégration Universiapolis
   Thème clair unique : fond menthe très pâle, cartes blanches, vert Universiapolis. */

:root {
  color-scheme: light;
  --brand: #0f9d7f;
  --brand-strong: #0b7c64;
  --brand-ink: #08634f;
  --brand-soft: #e4f6f0;
  --brand-softer: #f1fbf7;
  --accent: #ff8a3d;
  --ink: #17212b;
  --ink-2: #44505c;
  --ink-3: #7b8794;
  --line: #e3e9ec;
  --line-strong: #cfd8dd;
  --bg: #f4f8f7;
  --card: #ffffff;
  --danger: #d6453d;
  --danger-soft: #fdeeed;
  --warn: #a15c00;
  --warn-soft: #fff4e0;
  --ok: #0e8a55;
  --ok-soft: #e3f7ec;
  --info: #2563c9;
  --info-soft: #e9f1fe;
  --girls: #e0569b;
  --boys: #3b7be0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 33, 43, .05);
  --shadow: 0 1px 2px rgba(23, 33, 43, .04), 0 6px 20px rgba(23, 33, 43, .06);
  --shadow-lg: 0 18px 50px rgba(23, 33, 43, .14);
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-display: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --sidebar: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--ink-3); }
.small { font-size: .8rem; }
img, svg { max-width: 100%; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- mise en page ---------- */

.shell { max-width: 520px; margin: 0 auto; padding: 8px 16px 56px; }
.shell-wide { max-width: 1240px; margin: 0 auto; padding: 8px 24px 72px; }
@media (max-width: 720px) { .shell-wide { padding: 8px 16px 64px; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-bottom: 12px; }

.stack > * + * { margin-top: 16px; }
.stack > .card { margin-bottom: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid > .card { margin-bottom: 0; }
@media (min-width: 960px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 20px 0 20px; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { max-width: 70ch; }

/* ---------- marque (espace étudiant) ---------- */

.brandbar { display: flex; align-items: center; gap: 12px; padding: 18px 16px 10px; max-width: 520px; margin: 0 auto; }
.brandmark {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #16b892, var(--brand-strong));
  color: #fff; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(15, 157, 127, .3);
}
.brandbar strong { display: block; font-size: 1rem; letter-spacing: .12em; }
.brandbar div > span { display: block; font-size: .78rem; color: var(--ink-3); }

.hero {
  position: relative; overflow: hidden;
  margin: 6px 0 18px; padding: 24px 22px 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 138, 61, .18), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(15, 157, 127, .18), transparent 55%),
    linear-gradient(160deg, #ffffff, var(--brand-softer));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 1.85rem; margin-bottom: 8px; }
.hero .date {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--brand-ink); font-weight: 700; font-size: .85rem;
}
.hero .date::first-letter { text-transform: uppercase; }
.hero p:last-child { margin: 0; color: var(--ink-2); }

/* Étapes du parcours étudiant */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .78rem; font-weight: 600; color: var(--ink-3); position: relative; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--line-strong); color: var(--ink-3); font-weight: 800; font-size: .9rem;
  position: relative; z-index: 1;
}
.steps li + li::after { content: ""; position: absolute; top: 17px; right: 50%; width: 100%; height: 2px; background: var(--line-strong); }
.steps li.done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li.done + li::after, .steps li.current::after { background: var(--brand); }
.steps li.current { color: var(--ink); }
.steps li.current::before { border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 5px var(--brand-soft); }

/* ---------- formulaires ---------- */

label { display: block; font-weight: 650; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=search], input[type=file], input:not([type]), select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fbfdfc;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  min-height: 48px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type=file] { padding: 10px; background: var(--brand-softer); border-style: dashed; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #a3adb6; }
input:hover, select:hover, textarea:hover { border-color: #b5c2c9; }
textarea { min-height: 88px; resize: vertical; }
select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237b8794' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 157, 127, .15);
}
button:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(15, 157, 127, .45); outline-offset: 2px; }
input[type=color] { width: 56px; height: 48px; padding: 4px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); vertical-align: middle; flex: none; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 550; color: var(--ink); cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 700; font-size: .93rem; line-height: 1.2;
  color: #fff; background: var(--brand);
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(11, 124, 100, .25);
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--brand-strong); box-shadow: 0 4px 14px rgba(11, 124, 100, .25); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: progress; box-shadow: none; }
.btn-block { width: 100%; min-height: 56px; font-size: 1.05rem; border-radius: 14px; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--brand-softer); border-color: var(--brand); color: var(--brand-ink); box-shadow: none; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover { background: #b93831; box-shadow: 0 4px 14px rgba(214, 69, 61, .25); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .84rem; border-radius: 10px; }
.btn.selected { background: var(--ok); color: #fff; border-color: var(--ok); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-ink); text-decoration: underline; cursor: pointer; }

/* ---------- messages ---------- */

.alert { display: block; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-weight: 550; border: 1px solid transparent; }
.alert::before { font-weight: 800; margin-right: 8px; }
.alert-error { background: var(--danger-soft); color: #a8322b; border-color: #f6cfcc; }
.alert-error::before { content: "!"; }
.alert-success { background: var(--ok-soft); color: #0b6b43; border-color: #c4ead6; }
.alert-success::before { content: "✓"; }
.alert-info { background: var(--warn-soft); color: #86500a; border-color: #f7dfb5; }
.alert-info::before { content: "i"; }
.alert a { color: inherit; font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap; line-height: 1.5;
  background: #f1f4f5; color: var(--ink-2); border: 1px solid var(--line);
}
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: #c4ead6; }
.pill-wait { background: var(--warn-soft); color: var(--warn); border-color: #f7dfb5; }
.pill-live { background: var(--brand-soft); color: var(--brand-ink); border-color: #c3eadd; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.g-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; border-radius: 7px; padding: 0 6px; font-size: .74rem; font-weight: 800; color: #fff; border: 0; }
.g-F { background: var(--girls); }
.g-M { background: var(--boys); }
.btn.g-pill { min-height: 34px; min-width: 34px; border-radius: 10px; }

/* ---------- fiche étudiant ---------- */

.ticket {
  background: var(--card);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(23, 33, 43, .05), 0 20px 50px rgba(23, 33, 43, .10);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.ticket-band { padding: 22px 22px 20px; position: relative; }
.ticket-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.ticket-band small { color: inherit; opacity: .9; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .7rem; }
.ticket-band .bus { font-size: 2.6rem; font-weight: 800; line-height: 1.05; margin: 4px 0 2px; letter-spacing: -.03em; }
.ticket-body { padding: 20px 22px 18px; }
.ticket-name { font-size: 1.4rem; font-weight: 800; margin-bottom: 2px; letter-spacing: -.01em; }
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.ticket-cell { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.ticket-cell small { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.ticket-cell strong { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; }
.bracelet-swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.12); flex: none; display: inline-block; }
.ticket-perf { border: 0; border-top: 2px dashed var(--line-strong); margin: 0 22px; position: relative; overflow: visible; }
.ticket-perf::before, .ticket-perf::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.ticket-perf::before { left: -34px; }
.ticket-perf::after { right: -34px; }
.ticket-qr { display: flex; gap: 16px; align-items: center; padding: 18px 22px 22px; }
.ticket-qr img { width: 116px; height: 116px; background: #fff; border-radius: 12px; padding: 6px; flex: none; border: 1px solid var(--line); }
.ticket-qr p { font-size: .88rem; color: var(--ink-2); margin: 0; }

.waiting { display: flex; gap: 12px; align-items: center; background: var(--warn-soft); border: 1px solid #f7dfb5; border-radius: 14px; padding: 12px 14px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 138, 61, .5); } 50% { opacity: .7; transform: scale(.85); box-shadow: 0 0 0 8px rgba(255, 138, 61, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.next-up { background: linear-gradient(135deg, #14b08e, var(--brand-strong)); color: #fff; border: 0; box-shadow: 0 12px 30px rgba(11, 124, 100, .25); }
.next-up small { color: inherit; opacity: .9; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.next-up h2 { font-size: 1.4rem; margin: 6px 0 4px; }
.next-up p { margin: 0; opacity: .95; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 12px 0; position: relative; }
.timeline li + li { border-top: 1px dashed var(--line); }
.timeline time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.timeline .title { font-weight: 700; }
.timeline .meta { font-size: .85rem; color: var(--ink-3); }
.timeline li.past { opacity: .45; }
.timeline li.now { background: var(--brand-softer); border-radius: 12px; margin: 0 -10px; padding: 12px 10px; }
.timeline li.now .title::after { content: "En cours"; margin-left: 8px; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; vertical-align: 2px; }

.match { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.match.now { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 4px var(--brand-soft); }
.match.past { opacity: .6; }
.match .vs { font-weight: 800; font-size: 1.05rem; }

.toast-zone { position: fixed; left: 0; right: 0; bottom: 20px; display: grid; gap: 8px; justify-items: center; padding: 0 16px; z-index: 60; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 460px; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #17212b; color: #fff; border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow-lg); font-weight: 600;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast small { display: block; color: inherit; opacity: .75; font-weight: 500; }
.toast-error { background: var(--danger); }
.toast-action { flex: none; border: 0; background: rgba(255,255,255,.18); color: inherit; font: inherit; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.toast-action:hover { background: rgba(255,255,255,.28); }

/* ---------- installer l'app (ajout à l'écran d'accueil) ---------- */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 20px; z-index: 55;
  max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px 10px 12px 14px; box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease-out;
}
.app-shell ~ .install-banner { bottom: calc(92px + env(safe-area-inset-bottom)); }
.install-ico { font-size: 1.5rem; flex: none; }
.install-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.install-text strong { font-size: .92rem; }
.install-text small { color: var(--ink-3); font-size: .78rem; }
.install-close {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--ink-3); font-size: .85rem; cursor: pointer;
}
.install-ios { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; background: rgba(23,33,43,.4); padding: 12px; }
.install-ios-card {
  background: var(--card); border-radius: 20px 20px 12px 12px; padding: 20px 18px;
  box-shadow: var(--shadow-lg); max-width: 460px; margin: 0 auto; width: 100%;
}
.install-ios-card strong { display: block; margin-bottom: 10px; font-size: 1.05rem; }
.install-ios-card ol { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }
.ios-share { display: inline-block; }

/* ---------- espace équipe : barre latérale ---------- */

.topbar { display: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar);
  display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--line);
  padding: 18px 14px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; color: inherit; }
.sidebar .brand strong { display: block; letter-spacing: .1em; }
.sidebar .brand .brand-sub { display: block; font-size: .72rem; color: var(--ink-3); }
.sidebar nav { flex: 1; overflow-y: auto; min-height: 0; }
.nav-group { margin-bottom: 14px; }
.nav-group > p { margin: 0 0 4px; padding: 0 10px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #a3adb6; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 2px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.sidebar nav a .icon { color: var(--ink-3); }
.sidebar nav a:hover { background: var(--bg); color: var(--ink); }
.sidebar nav a[aria-current=page] { background: var(--brand-soft); color: var(--brand-ink); }
.sidebar nav a[aria-current=page] .icon { color: var(--brand); }
.sidebar .me { border-top: 1px solid var(--line); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; }
.sidebar .me div { flex: 1; min-width: 0; }
.sidebar .me strong { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me span { display: block; font-size: .75rem; color: var(--ink-3); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); border-color: #f6cfcc; }
.sidebar ~ main, .sidebar ~ .app-main { margin-left: var(--sidebar); }
.sidebar ~ main.shell-wide { max-width: none; padding-left: 32px; padding-right: 32px; }
.sidebar ~ main.shell { max-width: 560px; margin-left: calc(var(--sidebar) + max(16px, (100vw - var(--sidebar) - 560px) / 2)); }
.scrim { display: none; }
.sidebar-collapse { display: none; } /* bouton « réduire » : uniquement utile à partir de l'ordinateur/tablette horizontale */

@media (max-width: 1023px) {
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar strong { flex: 1; font-size: 1rem; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(23, 33, 43, .35); }
  .sidebar ~ main, .sidebar ~ .app-main { margin-left: 0; }
  .sidebar ~ main.shell-wide { padding-left: 16px; padding-right: 16px; }
  .sidebar ~ main.shell { margin-left: auto; }
}

/* ---------- tableau de bord ---------- */

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--brand-soft); }
.kpi small { display: block; font-weight: 650; position: relative; z-index: 1; }
.kpi strong { display: block; font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { font-size: .8rem; color: var(--ink-3); }

.meter { height: 10px; border-radius: 999px; background: #edf1f2; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; transition: width .4s ease; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .state { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.checklist .ok .state { background: var(--ok-soft); color: var(--ok); }
.checklist .todo .state { background: var(--warn-soft); color: var(--warn); }
.checklist .ok .label { color: var(--ink-3); }
.checklist .detail { display: block; font-size: .8rem; color: var(--ink-3); }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; font-weight: 650; }
.quick a:hover { border-color: var(--brand); background: var(--brand-softer); }
.quick .icon { color: var(--brand); width: 22px; height: 22px; }

.bus-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bus-row:first-of-type { border-top: 0; }
.bus-row .meter { grid-column: 1 / -1; }
.bus-row .count { font-variant-numeric: tabular-nums; font-weight: 700; }
.bus-row.current .name::after { content: "En remplissage"; margin-left: 8px; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }

.team-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.team-bar { text-align: center; font-size: .78rem; }
.team-bar .col { height: 86px; background: #eef2f3; border-radius: 10px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.team-bar .col > span { display: block; width: 100%; background: var(--brand); transition: height .4s ease; }
.team-bar .col > .part-girls { background: var(--girls); }
.team-bar .col > .part-boys { background: var(--boys); }
.team-bar .col > .part-other { background: #b9c3ca; }
.team-bar .gender-split { display: block; font-size: .68rem; color: var(--ink-3); white-space: nowrap; }
.team-bar b { display: block; font-size: .95rem; font-variant-numeric: tabular-nums; margin-top: 4px; }

.legend { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-size: .8rem; color: var(--ink-2); }

/* ---------- tableaux et listes ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 800; background: #f8fafa; }
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }
tbody tr:hover td { background: #fafcfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.top td { background: var(--brand-softer); }
tr.flash-row { animation: flashrow 1.6s ease; }
@keyframes flashrow { from { background: var(--brand-soft); } to { background: transparent; } }

.inline-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.inline-form .field { margin: 0; }
.inline-form .wide { grid-column: 1 / -1; }

details.edit { border-top: 1px solid var(--line); padding: 12px 0; }
details.edit:first-of-type { border-top: 0; }
details.edit summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: 10px; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit summary::after {
  content: "Modifier"; margin-left: auto;
  font-size: .8rem; font-weight: 700; color: var(--brand-ink);
  padding: 4px 10px; border-radius: 8px; background: var(--brand-softer); border: 1px solid #c3eadd;
}
details.edit[open] summary::after { content: "Fermer"; background: #f1f4f5; color: var(--ink-2); border-color: var(--line); }
details.edit > form { margin-top: 14px; padding: 16px; background: #f8fbfa; border: 1px solid var(--line); border-radius: 14px; }
details.edit[open] { padding-bottom: 16px; }

.result-card { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.result-card:first-child { border-top: 0; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; }
.danger-zone { border-color: #f3d2cf; background: linear-gradient(180deg, #fff, #fffafa); }
.danger-zone h2 { color: #a8322b; }

.qr-poster { text-align: center; padding: 40px 24px; background: linear-gradient(160deg, #fff, var(--brand-softer)); }
.qr-poster svg { width: min(420px, 80vw); height: auto; background: #fff; padding: 14px; border-radius: 20px; box-shadow: var(--shadow); }

.empty-state { text-align: center; padding: 28px 16px; color: var(--ink-3); }
.empty-state strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- accueil ---------- */

.accueil-bar { position: sticky; top: 0; z-index: 10; background: linear-gradient(var(--bg) 85%, rgba(244, 248, 247, 0)); padding: 8px 0 14px; display: grid; gap: 10px; }
@media (max-width: 1023px) { .accueil-bar { top: 58px; } }
.search { position: relative; }
.search::before {
  content: ""; position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.search input { min-height: 58px; font-size: 1.1rem; padding-left: 48px; padding-right: 52px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); border-color: var(--line); }
.search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink-2); font-size: 1.4rem; cursor: pointer; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip {
  flex: none; display: inline-flex; gap: 8px; align-items: center;
  min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2);
  font: inherit; font-weight: 650; font-size: .9rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--brand); }
.chip b { background: #eef2f3; border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-selected="true"] b { background: rgba(255,255,255,.2); }

.student-list-card { padding: 8px 18px 18px; }
.student-list { list-style: none; margin: 0; padding: 0; }
.student { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(170px, 1.4fr) auto; gap: 8px 16px; align-items: center; padding: 14px 10px; border-top: 1px solid var(--line); border-radius: 12px; }
.student:first-child { border-top: 0; }
.student:hover { background: #fafcfc; }
.student .name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.student .meta { font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.student .where { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.student .actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.student .actions .btn { white-space: nowrap; }
.student.todo { box-shadow: inset 4px 0 0 var(--accent); background: linear-gradient(90deg, #fff7ef, transparent 45%); }
.student.flash { animation: flashrow 1.6s ease; }
.student-list .empty { padding: 32px 8px; color: var(--ink-3); text-align: center; list-style: none; }
@media (max-width: 720px) {
  .student { grid-template-columns: 1fr auto; padding: 14px 6px; }
  .student .where { grid-column: 1 / -1; grid-row: 2; }
  .student .actions { grid-column: 2; grid-row: 1; }
  .student .actions .btn { min-height: 44px; }
  .student-list-card { padding: 4px 10px 12px; }
}

.row-menu { position: relative; }
.row-menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; font-weight: 800; color: var(--ink-2); }
.row-menu summary:hover { border-color: var(--brand); color: var(--brand-ink); }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-panel { position: absolute; right: 0; top: 46px; z-index: 15; min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.row-menu-panel a, .row-menu-panel button { text-align: left; padding: 10px 12px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: .92rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.row-menu-panel a:hover, .row-menu-panel button:hover { background: var(--bg); }
.row-menu-panel .danger { color: var(--danger); }
.row-menu-panel .danger:hover { background: var(--danger-soft); }

.modal { border: 0; border-radius: 20px; padding: 24px; max-width: 460px; width: calc(100% - 32px); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(23, 33, 43, .4); backdrop-filter: blur(2px); }
.modal p { color: var(--ink-2); }

/* ---------- tournoi ---------- */

.match-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.match-grid .card { margin: 0; padding: 18px; }
.match-card.focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }
.match-card.done { background: #fbfdfc; }
.match-card:target { box-shadow: 0 0 0 4px rgba(15, 157, 127, .35); }
.result-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: 14px; }
.result-grid .btn { flex-direction: column; gap: 0; min-height: 64px; padding: 8px; text-align: center; }
.result-grid .btn small { color: inherit; opacity: .75; font-weight: 600; font-size: .72rem; }
.round-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 1.05rem; }
.round-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 12px; margin: 8px 0 16px; text-align: center; }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.podium .step strong { font-size: .95rem; overflow-wrap: anywhere; }
.podium .medal { font-size: 2.2rem; line-height: 1; }
.podium .pts { color: var(--ink-3); font-weight: 700; font-size: .85rem; }
.podium .block { width: 100%; margin-top: 8px; border-radius: 16px 16px 0 0; background: linear-gradient(180deg, #e9eef0, #dfe6e9); color: var(--ink-2); font-weight: 800; font-size: 1.6rem; display: grid; place-items: center; }
.podium .step-1 .block { height: 120px; background: linear-gradient(180deg, #ffd66b, #f5b72a); color: #6b4a00; }
.podium .step-2 .block { height: 88px; background: linear-gradient(180deg, #eef2f5, #cfd8df); }
.podium .step-3 .block { height: 62px; background: linear-gradient(180deg, #f3c9a4, #dc9a63); color: #5c3310; }

.podium-list { list-style: none; margin: 12px 0 0; padding: 0; }
.podium-list li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.podium-list li:first-child { border-top: 0; }

.member { padding: 12px 4px; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
details.move { border-top: 0; padding: 6px 0 0; }
details.move summary { font-size: .85rem; color: var(--brand-ink); font-weight: 650; }
details.move summary::after { content: none; }

/* ---------- impression ---------- */

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .scrim, .no-print, .toast-zone, .accueil-bar { display: none !important; }
  .sidebar ~ main, .sidebar ~ main.shell-wide { margin: 0; padding: 0; }
  .card, .ticket, .kpi { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .shell, .shell-wide { max-width: none; padding: 0; }
  .ticket-band, .bracelet-swatch, .dot, .g-pill, .podium .block { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
}
details > summary.row { list-style: none; }
details > summary.row::-webkit-details-marker { display: none; }

/* Panneaux repliables (import, ajout…) */
details.panel { padding: 0; }
details.panel > summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; font-weight: 500; color: var(--ink-3); }
details.panel[open] > summary::after { content: "−"; }
details.panel > summary strong { display: block; }
details.panel > summary .small { display: block; }
details.panel > form { padding: 0 20px 20px; }
.panel-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; flex: none; }
td .row { flex-wrap: nowrap; }
td:has(.dot) { white-space: nowrap; }

/* ---------- accueil : poste de comptoir ---------- */

.desk-stats { display: flex; gap: 8px; }
.desk-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; text-align: center; min-width: 92px; box-shadow: var(--shadow-sm); }
.desk-stats strong { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.desk-stats span { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.desk-stats div:first-child { background: #fff7ef; border-color: #ffd9bd; }
.desk-stats div:first-child strong { color: #c25a14; }

.desk-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1024px) { .desk-grid { grid-template-columns: minmax(0, 1fr) 380px; } }
.desk-list { min-width: 0; }

.search-row { display: flex; gap: 10px; }
.search-row .search { flex: 1; min-width: 0; }
.scan-btn { min-height: 58px; border-radius: 16px; padding: 0 20px; font-size: 1rem; }
.scan-btn .icon { width: 22px; height: 22px; }
@media (max-width: 520px) { .scan-btn span { display: none; } .scan-btn { padding: 0 16px; } }

.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] b { background: rgba(255,255,255,.2); }
.color-chips .chip { min-height: 34px; font-size: .84rem; padding: 4px 12px; }

.student-list-card { padding: 4px 12px 14px; }
.srow { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 4px 0; }
.srow:first-child { border-top: 0; }
.srow-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 10px; border: 0; border-radius: 12px; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.srow-main:hover { background: #f5f9f8; }
.desk-list:has(#search:focus) .srow.hl .srow-main { background: var(--brand-softer); box-shadow: inset 0 0 0 1.5px #bfe7da; }
.srow.selected .srow-main { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.swatch { width: 34px; height: 34px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.1); }
.swatch-empty { background: repeating-linear-gradient(45deg, #eef2f3 0 5px, #e2e8ea 5px 10px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.srow-text { flex: 1; min-width: 0; display: grid; }
.srow-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.srow-meta { font-size: .8rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-todo { background: #fff1e4; color: #b4530f; }
.badge-done { background: var(--ok-soft); color: var(--ok); }
.badge-absent { background: #f1f4f5; color: var(--ink-3); }
.row-quick { flex: none; margin-right: 6px; background: var(--ok-soft); color: var(--ok); border-color: #c4ead6; box-shadow: none; }
.row-quick:hover { background: var(--ok); color: #fff; box-shadow: none; }
@media (max-width: 520px) { .badge { display: none; } .srow-main { gap: 10px; padding: 10px 6px; } }
@media (max-width: 1023px), (pointer: coarse) { #search-help { display: none; } }
@media (max-width: 720px) {
  .desk .page-head { margin: 12px 0; }
  .desk .page-head h1 { font-size: 1.4rem; }
  .desk .page-head p { font-size: .85rem; }
}

/* Panneau de l'étudiant : colonne fixe sur ordinateur, feuille du bas sur mobile */
.desk-panel {
  position: sticky; top: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 20px;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.desk-panel.has-student { border-color: #bfe7da; box-shadow: 0 0 0 4px var(--brand-softer), var(--shadow); }
.panel-empty { text-align: center; padding: 36px 12px; color: var(--ink-3); }
.panel-empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.panel-empty p { margin: 0; font-size: .9rem; }
.panel-empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-softer); color: var(--brand); }
.panel-empty-icon .icon { width: 30px; height: 30px; }
#panel-body > * + * { margin-top: 14px; }
.p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.p-name { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.p-band { border-radius: 18px; padding: 16px 18px; position: relative; overflow: hidden; }
.p-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.2), transparent 60%); pointer-events: none; }
.p-band small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; color: inherit; }
.p-band strong { display: block; font-size: 2.2rem; line-height: 1.1; letter-spacing: -.02em; }
.p-band span { display: block; font-weight: 600; opacity: .95; }
.p-band-empty { background: repeating-linear-gradient(45deg, #f4f7f8 0 10px, #eef2f4 10px 20px); color: var(--ink-2); border: 1px dashed var(--line-strong); }
.p-band-empty strong { font-size: 1.4rem; }
.p-band-empty span { font-weight: 500; font-size: .88rem; }
.btn-bracelet { gap: 12px; font-size: 1.1rem; min-height: 64px; }
.btn-bracelet .bracelet-swatch { width: 28px; height: 28px; box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.p-done { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--ok-soft); border: 1px solid #c4ead6; }
.p-done-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; font-weight: 800; font-size: 1.2rem; flex: none; }
.p-done strong { display: block; color: #0b6b43; }
.p-done span { font-size: .85rem; color: var(--ink-2); }
.p-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.p-facts div { background: var(--bg); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.p-facts dt { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.p-facts dd { margin: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-fix { border: 1px solid var(--line); border-radius: 14px; padding: 0; }
.p-fix summary { cursor: pointer; padding: 12px 14px; font-weight: 650; color: var(--ink-2); list-style: none; display: flex; justify-content: space-between; }
.p-fix summary::-webkit-details-marker { display: none; }
.p-fix summary::after { content: "▾"; color: var(--ink-3); }
.p-fix[open] summary::after { content: "▴"; }
.p-fix-body { display: grid; gap: 8px; padding: 0 14px 14px; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); border-color: #f6cfcc; color: var(--danger); }
.p-next { width: 100%; }

@media (max-width: 1023px) {
  .desk-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 45;
    max-height: 88vh; border-radius: 24px 24px 0 0; padding: 12px 18px 24px;
    transform: translateY(105%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .desk-panel::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 12px; }
  body.sheet-open .desk-panel { transform: none; }
  body.sheet-open .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(23, 33, 43, .35); }
  .panel-empty { display: none; }
  .desk-stats { width: 100%; }
  .desk-stats div { flex: 1; min-width: 0; }
}

/* Scanner */
.scanner { max-width: 520px; }
.scan-view { position: relative; margin-top: 14px; border-radius: 18px; overflow: hidden; background: #0e1419; aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); border: 3px solid rgba(255,255,255,.9); }

/* ---------- accueil : les deux étapes ---------- */

.p-progress { font-size: .82rem; font-weight: 700; margin-top: 2px; }
.p-progress-absent { color: var(--info); }
.p-progress-todo { color: #c25a14; }
.p-progress-done { color: var(--ok); }

.p-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.p-step { display: grid; grid-template-columns: 36px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.p-step:last-child { padding-bottom: 0; }
.p-step:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line-strong); }
.p-step-done:not(:last-child)::before { background: var(--ok); }
.p-step-num {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; background: #fff; border: 2px solid var(--line-strong); color: var(--ink-3);
  position: relative; z-index: 1;
}
.p-step-done .p-step-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.p-step-current .p-step-num { border-color: #ff8a3d; color: #c25a14; background: #fff7ef; box-shadow: 0 0 0 5px #fff1e4; animation: step-pulse 1.6s ease-in-out infinite; }
@keyframes step-pulse { 50% { box-shadow: 0 0 0 9px rgba(255, 138, 61, .12); } }
@media (prefers-reduced-motion: reduce) { .p-step-current .p-step-num { animation: none; } }
.p-step-body { min-width: 0; display: grid; gap: 8px; padding-top: 6px; }
.p-step-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 750; }
.p-step-state { font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #f1f4f5; color: var(--ink-3); white-space: nowrap; }
.p-step-done .p-step-state { background: var(--ok-soft); color: var(--ok); }
.p-step-current .p-step-state { background: #fff1e4; color: #c25a14; }
.p-step-note { font-size: .88rem; color: var(--ink-2); }
.p-step-done .p-step-title > span:first-child { color: var(--ink-2); }
.p-step-locked { opacity: .55; }
.p-step-current .p-step-body { background: #fffaf4; border: 1.5px solid #ffd9bd; border-radius: 16px; padding: 12px; margin-top: -2px; }

.mini-steps { display: inline-flex; gap: 3px; flex: none; }
.mini-steps i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .66rem; font-weight: 800; background: #eef2f3; color: var(--ink-3); }
.mini-steps i.ok { background: var(--ok); color: #fff; }
.mini-steps i.now { background: #ff8a3d; color: #fff; }

.pending-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-bottom: 14px; padding: 12px 16px; border-radius: 16px;
  background: #fff7ef; border: 1.5px solid #ffc89e; box-shadow: var(--shadow-sm);
}
.pending-bar::before { content: "!"; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #ff8a3d; color: #fff; font-weight: 800; flex: none; }
.pending-text { display: grid; }
.pending-text strong { color: #a2470c; }
.pending-text span { font-size: .82rem; color: var(--ink-2); }
.pending-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-list .chip { min-height: 34px; font-size: .85rem; border-color: #ffc89e; }

.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 520px) { .dialog-actions { flex-direction: column-reverse; } .dialog-actions .btn { width: 100%; } }
.dialog-actions:has(> :nth-child(3)) { flex-direction: column-reverse; }
.dialog-actions:has(> :nth-child(3)) .btn { width: 100%; }

/* ---------- tours ---------- */

.round-status.finished { background: linear-gradient(135deg, #fffbea, #fff); border-color: #f6dc8a; }
.round-track { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.rt { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: #eef2f3; color: var(--ink-3); }
.rt-done { background: var(--ok); color: #fff; }
.rt-current { background: #ff8a3d; color: #fff; box-shadow: 0 0 0 4px #fff1e4; }
.round-block { margin-bottom: 8px; }
.round-block > summary { cursor: pointer; list-style: none; }
.round-block > summary::-webkit-details-marker { display: none; }
.round-block > summary .pill { flex: none; }
.round-upcoming .match-card { opacity: .6; }
.match-card.locked .btn { cursor: not-allowed; }
.round-current > summary span:first-child { color: #c25a14; }

/* Réseau (accueil hors ligne) */
.net-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; border-radius: 16px; margin-bottom: 14px; position: sticky; top: 8px; z-index: 12; box-shadow: var(--shadow); }
.net-bar span { font-size: .85rem; flex: 1; min-width: 220px; }
.net-off { background: #fdeeed; border: 1.5px solid #f3b8b4; color: #8f2a24; }
.net-off strong::before { content: "⚠ "; }
.net-sync { background: var(--info-soft); border: 1.5px solid #c3d6f7; color: #1d4f9e; }
@media (max-width: 1023px) { .net-bar { top: 64px; } }

/* ---------- appel des bus ---------- */

.segmented { display: inline-flex; background: #eef2f3; border-radius: 12px; padding: 4px; }
.segmented a { padding: 8px 18px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 700; }
.segmented a[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.bus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.bus-card { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 16px 14px 12px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); }
.bus-card:hover { border-color: var(--brand); }
.bus-card.active { border-color: var(--ink); box-shadow: 0 0 0 3px #e4e9ec; }
.bus-card-band { position: absolute; inset: 0 0 auto 0; height: 6px; }
.bus-card-count { font-size: 1.1rem; margin-top: 6px; }
.bus-card-count b { font-size: 1.6rem; }
.miss { color: #c25a14; font-weight: 700; }
.ok { color: var(--ok); font-weight: 700; }
.roll-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-left: 14px; border-left: 6px solid var(--bus); margin-bottom: 12px; }
.roll-count { text-align: right; font-weight: 600; }
.roll-count b { font-size: 1.8rem; }
.roll-count .small { display: block; }
.roll-list { list-style: none; margin: 0; padding: 0; }
.roll-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.roll-row:first-child { border-top: 0; }
.roll-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.roll-toggle {
  flex: none; min-width: 170px; min-height: 48px; padding: 8px 14px; border-radius: 14px;
  border: 2px dashed var(--line-strong); background: #fff; color: var(--ink-2);
  font: inherit; font-weight: 700; cursor: pointer;
}
.roll-toggle:hover { border-color: var(--brand); color: var(--brand-ink); }
.roll-toggle[aria-pressed="true"] { border: 2px solid var(--ok); background: var(--ok-soft); color: var(--ok); }
.roll-row.is-present .roll-who { opacity: .7; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width: 520px) { .roll-toggle { min-width: 120px; } .roll-row { align-items: flex-start; } }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- incidents ---------- */

.incident { border-left: 6px solid var(--line-strong); }
.incident.sev-urgente { border-left-color: var(--danger); background: linear-gradient(90deg, #fff5f4, #fff 40%); }
.incident.sev-moyenne { border-left-color: #ff8a3d; }
.incident.sev-faible { border-left-color: #9fb3bd; }
.sev-pill-urgente, .pill-urgent { background: var(--danger); color: #fff; border-color: var(--danger); }
.sev-pill-moyenne { background: #fff1e4; color: #b4530f; border-color: #ffd9bd; }
.tiles { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.tile { margin: 0; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: #fff; font-weight: 650; color: var(--ink); font-size: .9rem; }
.tile input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.tile input:focus-visible + span { outline: 3px solid rgba(15, 157, 127, .45); }
.tile.sev-urgente input:checked + span { background: var(--danger); border-color: var(--danger); }
.tile.sev-moyenne input:checked + span { background: #ff8a3d; border-color: #ff8a3d; }
.report { position: sticky; top: 16px; }
@media (max-width: 1023px) { .report { position: static; order: -1; } }
.incident-alert { border-left: 6px solid var(--danger); }
.incident-banner { display: block; text-decoration: none; color: var(--ink); border-left: 6px solid #ff8a3d; background: #fffaf4; }
.incident-banner.urgent { border-left-color: var(--danger); background: #fff3f2; animation: urgent-glow 1.6s ease-in-out infinite; }
@keyframes urgent-glow { 50% { box-shadow: 0 0 0 5px rgba(214, 69, 61, .15); } }
@media (prefers-reduced-motion: reduce) { .incident-banner.urgent { animation: none; } }
.incident-mini { list-style: none; margin: 8px 0 0; padding: 0; font-size: .88rem; }
.incident-mini li { padding: 4px 0 4px 10px; border-left: 3px solid #ffd9bd; margin-top: 4px; }
.incident-mini li.sev-urgente { border-left-color: var(--danger); }

/* ---------- mon équipe & photos ---------- */

.team-members { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.team-members li { padding: 5px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.team-members li.captain { background: #fff6d6; border-color: #f3d57a; color: #7a5a00; }
.team-members li.me { background: var(--brand-soft); border-color: #bfe7da; color: var(--brand-ink); }

.photo-form { display: grid; gap: 4px; margin-bottom: 14px; }
.photo-drop { position: relative; display: grid; place-items: center; min-height: 130px; border: 2px dashed #bfe7da; border-radius: 16px; background: var(--brand-softer); cursor: pointer; overflow: hidden; margin-bottom: 12px; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop-text { text-align: center; font-weight: 700; color: var(--brand-ink); padding: 16px; }
.photo-drop-text small { display: block; font-weight: 500; color: var(--ink-3); margin-top: 4px; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo { margin: 0; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #eef2f3; }
.photo figcaption { display: grid; gap: 2px; padding: 8px 10px; font-size: .82rem; }
.photo figcaption small { color: var(--ink-3); }
.photo.pending img { opacity: .6; }
.gallery-page { max-width: 1240px; margin: 0 auto; padding: 8px 16px 56px; }
.photo-grid.gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.photo-grid.moderation { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
a.chip { text-decoration: none; }
.captain-pill { cursor: pointer; background: #fff6d6; border-color: #f3d57a; color: #7a5a00; font: inherit; font-size: .78rem; font-weight: 700; }
.export-card { display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--ink); }
.export-card:hover { border-color: var(--brand); }
.export-card .btn { justify-self: start; margin-top: 6px; }
.export-icon { font-size: 2rem; }

/* =====================================================================
   Espace étudiant v2 : écran comptoir + application à onglets
   ===================================================================== */

/* ---------- au comptoir ---------- */
.counter .steps { margin-top: 4px; }
.pass { background: var(--card); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 2px 6px rgba(23,33,43,.05), 0 24px 60px rgba(23,33,43,.12); }
.pass-band { padding: 22px 24px 20px; text-align: center; position: relative; }
.pass-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.2), transparent 60%); pointer-events: none; }
.pass-label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.pass-color { display: block; font-size: 3rem; line-height: 1.05; letter-spacing: -.03em; margin: 2px 0 4px; }
.pass-sub { font-weight: 700; opacity: .95; }
.pass-body { padding: 20px 22px 22px; display: grid; gap: 16px; }
.pass-who { text-align: center; }
.pass-who strong { display: block; font-size: 1.35rem; letter-spacing: -.01em; }
.pass-qr { display: grid; place-items: center; }
.pass-qr img { width: min(240px, 70vw); height: auto; aspect-ratio: 1; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.counter-foot { text-align: center; margin-top: 14px; }

/* ---------- application ---------- */
.app-shell { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.app-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(244, 248, 247, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.app-head-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-head-id strong { display: block; font-size: 1rem; }
.app-head-id div span { display: block; font-size: .78rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.app-qr-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.sound-btn { font-size: 1.05rem; line-height: 1; }
.sound-btn[aria-pressed="false"] { opacity: .6; }
.app-head .sound-btn { margin-left: auto; }
.app-qr-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.9; }
.app-main { max-width: 560px; margin: 0 auto; padding: 16px; }
.tab-panel > * + * { margin-top: 14px; }
.tab-panel .card { margin-bottom: 0; }
.card.compact { padding: 16px; }
.card.compact h2 { font-size: 1rem; margin-bottom: 8px; }
.panel-head h1 { font-size: 1.5rem; margin: 4px 0 2px; }
.panel-head p { margin: 0; }
.list-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 22px 0 8px !important; }
.date-cap::first-letter { text-transform: uppercase; }

/* carte d'identité */
.idcard { position: relative; overflow: hidden; border-radius: 24px; padding: 18px 20px; box-shadow: 0 14px 34px rgba(23,33,43,.16); }
.idcard::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.15); }
.idcard-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.idcard-top > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idcard-ok { background: rgba(255,255,255,.25); padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.idcard-name { position: relative; z-index: 1; }
.idcard-name { font-size: 1.3rem; font-weight: 800; margin: 10px 0 12px; letter-spacing: -.01em; }
.idcard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.idcard-grid div { background: rgba(255,255,255,.2); border-radius: 14px; padding: 8px 10px; }
.idcard-grid small { display: block; color: inherit; opacity: .85; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.idcard-grid strong { display: block; font-size: 1.25rem; line-height: 1.2; }
.idcard-foot { margin: 12px 0 0; font-weight: 600; font-size: .9rem; opacity: .95; }

/* maintenant */
.now-card { border-radius: 22px; padding: 16px 18px; background: #fff; border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.now-card small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
.now-card h2 { font-size: 1.35rem; margin: 4px 0 2px; }
.now-card p { margin: 0; color: var(--ink-2); }
.now-card.is-game { background: linear-gradient(135deg, #14b08e, #0b7c64); color: #fff; border: 0; box-shadow: 0 14px 32px rgba(11,124,100,.28); }
.now-card.is-game small, .now-card.is-game p { color: rgba(255,255,255,.92); }
.now-card.is-done { background: linear-gradient(135deg, #fff8e1, #fff); border-color: #f6dc8a; }
.now-link { margin-top: 12px; background: rgba(255,255,255,.2); color: inherit; border: 0; border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 700; cursor: pointer; }

.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.news li:first-child { border-top: 0; }
.news li.latest { font-weight: 700; }
.news small { color: var(--ink-3); flex: none; }
.notify { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notify strong { display: block; }

.shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shortcuts button { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); text-align: left; }
.shortcuts button span { font-size: 1.4rem; }
.shortcuts button:active { transform: scale(.98); }

/* jeux */
.round-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.rs { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: #eef2f3; color: var(--ink-3); }
.rs-current { background: #ff8a3d; color: #fff; box-shadow: 0 0 0 4px #fff1e4; }
.rs-done.win { background: var(--ok); color: #fff; }
.rs-done.loss { background: #f1c9c6; color: #9b2c26; }
.rs-done.draw { background: #dde5ea; color: var(--ink-2); }
.match-now { border-radius: 22px; padding: 18px 20px; background: linear-gradient(135deg, #fff7ef, #fff); border: 2px solid #ffc89e; box-shadow: var(--shadow); }
.match-now small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c25a14; }
.match-now h2 { font-size: 1.5rem; margin: 6px 0 4px; }
.match-now p { margin: 4px 0 0; }
.match-now .versus { font-size: 1.1rem; }
.match-now .rules { color: var(--ink-2); font-size: .9rem; }
.games { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.game + .game { border-top: 1px solid var(--line); }
.game summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.game summary::-webkit-details-marker { display: none; }
.game-round { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #eef2f3; font-weight: 800; font-size: .85rem; flex: none; }
.game-current .game-round { background: #ff8a3d; color: #fff; }
.game-current { background: #fffaf4; }
.game-main { flex: 1; min-width: 0; display: grid; }
.game-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-main span { font-size: .8rem; color: var(--ink-3); }
.game-state { flex: none; font-size: .74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f1f4f5; color: var(--ink-3); }
.game-state.win { background: var(--ok-soft); color: var(--ok); }
.game-state.loss { background: #fdeeed; color: #b3362f; }
.game-state.draw { background: #eef2f3; color: var(--ink-2); }
.game-current .game-state { background: #fff1e4; color: #c25a14; }
.game-more { padding: 0 14px 14px 56px; display: grid; gap: 4px; font-size: .88rem; }

/* équipe */
.captain { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #fff8e1, #fff); border: 1px solid #f6dc8a; }
.captain-star { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #f5b72a; color: #fff; font-size: 1.2rem; flex: none; }
.captain small { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #8a6400; }
.members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.members li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-weight: 600; min-width: 0; }
.members li.me { border-color: #bfe7da; background: var(--brand-softer); }
.members em { margin-left: auto; font-style: normal; font-size: .72rem; color: var(--brand-ink); font-weight: 800; }
.member-initial { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef2f3; font-size: .8rem; font-weight: 800; flex: none; }

/* barre d'onglets */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(23,33,43,.06);
}
.tabbar button {
  position: relative; display: grid; justify-items: center; gap: 2px;
  padding: 6px 2px; border: 0; border-radius: 12px; background: none;
  font: inherit; font-size: .7rem; font-weight: 700; color: var(--ink-3); cursor: pointer;
}
.tabbar .ti { font-size: 1.35rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabbar button[aria-selected="true"] { color: var(--brand-ink); background: var(--brand-soft); }
.tabbar button[aria-selected="true"] .ti { filter: none; opacity: 1; }
.dot-new { position: absolute; top: 4px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; border: 2px solid #fff; }
@media (min-width: 700px) {
  .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 520px; border-radius: 20px; border: 1px solid var(--line); padding: 6px; }
  .app-shell { padding-bottom: 110px; }
}

.qr-modal { text-align: center; max-width: 360px; }
.qr-modal img { width: 100%; max-width: 260px; height: auto; margin: 8px auto 16px; display: block; }
.app-foot { text-align: center; color: var(--ink-3); font-size: .85rem; margin-top: 24px !important; }
.app-shell ~ .toast-zone { bottom: calc(92px + env(safe-area-inset-bottom)); }

@media print {
  .app-head, .tabbar, .now-card, .shortcuts, #notify-card, .app-foot { display: none !important; }
  .tab-panel[hidden] { display: none !important; }
  .idcard { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =====================================================================
   Espace étudiant v3 : identité d'équipe et visuels
   ===================================================================== */

.app-shell {
  --team: var(--brand);
  background:
    radial-gradient(1200px 300px at 50% -120px, color-mix(in srgb, var(--team) 22%, transparent), transparent 70%),
    var(--bg);
}
.app-head { background: color-mix(in srgb, #fff 88%, var(--team)); }
.app-emblem { display: grid; place-items: center; flex: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.18)); }
.shield { display: block; }

/* barre d'onglets : icônes dessinées */
.tabbar .ti { filter: none; opacity: 1; display: grid; place-items: center; width: 28px; height: 26px; }
.tabbar .ti svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-selected="true"] { color: #fff; background: var(--team); box-shadow: 0 6px 14px color-mix(in srgb, var(--team) 35%, transparent); }

/* raccourcis colorés */
.shortcuts button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.shortcuts button span { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; }
.shortcuts button b { font-size: .95rem; }
.shortcuts button small { color: var(--ink-3); font-weight: 600; font-size: .75rem; }
.sc-games span { background: #fff1e4; }
.sc-team span { background: color-mix(in srgb, var(--team) 16%, #fff); }
.sc-photos span { background: #fde7f1; }
.sc-program span { background: #e7f0fe; }

/* maintenant : icône du jeu en filigrane */
.now-card { position: relative; overflow: hidden; }
.now-card[data-icon]:not([data-icon=""])::after {
  content: attr(data-icon); position: absolute; right: -6px; bottom: -14px;
  font-size: 5.5rem; opacity: .22; transform: rotate(-12deg); pointer-events: none;
}

/* jeux */
.match-now { position: relative; overflow: hidden; }
.match-now-icon { position: absolute; right: 14px; top: 12px; font-size: 3rem; line-height: 1; }
.match-now .versus { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.vs-team { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; font-weight: 800; font-size: .95rem; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); border: 1.5px solid color-mix(in srgb, var(--c) 40%, #fff); }
.vs-team::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.vs-team.mine { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.vs-x { font-weight: 900; color: #c25a14; font-size: .85rem; letter-spacing: .08em; }
.game-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: #f3f6f7; flex: none; }
.game-current .game-icon { background: #ffe8d4; box-shadow: 0 0 0 3px #fff1e4; }
.game-done .game-icon { filter: grayscale(.4); }
.game-main > span { display: block; }
.game-tour { font-weight: 800; color: var(--ink-2); }
.game-more { padding-left: 66px; }

/* équipe : bannière */
.team-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  padding: 22px 20px; border-radius: 26px; color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.25), transparent 45%),
    linear-gradient(135deg, var(--team), color-mix(in srgb, var(--team) 60%, #000));
  box-shadow: 0 16px 36px color-mix(in srgb, var(--team) 35%, transparent);
}
.team-hero::after { content: ""; position: absolute; inset: auto -30px -60px auto; width: 180px; height: 180px; border-radius: 50%; border: 22px solid rgba(255,255,255,.08); }
.team-hero-emblem { flex: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,.25)); }
.team-hero-emblem .shield path:first-child { stroke: rgba(255,255,255,.6); stroke-width: 1.5; }
.team-hero-text small { color: rgba(255,255,255,.88); display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.team-hero-text h1 { font-size: 2rem; margin: 2px 0; color: #fff; }
.team-hero-name { margin: 0; font-weight: 700; font-size: 1.05rem; }
.team-hero-count { margin: 6px 0 0; display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.2); font-weight: 700; font-size: .8rem; }

/* équipe : bilan */
.team-record { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: var(--shadow-sm); }
.record-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { text-align: center; padding: 10px 6px; border-radius: 14px; }
.stat b { display: block; font-size: 1.9rem; line-height: 1; }
.stat span { font-size: .75rem; font-weight: 700; }
.stat.win { background: var(--ok-soft); color: var(--ok); }
.stat.draw { background: #eef2f3; color: var(--ink-2); }
.stat.loss { background: #fdeeed; color: #b3362f; }
.record-progress { margin-top: 12px; }
.record-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.form { display: inline-flex; align-items: center; gap: 3px; }
.form i { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: .66rem; font-weight: 800; color: #fff; background: #9aa6ae; }
.form i.win { background: var(--ok); }
.form i.loss { background: #d6453d; }
.record-cheer { margin: 10px 0 0; font-size: .88rem; font-weight: 600; color: var(--ink-2); }

/* équipe : prochain jeu */
.next-game { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1.5px solid #ffc89e; background: linear-gradient(135deg, #fff7ef, #fff); font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.next-game-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: #ffe8d4; flex: none; }
.next-game-text { flex: 1; min-width: 0; display: grid; }
.next-game-text small { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c25a14; }
.next-game-text strong { font-size: 1.1rem; }
.next-game-text span { font-size: .82rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { font-size: 1.8rem; color: #c25a14; line-height: 1; }

/* équipe : capitaine et membres */
.avatar, .avatar-lg {
  --h: 160;
  display: grid; place-items: center; flex: none; border-radius: 50%; font-weight: 800;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 30%);
  box-shadow: inset 0 0 0 2px hsl(var(--h) 60% 82%);
}
.avatar { width: 36px; height: 36px; font-size: .8rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; position: relative; }
.avatar-lg.empty { background: #eef2f3; color: var(--ink-3); box-shadow: inset 0 0 0 2px #dfe6e9; }
.crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-style: normal; font-size: 1.2rem; }
.captain { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #fff8e1, #fff); border: 1.5px solid #f6dc8a; }
.captain strong { display: block; font-size: 1.05rem; }
.captain span:not(.avatar-lg) { display: block; font-size: .8rem; color: var(--ink-3); }
.captain-empty { background: #fff; border-style: dashed; border-color: var(--line-strong); }
.members { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.members li { padding: 8px 10px; gap: 10px; }
.member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members li.me { border-color: color-mix(in srgb, var(--team) 45%, #fff); background: color-mix(in srgb, var(--team) 8%, #fff); }
.members em { color: var(--team); }
.members-empty { grid-column: 1 / -1; justify-content: center; color: var(--ink-3); font-weight: 500 !important; }
.list-title-row { margin: 22px 0 8px; }
.list-title-row .list-title { margin: 0 !important; }

/* équipe : photos */
.photo-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.strip-photo { flex: none; width: 96px; height: 96px; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); }
.strip-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* programme : frise */
.app-shell .timeline { padding: 8px 16px; }
.app-shell .timeline li { grid-template-columns: 56px 18px 1fr; gap: 10px; border-top: 0; padding: 10px 0; }
.app-shell .timeline li + li { border-top: 0; }
.app-shell .timeline li::before { content: ""; grid-column: 2; grid-row: 1; justify-self: center; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #fff; border: 3px solid var(--line-strong); position: relative; z-index: 1; }
.app-shell .timeline li::after { content: ""; position: absolute; left: 74px; top: 26px; bottom: -10px; width: 2px; background: var(--line); }
.app-shell .timeline li { position: relative; }
.app-shell .timeline li:last-child::after { display: none; }
.app-shell .timeline li > time { grid-column: 1; grid-row: 1; }
.app-shell .timeline li > div { grid-column: 3; grid-row: 1; }
.app-shell .timeline li.past::before { background: var(--line-strong); }
.app-shell .timeline li.now::before { border-color: var(--team); background: var(--team); box-shadow: 0 0 0 5px color-mix(in srgb, var(--team) 20%, transparent); }
.app-shell .timeline li.now { background: none; margin: 0; padding: 10px 0; }
.app-shell .timeline li.now .title { color: var(--team); }

/* carte d'identité : motif */
.idcard { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 12px, transparent 12px 24px); }

/* =====================================================================
   Espace équipe & admin : même langage visuel que l'espace étudiant
   ===================================================================== */

/* menu : rubrique active pleine, comme la barre d'onglets étudiante */
.sidebar nav a[aria-current=page] { background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(15, 157, 127, .28); }
.sidebar nav a[aria-current=page] .icon { color: #fff; }
.sidebar { background: linear-gradient(180deg, #fff, #f7fbfa); }

/* bannière de titre */
.sidebar ~ main .page-head {
  position: relative; overflow: hidden;
  margin: 20px 0 20px; padding: 20px 22px 20px 86px; border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 138, 61, .16), transparent 40%),
    linear-gradient(135deg, #e7f7f1, #ffffff 70%);
  border: 1px solid #d6efe6; box-shadow: var(--shadow-sm);
  min-height: 88px; align-items: center;
}
.sidebar ~ main .page-head::after { content: ""; position: absolute; right: -40px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; border: 24px solid rgba(15, 157, 127, .06); pointer-events: none; }
.sidebar ~ main .page-head > div:first-of-type { position: relative; z-index: 1; }
.sidebar ~ main .page-head > :not(.page-ico) { position: relative; z-index: 1; }
.page-ico {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, #16b892, var(--brand-strong)); color: #fff;
  box-shadow: 0 8px 18px rgba(15, 157, 127, .3);
}
.page-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidebar ~ main .page-head:not(:has(.page-ico)) { padding-left: 22px; }
@media (max-width: 720px) {
  .sidebar ~ main .page-head { padding: 16px 16px 16px 76px; border-radius: 20px; }
  .page-ico { left: 14px; width: 46px; height: 46px; }
}

/* tuiles de chiffres */
.kpi { padding: 16px 16px 16px 18px; }
.kpi::after { display: none; }
.kpi-ico { float: right; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; }
.kpi-green { background: linear-gradient(135deg, #eaf8f2, #fff 70%); border-color: #cdeee0; }
.kpi-green .kpi-ico { background: #d4f1e5; }
.kpi-green strong { color: var(--ok); }
.kpi-orange { background: linear-gradient(135deg, #fff4ea, #fff 70%); border-color: #ffdcc2; }
.kpi-orange .kpi-ico { background: #ffe6d2; }
.kpi-orange strong { color: #c25a14; }
.kpi-blue { background: linear-gradient(135deg, #edf3fe, #fff 70%); border-color: #d3e1fb; }
.kpi-blue .kpi-ico { background: #dce8fd; }
.kpi-blue strong { color: #1d4f9e; }
.kpi-violet { background: linear-gradient(135deg, #f4effd, #fff 70%); border-color: #e2d6f7; }
.kpi-violet .kpi-ico { background: #e9dffa; }
.kpi-violet strong { color: #6a3fb0; }
.desk-stats div { border-radius: 16px; }
.desk-stats div:nth-child(2) { background: var(--ok-soft); border-color: #c4ead6; }
.desk-stats div:nth-child(2) strong { color: var(--ok); }

/* blasons et icônes de jeux */
.team-cell { display: inline-flex; align-items: center; gap: 8px; }
.team-cell .shield { flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }
.team-cell.big { gap: 12px; }
a.team-cell { text-decoration: none; }
.game-title { display: inline-flex; align-items: center; gap: 8px; }
.game-ico { width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center; background: #fff1e4; font-size: 1.1rem; flex: none; }
.game-ico.sm { width: 26px; height: 26px; border-radius: 8px; font-size: .9rem; }
.team-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.team-tag .shield { flex: none; }
.result-grid .btn .team-tag { flex-direction: column; gap: 2px; font-size: .88rem; }
.result-grid .btn { border-bottom-width: 3px; }
.result-grid .btn.selected .team-tag .shield { filter: drop-shadow(0 0 0 #fff) brightness(1.1); }
.team-dot { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.team-dot::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--tc); }
.team-tag.on-band { margin-left: 8px; padding: 2px 9px 2px 6px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); font-size: .8rem; }
.team-tag.on-band::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--tc); }
.p-band { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 12px, transparent 12px 24px); }
.p-band-meta { display: flex !important; align-items: center; flex-wrap: wrap; gap: 4px; }
.podium-shield { display: block; margin: 4px 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.team-bar-label { font-size: .72rem; font-weight: 800; color: var(--ink-2); display: inline-flex; align-items: center; gap: 3px; }
.team-bar-label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); }

/* cartes et listes : même douceur que l'espace étudiant */
.sidebar ~ main .card { border-radius: 22px; }
.match-card { border-top: 4px solid transparent; }
.match-card.focus { border-top-color: #ff8a3d; }
.match-card.done { border-top-color: var(--ok); }
.bus-card { border-radius: 20px; }
.student-list-card { border-radius: 22px; }
.srow-main { border-radius: 14px; }
.chip[aria-selected="true"], .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(15, 157, 127, .25); }
.chip[aria-selected="true"] b, .chip[aria-pressed="true"] b { background: rgba(255,255,255,.22); color: #fff; }
.desk-panel { border-radius: 26px; }
.p-step-num { box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.tie-card { border-left: 6px solid #f5b72a; }
.podium .block { display: flex; align-items: center; justify-content: center; gap: 1px; }
.podium .block sup { font-size: .5em; margin-top: -.6em; }

/* =====================================================================
   Finitions : accueil public, connexion, configuration, animations
   ===================================================================== */

/* ---------- page de check-in ---------- */
.welcome {
  position: relative; overflow: hidden; color: #fff;
  padding: 18px 16px 84px;
  background: linear-gradient(145deg, #0f9d7f 0%, #0b7c64 55%, #095c4b 100%);
}
.welcome-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.welcome .b1 { width: 260px; height: 260px; right: -80px; top: -90px; background: radial-gradient(circle, rgba(255, 209, 102, .55), transparent 70%); }
.welcome .b2 { width: 220px; height: 220px; left: -90px; bottom: -110px; background: radial-gradient(circle, rgba(255, 138, 61, .45), transparent 70%); }
.welcome .b3 { width: 140px; height: 140px; right: 20%; bottom: 10px; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); }
.confetti-deco { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.welcome-top, .welcome-hero { position: relative; max-width: 520px; margin: 0 auto; }
.welcome-top { display: flex; align-items: center; gap: 12px; }
.welcome-top strong { display: block; letter-spacing: .14em; }
.welcome-top div span { display: block; font-size: .78rem; opacity: .85; }
.brandmark.light { background: #fff; color: var(--brand-strong); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.welcome-hero { padding-top: 26px; }
.welcome-date { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.18); font-weight: 700; font-size: .85rem; backdrop-filter: blur(6px); }
.welcome-hero h1 { font-size: clamp(1.9rem, 7vw, 2.4rem); line-height: 1.1; margin: 0 0 10px; color: #fff; letter-spacing: -.03em; }
.welcome-msg { margin: 0; opacity: .92; font-size: 1rem; }
.welcome-main { position: relative; margin-top: -60px; }
.welcome-main .steps { background: #fff; border-radius: 20px; padding: 14px 8px 10px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.welcome-main #checkin-form { border-radius: 24px; box-shadow: 0 2px 6px rgba(23,33,43,.05), 0 20px 50px rgba(23,33,43,.10); }
.welcome-main #checkin-form h2 { font-size: 1.3rem; }
.welcome-help { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px dashed var(--line-strong); }
.welcome-help span { font-size: 1.6rem; }
.welcome-help p { margin: 0; font-size: .9rem; color: var(--ink-2); }
.welcome-links { text-align: center; margin: 14px 0 0; font-weight: 700; }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 400px at 10% 0%, #d7f2e9, transparent 60%), radial-gradient(700px 400px at 100% 100%, #ffe9d6, transparent 60%), var(--bg); }
.login-card { width: min(880px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 30px 80px rgba(23,33,43,.14); border: 1px solid var(--line); }
.login-side { position: relative; overflow: hidden; padding: 36px 32px; color: #fff; background: linear-gradient(150deg, #0f9d7f, #0a6b56); }
.login-side h2 { color: #fff; font-size: 1.8rem; margin: 22px 0 8px; }
.login-side p { opacity: .9; }
.login-side ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.login-side li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.login-side li span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 1.15rem; }
.login-side .b1 { width: 240px; height: 240px; right: -90px; bottom: -90px; background: radial-gradient(circle, rgba(255, 209, 102, .45), transparent 70%); }
.login-side .b2 { width: 160px; height: 160px; right: 30px; top: -60px; background: radial-gradient(circle, rgba(255,255,255,.2), transparent 70%); }
.login-form { padding: 36px 32px; }
.login-kicker { margin: 0 0 6px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink); }
.login-form h1 { font-size: 1.9rem; }
@media (max-width: 760px) {
  .login-card { grid-template-columns: 1fr; }
  .login-side { padding: 24px; }
  .login-side ul { display: none; }
  .login-side h2 { margin-top: 12px; font-size: 1.4rem; }
  .login-form { padding: 24px; }
}

/* ---------- configuration : bus et programme ---------- */
.bus-item { border-top: 0; padding: 6px 0; }
.bus-item > summary { padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); border-left: 6px solid var(--bc); background: #fff; }
.bus-item[open] > summary { box-shadow: var(--shadow-sm); }
.bus-pos { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--bc) 16%, #fff); color: color-mix(in srgb, var(--bc) 75%, #000); flex: none; }
.bus-item-main { flex: 1; min-width: 180px; display: grid; gap: 4px; }
.bus-item-main strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bus-item-count { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.bus-item-count b { font-size: 1.4rem; color: var(--ink); }
.prog-item > summary { align-items: center; flex-wrap: nowrap; }
.prog-item > summary::after { flex: none; }
.prog-time { width: 56px; flex: none; display: grid; text-align: right; }
.prog-time b { font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.prog-time small { font-size: .72rem; }
.prog-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--brand); background: #fff; flex: none; }
.prog-main { flex: 1; min-width: 0; display: grid; }
.prog-item .pill { flex: none; }
@media (max-width: 720px) { .prog-item .pill { display: none; } }

/* ---------- squelette de chargement ---------- */
.skeleton-row { display: flex; align-items: center; gap: 14px; padding: 14px 10px; border-top: 1px solid var(--line); }
.skeleton-row:first-child { border-top: 0; }
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, #eef2f3 25%, #f7f9fa 50%, #eef2f3 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk-dot { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 6px; }
.sk-line { height: 12px; width: 60%; }
.sk-line.short { width: 35%; }
.sk-pill { width: 90px; height: 30px; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- animations d'apparition ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card, .kpi, .pass, .idcard, .now-card, .team-hero, .team-record, .match-now, .shortcuts button,
  .bus-card, .login-card, .welcome-main > *, .export-card {
    animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
  }
  .kpis > :nth-child(2), .shortcuts > :nth-child(2), .welcome-main > :nth-child(2) { animation-delay: .05s; }
  .kpis > :nth-child(3), .shortcuts > :nth-child(3), .welcome-main > :nth-child(3) { animation-delay: .1s; }
  .kpis > :nth-child(4), .shortcuts > :nth-child(4), .welcome-main > :nth-child(4) { animation-delay: .15s; }
  .tab-panel:not([hidden]) { animation: fade .25s ease both; }
  .btn:active, .shortcuts button:active, .tabbar button:active, .chip:active { transform: scale(.97); }
  .welcome .b1 { animation: float 9s ease-in-out infinite; }
  .welcome .b2 { animation: float 11s ease-in-out infinite reverse; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes float { 50% { transform: translate(-14px, 12px); } }
/* le contenu remplacé en direct ne doit pas « réapparaître » à chaque mise à jour */
main[data-live] .card { animation: none; }

.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* tableaux : en-tête collant et lignes plus aérées */
.sidebar ~ main .table-wrap { border-radius: 16px; }
.sidebar ~ main th { position: sticky; top: 0; z-index: 1; }
.sidebar ~ main tbody tr:nth-child(even) td { background: #fbfcfc; }

/* =====================================================================
   v4 — typographie (Arial) et interface équipe façon application
   ===================================================================== */

body { font-family: var(--font); letter-spacing: 0; }
h1, h2, h3, .btn, .kpi strong, .stat b, .pass-color, .idcard-name, .idcard-grid strong, .ticket-name,
.team-hero-text h1, .now-card h2, .match-now h2, .p-name, .p-band strong, .bus-card-count b, .roll-count b,
.desk-stats strong, .podium .block, .round-title, .welcome-hero h1, .login-form h1, .login-side h2,
.brandbar strong, .sidebar .brand strong, .welcome-top strong, .game-main strong, .next-game-text strong,
.tabbar button, .chip, .pill, .badge, .game-state, .kpi-ico, .rs, .rt, .bus-pos, .prog-time b,
.panel-head h1, .list-title, th {
  font-family: var(--font-display);
}
h1 { font-weight: 700; letter-spacing: -.025em; }
h2 { font-weight: 600; letter-spacing: -.015em; }
.btn { font-weight: 600; letter-spacing: 0; }
.kpi strong, .stat b, .desk-stats strong { font-weight: 700; }

/* ---------- fond et coque ---------- */
body:has(.sidebar) {
  background:
    radial-gradient(900px 420px at 85% -120px, rgba(15, 157, 127, .14), transparent 70%),
    radial-gradient(700px 360px at 10% 110%, rgba(255, 138, 61, .08), transparent 70%),
    #f3f6f5;
  background-attachment: fixed;
}

/* ---------- menu latéral en carte flottante ---------- */
@media (min-width: 1024px) {
  .sidebar {
    inset: 14px auto 14px 14px; width: calc(var(--sidebar) - 14px);
    border: 0; border-radius: 26px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
    box-shadow: 0 10px 40px rgba(23, 33, 43, .08);
  }
  .sidebar ~ main.shell-wide { padding-left: 30px; padding-right: 30px; }

  /* Petit bouton en médaillon, à cheval sur le bord du menu, pour le réduire. */
  .sidebar-collapse {
    display: grid; position: absolute; top: 20px; right: -13px; z-index: 5;
    width: 26px; height: 26px; padding: 0; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 8px rgba(23, 33, 43, .18);
  }
  .sidebar-collapse .icon { width: 15px; height: 15px; }
  .sidebar-collapse[aria-pressed="true"] .icon { transform: scaleX(-1); }
}

/* ---------- menu latéral réduit (préférence mémorisée par appareil) ----------
 * Mêmes réglages que le rail de la tablette verticale : icônes seules, libellés
 * réduits à deux lignes, plus besoin de dérouler le menu pour changer de rubrique. */
@media (min-width: 1024px) {
  body.sidebar-collapsed .sidebar { width: calc(var(--rail, 88px) - 14px); align-items: center; }
  body.sidebar-collapsed .sidebar .brand { flex-direction: column; gap: 2px; padding: 2px 0 14px; text-align: center; }
  body.sidebar-collapsed .sidebar .brand span:not(.brandmark) { display: none; }
  body.sidebar-collapsed .nav-group > p { display: none; }
  body.sidebar-collapsed .sidebar nav { width: 100%; }
  body.sidebar-collapsed .sidebar nav a { flex-direction: column; gap: 4px; padding: 10px 2px; text-align: center; }
  body.sidebar-collapsed .sidebar nav a .nav-label {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: .64rem; line-height: 1.15;
  }
  body.sidebar-collapsed .sidebar .me { flex-direction: column; gap: 6px; width: 100%; }
  body.sidebar-collapsed .sidebar .me-info { display: none; }
  body.sidebar-collapsed .sidebar ~ main, body.sidebar-collapsed .sidebar ~ .app-main { margin-left: var(--rail, 88px); }
  body.sidebar-collapsed .sidebar ~ main.shell-wide { padding-left: 20px; padding-right: 20px; }
  body.sidebar-collapsed .sidebar ~ main.shell { margin-left: calc(var(--rail, 88px) + max(16px, (100vw - var(--rail, 88px) - 560px) / 2)); }
}
.sidebar .brand { padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.nav-group > p { font-family: var(--font-display); letter-spacing: .12em; }
.sidebar nav a { padding: 7px 8px; border-radius: 14px; font-weight: 500; gap: 12px; }
.sidebar nav a .icon {
  width: 34px; height: 34px; padding: 7px; border-radius: 11px;
  background: #f1f5f4; color: var(--ink-2); transition: background .15s ease, color .15s ease;
}
.sidebar nav a:hover .icon { background: var(--brand-soft); color: var(--brand-ink); }
.sidebar nav a[aria-current=page] { background: linear-gradient(135deg, #14b08e, var(--brand-strong)); color: #fff; font-weight: 600; box-shadow: 0 10px 22px rgba(15, 157, 127, .28); }
.sidebar nav a[aria-current=page] .icon { background: rgba(255, 255, 255, .2); color: #fff; }
.sidebar .me { margin: 8px -4px -4px; padding: 12px; border: 0; border-radius: 18px; background: #f3f7f6; }

/* ---------- bannière de titre pleine, comme la bannière d'équipe ---------- */
.sidebar ~ main .page-head {
  color: #fff; border: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 209, 102, .35), transparent 38%),
    radial-gradient(circle at 0% 120%, rgba(255, 255, 255, .12), transparent 45%),
    linear-gradient(135deg, #12a887 0%, #0b7c64 60%, #09624f 100%);
  box-shadow: 0 18px 40px rgba(11, 124, 100, .22);
  border-radius: 28px; min-height: 104px;
}
.sidebar ~ main .page-head::after { border-color: rgba(255, 255, 255, .08); }
.sidebar ~ main .page-head h1 { color: #fff; font-size: 1.75rem; }
.sidebar ~ main .page-head .muted, .sidebar ~ main .page-head p, .sidebar ~ main .page-head label { color: rgba(255, 255, 255, .86); }
.sidebar ~ main .page-head a:not(.btn) { color: #fff; }
.sidebar ~ main .page-head .btn-ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; box-shadow: none; backdrop-filter: blur(6px); }
.sidebar ~ main .page-head .btn-ghost:hover { background: rgba(255, 255, 255, .26); color: #fff; border-color: rgba(255, 255, 255, .45); }
.sidebar ~ main .page-head .btn:not(.btn-ghost):not(.btn-danger) { background: #fff; color: var(--brand-ink); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.sidebar ~ main .page-head .pill { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .25); }
.sidebar ~ main .page-head .pill-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7dffc9; margin-right: 2px; }
.page-ico { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.sidebar ~ main .page-head .segmented { background: rgba(255, 255, 255, .16); }
.sidebar ~ main .page-head .segmented a { color: rgba(255, 255, 255, .9); }
.sidebar ~ main .page-head .segmented a[aria-selected="true"] { background: #fff; color: var(--brand-ink); }
.sidebar ~ main .page-head .desk-stats div { background: rgba(255, 255, 255, .95); border: 0; color: var(--ink); }
.sidebar ~ main .page-head .desk-stats span { color: var(--ink-3); }

/* ---------- cartes : sans bordure, ombres douces, grands arrondis ---------- */
.sidebar ~ main .card, .sidebar ~ .desk-panel, .sidebar ~ main .desk-panel, .kpi, .bus-card, .team-record {
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(23, 33, 43, .04), 0 10px 30px rgba(23, 33, 43, .06);
}
.sidebar ~ main .card { border-radius: 24px; }
.sidebar ~ main .card h2 { font-size: 1.1rem; }
.kpi { border-radius: 24px; border: 0; }
.kpi strong { font-size: 2.3rem; }
.kpi small { font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.kpi-ico { width: 46px; height: 46px; border-radius: 16px; }

/* champs et boutons plus doux */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=search], input:not([type]), select, textarea { border-radius: 14px; background: #f7faf9; border-color: #dde5e3; }
.btn { border-radius: 14px; }
.btn-sm { border-radius: 11px; }
.chip { border-radius: 14px; }
.pill { border-radius: 10px; }

/* listes et tableaux */
.sidebar ~ main table { border-collapse: separate; border-spacing: 0; }
.sidebar ~ main th { background: #f4f8f7; border-bottom: 0; }
.sidebar ~ main thead th:first-child { border-radius: 12px 0 0 12px; }
.sidebar ~ main thead th:last-child { border-radius: 0 12px 12px 0; }
.sidebar ~ main td { border-bottom-color: #eef2f1; }
details.edit > summary { padding: 4px 2px; }
details.edit > form { border-radius: 18px; background: #f6f9f8; border-color: transparent; }

/* ---------- barre d'onglets de l'équipe (téléphone) ---------- */
.staff-tabbar { display: none; }
@media (max-width: 767px) {
  .staff-tabbar {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 32;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px;
    border-radius: 22px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
    box-shadow: 0 12px 34px rgba(23, 33, 43, .16);
  }
  .staff-tabbar a, .staff-tabbar button {
    display: grid; justify-items: center; gap: 2px; padding: 7px 2px; border: 0; border-radius: 16px;
    background: none; color: var(--ink-3); font: 600 .66rem var(--font-display); text-decoration: none; cursor: pointer;
    min-width: 0;
  }
  .staff-tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .staff-tabbar .icon { width: 22px; height: 22px; }
  .staff-tabbar a[aria-current=page] { background: linear-gradient(135deg, #14b08e, var(--brand-strong)); color: #fff; box-shadow: 0 6px 14px rgba(15, 157, 127, .3); }
  body:has(.staff-tabbar) main { padding-bottom: 110px !important; }
  body:has(.staff-tabbar) .toast-zone { bottom: 96px; }
}
@media (max-width: 1023px) {
  .topbar { border-bottom: 0; background: rgba(243, 246, 245, .9); }
  .topbar .icon-btn { border-radius: 12px; }
  .sidebar { border-radius: 0 26px 26px 0; }
  .sidebar ~ main .page-head { border-radius: 24px; min-height: 0; }
  .sidebar ~ main .page-head h1 { font-size: 1.45rem; }
}
@media print { .staff-tabbar { display: none !important; } }

/* ---------- tablette (portrait iPad et assimilés) : menu latéral fixe et étroit ----------
 * Assez d'espace pour garder le menu affiché en permanence (plus besoin du menu ☰ ni de la
 * barre du bas) : chaque rubrique reste à un seul geste, comme sur un ordinateur. */
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --rail: 88px; }
  .sidebar {
    transform: none; width: var(--rail); padding: 14px 6px; border-radius: 0 22px 22px 0;
    align-items: center;
  }
  .sidebar .brand { flex-direction: column; gap: 2px; padding: 2px 2px 14px; text-align: center; }
  .sidebar .brand span:not(.brandmark) { display: none; }
  .sidebar nav { width: 100%; }
  .nav-group > p { display: none; }
  .nav-group { margin-bottom: 6px; }
  .sidebar nav a {
    flex-direction: column; gap: 4px; padding: 10px 2px; text-align: center; border-radius: 16px;
  }
  .sidebar nav a .nav-label {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: .64rem; line-height: 1.15; font-weight: 600;
  }
  .sidebar .me { flex-direction: column; gap: 6px; margin: 8px 0 0; padding: 10px 4px; width: 100%; }
  .sidebar .me-info { display: none; }
  .topbar [data-menu] { display: none; }
  .topbar { margin-left: var(--rail); padding-left: 20px; }
  /* Avatar, son et déconnexion vivent déjà dans le rail : pas besoin de les répéter ici. */
  .topbar .sound-btn, .topbar .avatar { display: none; }
  .sidebar ~ main, .sidebar ~ .app-main { margin-left: var(--rail); }
  .sidebar ~ main.shell-wide { padding-left: 20px; padding-right: 20px; }
  .sidebar ~ main.shell { margin-left: calc(var(--rail) + max(16px, (100vw - var(--rail) - 560px) / 2)); }
  .scrim, body.menu-open .scrim { display: none !important; }
}

/* Arial : graisses normal / gras uniquement, titres légèrement resserrés */
h1, h2, h3, .kpi strong, .stat b, .pass-color, .team-hero-text h1, .welcome-hero h1, .login-form h1 { font-weight: 700; letter-spacing: -.02em; }
.btn, .chip, .pill, .badge, label, .nav-group > p { font-weight: 700; }
.sidebar nav a { font-weight: 400; }
.sidebar nav a[aria-current=page] { font-weight: 700; }
.p-facts .wide { grid-column: 1 / -1; }

/* ---------- élection du capitaine ---------- */
.vote-hint { margin: -2px 0 10px; font-size: .85rem; color: var(--ink-2); }
.vote-hint:empty { display: none; }
.members { grid-template-columns: 1fr; }
.members li.member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; }
.member .avatar { position: relative; }
.crown.sm { top: -11px; font-size: .9rem; }
.member-body { display: grid; gap: 4px; min-width: 0; }
.member-body .member-name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.member-body em { margin-left: 0; }
.member-body small { color: var(--ink-3); font-size: .72rem; font-weight: 600; }
.vote-bar { height: 6px; border-radius: 999px; background: #eef2f3; overflow: hidden; }
.vote-bar span { display: block; height: 100%; border-radius: inherit; background: var(--team); transition: width .35s ease; }
.members li.is-captain { background: linear-gradient(135deg, #fff8e1, #fff); border-color: #f6dc8a; }
.members li.voted { border-color: color-mix(in srgb, var(--team) 55%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--team) 14%, transparent); }
.vote-btn { min-height: 38px; padding: 6px 14px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--team) 45%, #fff); background: #fff; color: var(--team); font: 700 .85rem var(--font-display); cursor: pointer; white-space: nowrap; }
.vote-btn:hover { background: color-mix(in srgb, var(--team) 8%, #fff); }
.vote-btn.on { background: var(--team); border-color: var(--team); color: #fff; }
.vote-btn[disabled] { opacity: .6; }
