/* Outil « Organiser mon événement » : pages de création, gestion, inscription,
   billet et contrôle des entrées. S'appuie sur satellite.css (jetons --bg,
   --card, --card-2, --hair, --ink, --soft, --muted, --gold, --gold-ink) et sur
   outils-pratiques.css (.sim-field, .sim-switch, .sim-stat, .btn-ghost).
   Noir et blanc d'abord : la couleur ne sert qu'aux indicateurs d'état. */

:root { --evt-ok: #3ccf7a; --evt-warn: #e8b13a; --evt-err: #f07067; --evt-info: #8fb4ff; }
:root[data-theme="light"] { --evt-ok: #137a43; --evt-warn: #8a5a00; --evt-err: #b42318; --evt-info: #1d4ed8; }

.evt-main { display: grid; gap: 18px; }
.evt-main .panel { margin: 0; }
.evt-hidden, [hidden] { display: none !important; }
.evt-muted { color: var(--muted); }
.evt-small { font-size: .84rem; line-height: 1.5; }
.evt-stack { display: grid; gap: 12px; }
.evt-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.evt-row > .sim-field { flex: 1 1 200px; }
.evt-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.evt-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .evt-grid-2, .evt-grid-3 { grid-template-columns: 1fr; } }

.sim-field textarea { min-height: 88px; }
.evt-field-full { grid-column: 1 / -1; }
.evt-req { color: var(--muted); font-weight: 500; font-size: .78rem; }
.sim-field input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; }
.evt-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; color: var(--ink); font-size: .94rem; line-height: 1.4; cursor: pointer; }
.evt-check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ink); }
.evt-check small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* Boutons : 44 px minimum, un seul principal (.is-cta) par écran. */
.evt-main .btn-ghost, .evt-sheet .btn-ghost { min-height: 44px; padding: 10px 14px; display: inline-flex; align-items: center; gap: 8px; justify-content: center; cursor: pointer; font: inherit; font-weight: 700; font-size: .88rem; text-decoration: none; }
.btn-ghost[disabled] { opacity: .5; cursor: not-allowed; }
.evt-link-btn { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--ink); font: inherit; font-weight: 700; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-danger { color: var(--evt-err) !important; border-color: color-mix(in srgb, var(--evt-err) 45%, transparent) !important; }
.evt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.evt-actions-end { justify-content: flex-end; }
@media (max-width: 560px) { .evt-actions.is-full > .btn-ghost { flex: 1 1 100%; } }

/* Pastilles d'état : texte + couleur, jamais la couleur seule. */
.evt-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--hair); background: var(--card-2); color: var(--soft); font-size: .78rem; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.evt-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.evt-badge.is-ok { color: var(--evt-ok); border-color: color-mix(in srgb, var(--evt-ok) 40%, transparent); }
.evt-badge.is-warn { color: var(--evt-warn); border-color: color-mix(in srgb, var(--evt-warn) 40%, transparent); }
.evt-badge.is-err { color: var(--evt-err); border-color: color-mix(in srgb, var(--evt-err) 40%, transparent); }
.evt-badge.is-info { color: var(--evt-info); border-color: color-mix(in srgb, var(--evt-info) 40%, transparent); }
.evt-badge.is-plain::before { display: none; }

/* Choix des options */
.evt-templates { display: flex; gap: 8px; flex-wrap: wrap; }
.evt-chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(var(--w), .18); background: var(--card-2); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.evt-chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.evt-chip:focus-visible, .evt-opt:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.evt-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.evt-opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); cursor: pointer; min-height: 64px; }
.evt-opt input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }
.evt-opt b { display: block; color: var(--ink); font-size: .92rem; }
.evt-opt span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; margin-top: 2px; }
.evt-opt.is-on { border-color: rgba(var(--w), .42); }
.evt-opt .evt-free { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--hair); color: var(--soft); font-size: .72rem; font-weight: 700; vertical-align: 1px; }
.evt-note { padding: 10px 12px; border-left: 3px solid rgba(var(--w), .35); background: var(--card-2); border-radius: 0 8px 8px 0; color: var(--soft); font-size: .86rem; line-height: 1.5; }
.evt-note.is-warn { border-left-color: var(--evt-warn); }
.evt-note.is-err { border-left-color: var(--evt-err); }
.evt-note.is-ok { border-left-color: var(--evt-ok); }
.evt-note strong { color: var(--ink); }

