/* Suivi CLF — handoff Claude Design (maquettes 2a-2e)
   Cartes blanches sur fond crème ; vert + or réservés aux chiffres, jauges, liserés, boutons.
   Signature typographique : IBM Plex Serif 700 pour les chiffres clés. Flat strict. */
:root {
  --vert-fonce: #0e4a3a;
  --vert:       #14614c;
  --or:         #b07c1a;
  --or-pale:    #e6c98a;
  --fond:       #f6f4ef;
  --carte:      #ffffff;
  --bord:       #e9e6de;
  --bord-champ: #e0ddd4;
  --champ-fond: #fdfcf9;
  --piste:      #eceae2;
  --encre:      #212b27;
  --encre-2:    #68716c;
  --encre-3:    #8a938e;
  --avatar-fond:#eaf1ed;
  --jaune-fond: #fff9e6;
  --jaune-bord: #eadfa8;
  --jaune-texte:#6b5310;
  --wa:         #1d7a4f;
  --wa-fond:    #e6f4ec;
  --serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); background: var(--fond); color: var(--encre); font-size: 15px; line-height: 1.5; padding-bottom: 90px; }
a { color: var(--vert); text-decoration: none; }

/* ---------- en-tête ---------- */
header.top { background: var(--carte); border-bottom: 1px solid var(--bord); padding: 14px 18px 12px; }
header.top .hd { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
header.top img.logo-m { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }
header.top .titre { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--vert-fonce); }
header.top .moi { font-size: 12px; font-weight: 500; color: var(--encre-2); }
header.top .avatar-moi { margin-left: auto; width: 32px; height: 32px; border-radius: 50%;
  background: var(--avatar-fond); color: var(--vert-fonce); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: 0 0 auto; }

/* ---------- navigation ---------- */
nav.onglets { display: flex; background: var(--carte); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; }
nav.onglets .marque { display: none; }
nav.onglets a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--encre-3); padding: 8px 4px 9px; font-size: 10.5px; font-weight: 600; }
nav.onglets a svg { width: 21px; height: 21px; stroke: currentColor; }
nav.onglets a.actif { color: var(--vert-fonce); font-weight: 700; }
@media (max-width: 720px) {
  nav.onglets { position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    border-bottom: 0; border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 6px rgba(0,0,0,.04); }
  .lib-lg { display: none; }
}
@media (min-width: 721px) {
  body { padding-bottom: 20px; }
  nav.onglets { justify-content: flex-start; padding: 0 calc(50% - 450px); }
  nav.onglets a { flex: 0 0 auto; flex-direction: row; gap: 8px; font-size: 14px; padding: 12px 18px; }
  nav.onglets a.actif { box-shadow: inset 0 -2px 0 var(--vert); }
  .lib-sm { display: none; }
}
@media (min-width: 721px) and (max-width: 930px) { nav.onglets { padding: 0 14px; } }

main { padding: 16px 14px; max-width: 900px; margin: 0 auto; width: 100%; }

