/* Ferme NegaN — mobile d'abord (§9 de la référence) : contenu dense mais lisible, actions à portée de pouce. */
:root {
  --vert: #1f6f43; --vert-clair: #e7f2ea; --rouge: #b42318; --rouge-clair: #fdecea;
  --orange: #b45309; --orange-clair: #fff4e0; --fond: #f4f5f1; --texte: #1d2320; --doux: #5d655f;
  --bord: #dde1dc; --rayon: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 17px;
  line-height: 1.4; background: var(--fond); color: var(--texte); padding-bottom: 76px; }
a { color: var(--vert); }

/* En-tête et navigation */
.entete { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
  background: var(--vert); color: #fff; position: sticky; top: 0; z-index: 20; }
.marque { color: #fff; text-decoration: none; font-weight: 700; }
.deconnexion { margin: 0; }
.lien { background: none; border: 0; color: #fff; opacity: .85; font-size: .85rem; text-decoration: underline; padding: 0; }
.contenu { max-width: 600px; margin: 0 auto; padding: 12px 14px; }
.barre { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--bord); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.barre a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px;
  text-decoration: none; color: var(--doux); font-size: .72rem; }
.barre svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.barre a.actif { color: var(--vert); font-weight: 700; }
.barre a.actif svg { stroke-width: 2.4; }

/* Titres */
h1 { font-size: 1.45rem; margin: 6px 0 2px; }
h1 small { font-size: .85rem; font-weight: 400; color: var(--doux); margin-left: 6px; }
h2 { font-size: 1.05rem; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.sous-titre, .note { color: var(--doux); font-size: .92rem; margin: 2px 0 10px; }

/* Pastilles d'état (pas d'emoji : rendu identique sur tous les téléphones) */
.pastille { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.pastille.rouge { background: var(--rouge); } .pastille.orange { background: #d97706; } .pastille.verte { background: #16a34a; }
.compteur { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; font-size: .8rem;
  font-weight: 700; text-align: center; background: var(--bord); color: var(--texte); }
.compteur.rouge { background: var(--rouge); color: #fff; } .compteur.orange { background: #d97706; color: #fff; }

/* Cartes et listes */
.carte { display: block; background: #fff; border-radius: var(--rayon); padding: 12px 14px; margin: 8px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); color: var(--texte); text-decoration: none; }
.liste { background: #fff; border-radius: var(--rayon); box-shadow: 0 1px 2px rgba(0,0,0,.08); margin: 8px 0; overflow: hidden; }
.liste > * { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid #eef0ec; color: var(--texte); text-decoration: none; }
.liste > *:last-child { border-bottom: 0; }
.liste a:active, .carte:active { background: #f0f3ee; }
.liste .principal { min-width: 0; }
.liste .principal strong { display: block; }
.liste small, .carte small { color: var(--doux); }
.valeur { font-weight: 700; white-space: nowrap; }
.valeur.grand { font-size: 1.35rem; }
.chevron::after { content: "›"; color: #aab; font-size: 1.4rem; margin-left: 4px; }

/* Indicateurs */
.indicateurs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.indicateurs > div { background: #fff; border-radius: 10px; padding: 9px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.indicateurs .principal-kpi { grid-column: span 2; display: flex; align-items: baseline; gap: 10px; }
.indicateurs b { display: block; font-size: 1.15rem; }
.indicateurs .principal-kpi b { font-size: 2rem; display: inline; }
.indicateurs span { font-size: .78rem; color: var(--doux); }

/* Alertes groupées */
.alerte-groupe { border-left: 5px solid var(--rouge); }
.alerte-groupe.niveau-orange { border-left-color: #d97706; }
.alerte-groupe summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; color: var(--texte); margin: 0; }
.alerte-groupe summary::-webkit-details-marker { display: none; }
.alerte-groupe ul { margin: 8px 0 0; padding: 0; list-style: none; }
.alerte-groupe li a { display: block; padding: 8px 0; border-top: 1px solid #eef0ec; text-decoration: none; color: var(--texte); font-size: .92rem; }
.alerte-unique { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vide { display: flex; align-items: center; gap: 8px; color: var(--doux); padding: 4px 2px; }

/* Actions */
.raccourcis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.raccourcis a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px;
  background: var(--vert); color: #fff; border-radius: 10px; text-decoration: none; font-size: .88rem; font-weight: 600; text-align: center; padding: 6px; }
.raccourcis a.secondaire { background: var(--vert-clair); color: var(--vert); }
.raccourcis a span { font-size: 1.25rem; line-height: 1; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { margin-bottom: 4px; }
.bouton { display: block; font-size: 1.08rem; padding: 13px; border: 0; border-radius: 10px; background: var(--vert);
  color: #fff; width: 100%; margin-top: 12px; text-align: center; text-decoration: none; font-weight: 600; }
.bouton.petit { display: inline-block; width: auto; margin: 0; padding: 9px 12px; font-size: .92rem; }
.bouton.secondaire { background: var(--vert-clair); color: var(--vert); }
.rouge-fond { background: var(--rouge) !important; color: #fff !important; }

/* Navigation de période */
.periode { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: var(--rayon);
  padding: 6px; margin: 8px 0; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.periode a { padding: 8px 14px; text-decoration: none; font-size: 1.2rem; border-radius: 8px; }
.periode a:active { background: var(--vert-clair); }
.periode .inactif { padding: 8px 14px; color: #ccd; font-size: 1.2rem; }
.periode strong { text-transform: capitalize; }
.barre-prop { height: 6px; background: var(--vert-clair); border-radius: 3px; margin-top: 4px; }
.barre-prop i { display: block; height: 100%; background: var(--vert); border-radius: 3px; }

/* Journal */
.journal .ligne-haut { display: flex; justify-content: space-between; gap: 10px; }
.journal .ligne-haut strong, .journal .ligne-haut small { display: inline; }
.journal .qte { font-weight: 700; white-space: nowrap; }
.journal .plus { color: var(--vert); } .journal .moins { color: var(--rouge); }
.journal small { display: block; }
.barre-annule { opacity: .5; }
.barre-annule .ligne-haut { text-decoration: line-through; }
.outils { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; font-size: .88rem; }

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: .95rem; margin-top: 4px; }
input, select, textarea { font-size: 1.05rem; padding: 11px; border: 1px solid #b9bfb9; border-radius: 9px; background: #fff; width: 100%; font-family: inherit; }
.case { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.case input { width: 22px; height: 22px; flex: none; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deux > * { min-width: 0; }
.en-ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.en-ligne input, .en-ligne select { width: auto; flex: 1; }
fieldset { border: 1px solid var(--bord); border-radius: 10px; padding: 6px 12px 10px; margin: 6px 0; }
.aide { color: var(--doux); font-size: .82rem; }
details summary { cursor: pointer; color: var(--vert); margin: 6px 0; }

/* Messages */
.alerte { padding: 11px 13px; border-radius: 10px; margin: 8px 0; }
.rouge { background: var(--rouge-clair); color: var(--rouge); }
.verte { background: #e7f6ec; color: #14532d; }
.liste-cases { list-style: none; padding: 0; margin: 0; }
.liste-cases li { padding: 7px 0; border-bottom: 1px solid #eef0ec; }
.bulle-droite { margin-left: 24px; background: var(--vert-clair); }
.chiffre { font-size: 2.2rem; font-weight: 700; margin: 0; }
