/* ============ Sésame — feuille de style (identité HKF Staff) ============ */
@font-face { font-family: 'DM Sans'; font-weight: 500; src: url('/fonts/DMSans_500Medium.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'DM Sans'; font-weight: 700; src: url('/fonts/DMSans_700Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'DM Sans'; font-weight: 900; src: url('/fonts/DMSans_900Black.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Fraunces'; font-weight: 700; src: url('/fonts/Fraunces_700Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Fraunces'; font-weight: 900; font-style: italic; src: url('/fonts/Fraunces_900Black_Italic.ttf') format('truetype'); font-display: swap; }

:root {
  --navy: #002946;
  --navy-2: #0a4a7d;
  --navy-3: #06365c;
  --green: #66bd45;
  --green-dark: #3f8f22;
  --green-soft: #f0f8ec;
  --coral: #ff7a59;
  --coral-soft: #fff1ec;
  --gold: #ffc857;
  --red: #d62f3c;
  --red-soft: #fdecee;
  --orange: #e8890c;
  --orange-soft: #fff5e6;
  --cream: #fff8ec;
  --surface: #ebf1f5;
  --card: #ffffff;
  --text: #002946;
  --muted: #5c6b7a;
  --border: #e1e8ed;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 41, 70, .06), 0 8px 24px rgba(0, 41, 70, .06);
  --font: 'DM Sans', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-weight: 500; color: var(--text); background: var(--surface); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-2); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden, [hidden] { display: none !important; }
.hint { font-size: 12.5px; line-height: 1.45; }
.mt { margin-top: 16px; }
.input-auto { width: auto !important; }
.detail-h { font-size: 16px !important; margin-bottom: 12px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.nowrap { white-space: nowrap; }

/* ---------- Marque ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 26px; line-height: 1; }
.brand-sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--green); font-weight: 700; margin-top: 3px; }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px;
  font-weight: 700; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; transition: transform .06s, filter .15s; min-height: 44px; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-green { background: var(--green); color: var(--navy); }
.btn-coral { background: var(--coral); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 12px; min-height: 34px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--border); background: #fff; border-radius: 12px; padding: 11px 14px; min-height: 46px; outline: none; }
.input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(10, 74, 125, .15); }
textarea.input { min-height: 80px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: var(--red-soft); color: #8a1620; }
.alert-ok { background: var(--green-soft); color: #245d10; }
.alert-warn { background: var(--orange-soft); color: #7a4300; }

/* ---------- Pastilles ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.pill-solo { background: var(--green-soft); color: var(--green-dark); }
.pill-couple { background: var(--coral-soft); color: #b8431f; }
.pill-ok { background: var(--green-soft); color: var(--green-dark); }
.pill-wait { background: var(--surface); color: var(--muted); }
.pill-bad { background: var(--red-soft); color: var(--red); }
.pill-warn { background: var(--orange-soft); color: var(--orange); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.fp { display: inline-flex; gap: 3px; vertical-align: middle; }
.fp i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.fp.fp-lg i { width: 18px; height: 18px; border-radius: 5px; }

/* ================= CONNEXION ================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 70% 75%, rgba(255, 200, 87, .35), transparent 35%), linear-gradient(180deg, #011526 0%, var(--navy) 45%, var(--navy-2) 80%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .brand-name { color: #fff; }
.login-art h1 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(36px, 4.4vw, 60px); max-width: 12ch; }
.login-art h1 span { color: var(--gold); }
.login-art p { color: #cfe3f2; max-width: 40ch; line-height: 1.5; }
.login-art > div:nth-child(2) { max-width: calc(100% - min(34%, 270px)); position: relative; z-index: 1; }
.login-art .mascot { position: absolute; right: 12px; bottom: 0; width: min(34%, 270px); }
.login-art .waves { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--cream); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 28px; margin-bottom: 6px; }
.login-card .muted { margin: 0 0 24px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 260px; padding: 28px; }
  .login-art .mascot { width: 140px; }
  .login-art p { display: none; }
}

/* ================= APPLICATION ================= */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.side .brand-name { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #cfe3f2; text-decoration: none; font-weight: 700; font-size: 15px; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--green); color: var(--navy); }
.nav a.nav-scan { margin-top: 10px; border: 1.5px dashed rgba(255, 255, 255, .25); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-event { background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 14px; font-size: 13px; color: #cfe3f2; }
.side-event strong { display: block; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 20px; color: var(--gold); margin-bottom: 4px; }
.me { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--navy); display: grid; place-items: center; font-weight: 900; flex: none; }
.me-name { font-weight: 700; color: #fff; }
.me-role { color: #9fc3dd; }
.me button { margin-left: auto; background: none; border: 0; color: #9fc3dd; cursor: pointer; padding: 6px; }
.me button:hover { color: #fff; }

.main { padding: 28px clamp(16px, 3vw, 40px) 80px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h2 { font-size: 17px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Tuiles de chiffres */
.stat { padding: 20px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 32px; font-weight: 900; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat-alert .stat-value { color: var(--red); }
.progress { height: 8px; border-radius: 99px; background: var(--surface); margin-top: 12px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--green); width: 0; transition: width .4s; }

/* Barres horizontales (une seule série) */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; font-size: 14px; }
.bar-row .bar-label { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: var(--surface); border-radius: 4px; position: relative; }
.bar-track > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--navy-2); min-width: 2px; }
.bar-row:hover .bar-track > i { background: var(--navy); }
.bar-value { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; text-align: right; min-width: 120px; }
.bar-value b { color: var(--text); }

/* Tableau */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1.5px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f7fafc; }
.table .code { font-weight: 900; letter-spacing: .05em; white-space: nowrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty img { width: 110px; display: block; margin: 0 auto 10px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; flex: 1 1 220px; }
.toolbar select.input { flex: 0 1 180px; }

/* Choix du type de ticket */
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.type-opt { position: relative; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt label { display: block; border: 2px solid var(--border); border-radius: 16px; padding: 18px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.type-opt label:hover { border-color: #c9d6e0; }
.type-opt input:checked + label { border-color: var(--green); box-shadow: 0 0 0 4px rgba(102, 189, 69, .18); }
.type-opt.couple input:checked + label { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 122, 89, .18); }
.type-opt input:focus-visible + label { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.type-name { font-weight: 900; letter-spacing: .08em; font-size: 14px; }
.type-price { font-size: 30px; font-weight: 900; margin: 6px 0 2px; }
.type-price small { font-size: 14px; color: var(--muted); }
.type-desc { color: var(--muted); font-size: 13px; }

.sell-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .sell-layout { grid-template-columns: 1fr; } }
.preview-card { position: sticky; top: 20px; }
.ticket-img { width: 100%; height: auto; aspect-ratio: 2000 / 760; background: #dfe7ee; display: block; border-radius: 12px; filter: drop-shadow(0 10px 22px rgba(0, 41, 70, .22)); }
.ticket-img.is-loading { animation: pulse 1.2s ease-in-out infinite; }
.ticket-img[src] { background: none; }
@keyframes pulse { 50% { opacity: .55; } }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.success-banner { display: flex; gap: 14px; align-items: center; background: var(--green-soft); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.success-banner img { width: 56px; }
.success-banner strong { display: block; font-size: 17px; }

/* Détail ticket */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { padding: 8px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 10px; }
.timeline time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lvl-alert { color: var(--red); font-weight: 700; }
.lvl-warn { color: var(--orange); font-weight: 700; }

/* Fenêtre modale */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 21, 38, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 900px; max-height: 92vh; overflow: auto; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal.modal-sm { max-width: 460px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 20px; }
.close-x { background: var(--surface); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; flex: none; }

.secret { font-family: ui-monospace, Consolas, monospace; font-size: 20px; background: var(--cream); border: 1.5px dashed var(--gold); border-radius: 12px; padding: 14px; text-align: center; letter-spacing: .08em; user-select: all; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow); font-weight: 700; }
.toast.err { background: var(--red); }

/* Lien profil (barre latérale) */
.me-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; flex: 1; border-radius: 12px; padding: 4px; margin: -4px; }
.me-link:hover { background: rgba(255, 255, 255, .06); }

/* Profil & À propos */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 28px; }
.profile-head h1 { margin: 0; }
.link-list { display: flex; flex-direction: column; }
.link-list a, .link-list button { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-weight: 700; text-decoration: none; text-align: left; cursor: pointer; width: 100%; }
.link-list a:last-child, .link-list button:last-child { border-bottom: 0; }
.link-list svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.link-list .danger, .link-list .danger svg { color: var(--red); }
.about-hero { display: flex; align-items: center; gap: 18px; }
.about-hero img { width: 84px; height: 84px; }
.about-hero .brand-name { font-size: 34px; }
.version-tag { display: inline-block; font-family: ui-monospace, Consolas, monospace; background: var(--navy); color: var(--gold); padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.only-mobile, .link-list .only-mobile-flex { display: none; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }

/* ================= TÉLÉPHONE : application avec menu en bas ================= */
.topbar, .tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .only-mobile { display: block; }
  .link-list .only-mobile-flex { display: flex; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--navy); color: #fff;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px; position: sticky; top: 0; z-index: 30; }
  .topbar .brand-name { color: #fff; font-size: 22px; }
  .topbar .brand img { width: 32px; height: 32px; }
  .top-avatar { text-decoration: none; }
  .main { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .bar-row { grid-template-columns: 90px 1fr; }
  .bar-value { grid-column: 2; text-align: left; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: flex-end;
    box-shadow: 0 -6px 24px rgba(0, 41, 70, .08); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted);
    text-decoration: none; font-size: 11px; font-weight: 700; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--navy); }
  .tabbar a.active svg { color: var(--green-dark); }
  /* Bouton principal au centre : le Contrôle d'entrée */
  .tabbar a.tab-main { flex: 0 0 auto; color: var(--navy); margin-top: -30px; }
  .tabbar a.tab-main svg { width: 64px; height: 64px; padding: 17px; border-radius: 50%; background: var(--green); color: var(--navy);
    box-shadow: 0 8px 20px rgba(102, 189, 69, .45), 0 0 0 5px #fff; }
  .tabbar a.tab-main:active svg { transform: scale(.94); }
}

/* ================= SCANNER ================= */
body.scan-body { background: #000; color: #fff; overflow: hidden; height: 100dvh; }
.scan { position: fixed; inset: 0; display: flex; flex-direction: column; }
.scan-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); z-index: 3; }
.scan-top .brand-name { color: #fff; font-size: 22px; }
.scan-top .brand img { width: 30px; height: 30px; }
.scan-count { margin-left: auto; text-align: right; font-size: 12px; color: #9fc3dd; line-height: 1.3; }
.scan-count b { color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }
.scan-icon-btn { background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.scan-icon-btn svg { width: 20px; height: 20px; }
.scan-icon-btn.on { background: var(--gold); color: var(--navy); }
.scan-view { position: relative; flex: 1; overflow: hidden; background: #000; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 46%; width: min(68vw, 330px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 28px; box-shadow: 0 0 0 100vmax rgba(0, 21, 38, .55); }
.scan-frame::before, .scan-frame::after { content: ''; position: absolute; inset: -3px; border-radius: 30px; border: 4px solid var(--green);
  -webkit-mask: linear-gradient(#000 0 0) top/60% 6px no-repeat, linear-gradient(#000 0 0) bottom/60% 6px no-repeat, linear-gradient(#000 0 0) left/6px 60% no-repeat, linear-gradient(#000 0 0) right/6px 60% no-repeat;
  mask: linear-gradient(#000 0 0) top/60% 6px no-repeat, linear-gradient(#000 0 0) bottom/60% 6px no-repeat, linear-gradient(#000 0 0) left/6px 60% no-repeat, linear-gradient(#000 0 0) right/6px 60% no-repeat; opacity: 0; }
.scan-frame::after { opacity: 1; -webkit-mask: none; mask: none; border-color: transparent;
  background: linear-gradient(180deg, transparent 45%, rgba(102, 189, 69, .55) 50%, transparent 55%) 0 0/100% 200%; animation: sweep 2.2s linear infinite; }
@keyframes sweep { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
.scan-corners { position: absolute; inset: -4px; }
.scan-corners i { position: absolute; width: 44px; height: 44px; border: 5px solid var(--green); }
.scan-corners i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 26px 0 0 0; }
.scan-corners i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 26px 0 0; }
.scan-corners i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 26px; }
.scan-corners i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 26px 0; }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-weight: 700; color: #fff; text-shadow: 0 1px 4px #000; padding: 0 16px; }
.scan-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 14px; background: var(--navy); z-index: 2; }
.scan-msg img { width: 130px; }
.scan-bottom { display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--navy); z-index: 3; }
.scan-bottom .btn { flex: 1; }

/* Résultat de scan */
.result { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; color: #fff; animation: pop .18s ease-out; overflow: auto; }
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.result.r-loading { background: rgba(0, 41, 70, .94); justify-content: center; }
.result.r-valid { background: linear-gradient(180deg, #2f8f17, #1f6b0d); }
.result.r-used, .result.r-forged { background: linear-gradient(180deg, #d62f3c, #9b1520); }
.result.r-revoked, .result.r-invalid { background: linear-gradient(180deg, #e8890c, #a95c00); }
.result-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px 10px; gap: 6px; }
.result-head img { width: 120px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .25)); }
.result-title { font-size: clamp(30px, 9vw, 44px); font-weight: 900; letter-spacing: .02em; }
.result-msg { font-size: 16px; max-width: 34ch; opacity: .95; }
.result-card { background: rgba(255, 255, 255, .96); color: var(--text); margin: 14px 16px; border-radius: 20px; padding: 18px; }
.result-name { font-size: 24px; font-weight: 900; }
.result-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.result-line:last-child { border-bottom: 0; }
.result-line .fp { flex-wrap: wrap; justify-content: flex-end; }
.result-line .fp.fp-lg i { width: 15px; height: 15px; border-radius: 4px; }
.result-line span:first-child { color: var(--muted); font-weight: 700; }
.result-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
.result-actions .btn { min-height: 58px; font-size: 18px; border-radius: 16px; }
.btn-white { background: #fff; color: var(--navy); }
.btn-outline-white { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .6); }
.result-actions .split { display: flex; gap: 10px; }
.result-actions .split .btn { flex: 1; }

.manual { position: fixed; inset: 0; background: rgba(0, 21, 38, .85); z-index: 20; display: flex; align-items: flex-end; }
.manual-sheet { background: #fff; color: var(--text); width: 100%; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
.manual-sheet .input { font-size: 24px; letter-spacing: .12em; text-transform: uppercase; text-align: center; font-weight: 900; }

/* Impression : uniquement le ticket */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
