/* Gestion des membres et des finances — mode clair professionnel */
:root {
  --vert: #0f5132; --vert-2: #157347; --vert-clair: #e8f3ee; --or: #c9a227;
  --fond: #f3f5f8; --carte: #fff; --texte: #1f2937; --doux: #6b7280; --bord: #e5e7eb;
  --rouge: #dc2626; --rouge-clair: #fdecec; --orange: #d97706; --orange-clair: #fef3e2;
  --bleu: #2563eb; --bleu-clair: #e8effd; --violet: #7c3aed; --violet-clair: #f1ebfe;
  --rayon: 14px; --ombre: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --menu: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fond); color: var(--texte); }
a { color: var(--vert-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: .95rem; margin: 0 0 .6rem; }
.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; flex: none; vertical-align: -3px; }
.doux, .muted { color: var(--doux); }
.petit { font-size: .85rem; }
.droite { text-align: right; }
.nowrap { white-space: nowrap; }
.montant { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.vert { color: var(--vert-2); } .rouge { color: var(--rouge); } .orange { color: var(--orange); }

/* ---------- menu latéral ---------- */
.menu { position: fixed; inset: 0 auto 0 0; width: var(--menu); background: #fff; border-right: 1px solid var(--bord);
  display: flex; flex-direction: column; z-index: 40; transition: width .2s, transform .2s; }
.menu-tete { display: flex; align-items: center; gap: .7rem; padding: 1rem 1rem .8rem; min-height: 68px; }
.menu-tete img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: none; }
.menu-tete b { font-size: .92rem; line-height: 1.2; display: block; }
.menu-tete small { color: var(--doux); font-size: .75rem; }
.menu nav { flex: 1; overflow-y: auto; padding: .3rem .7rem 1rem; }
.menu .groupe { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af;
  margin: 1rem .6rem .3rem; white-space: nowrap; }