/* Sections repliables de la gestion */
.evt-section { border: 1px solid var(--hair); border-radius: 14px; background: var(--card); overflow: clip; }
.evt-section > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; min-height: 56px; }
.evt-section > summary::-webkit-details-marker { display: none; }
.evt-section > summary h2 { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--ink); flex: 1 1 auto; display: flex; gap: 10px; align-items: center; }
.evt-section > summary h2 svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.evt-section > summary .evt-sum { color: var(--muted); font-size: .82rem; font-weight: 600; text-align: right; }
.evt-section > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; flex: none; }
.evt-section[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.evt-section > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.evt-section-body { padding: 4px 18px 20px; display: grid; gap: 14px; }
@media (max-width: 560px) { .evt-section > summary { padding: 14px; } .evt-section-body { padding: 2px 14px 16px; } .evt-section > summary .evt-sum { display: none; } }

/* En-tête de la gestion */
.evt-head { display: grid; gap: 12px; }
.evt-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.evt-head-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--soft); font-size: .92rem; }
.evt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.evt-kpis .sim-stat-value { font-size: 1.35rem; }
.evt-kpis .sim-stat small { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.evt-next { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.evt-next li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); color: var(--ink); font-size: .92rem; }
.evt-next li .btn-ghost { flex: none; }
@media (max-width: 560px) { .evt-next li { flex-direction: column; align-items: stretch; } }

/* Listes (participants, tâches…) */
.evt-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.evt-toolbar input[type="search"], .evt-toolbar select { min-height: 44px; padding: 0 12px; border: 1px solid rgba(var(--w), .18); border-radius: 8px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 16px; }
.evt-toolbar input[type="search"] { flex: 1 1 200px; }
.evt-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.evt-item { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); }
.evt-item-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.evt-item-title { color: var(--ink); font-weight: 700; font-size: .96rem; overflow-wrap: anywhere; }
.evt-item-sub { color: var(--muted); font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.evt-item-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.evt-item details > summary { cursor: pointer; color: var(--soft); font-size: .86rem; font-weight: 700; padding: 8px 0; min-height: 40px; }
.evt-item .evt-actions .btn-ghost { min-height: 40px; padding: 8px 12px; font-size: .82rem; }
.evt-empty { color: var(--muted); font-size: .9rem; padding: 6px 0; }
.evt-count { font-variant-numeric: tabular-nums; }
.evt-progress { height: 6px; border-radius: 999px; background: rgba(var(--w), .1); overflow: hidden; }
.evt-progress > span { display: block; height: 100%; background: var(--ink); }

/* Feuille modale (formulaires) */
.evt-sheet { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .6); padding: 0; }
.evt-sheet[hidden] { display: none; }
.evt-sheet-box { width: min(100%, 640px); max-height: 92vh; overflow: auto; background: var(--card); border: 1px solid var(--hair); border-radius: 16px 16px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; color: var(--ink); }
@media (min-width: 760px) { .evt-sheet { align-items: center; padding: 20px; } .evt-sheet-box { border-radius: 16px; padding: 24px; } }
.evt-sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.evt-sheet-head h2 { margin: 0; font-size: 1.15rem; }
.evt-close { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--hair); background: transparent; color: var(--ink); font-size: 1.4rem; cursor: pointer; flex: none; }

/* Messages à copier */
.evt-copy { display: grid; gap: 8px; }
.evt-copy textarea { width: 100%; min-height: 130px; padding: 12px; border: 1px solid rgba(var(--w), .18); border-radius: 8px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; box-sizing: border-box; }

/* Toast */
.evt-toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--card); font-weight: 700; font-size: .92rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.evt-toast.is-err { background: var(--evt-err); color: #fff; }

/* Page publique */
.evt-public-hero { display: grid; gap: 14px; }
.evt-public-img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; border: 1px solid var(--hair); background: var(--card-2); }
.evt-facts { display: grid; gap: 0; }
.evt-fact { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-top: 1px solid var(--hair); color: var(--ink); font-size: .96rem; line-height: 1.45; }
.evt-fact svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.evt-fact small { display: block; color: var(--muted); font-size: .82rem; }
.evt-programme { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.evt-programme li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); }
.evt-programme time { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; font-size: .92rem; }
.evt-programme b { color: var(--ink); }
.evt-programme span { display: block; color: var(--muted); font-size: .84rem; }
@media (max-width: 480px) { .evt-programme li { grid-template-columns: 1fr; gap: 2px; } }
.evt-poll { display: grid; gap: 8px; }
.evt-poll-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); }
.evt-poll-row .sim-switch button { min-height: 40px; padding: 0 10px; font-size: .82rem; }
@media (max-width: 520px) { .evt-poll-row { grid-template-columns: 1fr; } }

