/* Main courante — ELIF · SOCADEM — v1.0 (même charte que le Planning des équipes) */
@font-face { font-family: 'Open Sans'; font-weight: 400; font-display: swap; src: url('fonts/open-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 600; font-display: swap; src: url('fonts/open-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 700; font-display: swap; src: url('fonts/open-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 800; font-display: swap; src: url('fonts/open-sans-latin-800-normal.woff2') format('woff2'); }

:root {
  --vert: #00AB4E;
  --vert-action: #007A38;
  --vert-action-fonce: #005C2A;
  --vert-texte: #0B6B35;
  --vert-doux: #E6F4EC;
  --encre: #0E1B14;
  --encre-2: #3E4F46;
  --encre-3: #5E6E66;
  --encre-4: #6B7B73;
  --ligne: #E4EAE6;
  --ligne-2: #EEF1EE;
  --champ: #CFD8D2;
  --fond: #F7F6F2;
  --blanc: #FFFFFF;
  --rouge: #B3261E;
  --rouge-doux: #FDF1F0;
  --rouge-bord: #F1C7C3;
  --ombre: 0 1px 2px rgba(14,27,20,.04), 0 10px 30px rgba(14,27,20,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--fond); color: var(--encre); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea { font-family: inherit; color: inherit; font-size: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--vert-action); outline-offset: 2px; }
[hidden] { display: none !important; }

.liseret { height: 4px; background: var(--vert); }
.barre { height: 84px; padding: 0 32px; background: var(--blanc); border-bottom: 1px solid var(--ligne); display: flex; align-items: center; gap: 24px; }
.logo { height: 50px; width: auto; display: block; }
.sep { width: 1px; height: 40px; background: var(--ligne); }
.titres { flex: 1; min-width: 0; }
.titres h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.sous-titre { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--encre-3); }

.page { max-width: 1040px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 18px; }
.carte { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 18px; box-shadow: var(--ombre); }

/* ---------- Saisie ---------- */
.saisie { padding: 22px 24px; }
.saisie h2 { margin: 0 0 14px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
#formEvenement { display: flex; flex-direction: column; gap: 14px; }
.ligne-champs { display: grid; grid-template-columns: 170px 130px minmax(0, 1fr); gap: 14px; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ > span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); }
.champ input, .champ textarea { height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--champ); background: var(--blanc); font-size: 15px; width: 100%; }
.champ textarea { height: auto; min-height: 86px; padding: 11px 14px; line-height: 1.5; resize: vertical; }
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--vert-action); outline-offset: 1px; border-color: var(--vert-action); }
.champ.erreur input, .champ.erreur textarea { border-color: var(--rouge); }
.pied-saisie { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.aide { flex: 1; text-align: right; font-size: 12px; color: var(--encre-4); }

.bascule { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; cursor: pointer; position: relative; }
.bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.piste { width: 42px; height: 24px; border-radius: 100px; background: #C6CEC9; position: relative; flex-shrink: 0; transition: background .15s; }
.piste::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.bascule input:checked + .piste { background: var(--rouge); }
.bascule input:checked + .piste::after { left: 21px; }
.bascule input:focus-visible + .piste { outline: 2px solid var(--vert-action); outline-offset: 2px; }

.btn { height: 44px; padding: 0 20px; border-radius: 12px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background .15s; }
.btn-plein { background: var(--vert-action); color: #fff; border: none; }
.btn-plein:hover { background: var(--vert-action-fonce); }
.btn-plein:disabled { opacity: .6; cursor: wait; }
.btn-contour { background: var(--blanc); border: 1.5px solid var(--champ); }
.btn-contour:hover { background: #F0F4F1; }

/* ---------- Outils ---------- */
.outils { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filtres { display: flex; gap: 4px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 14px; padding: 4px; }
.filtres button { height: 38px; padding: 0 14px; border: none; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.filtres button:hover { background: var(--vert-doux); }
.filtres button.actif { background: var(--vert-action); color: #fff; }
.nb { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 100px; background: #EEF1EE; color: var(--encre-2); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.filtres button.actif .nb { background: rgba(255,255,255,.22); color: #fff; }
.filtres button[data-filtre="importants"] .nb.plein { background: var(--rouge-doux); color: var(--rouge); }
.filtres button[data-filtre="nonlus"] .nb.plein { background: var(--vert-doux); color: var(--vert-texte); }
.recherche { flex: 1; min-width: 220px; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 14px; color: var(--encre-3); }
.recherche input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 15px; color: var(--encre); }
.recherche:focus-within { outline: 2px solid var(--vert-action); outline-offset: 1px; }

/* ---------- Liste ---------- */
#liste { display: flex; flex-direction: column; gap: 10px; }
.jour { margin: 12px 4px 2px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); display: flex; align-items: center; gap: 10px; }
.jour::after { content: ''; flex: 1; height: 1px; background: var(--ligne); }
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; padding: 16px 18px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; transition: box-shadow .15s; }
.ev:hover { box-shadow: var(--ombre); }
.ev.important { background: var(--rouge-doux); border-color: var(--rouge-bord); }
.ev .heure { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ev .point { width: 9px; height: 9px; border-radius: 50%; background: var(--vert); }
.ev.lu .point { display: none; }
.ev .corps { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ev .qui { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pastille { padding: 2px 9px; border-radius: 100px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; }
.pastille.imp { background: var(--rouge); color: #fff; }
.pastille.nouveau { background: var(--vert-doux); color: var(--vert-texte); }
.pastille.lu { background: #EEF1EE; color: var(--encre-3); font-weight: 700; }
.ev .texte { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.ev.lu .texte { color: var(--encre-2); }
.ev .actions { display: flex; align-items: flex-start; gap: 6px; }
.act { height: 38px; border-radius: 10px; border: 1.5px solid var(--ligne); background: var(--blanc); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--encre-2); transition: background .15s, border-color .15s; }
.act.icone { width: 38px; padding: 0; }
.act:hover { background: #F0F4F1; }
.act.lire[aria-pressed="true"] { background: var(--vert-doux); border-color: #BFE3CD; color: var(--vert-texte); }
.act.drapeau[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.act.drapeau[aria-pressed="true"] svg { fill: currentColor; }
.act.corbeille:hover { background: #FBEDEC; border-color: var(--rouge-bord); color: var(--rouge); }
.vide { padding: 48px 24px; text-align: center; color: var(--encre-3); background: var(--blanc); border: 1px dashed var(--champ); border-radius: 16px; }
.vide strong { display: block; color: var(--encre); font-size: 16px; margin-bottom: 4px; }
.plus { display: flex; justify-content: center; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--encre); color: #fff; padding: 10px 10px 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); min-height: 44px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.erreur { background: var(--rouge); }
.toast button { height: 32px; padding: 0 12px; border-radius: 8px; border: none; background: rgba(255,255,255,.18); color: #fff; font-weight: 800; }
.toast button:hover { background: rgba(255,255,255,.3); }

@media (max-width: 760px) {
  .barre { height: auto; min-height: 64px; padding: 10px 14px; gap: 12px; }
  .logo { height: 34px; }
  .sep { display: none; }
  .titres h1 { font-size: 17px; }
  .sous-titre { font-size: 10.5px; }
  .page { padding: 14px 12px 32px; gap: 14px; }
  .saisie { padding: 18px 16px; }
  .ligne-champs { grid-template-columns: 1fr 1fr; }
  .ligne-champs .large { grid-column: 1 / -1; }
  .aide { display: none; }
  .pied-saisie .btn { width: 100%; justify-content: center; }
  .filtres { width: 100%; overflow-x: auto; }
  .filtres button { padding: 0 10px; flex-shrink: 0; }
  .ev { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .ev .heure { flex-direction: row; align-items: center; }
  .ev .actions { justify-content: flex-end; }
}
