/* Evento — feuille de style unique, sans build.
   Palette : docs/identite/LISEZMOI.md (violet = principale, abricot = accent, formes et grands textes). */
:root {
  color-scheme: light dark;
  --bg: #F3F5FE;
  --surface: #ffffff;
  --surface-2: #E4E7F5;
  --text: #161826;
  --muted: #595D6C;
  --border: #D6DAEC;
  --primary: #5D5294;
  --primary-dark: #4A4178;
  --primary-soft: #E6E3F5;
  --on-primary: #ffffff;
  --accent: #B5652F;
  --ok: #2A7048;
  --ok-soft: #E1F2E7;
  --wait: #8A5A00;
  --wait-soft: #FBEFD5;
  --ko: #A8322B;
  --ko-soft: #FBE4E2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 38, .06), 0 2px 8px rgba(22, 24, 38, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161826;
    --surface: #1D1F2C;
    --surface-2: #232532;
    --text: #E9E9ED;
    --muted: #9397AB;
    --border: #2F3242;
    --primary: #9184D9;
    --primary-dark: #A79CE3;
    --primary-soft: #2B2A45;
    --on-primary: #161826;
    --accent: #E8A06E;
    --ok: #6FCF97;
    --ok-soft: #1E3328;
    --wait: #E8C26E;
    --wait-soft: #3A3020;
    --ko: #F08A82;
    --ko-soft: #3D2224;
    --shadow: none;
  }
}
.brand img.logo-sombre { display: none; }
@media (prefers-color-scheme: dark) {
  .brand img.logo-clair { display: none; }
  .brand img.logo-sombre { display: inline; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }

/* En-tête */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 28px; width: auto; display: block; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { color: var(--text); }
.topbar nav a.active { color: var(--primary); font-weight: 500; }
.topbar .user { color: var(--muted); font-size: .9rem; display: flex; gap: .75rem; align-items: center; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: .5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .meta { color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Boutons */
.btn, button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2;
}
.btn:hover, button:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary, button.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover, button.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--ko); border-color: var(--ko-soft); }
.btn-danger:hover { background: var(--ko-soft); }
.btn-sm { padding: .25rem .55rem; font-size: .85rem; }
.btn-link { border: 0; background: none; color: var(--primary); padding: 0; }
.inline { display: inline; margin: 0; }

/* Messages */
.flash { padding: .65rem .9rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--ko-soft); color: var(--ko); }

/* Cartes / grilles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.6rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: .85rem; }
.stat.accent { border-color: var(--primary); border-top: 3px solid var(--accent); }

.event-card { display: block; color: inherit; }
.event-card:hover { text-decoration: none; border-color: var(--primary); }
.event-card h3 { margin-bottom: .2rem; }

/* Badges */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.badge-confirme { background: var(--ok-soft); color: var(--ok); }
.badge-en_attente { background: var(--wait-soft); color: var(--wait); }
.badge-refuse { background: var(--ko-soft); color: var(--ko); }
.badge-neutre { background: var(--surface-2); color: var(--muted); }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 6px; background: var(--surface-2); font-size: .8rem; margin: 0 .2rem .2rem 0; }
.tag-regime { background: var(--wait-soft); color: var(--wait); }

/* Tableaux */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 500; background: var(--surface-2); }
tr:target { background: var(--primary-soft); }
tr.refuse td { opacity: .55; }

/* Filtres */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { padding: .3rem .7rem; border-radius: 999px; color: var(--text); border: 1px solid var(--border); background: var(--surface); font-size: .9rem; }
.tabs a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs a:hover { text-decoration: none; }
.filters form { margin-left: auto; display: flex; gap: .35rem; }

.statut-switch { display: inline-flex; gap: .2rem; }
.statut-switch button { padding: .2rem .45rem; font-size: .78rem; border-radius: 6px; }
.statut-switch button.current { font-weight: 500; }
.statut-switch button.s-confirme.current { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.statut-switch button.s-en_attente.current { background: var(--wait-soft); border-color: var(--wait); color: var(--wait); }
.statut-switch button.s-refuse.current { background: var(--ko-soft); border-color: var(--ko); color: var(--ko); }

/* Formulaires */
form.form { max-width: 720px; }
.form-row, form.form > div { margin-bottom: 1rem; }
label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: .92rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=file] { font: inherit; }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); }
.radio-inline > div, form .choices { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-inline label, .choices label { font-weight: 500; display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
form ul { list-style: none; padding: 0; margin: .25rem 0; color: var(--ko); font-size: .88rem; }
.help { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Lignes de collection (personnes, tarifs) */
.collection-items { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.collection-item { display: grid; gap: .5rem; align-items: end; background: var(--surface-2); padding: .6rem; border-radius: 8px; }
.collection-item > div { margin: 0; }
.collection-item label { font-size: .8rem; }
.collection-personnes .collection-item { grid-template-columns: 1fr 160px 1.3fr auto; }
.collection-tarifs .collection-item { grid-template-columns: 1fr 1fr auto; }
@media (max-width: 640px) {
  .collection-personnes .collection-item, .collection-tarifs .collection-item { grid-template-columns: 1fr; }
}

.danger-zone { margin-top: 3rem; border: 1px solid var(--ko-soft); border-radius: var(--radius); padding: 1rem; background: var(--surface); }
.danger-zone h2 { margin-top: 0; color: var(--ko); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: .4rem; }
.progress > span { display: block; height: 100%; background: var(--ok); }

.login { max-width: 380px; margin: 8vh auto; }
.login .brand { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.login .brand img { height: 56px; }