/* Billets */
.evt-tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.evt-ticket { display: grid; gap: 10px; justify-items: center; padding: 18px 16px; border: 1px solid var(--hair); border-radius: 14px; background: var(--card); text-align: center; break-inside: avoid; }
.evt-ticket .evt-qr { width: min(100%, 240px); aspect-ratio: 1; background: #fff; border-radius: 10px; padding: 8px; box-sizing: border-box; }
.evt-ticket .evt-qr svg { width: 100%; height: 100%; display: block; }
.evt-ticket-name { color: var(--ink); font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.evt-ticket-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.35rem; font-weight: 800; letter-spacing: .18em; color: var(--ink); }
.evt-ticket-event { color: var(--soft); font-size: .86rem; line-height: 1.4; }
.evt-ticket.is-void { opacity: .75; }
.evt-ticket.is-void .evt-qr { display: none; }

/* Contrôle des entrées (téléphone, file d'attente) */
.evt-scan-wrap { position: relative; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--hair); }
.evt-scan-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.evt-scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; pointer-events: none; }
.evt-scan-msg { position: absolute; inset: auto 0 0 0; padding: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .88rem; text-align: center; }
.evt-result { display: grid; gap: 6px; padding: 18px; border-radius: 14px; border: 2px solid var(--hair); background: var(--card-2); text-align: center; }
.evt-result-title { font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 900; line-height: 1.15; color: var(--ink); }
.evt-result-sub { color: var(--soft); font-size: 1rem; line-height: 1.45; }
.evt-result.is-ok { border-color: var(--evt-ok); }
.evt-result.is-ok .evt-result-title { color: var(--evt-ok); }
.evt-result.is-warn { border-color: var(--evt-warn); }
.evt-result.is-warn .evt-result-title { color: var(--evt-warn); }
.evt-result.is-err { border-color: var(--evt-err); }
.evt-result.is-err .evt-result-title { color: var(--evt-err); }
.evt-result .evt-result-icon { font-size: 2.2rem; line-height: 1; font-weight: 900; }
.evt-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.evt-counters .sim-stat { text-align: center; padding: 10px 6px; }
.evt-counters .sim-stat-value { font-size: 1.5rem; margin-top: 2px; }
.evt-big-input { width: 100%; min-height: 56px; padding: 0 14px; border: 1px solid rgba(var(--w), .22); border-radius: 10px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 20px; box-sizing: border-box; }
.evt-big-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 160, 23, .22); }
.evt-search-results .evt-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.evt-search-results .btn-ghost { min-height: 48px; }

/* Impression : liste de secours et billets */
.evt-print-only, body > .evt-print-target { display: none; }
@media print {
  .nav, .official-footer, .breadcrumb, .no-print, .evt-sheet, .evt-toast, .evt-section > summary::after { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .evt-print-only { display: block; }
  body.evt-printing-list > *:not(.evt-print-target) { display: none !important; }
  body.evt-printing-list > .evt-print-target { display: block !important; }
  .evt-print-table { width: 100%; border-collapse: collapse; font: 11pt Arial, sans-serif; color: #000; }
  .evt-print-table th, .evt-print-table td { border: 1px solid #999; padding: 5px 6px; text-align: left; vertical-align: top; }
  .evt-print-table td.box { width: 22px; }
  .evt-ticket { border: 1px solid #999; background: #fff; color: #000; page-break-inside: avoid; }
  .evt-ticket * { color: #000 !important; }
  .evt-tickets { grid-template-columns: repeat(2, 1fr); }
}

/* Récapitulatif de la création : libellé + valeur, sans icône. */
#evt-recap-list .kv-row { grid-template-columns: 76px minmax(0, 1fr); }
#evt-recap-list .kv-value { overflow-wrap: anywhere; }
