:root {
  --vert: #2f6f4e;
  --vert-fonce: #234f3a;
  --fond: #f6f7f5;
  --carte: #ffffff;
  --texte: #1f2a24;
  --muet: #6b7770;
  --bord: #e2e6e2;
  --ok: #2f6f4e;
  --off: #b04a3a;
  --ombre: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.5;
}
a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Barre de navigation */
.barre {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--carte); border-bottom: 1px solid var(--bord);
  padding: .75rem 1.5rem; box-shadow: var(--ombre);
}
.marque { font-weight: 700; font-size: 1.05rem; color: var(--vert-fonce); }
.marque .sous { color: var(--muet); font-weight: 400; }
.barre nav { display: flex; gap: 1rem; }
.barre nav a { color: var(--texte); padding: .25rem 0; }
.profil { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.profil .qui { font-weight: 600; }
.profil .role { color: var(--muet); }
.profil .deco { color: var(--off); }

/* Contenu */
main { max-width: 1000px; margin: 2rem auto; padding: 0 1.5rem; }
main.plein { display: flex; min-height: 80vh; align-items: center; justify-content: center; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.muet { color: var(--muet); }

/* Flashs */
.flashes { margin-bottom: 1rem; }
.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: .5rem; font-size: .92rem; }
.flash-error { background: #fbe9e7; color: #8a2f22; border: 1px solid #f0c4bd; }
.flash-info  { background: #e9f3ee; color: #234f3a; border: 1px solid #c7e2d3; }

/* Login */
.carte-login {
  background: var(--carte); padding: 2rem; border-radius: 10px;
  box-shadow: var(--ombre); width: 340px; border: 1px solid var(--bord);
}
.carte-login h1 { color: var(--vert-fonce); margin-bottom: .25rem; }
.carte-login form { margin-top: 1.25rem; display: flex; flex-direction: column; }
label { font-size: .85rem; font-weight: 600; margin: .6rem 0 .2rem; }
input, select {
  padding: .55rem .65rem; border: 1px solid var(--bord); border-radius: 6px;
  font-size: .95rem; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--vert); border-color: var(--vert); }
button {
  margin-top: 1rem; padding: .6rem 1rem; background: var(--vert); color: #fff;
  border: 0; border-radius: 6px; font-size: .95rem; cursor: pointer;
}
button:hover { background: var(--vert-fonce); }
button:disabled { background: var(--muet); cursor: not-allowed; }
button.mini { margin: 0; padding: .3rem .6rem; font-size: .8rem; }

/* Grille tuiles */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.tuile { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 1.1rem; box-shadow: var(--ombre); }
.tuile h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.tuile p { margin: 0 0 .6rem; color: var(--muet); font-size: .9rem; }
.tuile.inactif { opacity: .7; }
.badge { font-size: .75rem; background: #eef1ee; color: var(--muet); padding: .2rem .5rem; border-radius: 999px; }
.lien-tuile { font-weight: 600; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--bord); font-size: .9rem; }
.tableau th { background: #eef1ee; font-weight: 600; }
.tableau tr:last-child td { border-bottom: 0; }
.ligne-inactive { opacity: .55; }
.nowrap { white-space: nowrap; }
code { background: #eef1ee; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }

.pastille { font-size: .78rem; padding: .15rem .5rem; border-radius: 999px; }
.pastille.ok { background: #e2f0e8; color: var(--ok); }
.pastille.off { background: #f7e3df; color: var(--off); }

/* Formulaires */
.formulaire { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: 1.1rem; margin-top: .5rem; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.champs > div { display: flex; flex-direction: column; }
form.inline { margin: 0; }

.carte-erreur { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 1.5rem; }

/* Lot 1 — référentiels */
.barre-recherche { display: flex; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.barre-recherche input[type=search] { flex: 0 1 340px; }
.barre-recherche button { margin-top: 0; }
details.editeur summary { cursor: pointer; color: var(--vert); font-size: .85rem; }
details.editeur .formulaire { margin: .5rem 0; }
button.secondaire { background: #eef1ee; color: var(--texte); }
button.secondaire:hover { background: #dfe5df; }
.pastille.st-autorise   { background: #e2f0e8; color: var(--ok); }
.pastille.st-restreint  { background: #fdf0dc; color: #9a6b1a; }
.pastille.st-novel_food { background: #eae4f7; color: #5d3fa0; }
.pastille.st-a_verifier { background: #eef1ee; color: var(--muet); }

/* Lots 2-3 */
.pastille.chine { background: #fdeaea; color: #a33; font-weight: 600; }
.pastille.st { background: #eef1ee; color: var(--muet); }
.bloc { margin: .75rem 0; }