/* ---------- blocs ---------- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.carte h2 { font-size: 12px; margin-bottom: 12px; color: var(--encre-2); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.flash { background: var(--wa-fond); border: 1px solid #cfe2d9; color: var(--vert-fonce); border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }

details.carte { padding: 0; }
details.carte > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 700; color: var(--encre); min-height: 44px; }
details.carte > summary::-webkit-details-marker { display: none; }
details.carte > summary::after { content: "›"; margin-left: auto; font-size: 19px; color: var(--encre-2); transform: rotate(90deg); transition: transform .15s; }
details.carte[open] > summary::after { transform: rotate(-90deg); }
details.carte > .contenu { padding: 0 16px 14px; }
.somme { color: var(--encre-2); font-weight: 500; font-size: 12.5px; }

/* ---------- carte Collecte : montant serif + jauge à deux segments ---------- */
.hero { background: var(--carte); border: 1px solid var(--bord); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.hero .surtitre { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--encre-2);
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hero .surtitre .somme { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hero .montant { font-family: var(--serif); font-size: 40px; font-weight: 700; line-height: 1.2; margin: 4px 0 0; color: var(--vert-fonce); }
.hero .montant small { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--encre-2); }
.hero .detail { font-size: 13px; color: var(--encre-2); }
.jauge-collecte { display: flex; background: var(--piste); border-radius: 999px; height: 10px; overflow: hidden; margin: 12px 0 8px; }
.jauge-collecte .seg-recu { background: var(--vert); height: 100%; }
.jauge-collecte .seg-promis { background: var(--or-pale); height: 100%; }
.legende { display: flex; gap: 16px; font-size: 12px; color: var(--encre-2); }
.legende span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.legende .leg-recu::before { background: var(--vert); }
.legende .leg-promis::before { background: var(--or-pale); }

/* ---------- carte Progression ---------- */
.prog-ligne { margin-bottom: 12px; }
.prog-ligne:last-child { margin-bottom: 2px; }
.prog-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.prog-tete b { font-weight: 600; color: var(--encre); }
.prog-tete span { color: var(--encre-2); font-size: 12.5px; }
.jauge-plate { display: block; background: var(--piste); border-radius: 999px; height: 7px; overflow: hidden; }
.jauge-plate .j-vert { background: var(--vert); height: 100%; border-radius: 999px; min-width: 5px; }
.jauge-plate .j-or { background: var(--or); height: 100%; border-radius: 999px; min-width: 5px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { border-radius: 16px; padding: 13px 14px; background: var(--carte); border: 1px solid var(--bord); display: block; color: inherit; }
.kpi .val { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--encre); }
.kpi .lib { font-size: 11.5px; color: var(--encre-2); margin-top: 1px; font-weight: 600; }
.kpi.plein-vert .val { color: var(--vert); }
.kpi.plein-or .val { color: var(--or); }
a.kpi:hover { border-color: var(--vert); }

/* ---------- entonnoir en barres horizontales ---------- */
.barres .barre { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: inherit; }
.barres .barre:last-child { margin-bottom: 0; }
.barres .b-lib { width: 96px; flex: 0 0 96px; font-size: 12.5px; color: var(--encre-2); }
.barres .b-piste { flex: 1; background: var(--piste); border-radius: 5px; height: 20px; overflow: hidden; }
.barres .b-rempli { height: 100%; border-radius: 5px; min-width: 3px; }
.barres .b-n { flex: 0 0 34px; text-align: right; font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--encre); }
.barres .c1 { background: #dcd9cf; }
.barres .c2 { background: #9fbfb2; }
.barres .c3 { background: #5c907e; }
.barres .c4 { background: #d7b465; }
.barres .c5 { background: var(--or); }
a.barre:hover .b-lib { color: var(--vert-fonce); }

/* ---------- équipe : avatars à initiales ---------- */
.membre-ligne { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.membre-ligne:last-child { margin-bottom: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--avatar-fond); color: var(--vert-fonce);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.membre-ligne .m-nom { font-weight: 600; font-size: 14px; }
.membre-ligne .m-sous { font-size: 12px; color: var(--encre-2); }
.membre-ligne .m-mad { margin-left: auto; font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--vert-fonce); }

/* ---------- listes / historique ---------- */
.ligne-contact { display: block; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 11px 14px; margin-bottom: 7px; color: var(--encre); }
.ligne-contact .nom { font-weight: 600; font-size: 14.5px; }
.ligne-contact .sous { font-size: 12.5px; color: var(--encre-2); margin-top: 1px; }
.ligne-contact:hover { border-color: var(--vert); }
.lc-flex { display: flex; align-items: center; gap: 10px; padding: 0; }
.lc-corps { flex: 1; display: block; color: inherit; padding: 11px 0 11px 14px; min-width: 0; }
.lc-mad { flex: 0 0 auto; font-family: var(--serif); font-weight: 700; font-size: 16px; margin-right: 14px; }
.lc-mad.recu { color: var(--vert-fonce); }
.lc-mad.promis { color: var(--or); }

.wa-btn { flex: 0 0 auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--wa-fond); color: var(--wa); margin-right: 10px; }
.wa-btn svg { width: 22px; height: 22px; }
.wa-btn:hover { background: #d3ecdf; }
.btn.wa-grand { display: block; text-align: center; margin-top: 12px; background: var(--wa); color: #fff; min-height: 48px; }
.btn.wa-grand:hover { background: #15613d; }

a.hist { display: block; color: inherit; }
.hist { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; margin-bottom: 7px; font-size: 13.5px; }
.hist .quand { color: var(--encre-2); font-size: 12px; margin-top: 1px; }
a.hist-lien:hover { border-color: var(--vert); }
.hist-or { border-left: 3px solid var(--or); }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: 1px; margin-left: 5px; }
.b-non { background: #f0f0ec; color: var(--encre-2); }
.b-contact { background: #e9eff6; color: #2f5a83; }
.b-repondu { background: #f6efdd; color: #7d5c0e; }
.b-promesse { background: #f6efdd; color: #7d5c0e; }
.b-recu { background: #e6f1ec; color: var(--vert); }
.b-p1 { background: #e6f1ec; color: var(--vert); }
.b-p2 { background: #f6efdd; color: #7d5c0e; }
.b-p3 { background: #f0f0ec; color: var(--encre-2); }

/* lignes jaunes de l'Excel — palette RÉSERVÉE */
.b-alire { background: var(--jaune-fond); border: 1px solid var(--jaune-bord); color: var(--jaune-texte); }
.commentaire-note { margin-top: 6px; background: var(--jaune-fond); border: 1px solid var(--jaune-bord); border-radius: 10px;
  padding: 6px 10px; font-size: 12.5px; color: var(--jaune-texte); }
.bloc-alire { background: var(--jaune-fond); border: 1px solid var(--jaune-bord); border-radius: 12px; padding: 12px 15px;
  margin-bottom: 12px; font-size: 14px; color: var(--jaune-texte); }
.bloc-alire-titre { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }

/* paliers contacts */
details.palier { margin-bottom: 10px; }
details.palier > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid #b9bfba;
  border-radius: 12px; padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--encre); min-height: 44px; }
details.palier > summary::-webkit-details-marker { display: none; }
details.palier > summary .palier-nb { margin-left: auto; color: var(--encre-2); font-size: 13px; font-weight: 600; }
details.palier > summary::after { content: "›"; font-size: 18px; color: var(--encre-2); transform: rotate(90deg); transition: transform .15s; }
details.palier[open] > summary::after { transform: rotate(-90deg); }
details.palier > .palier-liste { padding-top: 8px; }
details.palier.palier-vert > summary { border-left-color: var(--vert); }
details.palier.palier-or > summary { border-left-color: var(--or); }

/* ---------- formulaires ---------- */
form.filtre { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  border: 1px solid var(--bord-champ); border-radius: 11px; padding: 11px 13px; background: var(--champ-fond); color: var(--encre); width: 100%;
}
input::placeholder { color: var(--encre-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vert); outline-offset: 0; border-color: var(--vert); }
form.filtre input[type="search"] { flex: 2 1 170px; background: var(--carte); }
form.filtre select { width: auto; flex: 1 1 120px; border-radius: 999px; padding: 8px 13px; background: var(--carte); }
form.filtre button { border-radius: 999px; padding: 7px 18px; min-height: 42px; }
.champ { margin-bottom: 12px; }
.champ label { display: block; font-size: 12px; color: var(--encre-2); margin-bottom: 4px; font-weight: 600; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grille2 { grid-template-columns: 1fr; } }

button, .btn { background: var(--vert); color: #fff; border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 600; cursor: pointer; min-height: 44px; }
button:hover, .btn:hover { background: var(--vert-fonce); }
button.discret, .btn.discret { background: var(--carte); color: var(--vert); border: 1px solid var(--vert); }
button.discret:hover, .btn.discret:hover { background: var(--wa-fond); }
.btn-mini { padding: 6px 12px; font-size: 13px; border-radius: 9px; min-height: 36px; }
.btn { display: inline-block; }

.deux-boutons { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.deux-boutons > * { flex: 1 1 150px; text-align: center; }
.deux-boutons button { background: var(--carte); color: var(--vert); border: 1px solid var(--vert); }
.deux-boutons button:hover { background: var(--wa-fond); }
.deux-boutons button.or { color: var(--or); border-color: var(--or); }
.deux-boutons button.or:hover { background: #faf5e8; }

.detail-info { font-size: 14.5px; line-height: 1.8; }
.detail-info b { color: var(--vert-fonce); }
.section-titre { font-size: 12px; font-weight: 700; color: var(--encre-2); margin: 18px 0 9px; text-transform: uppercase; letter-spacing: .1em; }
.vide { color: var(--encre-2); font-size: 14px; font-style: italic; padding: 4px 0; }

/* fiche contact */
.carte h2.nom-fiche { font-family: var(--serif); font-size: 22px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--encre); margin-bottom: 0; }
.fiche-tete { display: flex; align-items: center; gap: 13px; margin-bottom: 10px; }
.fiche-tete .avatar { width: 52px; height: 52px; font-family: var(--serif); font-size: 19px; }
.retour { display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--vert); margin-bottom: 10px; }
.deja-contacte { background: #f0f0ec; border: 1px solid var(--bord); border-radius: 10px; padding: 10px 13px;
  margin-top: 12px; font-size: 13.5px; color: var(--encre-2); }
.deja-contacte b { color: var(--encre); }

/* visuel de campagne */
.visuel-carte { display: flex; align-items: center; gap: 12px; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; color: var(--encre); }
.visuel-carte img { width: 46px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bord); flex: 0 0 auto; }
.visuel-carte b { font-size: 13.5px; display: block; }
.visuel-carte small { font-size: 12px; color: var(--encre-2); display: block; margin-top: 1px; }
.visuel-carte:hover { border-color: var(--vert); }
.lien-visuel { display: block; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--vert); margin-top: 8px; }

/* retour d'un message dans l'historique */
.retour-bloc { margin-top: 8px; }
.retour-bloc > summary { list-style: none; cursor: pointer; display: inline-block; font-size: 12.5px;
  font-weight: 600; color: var(--vert); padding: 4px 0; min-height: 0; }
.retour-bloc > summary::-webkit-details-marker { display: none; }
.retour-bloc > summary::before { content: "+ "; }
.retour-bloc[open] > summary::before { content: "– "; }
.annuler-bloc > summary { color: var(--encre-3); margin-left: 14px; }
.reponse-form-bloc { background: var(--wa-fond); border: 1px solid #cfe2d9; border-radius: 12px;
  padding: 12px 15px; margin-top: 12px; font-size: 14px; color: var(--encre); }
.reponse-form-bloc .bloc-alire-titre { color: var(--wa); }

/* totaux contributions */
.deux-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.total-carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 16px; padding: 14px; }
.total-carte .val { font-family: var(--serif); font-size: 27px; font-weight: 700; }
.total-carte.t-recu .val { color: var(--vert-fonce); }
.total-carte.t-promis .val { color: var(--or); }
.total-carte .lib { font-size: 11.5px; color: var(--encre-2); font-weight: 600; margin-top: 1px; }

/* ---------- accès ---------- */
.acces-page { max-width: 400px; margin: 0 auto; padding: 44px 22px; }
.acces-bloc { text-align: center; margin-bottom: 18px; }
.acces-bloc img { height: 76px; width: auto; }
.acces-bloc .logo { font-family: var(--serif); font-size: 25px; font-weight: 700; color: var(--vert-fonce); margin-top: 10px; }
.acces-bloc .logo .accent { color: inherit; }
.acces-bloc .sous-logo { color: var(--encre-2); font-size: 13.5px; margin-top: 4px; }
.acces-page .carte { padding: 20px 18px; }
.acces-page input[name="code"] { letter-spacing: .3em; }
.acces-page button { min-height: 50px; width: 100%; }
.acces-pied { text-align: center; font-size: 12.5px; color: var(--encre-2); margin-top: 14px; }