.menu nav a { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px;
  color: #374151; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.menu nav a:hover { background: var(--fond); text-decoration: none; }
.menu nav a.actif { background: var(--vert-clair); color: var(--vert); }
.menu nav a .compte { margin-left: auto; background: var(--rouge); color: #fff; font-size: .7rem; border-radius: 99px;
  padding: 0 .45rem; line-height: 1.4rem; }
.menu-pied { border-top: 1px solid var(--bord); padding: .7rem; }
.menu-pied .qui { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem .6rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--vert); color: #fff; display: grid;
  place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.menu-pied .qui div { min-width: 0; }
.menu-pied .qui b, .menu-pied .qui small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-pied .qui small { color: var(--doux); font-size: .75rem; }
.menu-pied form, .menu-pied a { margin: 0; }
.menu-pied .lien { display: flex; gap: .6rem; align-items: center; width: 100%; padding: .45rem .7rem; border-radius: 10px;
  background: none; border: 0; font: inherit; font-size: .9rem; color: #374151; cursor: pointer; }
.menu-pied .lien:hover { background: var(--fond); text-decoration: none; }

body.replie { --menu: 72px; }
body.replie .menu .groupe, body.replie .menu nav a span, body.replie .menu-tete div, body.replie .menu-pied .qui div,
body.replie .menu-pied .lien span, body.replie .menu nav a .compte { display: none; }
body.replie .menu nav a, body.replie .menu-pied .lien { justify-content: center; }
body.replie .menu-tete { justify-content: center; padding: 1rem .5rem; }

.principal { margin-left: var(--menu); min-height: 100vh; transition: margin .2s; display: flex; flex-direction: column; }
.barre { position: sticky; top: 0; z-index: 30; background: rgba(243,245,248,.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: .8rem; padding: .8rem 1.6rem; border-bottom: 1px solid transparent; }
.barre .bouton-menu { background: #fff; border: 1px solid var(--bord); border-radius: 10px; width: 38px; height: 38px;
  display: grid; place-items: center; cursor: pointer; color: #374151; flex: none; }
.barre .titre { flex: 1; min-width: 0; }
.barre .titre small { display: block; color: var(--doux); font-size: .8rem; }
.barre .actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
main { padding: .6rem 1.6rem 2.5rem; flex: 1; width: 100%; max-width: 1400px; }
.voile { display: none; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid var(--vert); background: var(--vert); color: #fff; font: inherit;
  font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; line-height: 1.25; }
.btn:hover { background: var(--vert-2); text-decoration: none; }
.btn.secondaire { background: #fff; color: #374151; border-color: var(--bord); }
.btn.secondaire:hover { background: var(--fond); }
.btn.danger { background: #fff; color: var(--rouge); border-color: #f3c4c4; }
.btn.danger:hover { background: var(--rouge-clair); }
.btn.petit { padding: .35rem .65rem; font-size: .82rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.boutons { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- cartes et grilles ---------- */
.bloc { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; min-width: 0; }
.bloc-tete { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.bloc-tete h2 { margin: 0; }
.grille { display: grid; gap: 1.2rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: flex-start; color: inherit; }
a.stat:hover { text-decoration: none; border-color: #cfd6de; }
.stat .pastille { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--vert-clair); color: var(--vert); }
.stat .pastille .i { width: 21px; height: 21px; }
.stat small { display: block; color: var(--doux); font-size: .8rem; font-weight: 500; }
.stat b { display: block; font-size: 1.35rem; letter-spacing: -.01em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: .78rem; color: var(--doux); }
.stat.bleu .pastille { background: var(--bleu-clair); color: var(--bleu); }
.stat.rouge .pastille { background: var(--rouge-clair); color: var(--rouge); }
.stat.orange .pastille { background: var(--orange-clair); color: var(--orange); }
.stat.violet .pastille { background: var(--violet-clair); color: var(--violet); }
.stat.or .pastille { background: #fbf4dc; color: #9a7b12; }

/* ---------- tableaux ---------- */
.tableau-defile { overflow-x: auto; margin: 0 -1.3rem; padding: 0 1.3rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux);
  font-weight: 600; padding: .55rem .6rem; border-bottom: 1px solid var(--bord); white-space: nowrap; background: #fafbfc; }
td { padding: .6rem; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
tr.annulee td { color: #9ca3af; }
tr.annulee td.montant { text-decoration: line-through; }
tfoot td { font-weight: 700; border-top: 2px solid var(--bord); background: var(--vert-clair); }
.vignette { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #eef1f4; display: inline-grid;
  place-items: center; font-size: .75rem; font-weight: 700; color: #6b7280; vertical-align: middle; flex: none; }
.nom-membre { display: flex; align-items: center; gap: .6rem; }
.nom-membre b { display: block; }
.nom-membre small { color: var(--doux); }
.vide { text-align: center; color: var(--doux); padding: 2rem 1rem; }

/* ---------- étiquettes ---------- */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600;
  white-space: nowrap; background: #eef1f4; color: #374151; }
.badge.ok, .badge.actif, .badge.validee, .badge.valide { background: #dcf3e6; color: #11633a; }
.badge.ko, .badge.suspendu, .badge.annulee, .badge.expiree, .badge.annule { background: var(--rouge-clair); color: #b42318; }
.badge.attention, .badge.inactif, .badge.bientot { background: var(--orange-clair); color: #a15c07; }
.badge.info, .badge.remplacee { background: var(--bleu-clair); color: #1d4ed8; }

/* ---------- formulaires ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filtres label { font-size: .78rem; color: var(--doux); font-weight: 600; display: flex; flex-direction: column; gap: .2rem; }
.filtres .recherche { flex: 1 1 220px; }
input, select, textarea { font: inherit; font-size: .92rem; padding: .55rem .7rem; border: 1px solid #d5dae1;
  border-radius: 10px; background: #fff; color: var(--texte); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(21,115,71,.25); border-color: var(--vert-2); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--vert); transform: scale(1.15); }
input[type=color] { padding: .2rem; height: 40px; width: 70px; }
input[type=file] { padding: .4rem; }
.filtres input, .filtres select { width: auto; min-width: 120px; }
.filtres .recherche input { width: 100%; }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem 1.1rem; }
.champ label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: #374151; }
.champ.large { grid-column: 1 / -1; }
.champ .aide { font-size: .78rem; color: var(--doux); margin-top: .25rem; }
.champ .erreur, .erreurs { color: var(--rouge); font-size: .82rem; margin-top: .25rem; }
.erreurs { background: var(--rouge-clair); padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; }
.champ.case label { display: flex; gap: .55rem; align-items: center; font-weight: 600; margin-top: 1.6rem; cursor: pointer; }
.champ.invalide input, .champ.invalide select { border-color: var(--rouge); }
.form-pied { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
fieldset { border: 1px solid var(--bord); border-radius: 12px; padding: 1rem 1.1rem 1.1rem; margin: 1.2rem 0 0; }
legend { font-weight: 700; padding: 0 .4rem; font-size: .92rem; }
.recherche-select { margin-bottom: .35rem; }

/* ---------- messages ---------- */
.messages { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem;
  max-width: min(420px, calc(100vw - 2rem)); }
.message { background: #fff; border: 1px solid var(--bord); border-left: 4px solid var(--vert-2); border-radius: 12px;
  padding: .8rem 2.2rem .8rem 1rem; box-shadow: 0 10px 25px rgba(0,0,0,.12); font-size: .9rem; position: relative;
  animation: arrivee .25s ease-out; }
.message.erreur { border-left-color: var(--rouge); }
.message.attention { border-left-color: var(--orange); }
.message.info { border-left-color: var(--bleu); }
.message button { position: absolute; top: .45rem; right: .5rem; background: none; border: 0; font-size: 1.2rem;
  cursor: pointer; color: var(--doux); }
@keyframes arrivee { from { opacity: 0; transform: translateY(-8px); } }
.note { background: var(--bleu-clair); color: #1e3a8a; border-radius: 10px; padding: .7rem .9rem; font-size: .88rem; margin-bottom: 1rem; }
.note.attention { background: var(--orange-clair); color: #7c4a03; }
.note.danger { background: var(--rouge-clair); color: #8a1c13; }

/* ---------- divers ---------- */
.pagination { display: flex; gap: .4rem; justify-content: center; align-items: center; margin-top: 1rem; font-size: .88rem; }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0;
  border-bottom: 1px solid #f0f2f5; }
.liste-simple li:last-child { border-bottom: 0; }
.fiche { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.4rem; }
.fiche-photo { width: 150px; height: 185px; object-fit: cover; border-radius: 12px; background: #eef1f4; display: grid;
  place-items: center; font-size: 2.4rem; font-weight: 700; color: #9ca3af; }
.infos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem 1.2rem; margin: 0; }
.infos dt { font-size: .75rem; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.infos dd { margin: .1rem 0 0; font-weight: 500; }
.grille-mois { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.grille-mois div { border-radius: 10px; padding: .45rem .3rem; text-align: center; font-size: .8rem; background: #f3f4f6; color: var(--doux); }
.grille-mois div.paye { background: #dcf3e6; color: #11633a; font-weight: 600; }
.grille-mois div b { display: block; font-size: .72rem; }
.onglets { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.onglets a { padding: .4rem .85rem; border-radius: 99px; background: #fff; border: 1px solid var(--bord); color: #374151;
  font-size: .85rem; font-weight: 600; }
.onglets a.actif { background: var(--vert); border-color: var(--vert); color: #fff; }
.onglets a:hover { text-decoration: none; }
.graph { position: relative; height: 280px; }
.resume-ligne { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed var(--bord); gap: 1rem; }
.resume-ligne:last-child { border-bottom: 0; }
.resume-ligne.total { font-weight: 700; border-top: 2px solid var(--bord); border-bottom: 0; margin-top: .3rem; padding-top: .6rem; }
details summary { cursor: pointer; font-weight: 600; }

/* aperçu de la carte de membre (85,60 × 53,98 mm) */
.apercu-cartes { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.carte-pvc { width: 342px; aspect-ratio: 85.6 / 53.98; border-radius: 14px; background: #fff; position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,23,42,.16); border: 1px solid #e5e7eb; font-size: 11px; color: #111827; flex: none; }
.carte-pvc .bandeau { height: 24%; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #fff;
  border-bottom: 3px solid var(--c2); background: var(--c1); }
.carte-pvc .bandeau img { width: 36px; height: 36px; object-fit: contain; }
.carte-pvc .bandeau b { display: block; font-size: 12px; line-height: 1.1; }
.carte-pvc .bandeau small { color: var(--c2); font-weight: 700; font-size: 9.5px; letter-spacing: .05em; }
.carte-pvc .corps { display: flex; gap: 10px; padding: 9px 12px; }
.carte-pvc .photo { width: 80px; height: 100px; object-fit: cover; border: 1.5px solid var(--c1); background: #eef1f4;
  display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #8a94a3; flex: none; }
.carte-pvc .textes { flex: 1; min-width: 0; }
.carte-pvc .textes .nom { font-weight: 800; font-size: 13px; line-height: 1.15; margin-bottom: 4px; }
.carte-pvc .textes dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 6px; font-size: 9.5px; }
.carte-pvc .textes dt { color: #6b7280; text-transform: uppercase; font-size: 8px; padding-top: 1px; }
.carte-pvc .textes dd { margin: 0; font-weight: 700; }
.carte-pvc .qr { position: absolute; right: 11px; bottom: 13px; width: 64px; height: 64px; background: #fff; }
.carte-pvc .pied { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--c1); }
.carte-pvc .tampon { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(204,26,26,.8);
  font-weight: 900; font-size: 34px; transform: rotate(-20deg); pointer-events: none; letter-spacing: .05em; }
.carte-pvc.verso .bandeau { height: 17%; justify-content: center; }
.carte-pvc.verso .texte { padding: 8px 14px; font-size: 9.5px; color: #374151; white-space: pre-line; max-width: 72%; }

/* page publique de vérification */
.verif { max-width: 440px; margin: 2rem auto; padding: 0 1rem; }
.verif .etat { border-radius: var(--rayon); padding: 1.2rem; text-align: center; color: #fff; font-weight: 800; font-size: 1.3rem; }
.verif .etat.ok { background: #16a34a; } .verif .etat.ko { background: #dc2626; }

/* connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(circle at 20% 10%, #e3f1ea, transparent 50%), radial-gradient(circle at 80% 90%, #f5ecd2, transparent 45%), var(--fond); }
.auth-boite { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; box-shadow: 0 20px 50px rgba(15,23,42,.12);
  padding: 2rem 1.8rem; border: 1px solid var(--bord); }
.auth-boite img { width: 76px; height: 76px; object-fit: contain; display: block; margin: 0 auto .8rem; }
.auth-boite h1 { text-align: center; font-size: 1.3rem; }
.auth-boite p.doux { text-align: center; margin: .3rem 0 1.4rem; }
.auth-boite .champ { margin-bottom: .9rem; }
.auth-boite .btn { width: 100%; padding: .75rem; margin-top: .4rem; }

/* ---------- téléphone et tablette ---------- */
@media (max-width: 1100px) { .g3 { grid-template-columns: 1fr 1fr; } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  body, body.replie { --menu: 0px; }
  .menu { width: 270px; transform: translateX(-100%); box-shadow: none; }
  body.menu-ouvert .menu { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.menu-ouvert .voile { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 35; }
  body.replie .menu .groupe, body.replie .menu nav a span, body.replie .menu-tete div, body.replie .menu-pied .qui div,
  body.replie .menu-pied .lien span { display: initial; }
  body.replie .menu nav a { justify-content: flex-start; }
  .barre { padding: .7rem 1rem; }
  .barre h1 { font-size: 1.15rem; }
  main { padding: .4rem 1rem 2rem; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .stat { padding: .8rem; gap: .6rem; flex-direction: column; }
  .stat b { font-size: 1.1rem; }
  .bloc { padding: 1rem; }
  .tableau-defile { margin: 0 -1rem; padding: 0 1rem; }
  .fiche { grid-template-columns: 1fr; }
  .fiche-photo { width: 120px; height: 150px; }
  .cacher-mobile { display: none; }
  .barre .actions .btn span { display: none; }
  .carte-pvc { width: 100%; max-width: 342px; }
  .grille-mois { grid-template-columns: repeat(4, 1fr); }
}
@media print {
  .menu, .barre .actions, .barre .bouton-menu, .filtres, .form-pied, .messages, .pagination, .pas-imprimer { display: none !important; }
  .principal { margin: 0; } body { background: #fff; } .bloc { box-shadow: none; break-inside: avoid; }
}
