/* NAG Accueil — identité Next African Generation : bleu marine, or souverain, ivoire */
:root {
  --navy: #0C2340;
  --navy-2: #16345C;
  --gold: #C5A059;
  --gold-2: #B08A42;
  --gold-soft: #F3EBDB;
  --ivory: #FAF9F6;
  --paper: #FFFFFF;
  --ink: #1E293B;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #EEF0F3;
  --green: #15803D;
  --green-soft: #DCFCE7;
  --red: #B91C1C;
  --red-soft: #FEE2E2;
  --orange: #C2410C;
  --orange-soft: #FFEDD5;
  --gray: #64748B;
  --gray-soft: #F1F5F9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(12, 35, 64, .05), 0 6px 24px rgba(12, 35, 64, .06);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --nums: lining-nums tabular-nums;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Démarrage ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--navy); }
.boot-mark { font-family: var(--serif); font-size: 44px; font-weight: 700; color: var(--gold); letter-spacing: .12em; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- Typographie ---------- */
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); }
.display { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; color: var(--navy); letter-spacing: -.01em; }
h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.link { font-size: 13px; font-weight: 600; color: var(--gold-2); }

/* ---------- Authentification ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #1B3B66 0%, var(--navy) 55%, #081830 100%); }
.auth-card { width: 100%; max-width: 400px; background: var(--paper); border-radius: 20px; padding: 36px 28px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); text-align: center; }
.auth-mark { width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 16px; background: var(--navy);
  color: var(--gold); font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .08em; box-shadow: inset 0 0 0 1.5px var(--gold); }
.auth-title { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--navy); margin: 0 0 22px; }
.auth-card .form { text-align: left; }
.auth-foot { margin: 18px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197, 160, 89, .18); }
textarea { resize: vertical; }
.form-error { margin: 0; min-height: 0; color: var(--red); font-size: 13px; font-weight: 500; }
.form-error:empty { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy); }
.agent-perms { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; font-weight: 500; transition: all .15s; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: .01em; transition: transform .08s, background .15s, opacity .15s; white-space: nowrap; user-select: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #CFAC69; }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--navy); }
.btn-ghost:hover { border-color: #CBD5E1; }
.btn-text { background: none; color: var(--muted); }
.btn-warn { color: var(--orange); }
.btn-danger { color: var(--red); }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 20px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-white { background: #fff; color: var(--ink); }
.btn-outline-white { background: transparent; border-color: rgba(255,255,255,.65); color: #fff; }
.btn-text-white { background: transparent; color: rgba(255,255,255,.85); font-weight: 500; }
.btn small { font-weight: 500; opacity: .6; }

/* ---------- Structure ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: rgba(250, 249, 246, .92);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--navy); color: var(--gold);
  font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: .06em; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-event { font-weight: 600; font-size: 14px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--gray); white-space: nowrap; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.on { background: var(--green-soft); color: var(--green); }
.conn.on i { animation: live 2s ease-in-out infinite; }
.conn.off { background: var(--red-soft); color: var(--red); }
.conn.sync { background: var(--orange-soft); color: var(--orange); }
@keyframes live { 50% { box-shadow: 0 0 0 4px rgba(21,128,61,.18); } }

.view { max-width: 1080px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }

.tabs { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: flex-end;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 6px var(--safe-b); background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h);
  font-size: 11px; font-weight: 500; color: var(--muted); }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--navy); }
.tab.active svg { stroke-width: 2.1; }
.tab-scan { flex: 0 0 auto; width: 76px; }
.tab-scan svg { width: 58px; height: 58px; padding: 15px; margin-top: -26px; border-radius: 50%; background: var(--navy); color: var(--gold);
  box-shadow: 0 8px 20px rgba(12,35,64,.35), 0 0 0 4px var(--ivory); stroke-width: 2; }
.tab-scan span { color: var(--navy); font-weight: 600; }

@media (min-width: 960px) {
  :root { --nav-h: 0px; }
  body { padding-left: 232px; }
  .topbar { padding-left: 28px; }
  .tabs { top: 0; right: auto; width: 232px; height: 100vh; flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 4px; padding: 88px 14px 20px; border-top: 0; border-right: 1px solid var(--line); background: var(--paper); }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
  .tab.active { background: var(--gold-soft); }
  .tab-scan { order: -1; width: auto; margin-bottom: 14px; height: 52px; background: var(--navy); border-radius: 12px; }
  .tab-scan svg { width: 22px; height: 22px; padding: 0; margin: 0; background: none; box-shadow: none; }
  .tab-scan span { color: #fff; }
  .tab-scan.active { background: var(--navy-2); }
  .view { padding: 32px 32px 48px; }
  .display { font-size: 40px; }
}

/* ---------- En-têtes de page ---------- */
.page-head { margin-bottom: 20px; }
.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.back svg { width: 16px; height: 16px; }
.hero { margin-bottom: 18px; }

/* ---------- Tableau de bord ---------- */
.scan-cta { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 18px; border-radius: 16px; background: var(--navy); color: #fff;
  box-shadow: 0 10px 30px rgba(12,35,64,.25); transition: transform .1s; }
.scan-cta:active { transform: scale(.99); }
.scan-cta > svg:first-child { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: rgba(197,160,89,.18); color: var(--gold); }
.scan-cta span { flex: 1; display: flex; flex-direction: column; }
.scan-cta b { font-size: 17px; }
.scan-cta small { color: rgba(255,255,255,.65); font-size: 13px; }
.scan-cta > svg:last-child { color: var(--gold); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.stat-n { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1; color: var(--navy); font-variant-numeric: var(--nums); }
.stat-n small { font-size: 20px; color: var(--muted); font-weight: 500; }
.stat-l { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.stat-main { grid-column: 1 / -1; background: linear-gradient(135deg, #fff 0%, #FBF8F1 100%); }
.stat-main .stat-l { order: -1; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-2); font-size: 11px; margin-bottom: 6px; }
.stat-main .stat-n { font-size: 52px; }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-warn { border-color: #FED7AA; background: #FFFBF5; }
.stat-warn .stat-n { color: var(--orange); }
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat-main { grid-column: span 4; }
}

.progress { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .5s ease; }
.progress-lg { height: 8px; margin-top: 14px; }

.panel { padding: 18px; margin-bottom: 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.panel-head select { width: auto; padding: 7px 34px 7px 12px; font-size: 13px; }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-2); overflow: hidden; }
.panel .list { border: 0; border-radius: 0; margin: 0 -18px -18px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); transition: background .12s; min-height: 64px; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: #FCFBF8; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-name { font-weight: 600; font-size: 14px; color: var(--navy); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name .fn { font-weight: 500; letter-spacing: 0; color: var(--ink); }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.row-sub > span:not(.cat):not(.role-chip) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.row-right { flex: none; display: flex; align-items: center; }
.row-time { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--green); font-variant-numeric: var(--nums); }
.count { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.list-sheet { max-height: 52vh; overflow-y: auto; margin: 12px 0; }

.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; object-fit: cover;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; background: var(--gray-soft); color: var(--gray); }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 30px; }
.av-vip { background: var(--gold-soft); color: var(--gold-2); }
.av-partenaire { background: #E0E7FF; color: #3730A3; }
.av-presse { background: #FCE7F3; color: #9D174D; }
.av-equipe { background: #DBEAFE; color: var(--navy); }
.av-client { background: #E0F2FE; color: #075985; }
.av-team { background: var(--navy); color: var(--gold); }
.av-unknown { background: rgba(255,255,255,.25); color: inherit; }

.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.s-present, .s-onsite { background: var(--green-soft); color: var(--green); }
.s-onsite { background: #ECFDF5; box-shadow: inset 0 0 0 1px #A7F3D0; }
.s-invited { background: var(--gray-soft); color: var(--gray); }
.s-absent { background: var(--gray-soft); color: #475569; }
.s-pending { background: var(--orange-soft); color: var(--orange); }
.s-cancelled { background: var(--red-soft); color: var(--red); }

.cat { display: inline-flex; padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--gray-soft); color: var(--gray); }
.cat-vip { background: var(--gold-soft); color: var(--gold-2); }
.cat-partenaire { background: #E0E7FF; color: #3730A3; }
.cat-presse { background: #FCE7F3; color: #9D174D; }
.cat-equipe { background: #DBEAFE; color: var(--navy); }
.cat-client { background: #E0F2FE; color: #075985; }
.role-chip { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--gold-soft); color: var(--gold-2); }
.muted-chip { background: var(--gray-soft); color: var(--gray); }
.dot-online { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: #22C55E; vertical-align: middle; }

.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty.small { padding: 20px; font-size: 13px; }
.empty p { margin: 4px 0; }

/* ---------- Barre d'outils ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.search { position: relative; }
.search > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search input { padding-left: 42px !important; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 760px) { .toolbar { flex-direction: row; } .toolbar .search { flex: 1; } .filters { width: 380px; } }

.present-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.present-summary span { padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.present-summary b { color: var(--navy); }

/* ---------- Événements ---------- */
.events-page { max-width: 1080px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 28px) 16px 48px; }
body:has(.events-page), body:has(.auth) { padding-left: 0; }
.events-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.events-head .display { font-size: 38px; }
.event-grid { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 700px) { .event-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .event-grid { grid-template-columns: repeat(3, 1fr); } }
.event-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; border-top: 3px solid var(--gold); }
.event-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(12,35,64,.1); }
.event-card.archived { opacity: .6; border-top-color: var(--line); }
.event-card h3 { margin: 4px 0 0; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--navy); line-height: 1.15; }
.event-card p { margin: 0; font-size: 13px; text-transform: capitalize; }
.event-card-top { display: flex; gap: 6px; }
.event-card-stats { display: flex; gap: 14px; margin: 10px 0 6px; font-size: 13px; color: var(--muted); }
.event-card-stats b { color: var(--navy); }
.event-card-stats span:last-child { margin-left: auto; font-weight: 600; color: var(--gold-2); }

/* ---------- Scanner ---------- */
.scanner { max-width: 520px; margin: 0 auto; }
.scan-stage { position: relative; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; border-radius: 22px; overflow: hidden; background: #050B14; box-shadow: 0 16px 40px rgba(12,35,64,.3); }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 0; margin: auto; width: 64%; aspect-ratio: 1; height: auto; top: 0; bottom: 0; box-shadow: 0 0 0 9999px rgba(5, 11, 20, .45); border-radius: 18px; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 3px solid var(--gold); }
.scan-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.scan-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.scan-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.scan-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 2px; top: 10%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: sweep 2.2s ease-in-out infinite; }
@keyframes sweep { 50% { top: 88%; } }
.scan-msg { position: absolute; left: 16px; right: 16px; bottom: 18px; text-align: center; color: #fff; font-size: 14px; font-weight: 500; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.torch { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; }
.torch.on { background: var(--gold); color: var(--navy); }
.scan-counter { text-align: center; margin: 14px 0; font-size: 13px; color: var(--muted); }
.scan-counter b { color: var(--navy); }
.scan-actions { display: flex; flex-direction: column; gap: 10px; }
.scan-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Résultat du scan (plein écran) ---------- */
.result { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(var(--safe-b) + 20px);
  color: #fff; overflow-y: auto; }
.r-ok { background: radial-gradient(circle at 50% 0%, #22A355 0%, #15803D 45%, #0E5E2C 100%); }
.r-red { background: radial-gradient(circle at 50% 0%, #DC3B3B 0%, #B91C1C 45%, #7F1414 100%); }
.r-orange { background: radial-gradient(circle at 50% 0%, #F27A2E 0%, #D9590F 45%, #9A3A06 100%); }
.r-inner { width: 100%; max-width: 440px; text-align: center; }
.r-icon svg { width: 76px; height: 76px; padding: 16px; border-radius: 50%; background: rgba(255,255,255,.18); animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.r-title { margin-top: 14px; font-size: 30px; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.r-sub { margin-top: 8px; font-size: 15px; color: rgba(255,255,255,.9); }
.r-person { margin: 24px 0 26px; padding: 22px 18px; border-radius: 20px; background: rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.r-person .avatar { box-shadow: 0 0 0 4px rgba(255,255,255,.35); margin-bottom: 6px; }
.r-name { font-size: 28px; line-height: 1.15; font-weight: 500; }
.r-name b { font-weight: 800; letter-spacing: .02em; }
.r-org { font-size: 16px; color: rgba(255,255,255,.85); }
.r-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.r-tags .cat { background: rgba(255,255,255,.95); }
.tag { padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.18); }
.r-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Fiche invité ---------- */
.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.profile-name { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.1; color: var(--navy); }
.profile-name b { font-weight: 700; letter-spacing: .01em; }
.profile-org { margin: 4px 0 0; color: var(--muted); }
.profile-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.presence-box { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; margin-bottom: 14px; border-radius: 12px; }
.presence-box b { font-size: 16px; }
.presence-box span { font-size: 13px; opacity: .85; }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-grid { display: grid; gap: 0 16px; }
@media (min-width: 800px) { .detail-grid { grid-template-columns: 1.5fr 1fr; } }
.kv { margin: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); flex: none; }
.kv dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }
.kv dd a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.notes { white-space: pre-wrap; margin: 0; padding: 12px; border-radius: 10px; background: var(--ivory); font-size: 14px; }
.sheet-sub { margin: 18px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qr-panel { text-align: center; }
.qr { width: 100%; max-width: 220px; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); padding: 6px; background: #fff; }
.qr-actions { display: flex; justify-content: center; gap: 8px; }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-pick .av-unknown { background: var(--gray-soft); color: var(--muted); }

/* ---------- Doublons ---------- */
.dup { padding: 14px; border-radius: 12px; background: var(--orange-soft); border: 1px solid #FED7AA; display: flex; flex-direction: column; gap: 8px; }
.dup-title { margin: 0; font-weight: 600; color: var(--orange); }
.dup .row { background: #fff; border-radius: 10px; border: 0; }

/* ---------- Menu ---------- */
.menu { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-2); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 16px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; width: 100%; }
.menu-item:last-child { border-bottom: 0; }
.menu-item > svg:first-child { width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-2); }
.menu-item span { flex: 1; display: flex; flex-direction: column; }
.menu-item b { font-weight: 600; color: var(--navy); }
.menu-item small { font-size: 12px; color: var(--muted); }
.menu-item > svg:last-child { color: var(--muted); width: 16px; }
.legal { margin: 20px 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.roles-legend { display: grid; gap: 8px; margin-bottom: 16px; }
@media (min-width: 760px) { .roles-legend { grid-template-columns: repeat(4, 1fr); } }
.roles-legend div { padding: 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.roles-legend b { font-size: 13px; color: var(--navy); }
.roles-legend span { font-size: 12px; color: var(--muted); }
.member .row-sub { gap: 4px 10px; }

/* ---------- Historique & statistiques ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stats-grid .panel { grid-column: 1 / -1; margin: 0; }
@media (min-width: 860px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stats-grid .panel { grid-column: span 2; }
  .stats-grid .panel.span2 { grid-column: 1 / -1; }
}
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; overflow-x: auto; }
.bar { flex: 1; min-width: 28px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; position: relative; }
.bar i { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--gold), var(--gold-2)); }
.bar span { position: absolute; top: 0; font-size: 11px; font-weight: 700; color: var(--navy); }
.bar small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 90px 1fr 60px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.hbar-track { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--navy); border-radius: inherit; }
.hbar-v { text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }

.log { display: flex; flex-direction: column; margin: 0 -18px; }
.log-row { display: flex; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent; font-size: 14px; }
.log-row:last-child { border-bottom: 0; }
.log-row.ok { border-left-color: var(--green); }
.log-row.err { border-left-color: var(--red); }
.log-row.warn { border-left-color: var(--orange); }
.log-time { flex: none; width: 48px; display: flex; flex-direction: column; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.log-time small { font-size: 11px; color: var(--muted); font-weight: 500; }
.log-main { display: flex; flex-direction: column; min-width: 0; }
.log-main a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 2px; }
.log-main small { color: var(--muted); font-size: 12px; }

.danger-zone { border-color: #FECACA; }

/* ---------- Import / export ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; border: 1.5px dashed #CBD5E1; border-radius: 12px; color: var(--navy); font-weight: 600; cursor: pointer; background: var(--ivory); }
.dropzone:hover { border-color: var(--gold); }
.export-grid { display: flex; flex-direction: column; }
.export-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.export-row span { flex: 1; font-weight: 500; }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.notice.ok { background: var(--green-soft); color: #14532D; }
.notice.err { background: var(--red-soft); color: var(--red); }

/* ---------- Feuilles modales ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(8, 20, 38, .5); opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 26px 20px calc(var(--safe-b) + 22px);
  border-radius: 22px 22px 0 0; background: var(--paper); transform: translateY(30px); opacity: 0; transition: transform .22s cubic-bezier(.2,.9,.3,1), opacity .2s; }
.sheet-wrap.show .backdrop { opacity: 1; }
.sheet-wrap.show .sheet { transform: none; opacity: 1; }
.sheet h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: 0; text-transform: none; margin: 0 36px 10px 0; }
.sheet-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--gray-soft); color: var(--muted); display: grid; place-items: center; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; padding-bottom: 24px; } }

/* ---------- Notifications ---------- */
#toasts { position: fixed; z-index: 120; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(-8px); transition: all .25s; border-left: 4px solid var(--gold); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-left-color: #4ADE80; }
.toast.err { border-left-color: #F87171; }
.toast.warn { border-left-color: #FB923C; }

@media (max-width: 380px) {
  .grid2 { grid-template-columns: 1fr; }
  .display { font-size: 28px; }
  .r-name { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
