:root { --fond: #fafaf7; --texte: #1f2933; --discret: #52606d; --bord: #d9dde3; --accent: #3e6b2f; --erreur: #b42318; }
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; min-height: 100vh; background: var(--fond); color: var(--texte); }
.centre { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 2rem; width: 100%; max-width: 380px; }
h1 { font-size: 1.4rem; margin: 0 0 1.25rem; }
label { display: block; font-size: .9rem; margin: .9rem 0 .3rem; color: var(--discret); }
input { width: 100%; padding: .6rem .7rem; font-size: 1rem; border: 1px solid var(--bord); border-radius: 6px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { margin-top: 1.25rem; width: 100%; padding: .65rem; font-size: 1rem; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button.secondaire { width: auto; margin: 0; padding: .45rem .9rem; background: transparent; color: var(--texte); border: 1px solid var(--bord); }
.erreur { color: var(--erreur); font-size: .9rem; min-height: 1.2em; margin: .8rem 0 0; }
.aide { color: var(--discret); font-size: .9rem; }
header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.25rem; background: #fff; border-bottom: 1px solid var(--bord); }
header { gap: .75rem; }
.logo { display: inline-flex; flex-shrink: 0; border-radius: 6px; }
.logo img { display: block; height: 32px; width: auto; }
.logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
header > div { display: flex; align-items: center; min-width: 0; }
@media (max-width: 480px) {
  header { padding: .6rem .9rem; }
  .logo img { height: 26px; }
  body > header span { display: none; }
  body > header button.secondaire { white-space: nowrap; padding: .4rem .7rem; font-size: .9rem; }
}
body > header span { color: var(--discret); margin-right: .8rem; }
main { padding: 2rem 1.25rem; }
[hidden] { display: none !important; }

/* Onglets */
.onglets { display: flex; gap: .25rem; padding: 0 1.25rem; background: #fff; border-bottom: 1px solid var(--bord); }
.onglets a { padding: .7rem .9rem; color: var(--discret); text-decoration: none; border-bottom: 3px solid transparent; }
.onglets a[aria-current="page"] { color: var(--texte); border-bottom-color: var(--accent); font-weight: 600; }
.onglets a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
main { max-width: 1200px; margin: 0 auto; }
h2 { font-size: 1.15rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1rem; margin: 0; }
.rouge, .rouge td, .rouge th { color: var(--erreur); }
small { color: var(--discret); font-size: .8em; }

/* Import */
.invisible { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.depot { display: grid; gap: .3rem; place-items: center; text-align: center; margin: 0 0 1rem; padding: 2rem 1rem;
  border: 2px dashed var(--bord); border-radius: 10px; background: #fff; color: var(--texte); font-size: 1rem; cursor: pointer; }
.depot.survol, .depot:hover { border-color: var(--accent); background: #f3f7f0; }
#fichiers:focus-visible + .barre, .depot:focus-within { outline: 2px solid var(--accent); }
.barre { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.barre button { width: auto; margin: 0; padding: .45rem .9rem; }
.barre span { flex: 1 1 200px; }
.fiche { background: #fff; border: 1px solid var(--bord); border-left: 4px solid var(--bord); border-radius: 8px; padding: 1rem; margin: 0 0 1rem; }
.fiche.etat-pret { border-left-color: var(--accent); }
.fiche.etat-bloque, .fiche.etat-erreur { border-left-color: var(--erreur); }
.fiche.etat-doublon { border-left-color: #b7791f; }
.fiche.etat-enregistre { border-left-color: #2b6cb0; }
.fiche > header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 0; background: none; border: 0; }
.fiche > header > div { display: grid; gap: .15rem; min-width: 0; }
.fiche > header .aide { font-size: .8rem; overflow-wrap: anywhere; }
.pastille { flex-shrink: 0; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; background: #edf0f3; }
.pastille.etat-pret { background: #e3f0dc; color: #2c5222; }
.pastille.etat-bloque, .pastille.etat-erreur { background: #fde4e1; color: var(--erreur); }
.pastille.etat-doublon { background: #fdf0d5; color: #7a4f0f; }
.pastille.etat-enregistre { background: #dfeaf7; color: #1e4e86; }
.messages { margin: .7rem 0; padding: .5rem .75rem; border-radius: 6px; font-size: .9rem; }
.messages ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.messages.err { background: #fde4e1; color: var(--erreur); }
.messages.avert { background: #fdf0d5; color: #6b4410; }
.messages.info { background: #f1f3f5; color: var(--discret); }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem 1rem; margin: .8rem 0; }
.champs dt { font-size: .75rem; color: var(--discret); }
.champs dd { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.champs .rouge dd { color: var(--erreur); font-weight: 600; }
details { margin: .5rem 0; }
summary { cursor: pointer; color: var(--accent); padding: .3rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.actions button { width: auto; margin: 0; padding: .45rem .9rem; }
.defile { overflow-x: auto; margin: .5rem 0; }
.tableau { border-collapse: collapse; width: 100%; background: #fff; font-size: .9rem; }
.tableau th, .tableau td { padding: .4rem .6rem; border-bottom: 1px solid var(--bord); text-align: left; white-space: nowrap; }
.tableau thead th { font-size: .8rem; color: var(--discret); font-weight: 600; }
.tableau tbody th { font-weight: 500; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau.compact { width: auto; min-width: 50%; }
.tableau.compact th, .tableau.compact td { padding: .25rem .5rem; font-size: .85rem; }
.tableau a { color: var(--accent); }
@media (max-width: 480px) {
  .onglets { padding: 0 .6rem; }
  main { padding: 1.25rem 1rem; }
}

/* Couleurs des graphiques (palette validée : ordre fixe, jamais recyclée). */
:root { --serie-1: #2a78d6; --serie-2: #eb6834; --serie-3: #1baf7a; --serie-4: #eda100; --serie-5: #e87ba4;
  --serie-6: #7b5cc4; --serie-7: #8a6a3a; --serie-8: #8f9aa3;
  --alerte: #d03b3b; --grille: #e1e0d9; --axe: #c3c2b7; --muet: #898781; }
main.large { max-width: 1400px; }

/* Filtres : une rangée au-dessus de tout ce qu'ils filtrent. */
.filtres { display: grid; gap: .5rem; margin: 0 0 1rem; padding: .75rem; background: #fff; border: 1px solid var(--bord); border-radius: 8px; }
.ligne-filtres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.champ { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-size: .85rem; }
.champ input, .champ select { width: auto; padding: .35rem .45rem; font-size: .9rem; }
input.court { width: 5.5rem; }
select { padding: .4rem .5rem; font-size: .9rem; border: 1px solid var(--bord); border-radius: 6px; background: #fff; color: var(--texte); max-width: 100%; }
details.filtre { position: relative; }
details.filtre > summary { list-style: none; padding: .35rem .7rem; border: 1px solid var(--bord); border-radius: 999px; font-size: .85rem; color: var(--texte); white-space: nowrap; }
details.filtre > summary::-webkit-details-marker { display: none; }
details.filtre > summary::after { content: ' ▾'; color: var(--discret); }
details.filtre > summary.actif { border-color: var(--accent); background: #f3f7f0; font-weight: 600; }
details.filtre .panneau { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; max-width: min(360px, 90vw);
  background: #fff; border: 1px solid var(--bord); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.1); padding: .5rem; }
.panneau input[type=search] { margin-bottom: .4rem; padding: .35rem .5rem; font-size: .9rem; }
.choix { max-height: 260px; overflow-y: auto; }
.choix label { display: flex; gap: .4rem; align-items: baseline; margin: 0; padding: .25rem .3rem; font-size: .88rem; color: var(--texte); border-radius: 4px; cursor: pointer; }
.choix label:hover { background: #f4f5f2; }
.choix input { width: auto; }
button.lien { width: auto; margin: .3rem 0 0; padding: .2rem .3rem; background: none; color: var(--accent); font-size: .85rem; }
.actions-filtres { justify-content: flex-end; }
.actions-filtres button { margin: 0; }
.bouton-lien { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--bord); border-radius: 6px; color: var(--texte); text-decoration: none; font-size: .9rem; background: #fff; }
.bouton-lien:hover { border-color: var(--accent); }

.sous-onglets { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--bord); }
.sous-onglets a { padding: .5rem .8rem; color: var(--discret); text-decoration: none; border-bottom: 2px solid transparent; font-size: .95rem; }
.sous-onglets a[aria-current="page"] { color: var(--texte); border-bottom-color: var(--accent); font-weight: 600; }

#resultats-analyses { transition: opacity .15s; }
#resultats-analyses.charge { opacity: .45; }

/* Indicateurs */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.tuile { display: grid; gap: .2rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--bord); border-radius: 8px; }
.tuile.alerte { border-left: 4px solid var(--alerte); }
.tuile-lib { font-size: .82rem; color: var(--discret); }
.tuile-val { font-size: 1.6rem; font-weight: 600; }
.tuile .aide { font-size: .8rem; }

section { margin: 0 0 1.5rem; }
.alertes { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.alerte-ligne { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; padding: .6rem .8rem; background: #fff; border: 1px solid var(--bord); border-left: 4px solid var(--alerte); border-radius: 6px; font-size: .92rem; }
.grille-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.grille-3 h3 { margin: 0 0 .4rem; font-size: .95rem; }

/* Tableaux triables */
button.tri { width: auto; margin: 0; padding: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: inherit; }
th[aria-sort="ascending"] button.tri::after { content: ' ▲'; }
th[aria-sort="descending"] button.tri::after { content: ' ▼'; }
.tableau tbody tr:hover { background: #fafaf7; }
tr.a-traiter td:first-child { font-weight: 600; }
.temoin { font-size: .8rem; color: var(--discret); }
.temoin.ok { color: var(--accent); }
.temoin.erreur { color: var(--erreur); }

/* Graphiques */
.graphe-zone { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .75rem .5rem .5rem; }
svg.graphe { display: block; max-width: 100%; overflow: visible; }
svg.graphe .grille { stroke: var(--grille); stroke-width: 1; }
svg.graphe .axe { stroke: var(--axe); stroke-width: 1; }
svg.graphe .reference { stroke: var(--discret); stroke-width: 1; }
svg.graphe .gradu { fill: var(--muet); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.graphe .etiquette { fill: var(--texte); font-size: 12px; }
svg.graphe .trait { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.graphe .point { stroke: #fff; stroke-width: 2; }
svg.graphe .reticule { stroke: var(--axe); stroke-width: 1; }
svg.graphe .colonne:hover path, svg.graphe .colonne:focus path { opacity: .8; }
svg.graphe [tabindex]:focus { outline: none; }
svg.graphe .colonne:focus rect, svg.graphe rect:focus { stroke: var(--accent); stroke-width: 1; }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; margin: .5rem 0 0; padding: 0 .5rem; font-size: .85rem; color: var(--texte); }
.legende li { display: inline-flex; align-items: center; gap: .4rem; }
.cle-ligne { display: inline-block; width: 16px; height: 2px; border-radius: 1px; }
.cle-rect { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.bulle { position: absolute; z-index: 50; pointer-events: none; background: #fff; border: 1px solid var(--bord); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: .45rem .6rem; font-size: .82rem; max-width: 280px; }
.bulle-titre { color: var(--discret); margin-bottom: .2rem; }
.bulle-ligne { display: flex; align-items: center; gap: .35rem; }
.bulle-ligne span:not(.bulle-cle) { color: var(--discret); }
.bulle-cle { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }

/* Impression / PDF : uniquement le contenu de la vue. */
@media print {
  body > header, .onglets, .filtres .ligne-filtres:last-child, .sous-onglets, .bulle, button.tri::after { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .defile { overflow: visible; }
  .tableau th, .tableau td { white-space: normal; }
  details:not([open]) > :not(summary) { display: none; }
  section, .tuile, .graphe-zone, tr { break-inside: avoid; }
  details.filtre .panneau { display: none; }
}

.filtres > summary.titre-filtres { display: none; }
@media (max-width: 640px) {
  .filtres > summary.titre-filtres { display: block; cursor: pointer; font-weight: 600; }
  .filtres[open] > summary.titre-filtres { margin-bottom: .5rem; }
  .champ input[type=date] { width: 9.5rem; }
}

/* Barre propre à chaque module : retour à l'accueil, nom du module, onglets du module */
.barre-module { align-items: stretch; flex-wrap: wrap; }
.barre-module .retour { color: var(--accent); font-weight: 600; }
.barre-module .nom-module { display: flex; align-items: center; padding: 0 1rem 0 .4rem; margin-right: .5rem;
  font-weight: 700; border-right: 1px solid var(--bord); }
body > header .lien-entete { color: var(--accent); text-decoration: none; font-weight: 600; margin-right: .9rem; white-space: nowrap; }
body > header .lien-entete:hover { text-decoration: underline; }

/* Accueil : un bouton par module (icône, titre, flèche) */
#ecran-accueil { max-width: 720px; padding-top: 2.5rem; }
.bonjour { font-size: 1.3rem; margin-bottom: 1.25rem; }
.boutons-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.bouton-module { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: .9rem;
  align-items: center; padding: .9rem 1rem; background: #fff; border: 1px solid var(--bord); border-radius: 10px;
  color: var(--texte); text-decoration: none; }
.bouton-module::after { content: "›"; grid-column: 3; grid-row: 1 / 3; font-size: 1.6rem; line-height: 1; color: var(--discret); }
.bouton-module:hover { border-color: var(--accent); background: #f6f9f4; }
.bouton-module:hover::after { color: var(--accent); }
.bouton-module:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bouton-module svg { grid-row: 1 / 3; width: 40px; height: 40px; padding: 7px; border-radius: 8px; }
.bouton-module-titre { font-size: 1rem; font-weight: 600; }
.bouton-module-sous-titre { font-size: .85rem; color: var(--discret); }
.bouton-module.scores svg { background: #e3f0dc; }
.bouton-module.scores svg rect { fill: var(--accent); }
.bouton-module.scores svg .trait { fill: none; }
.bouton-module.scores svg .courbe { stroke: #b7791f; }
.bouton-module.ventes svg { background: #fdf3d1; }
.bouton-module.ventes svg rect { fill: none; stroke: #9a6f0a; stroke-width: 3; }
.bouton-module.ventes svg .courbe { stroke: #9a6f0a; }
.version { margin-top: 2rem; }
@media (max-width: 640px) {
  #ecran-accueil { padding-top: 1.25rem; }
  .barre-module .retour span { display: none; }
  .barre-module .nom-module { padding-right: .7rem; margin-right: .2rem; }
}
@media (max-width: 480px) {
  body > header .lien-entete { margin-right: .6rem; font-size: .9rem; }
}

/* Utilisateurs */
.carte-large { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 1.25rem 1.5rem; margin: 0 0 1rem; }
.carte-large h2 { margin-top: 0; }
.carte-large button[type=submit] { width: auto; padding: .6rem 1.4rem; }
.champs-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.champs-form select { width: 100%; padding: .6rem .5rem; font-size: 1rem; }
.provisoire { display: grid; gap: .3rem; margin: 0 0 1rem; padding: 1rem 1.25rem; border-radius: 8px; background: #e3f0dc; color: #2c5222; }
.provisoire code { font-size: 1.2rem; font-weight: 700; letter-spacing: .05em; user-select: all; overflow-wrap: anywhere; }
.comptes { display: grid; gap: .75rem; }
.compte { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 1rem 1.25rem; display: grid; gap: .7rem; }
.compte.inactif { opacity: .65; }
.compte > header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 0; background: none; border: 0; }
.compte > header > div { display: grid; gap: .15rem; min-width: 0; }
.compte .actions { margin-top: 0; }
.acces { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; }
.acces-module { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--texte); font-size: .95rem; }
.legende { margin: 0 0 .8rem; font-size: .9rem; }
.legende ul { margin: .4rem 0; padding-left: 1.2rem; color: var(--discret); }

/* Écran Export */
.filtres-export { margin: .5rem 0 .75rem; background: #fcfcfa; }
.groupe-filtres { min-width: 4.6rem; font-size: .8rem; font-weight: 600; color: var(--discret); text-transform: uppercase; letter-spacing: .03em; }
.barre-apercu { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.apercu-export { margin: 0; font-size: .95rem; }
.cases-export { display: grid; gap: .35rem; margin: .5rem 0; }
.cases-export.colonnes { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.case-export { display: flex; align-items: flex-start; gap: .5rem; margin: 0; font-size: .92rem; color: var(--texte); cursor: pointer; }
.case-export input { width: auto; margin: .2rem 0 0; flex: none; }
.case-export small { color: var(--discret); }
@media (max-width: 640px) {
  .groupe-filtres { width: 100%; }
}

/* Import par e-mail : file « À valider » et réglages de réception. */
.onglets a .compteur { display: inline-block; min-width: 1.4em; margin-left: .2rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4; }
label.case { display: flex; align-items: flex-start; gap: .5rem; margin: .7rem 0 0; color: var(--texte); font-size: .92rem; cursor: pointer; }
label.case input { width: auto; margin: .2rem 0 0; flex: none; }
.acces-module.case { margin: 0; align-items: center; }
.acces-module.case input { margin: 0; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: #f4f7f1; }
.entete-attente h2 { margin: .6rem 0 .2rem; }
.validation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: 1rem; }
.colonne-pdf { position: sticky; top: .5rem; max-height: calc(100vh - 1rem); overflow: auto; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .5rem; }
.colonne-pdf .barre { margin: 0 0 .5rem; }
.pages-pdf { display: grid; gap: .5rem; }
.pages-pdf canvas { display: block; width: 100%; height: auto; border: 1px solid var(--bord); }
.colonne-donnees { min-width: 0; }
.colonne-donnees h3 { margin: 1.2rem 0 .4rem; }
.grille-saisie { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .55rem .9rem; margin: .8rem 0; }
.saisie { display: grid; gap: .15rem; align-content: start; }
.saisie.large { grid-column: 1 / -1; }
.saisie label { margin: 0; font-size: .78rem; }
.saisie input { padding: .4rem .5rem; font-size: .92rem; }
.saisie small { font-size: .78rem; }
.saisie-cartons input[type=text] { width: 7.5rem; padding: .25rem .4rem; font-size: .88rem; }
.saisie-cartons input[type=checkbox] { width: auto; }
.douteux input, td.douteux input { border-color: #b7791f; background: #fff8e6; }
.saisie.douteux label { color: #7a4f0f; font-weight: 600; }
.legende-douteux .temoin { display: inline-block; width: 1.1em; height: .9em; vertical-align: -.1em; border: 1px solid #b7791f; background: #fff8e6; border-radius: 3px; }
.actions-validation { position: sticky; bottom: 0; padding: .7rem 0; background: var(--fond); border-top: 1px solid var(--bord); align-items: center; }
.actions-validation label.case { margin: 0 auto 0 0; }
.rejet { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.rejet label { margin: 0; }
.rejet input { flex: 1 1 240px; width: auto; }
.rejet button { width: auto; margin: 0; }
button.danger { color: var(--erreur); border-color: var(--erreur); }
.liste-expediteurs { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .3rem; }
.liste-expediteurs li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .5rem; background: #f6f7f4; border-radius: 6px; overflow-wrap: anywhere; }
.liste-expediteurs button.lien { margin: 0; }
.ligne-ajout { display: flex; flex-wrap: wrap; gap: .5rem; }
.ligne-ajout input { flex: 1 1 200px; width: auto; }
.ligne-ajout button { width: auto; margin: 0; padding: .55rem 1.2rem; }
.texte-long { white-space: normal !important; min-width: 12rem; max-width: 28rem; overflow-wrap: anywhere; }
section > .barre h2 { margin: 1.5rem 0 .5rem; flex: 1; }
@media (max-width: 900px) {
  .validation { grid-template-columns: minmax(0, 1fr); }
  .colonne-pdf { position: static; max-height: 70vh; }
}
@media (max-width: 480px) {
  .onglets { overflow-x: auto; }
  .onglets a { white-space: nowrap; }
}
@media (max-width: 480px) {
  /* Administrateur sur téléphone : le lien « Utilisateurs » et « Se déconnecter » tiennent sur la ligne. */
  body > header .lien-entete { margin-right: .5rem; font-size: .88rem; }
  body > header { gap: .5rem; }
  body > header { padding: .55rem .75rem; }
  .logo { flex-shrink: 1; min-width: 0; }
  .logo img { max-width: 100%; height: auto; max-height: 26px; }
  body > header button.secondaire { padding: .35rem .55rem; font-size: .85rem; }
}

/* Cahier des charges : résultats de recherche */
#cahier input[type=search] { flex: 1 1 280px; max-width: 520px; }
.resultats-cahier { margin: 0 0 1rem; }
.resultat-cahier h3 { font-size: .95rem; margin: .8rem 0 .3rem; }
.resultat-cahier ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.resultat-cahier li { margin: .2rem 0; }

/* Vues d'exploitation */
.pv-onglets { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--bord); }
.pv-onglets button { width: auto; margin: 0 0 -1px; padding: .45rem .8rem; background: transparent; color: var(--discret);
  border: 1px solid transparent; border-radius: 6px 6px 0 0; font-size: .92rem; }
.pv-onglets button.actif { background: #fff; color: var(--texte); border-color: var(--bord); border-bottom-color: #fff; font-weight: 600; }
.pv-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.pv-entete h2 { margin: .3rem 0; }
.pv-parcelles td, .pv-base td { font-size: .85rem; }
.pv-comm { white-space: normal !important; min-width: 12rem; max-width: 24rem; }
.pv-alerte { color: #a15c07; }
.pv-parcelles tfoot td, .pv-parcelles tfoot th, .pv-exploitation tfoot th, .tableau tfoot th, .tableau tfoot td { font-weight: 600; border-top: 2px solid var(--bord); }
.pv-bas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.pv-notes { width: 100%; font: inherit; font-size: .9rem; padding: .5rem; border: 1px solid var(--bord); border-radius: 6px; }
.pv-notes-lecture { white-space: pre-line; font-size: .9rem; }
.pv-seulement-impression { display: none; }
.pv-lien { margin: 0; padding: 0; font-size: inherit; }
.pv-dialogue { width: min(920px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); border: 1px solid var(--bord); border-radius: 10px; padding: 1.25rem 1.5rem; }
.pv-dialogue::backdrop { background: rgba(0, 0, 0, .35); }
.pv-dialogue h2 { margin-top: 0; }
.pv-dialogue textarea { width: 100%; font: inherit; padding: .5rem; border: 1px solid var(--bord); border-radius: 6px; }
.pv-dialogue .actions button[type=submit] { width: auto; padding: .45rem 1.2rem; }
.pv-journal ul { margin: .3rem 0; padding-left: 1.2rem; font-size: .88rem; }

/* Version imprimable : une exploitation (ou la synthèse) par envoi, A4 paysage. */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  body > header, nav.barre-module, .pv-barre, .pv-onglets, .pv-sans-impression, #ecran-ventes > h1 { display: none !important; }
  main, main.large { max-width: none; padding: 0; margin: 0; }
  .pv-seulement-impression { display: block; }
  .defile { overflow: visible; }
  .tableau { font-size: 7.5pt; }
  .tableau th, .tableau td, .pv-parcelles td { padding: 1.5pt 3pt; font-size: 7.5pt; }
  .pv-comm { min-width: 0; max-width: 45mm; }
  .champs { grid-template-columns: repeat(7, 1fr); gap: 2pt 6pt; margin: 2pt 0 6pt; }
  .champs dd { font-size: 8.5pt; }
  h2 { font-size: 13pt; margin: 0 0 4pt; }
  h3 { font-size: 10pt; margin: 8pt 0 3pt; }
  .pv-bas { grid-template-columns: 1fr 2fr; gap: 8pt; break-inside: avoid; }
  .aide { font-size: 7.5pt; }
  tr { break-inside: avoid; }
  tr.a-traiter td:first-child { font-weight: normal; }
}
@media print {
  .pv-contenu section, .pv-exploitation { break-inside: auto; }
  .pv-parcelles th, .pv-parcelles td { white-space: nowrap; }
  .pv-parcelles td.pv-comm { white-space: normal; }
}

/* Pleine largeur (24/11/2026) : écrans élargis au maximum, très peu de marge à gauche et à droite. */
main, main.large { max-width: none; padding-left: 1.5rem; padding-right: 1.5rem; }
.pv-cliquable { cursor: pointer; }
.pv-cliquable:hover td { background: #f6f8f3; }
.pv-aide-tel { display: none; }

/* Téléphone : colonnes essentielles, fiche complète au toucher d'une ligne. */
@media (max-width: 760px) {
  main, main.large { padding: .8rem .75rem; }
  #ecran-ventes > h1 { font-size: 1.15rem; margin-bottom: .6rem; }
  .pv-sec { display: none; }
  .pv-aide-tel { display: block; }
  .pv-onglets { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .pv-onglets button { flex: 0 0 auto; padding: .5rem .7rem; }
  .pv-barre .ligne-filtres { display: grid; grid-template-columns: 1fr; }
  .pv-barre .champ { display: grid; gap: .2rem; }
  .pv-barre select, .pv-barre input[type=date], .pv-barre button { width: 100%; }
  .filtres .ligne-filtres > select, .filtres .ligne-filtres > input, .filtres .ligne-filtres > button { flex: 1 1 100%; width: 100%; }
  .tableau th, .tableau td, .pv-parcelles td, .pv-base td { padding: .45rem .4rem; font-size: .88rem; }
  .pv-comm { min-width: 0; }
  .champs { grid-template-columns: repeat(2, 1fr); gap: .4rem .6rem; }
  .pv-entete button { width: 100%; }
  .pv-bas { grid-template-columns: 1fr; }
  .pv-dialogue { width: calc(100vw - .5rem); max-width: none; max-height: calc(100vh - .5rem); padding: 1rem .8rem; margin: auto; }
  .pv-dialogue .champs-form { grid-template-columns: 1fr 1fr; }
  .pv-dialogue .actions button { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .pv-dialogue .champs-form { grid-template-columns: 1fr; }
}
@media print { .pv-sec { display: table-cell !important; } .pv-sec.pv-sans-impression { display: none !important; } .pv-aide-tel { display: none !important; } }
.bouton-module.sols svg { background: #f3e6d8; }
.bouton-module.sols svg .terre { fill: #b98a5e; }
.bouton-module.sols svg .courbe { stroke: #7a5230; }
.bouton-module.sols svg .pousse { stroke: var(--accent); }
.bouton-module.sols svg .grain { fill: #7a5230; }

/* Analyses de sol : écart à l'objectif (couleur doublée d'un texte pour les lecteurs d'écran). */
.so-bas { background: #fde4d9; color: #8a3210; }
.so-haut { background: #dfeaf7; color: #1e4e86; }
.so-pastille { padding: 0 .4rem; border-radius: 4px; }
.so-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.so-tableau td.num, .so-tableau th.num { font-variant-numeric: tabular-nums; }
.so-tableau td.so-bas, .so-tableau td.so-haut { font-weight: 600; }
.so-total th, .so-total td { font-weight: 600; border-top: 2px solid var(--bord); }
.so-fiche { width: min(1200px, calc(100vw - 2rem)); }
.so-fiche .graphe-zone { margin: .5rem 0; }
.so-nom-origine { font-size: .8rem; vertical-align: top; }
.so-nom-origine .lien { display: block; padding: 0; margin: .2rem 0 0; font-size: .8rem; }
.so-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 .8rem; max-height: 50vh; overflow-y: auto; margin: .5rem 0; }
.so-choix label.case { margin: .35rem 0 0; }
.so-seuils { white-space: nowrap; }
.so-seuil { width: 4.5rem; padding: .2rem .35rem; margin: 0 .15rem; text-align: right; }
.so-seuil.so-ok { border-color: var(--accent); }
.so-ajout-note { max-width: 640px; margin-bottom: 1.5rem; }
.so-ajout-note input[type=number] { width: 6rem; }
.so-legende { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.filtres label.case { margin: 0; align-items: center; }
.filtres label.case input { margin: 0; }
/* Analyses de sol : import des rapports Kinsey */
.so-import { margin: 0 0 1.5rem; padding: .8rem 1rem; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
.so-import h3 { margin: 0 0 .2rem; }
.so-import td { vertical-align: top; }
.so-import select { width: auto; max-width: 16rem; }
.so-import .actions button { width: auto; margin: .5rem .5rem 0 0; padding: .45rem .9rem; }
.so-ignore td { opacity: .5; }
.so-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: .4rem 0; }
button.secondaire.petit { padding: .2rem .5rem; font-size: .85rem; }
.so-cle { display: inline-flex; align-items: center; gap: .3rem; margin-right: .8rem; }
.so-trait { display: inline-block; width: 1.2rem; height: 3px; border-radius: 2px; }
.so-tableau .so-souhaite { color: var(--discret); font-style: italic; }
/* Éléments en kg/ha : colonne « trouvé » et colonne « souhaité » de même largeur ;
   l'en-tête « souhaité » passe à la ligne sous le nom de l'élément. */
.so-tableau th.so-kg, .so-tableau td.so-kg { width: 4.2rem; min-width: 4.2rem; }
.so-tableau thead th { vertical-align: bottom; }
/* Une ligne par échantillon, toutes de même hauteur : recommandation coupée (texte complet au survol). */
.so-tableau td.so-reco { max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.so-objectif-souhaite { white-space: nowrap; }
.so-objectif-souhaite .aide { margin: 0; font-size: .75rem; font-weight: normal; }
.so-export { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .6rem; }
.so-export button { width: auto; }
.so-export p { margin: 0; }
/* Onglet Préparer une campagne */
.so-prev-entete { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1rem; }
.so-prev-entete label, .so-prev-nouvelle label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.so-prev-entete input, .so-prev-nouvelle input[type=month] { width: auto; padding: .35rem .5rem; font-size: .9rem; }
input.so-prev-titre { width: 22rem; max-width: 70vw; }
.so-prev-nouvelle { display: grid; gap: .5rem; margin-top: .5rem; }
.so-prev-ajout input[type=text] { width: 14rem; padding: .35rem .5rem; font-size: .9rem; }
.so-prev-ajout label.case { margin: 0; align-items: center; white-space: nowrap; }
.so-prev-table td { vertical-align: middle; }
.so-prev-table input[type=text] { padding: .25rem .4rem; font-size: .85rem; }
.so-prev-obs { min-width: 16rem; white-space: nowrap; }
.so-prev-obs input { width: 14rem; display: inline-block; }
.so-prev-obs .lien { font-size: .8rem; margin-left: .3rem; }
.so-prev-com input { width: 18rem; }
.so-prev-seve { text-align: center; }
.so-prev-seve input { width: auto; }
.so-prev-choix select { max-width: 22rem; }
.so-prev-nouvelle-p { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.so-prev-nouvelle-p input { width: 14rem; padding: .25rem .4rem; font-size: .85rem; }
tr.douteux td { background: #fff8e6; }
/* Onglet Exporter */
.so-exporter { max-width: 900px; }
.so-bloc-export { margin: 0 0 1rem; padding: .6rem 1rem .9rem; background: #fff; border: 1px solid var(--bord); border-radius: 8px; }
.so-bloc-export legend { padding: 0 .3rem; font-weight: 600; }
.so-bloc-export label.case { margin: .45rem 0 0; }
.so-bloc-export .aide { font-size: .85rem; }
.so-bloc-export > p.aide { margin: .5rem 0 0; }
.so-preparer .actions-validation button { width: auto; margin: 0; padding: .45rem .9rem; }

/* Comptes-rendus de tournée (téléphone d'abord : gros boutons, une main) */
.bouton-module.tournees svg { background: #e1ecf4; }
.bouton-module.tournees svg .feuille { fill: #fff; stroke: #2f5f80; stroke-width: 2.5; }
.bouton-module.tournees svg .lignes { stroke: #2f5f80; }
.bouton-module.tournees svg .micro { fill: var(--accent); }
.bouton-module.tournees svg .pied { stroke: var(--accent); }
#ecran-tournees { max-width: 860px; }
.tr-contenu textarea { width: 100%; font: inherit; font-size: 1rem; padding: .55rem .6rem; border: 1px solid var(--bord); border-radius: 6px; resize: vertical; line-height: 1.4; }
.tr-contenu select { font-size: 1rem; padding: .5rem; }
.tr-contenu h2 { margin-top: 1.6rem; }
.tr-centre { text-align: center; }
.tr-demarrer { text-align: center; padding: 1.5rem 0 .5rem; }
button.tr-gros { display: inline-flex; flex-direction: column; align-items: center; gap: .4rem; width: min(100%, 22rem); margin: 0 auto 1rem;
  padding: 1.6rem 1rem; font-size: 1.3rem; font-weight: 600; border-radius: 16px; }
.tr-icone { font-size: 1.8rem; line-height: 1; }
button.tr-micro { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  width: 11rem; height: 11rem; margin: 1rem auto .5rem; border-radius: 50%; font-size: 1.25rem; font-weight: 600;
  background: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); touch-action: manipulation; }
button.tr-micro .tr-icone { font-size: 2.4rem; color: #fde4e1; }
button.tr-micro.actif { background: #b42318; animation: tr-pulse 1.6s ease-in-out infinite; }
button.tr-micro.actif .tr-icone { color: #fff; }
button.tr-micro.petit { width: auto; height: auto; min-width: 12rem; flex-direction: row; gap: .6rem; margin: 0; padding: 1rem 1.4rem; border-radius: 40px; font-size: 1.1rem; }
button.tr-micro.petit .tr-icone { font-size: 1.4rem; }
.tr-minuteur { font-size: 1rem; font-variant-numeric: tabular-nums; font-weight: 400; }
@keyframes tr-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .45); } 50% { box-shadow: 0 0 0 14px rgba(180, 35, 24, 0); } }
@media (prefers-reduced-motion: reduce) { button.tr-micro.actif { animation: none; } }
button.tr-large { width: 100%; margin: 0; padding: 1rem; font-size: 1.1rem; font-weight: 600; border-radius: 10px; }
.tr-actions { display: flex; flex-direction: column; gap: .6rem; margin: 1.4rem 0; }
.tr-actions.haut { flex-direction: row; flex-wrap: wrap; margin: 0 0 1rem; }
.tr-actions > button.secondaire { width: 100%; padding: .7rem; }
.tr-actions.haut > button.secondaire, .tr-actions.haut > a { width: auto; }
a.bouton-lien { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); text-decoration: none; font-weight: 600; }
.tr-entete { margin: 0; }
.tr-segments, .tr-liste, .tr-historique, .tr-lexique ul { list-style: none; padding: 0; margin: .8rem 0; }
.tr-segments li, .tr-liste li, .tr-lexique li { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .6rem .7rem; background: #fff; border: 1px solid var(--bord); border-radius: 8px; margin-bottom: .4rem; }
.tr-liste li > a { display: flex; flex-direction: column; gap: .1rem; color: var(--texte); text-decoration: none; flex: 1; min-width: 0; }
.tr-liste li > a:hover strong { color: var(--accent); text-decoration: underline; }
.tr-date { font-size: .85rem; color: var(--discret); }
.tr-statut { flex-shrink: 0; font-size: .8rem; padding: .15rem .55rem; border-radius: 20px; background: #f1f3f5; color: var(--discret); white-space: nowrap; }
.tr-statut.questions, .tr-statut.enregistrement { background: #fdf0d5; color: #6b4410; }
.tr-statut.relecture { background: #e1ecf4; color: #2f5f80; }
.tr-statut.validee { background: #e3f0dc; color: var(--accent); }
.tr-entete-detail { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.tr-retour { color: var(--accent); text-decoration: none; }
.tr-attente { text-align: center; padding: 2.5rem 1rem; }
.tr-roue { display: inline-block; width: 2.6rem; height: 2.6rem; border: 4px solid #e3f0dc; border-top-color: var(--accent); border-radius: 50%; animation: tr-tourne 1s linear infinite; }
@keyframes tr-tourne { to { transform: rotate(360deg); } }
.tr-transcription { padding-left: 1.3rem; }
.tr-transcription li { margin-bottom: .8rem; }
.tr-transcription p { margin: .2rem 0; white-space: pre-wrap; }
.tr-resume { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .8rem; }
.tr-resume p { margin: .2rem 0; }
.tr-choix { background: #fff8e6; border: 1px solid #e8c770; border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
.tr-choix summary { cursor: pointer; font-weight: 600; }
.tr-choix ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.tr-choix li { margin: .2rem 0; }
.tr-numero { margin: 1.2rem 0 .3rem; color: var(--discret); font-size: .9rem; }
.tr-question { font-size: 1.3rem; font-weight: 600; line-height: 1.35; margin: 0 0 .4rem; }
.tr-boutons-question { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; }
.tr-navigation { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1rem; }
.tr-navigation button { width: auto; margin: 0; padding: .7rem 1rem; }
.tr-details { margin-top: 1.4rem; }
.tr-details summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: .3rem 0; }
.tr-grille { display: grid; grid-template-columns: 1fr auto; gap: .8rem; }
.tr-section { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: .8rem; margin: .8rem 0; }
.tr-section-tete { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.tr-section > button.secondaire { margin-top: .4rem; }
.tr-observation { border-top: 1px solid var(--bord); padding: .7rem 0 .3rem; }
.tr-observation-tete { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.tr-observation-tete select { flex: 1 1 14rem; font-weight: 600; }
.tr-observation-tete input { flex: 1 1 10rem; width: auto; }
.tr-outils { display: inline-flex; gap: .3rem; flex-shrink: 0; }
.tr-outils button[type=submit] { width: auto; margin: 0; padding: .45rem .9rem; }
.tr-ajout-expl { margin: .3rem 0 .6rem; }
.tr-actions-liste { padding-left: 1.4rem; }
.tr-actions-liste li { display: flex; gap: .4rem; align-items: flex-start; margin-bottom: .4rem; }
.tr-filtres { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .8rem; }
.tr-filtre { margin: 0; display: flex; flex-direction: column; gap: .25rem; flex: 1 1 12rem; }
.tr-historique li { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .5rem; }
.tr-historique li a { font-weight: 600; color: var(--accent); }
.tr-historique li p { margin: .3rem 0 0; white-space: pre-wrap; }
.tr-lexique-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .4rem; align-items: center; width: 100%; margin-bottom: .6rem; }
.tr-lexique-form .erreur { grid-column: 1 / -1; margin: 0; min-height: 0; }
.tr-document { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 1.4rem 1.6rem; line-height: 1.5; }
.tr-doc-date { text-align: right; color: var(--discret); }
h2.tr-doc-titre { color: var(--accent); font-size: 1.5rem; margin: .3rem 0 .8rem; }
h3.tr-doc-section { color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: .2rem; margin: 1.4rem 0 .6rem; }
.tr-document h4 { margin: .9rem 0 .2rem; font-size: 1rem; }
.tr-document h4 a { color: inherit; }
.tr-doc-obs p { margin: 0 0 0 .8rem; white-space: pre-wrap; }
@media (max-width: 640px) {
  #ecran-tournees { padding: 1rem .7rem; }
  #ecran-tournees > h1 { font-size: 1.15rem; margin-bottom: .8rem; }
  .tr-grille { grid-template-columns: 1fr; }
  .tr-lexique-form { grid-template-columns: 1fr; }
  .tr-document { padding: 1rem; }
  .tr-segments li, .tr-liste li, .tr-lexique li { flex-wrap: wrap; }
}
@media print {
  .tr-onglets, .tr-entete-detail, .tr-actions, #ecran-tournees > h1 { display: none !important; }
  .tr-document { border: 0; padding: 0; }
}

/* Modules en construction : eau, cercosporiose, fumure */
.bouton-module.eau svg { background: #dcecf7; }
.bouton-module.eau svg .goutte { fill: #2b7bb9; }
.bouton-module.eau svg .reflet { stroke: #dcecf7; }
.bouton-module.cerco svg { background: #e3f0dc; }
.bouton-module.cerco svg .feuille { fill: #5c9a3c; }
.bouton-module.cerco svg .nervure { stroke: #e3f0dc; }
.bouton-module.cerco svg .tache { fill: #5a3a1a; }
.bouton-module.fumure svg { background: #f4ecd9; }
.bouton-module.fumure svg .sac { fill: #c9a86a; }
.bouton-module.fumure svg .col { stroke: #8a6a2e; }
.bouton-module.fumure svg .pousse { stroke: var(--accent); }

/* Écran Utilisateurs et droits : tableau comptes × modules */
.bouton-module.administration svg { background: #ece7f3; }
.bouton-module.administration svg .tete, .bouton-module.administration svg .corps { fill: #5b4a7a; }
.bouton-module.administration svg .bouclier { fill: var(--accent); }
.bouton-module.administration svg .coche { stroke: #fff; }
.droits-defile { overflow-x: auto; }
table.droits { min-width: 100%; }
table.droits th, table.droits td { vertical-align: top; padding: .55rem .6rem; }
table.droits thead th { white-space: normal; min-width: 8.5rem; }
table.droits tbody th { position: sticky; left: 0; z-index: 1; background: #fff; min-width: 15rem; text-align: left; font-weight: 400; border-right: 1px solid var(--bord); }
table.droits tr.inactif { opacity: .6; }
table.droits select { width: 100%; }
table.droits td.droit-aucun select { color: var(--discret); }
td.droit-admin { color: var(--accent); font-weight: 600; }
.droit-compte { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.droit-boutons { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.droit-particulier { display: flex; align-items: flex-start; gap: .35rem; margin: .4rem 0 0; font-size: .82rem; color: var(--texte); }
.droit-particulier input { width: auto; margin: .15rem 0 0; }

/* Consommations d'eau */
.eau-tete-saisie { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-bottom: .6rem; }
.eau-tete-saisie label { margin: 0; display: flex; align-items: center; gap: .5rem; color: var(--texte); font-weight: 600; }
.eau-tete-saisie input { width: auto; }
.eau-groupe h3 { margin: 1.2rem 0 .4rem; color: var(--accent); }
.eau-entetes, .eau-ligne { display: grid; grid-template-columns: minmax(10rem, 1.3fr) minmax(8rem, 1fr) minmax(11rem, 1.3fr) minmax(7rem, .9fr) minmax(10rem, 1.6fr) minmax(8rem, 1fr); gap: .5rem; align-items: start; }
.eau-entetes { font-size: .8rem; color: var(--discret); padding: 0 .6rem .2rem; }
.eau-ligne { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .5rem .6rem; margin-bottom: .35rem; }
.eau-ligne.remplie { border-color: var(--accent); background: #fbfdf9; }
.eau-nom, .eau-prec, .eau-calcul, .eau-controle { display: flex; flex-direction: column; gap: .1rem; font-size: .92rem; }
.eau-saisie { display: flex; flex-direction: column; gap: .3rem; }
.eau-saisie input { padding: .45rem .5rem; font-size: 1rem; }
.eau-saisie input[inputmode] { font-variant-numeric: tabular-nums; font-weight: 600; }
.eau-m3j { color: var(--discret); }
.eau-bloque { color: var(--erreur); font-weight: 600; }
.eau-anomalie { color: #6b4410; background: #fdf0d5; border-radius: 6px; padding: .3rem .45rem; }
.eau-confirmer { display: flex; align-items: center; gap: .35rem; margin: .3rem 0 0; color: #6b4410; font-weight: 600; }
.eau-confirmer input { width: auto; margin: 0; }
.eau-depasse { color: var(--erreur); }
.eau-ok { color: var(--accent); font-weight: 700; }
.eau-plus summary { cursor: pointer; font-size: .85rem; color: var(--accent); }
.eau-plus select, .eau-plus input { margin-top: .3rem; width: 100%; }
.eau-changement { display: grid; gap: .3rem; }
.eau-pied { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 0; background: var(--fond); border-top: 1px solid var(--bord); margin-top: .8rem; }
button.eau-enregistrer { width: auto; margin: 0; padding: .75rem 1.4rem; font-size: 1.05rem; }
.eau-barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.eau-barre label.case { margin: 0; color: var(--texte); }
.eau-barre input[type=checkbox] { width: auto; }
.eau-defile { max-height: 75vh; overflow: auto; }
table.eau-tableau { font-size: .85rem; }
table.eau-tableau thead th { position: sticky; top: 0; z-index: 2; background: #fff; white-space: nowrap; }
table.eau-tableau tbody th { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; white-space: nowrap; font-weight: 400; }
table.eau-tableau tr.eau-type th { background: #f1f5ee; color: var(--accent); font-weight: 700; }
table.eau-tableau td { white-space: nowrap; }
tr.eau-arrete { opacity: .6; }
.eau-c-depasse { background: #fde4e1; color: var(--erreur); font-weight: 600; }
.eau-c-anomalie { background: #fdf0d5; color: #6b4410; }
.eau-c-douteux { color: #888; font-style: italic; }
.eau-c-changement { color: #2f5f80; }
.eau-vide { color: #aaa; text-align: center; }
.eau-legende { padding: 0 .35rem; border-radius: 4px; }
.eau-liste { list-style: none; padding: 0; margin: .3rem 0 .8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .35rem; }
.eau-liste li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .5rem .7rem; }
.eau-liste li a { display: flex; flex-direction: column; color: var(--texte); text-decoration: none; min-width: 0; }
.eau-liste li a:hover strong { color: var(--accent); text-decoration: underline; }
.eau-dernier { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eau-averifier { background: #fdf0d5; border-radius: 8px; padding: .5rem .8rem; margin-bottom: .8rem; }
.eau-averifier summary { cursor: pointer; font-weight: 600; color: #6b4410; }
.eau-admin { margin: 1rem 0; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .9rem; }
.eau-admin summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.eau-form textarea { width: 100%; font: inherit; padding: .5rem; border: 1px solid var(--bord); border-radius: 6px; }
.eau-form label.case { display: flex; align-items: center; gap: .4rem; color: var(--texte); }
.eau-form label.case input { width: auto; }
.eau-form button[type=submit] { width: auto; padding: .55rem 1.3rem; }
.eau-chiffres { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .5rem; margin: .8rem 0; }
.eau-chiffres > div { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .5rem .7rem; }
.eau-graphe { min-height: 240px; }
table.eau-releves td.eau-comm { white-space: normal; min-width: 16rem; font-size: .85rem; }
.eau-edition td { background: #f6f9f4; }
.eau-edition-champs { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.eau-edition-champs label { margin: 0; display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
.eau-edition-champs label.case { flex-direction: row; align-items: center; }
.eau-edition-champs input, .eau-edition-champs select { width: auto; min-width: 8rem; }
.eau-edition .tr-outils { margin-top: .5rem; }
.eau-edition .tr-outils button { width: auto; margin: 0; padding: .4rem .9rem; }
.eau-alerte h3 { display: flex; align-items: center; gap: .5rem; margin: 1.3rem 0 .4rem; }
.eau-alerte ul { margin: .2rem 0; padding-left: 1.2rem; }
.eau-alerte li { margin: .2rem 0; }
@media (max-width: 900px) {
  .eau-entetes { display: none; }
  .eau-ligne { grid-template-columns: 1fr 1fr; }
  .eau-nom { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: baseline; }
  .eau-saisie { grid-column: 1 / -1; flex-direction: row; }
  .eau-saisie input { flex: 1; min-width: 0; }
  .eau-controle, .eau-plus { grid-column: 1 / -1; }
}
.eau-alerte .compteur { display: inline-block; min-width: 1.5em; padding: 0 .4rem; border-radius: 999px; background: #fde4e1; color: var(--erreur); font-size: .85rem; text-align: center; }
.eau-periode { margin: 0; display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.eau-periode select { width: auto; }
.eau-historique { margin-top: 2rem; }
/* Analyses de sol : commentaires par parcelle */
.so-tableau td.so-com { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-com-nb { font-weight: 600; color: var(--accent); }
.so-commentaires { margin-top: 1.2rem; }
.so-com-liste { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .5rem; }
.so-com-liste li { border-left: 3px solid var(--accent); padding: .3rem .6rem; background: #f7f9f5; }
.so-com-liste li.so-com-traite { border-left-color: #bbb; opacity: .6; }
.so-com-texte { white-space: pre-wrap; }
.so-com-boutons { display: flex; gap: 1rem; margin-top: .2rem; }
.so-com-ajout textarea, .so-com-edition textarea { width: 100%; }
.so-com-ajout .actions, .so-com-edition .actions { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }
input.so-com-campagne { width: 7rem; }
.so-prev-com-parcelle { margin: .2rem 0 0; padding-left: 0; list-style: none; font-size: .85rem; color: #5b4a12; }
.so-prev-commentees { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
button.so-com-plus { width: 1.1rem; height: 1.1rem; min-height: 0; padding: 0; margin: 0 .35rem 0 0; border-radius: 50%; border: 1px solid #c4c4c4;
  background: transparent; color: #9a9a9a; font-size: .8rem; font-weight: 400; line-height: 1; vertical-align: middle; box-shadow: none; cursor: pointer; }
button.so-com-plus:hover, button.so-com-plus:focus-visible { color: #555; border-color: #888; background: #f2f2f2; }
.so-tableau td.so-com-saisie { white-space: nowrap; max-width: none; overflow: visible; }
.so-com-saisie input { width: 18rem; max-width: 60vw; padding: .3rem .5rem; font-size: .9rem; margin: 0 .3rem 0 0; display: inline-block; }
.so-com-saisie button { width: auto; margin: 0 .2rem 0 0; display: inline-block; }
/* Traitements cercosporiose */
.co-entete { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .8rem; }
.co-annee { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 600; }
.co-annee select { width: auto; }
.co-proprietes { display: flex; flex-wrap: wrap; gap: .3rem; }
.co-proprietes button { width: auto; margin: 0; padding: .3rem .7rem; font-size: .88rem; background: #fff; color: var(--texte); border: 1px solid var(--bord); }
.co-proprietes button.actif { background: var(--accent); color: #fff; border-color: var(--accent); }
.co-barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin: .4rem 0; }
.co-barre .aide { margin: 0; flex: 1 1 30rem; }
.co-barre label.case { margin: 0; color: var(--texte); }
.co-barre input[type=checkbox] { width: auto; }
table.co-table { font-size: .88rem; }
table.co-table tfoot th, table.co-table tfoot td { font-weight: 700; border-top: 2px solid var(--bord); }
table.co-table tr.co-sans th { color: var(--discret); font-weight: 400; }
table.co-table tr.co-type th { background: #f1f5ee; color: var(--accent); }
table.co-table tr.co-inactif { opacity: .55; }
.co-table td.co-remarque { max-width: 22rem; white-space: normal; font-size: .82rem; }
.co-table td.co-parcelles { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-alerte-rouge { color: var(--erreur); font-weight: 600; }
.co-alerte-orange { color: #a15c07; }
.co-depasse { background: #fde4e1; color: var(--erreur); font-weight: 600; }
.co-proche { background: #fdf0d5; }
.co-alertes .messages { margin: .3rem 0; }
.co-chiffres { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.co-chiffres > div { display: flex; flex-direction: column; padding: .4rem .7rem; border: 1px solid var(--bord); border-radius: 6px; background: #fff; min-width: 7rem; }
.co-chiffres strong { font-size: 1.05rem; }
.co-budget-entete { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; margin-bottom: .4rem; }
.co-budget-entete label { display: flex; align-items: center; gap: .4rem; margin: 0; }
.co-budget-entete select { width: auto; }
.co-defile { max-height: 75vh; overflow: auto; }
table.co-calendrier { font-size: .85rem; }
table.co-calendrier thead th, table.co-grille thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
table.co-calendrier td, table.co-calendrier th { padding: .15rem .35rem; vertical-align: middle; white-space: nowrap; }
table.co-calendrier select { width: auto; max-width: 11rem; padding: .2rem .3rem; font-size: .85rem; margin: 0; }
table.co-calendrier tr:not(.co-traitee) { color: var(--discret); }
table.co-calendrier tr.co-traitee { background: #f7f9f5; }
input.co-dose { width: 4.5rem; padding: .2rem .35rem; font-size: .85rem; margin: 0; text-align: right; }
input.co-invalide { border-color: var(--erreur); background: #fde4e1; }
table.co-grille { font-size: .78rem; }
table.co-grille th, table.co-grille td { padding: .15rem .25rem; white-space: nowrap; text-align: center; }
table.co-grille tbody th { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 400; }
table.co-grille td.co-fait { background: #e3efda; }
table.co-grille tr.co-ligne-prevu td { color: var(--discret); font-style: italic; }
table.co-grille tr.co-ligne-avis td.co-avis { background: #fdf0d5; color: #a15c07; }
button.co-case { width: 1.3rem; height: 1.3rem; min-height: 0; padding: 0; margin: 0; background: transparent; border: 1px dashed #ccc; color: #a15c07; font-size: .8rem; line-height: 1; }
.co-saisie { border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .9rem; margin: 0 0 1rem; background: #fff; }
.co-saisie summary { font-weight: 600; cursor: pointer; }
.co-saisie-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .5rem 0; }
.co-saisie-ligne label { display: flex; align-items: center; gap: .35rem; margin: 0; }
.co-saisie-ligne select, .co-saisie-ligne input[type=date] { width: auto; margin: 0; }
.co-saisie-ligne input[type=text]:not(.co-dose) { flex: 1 1 20rem; margin: 0; }
.co-parcelles-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .2rem .8rem; max-height: 16rem; overflow: auto; padding: .3rem; border: 1px solid var(--bord); border-radius: 6px; }
label.co-parcelle { display: flex; align-items: center; gap: .3rem; margin: 0; font-size: .88rem; }
label.co-parcelle input { width: auto; margin: 0; }
.co-nouveau label { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.co-nouveau select { width: auto; }
.co-form { display: grid; gap: .5rem; }
label.co-champ { display: grid; grid-template-columns: 14rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; margin: 0; }
label.co-champ > span:first-child { color: var(--texte); }
@media (max-width: 640px) { label.co-champ { grid-template-columns: 1fr; } }
/* Plan de fumure */
.fu-barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin: .5rem 0; }
.fu-barre .aide { margin: 0; flex: 1 1 30rem; }
.fu-annee { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 600; }
.fu-annee select { width: auto; }
table.fu-table { font-size: .86rem; }
table.fu-table caption { text-align: left; font-weight: 600; padding: .3rem 0; }
table.fu-table tfoot th, table.fu-table tfoot td { font-weight: 700; border-top: 2px solid var(--bord); }
table.fu-table tr.fu-besoins th, table.fu-table tr.fu-besoins td { font-weight: 400; color: var(--discret); border-top: 0; }
table.fu-blocs select, table.fu-blocs input[type=text] { width: auto; max-width: 14rem; margin: 0; padding: .2rem .35rem; font-size: .85rem; }
input.fu-nb { width: 5.5rem; padding: .2rem .35rem; font-size: .85rem; margin: 0; text-align: right; }
input.fu-invalide { border-color: var(--erreur); background: #fde4e1; }
.fu-alerte { color: #a15c07; }
td.fu-manque { color: var(--erreur); font-weight: 600; }
td.fu-hausse { color: var(--erreur); }
.fu-ancien { color: var(--discret); }
tr.fu-inactif { opacity: .6; }
.fu-commentaire { font-weight: 400; max-width: 22rem; white-space: normal; }
td.fu-compo { font-size: .8rem; color: var(--discret); max-width: 18rem; white-space: normal; }
.fu-chiffres { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.fu-chiffres > div { display: flex; flex-direction: column; padding: .4rem .7rem; border: 1px solid var(--bord); border-radius: 6px; background: #fff; min-width: 8rem; }
.fu-choix { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.fu-choix button { width: auto; margin: 0; padding: .3rem .7rem; font-size: .88rem; background: #fff; color: var(--texte); border: 1px solid var(--bord); }
.fu-choix button.actif { background: var(--accent); color: #fff; border-color: var(--accent); }
.fu-plan-entete { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .3rem 0; }
.fu-defile { max-height: 70vh; overflow: auto; }
table.fu-grille { font-size: .78rem; }
table.fu-grille th, table.fu-grille td { padding: .1rem .15rem; white-space: nowrap; }
table.fu-grille thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
table.fu-grille tr.fu-sem th { top: 1.4rem; color: var(--discret); font-weight: 400; }
table.fu-grille tr.fu-stades th { top: 2.8rem; }
table.fu-grille tbody th, table.fu-grille thead th:first-child { position: sticky; left: 0; z-index: 3; background: #fff; text-align: left; }
table.fu-grille td.fu-dose { background: #e3efda; }
table.fu-grille th.fu-fin-bilan { border-right: 2px solid var(--accent); }
input.fu-case { width: 2.6rem; padding: .1rem .15rem; font-size: .78rem; margin: 0; text-align: right; border-color: #e2e2e2; background: transparent; }
input.fu-stade-champ { width: 2.6rem; padding: .1rem; font-size: .7rem; margin: 0; border: 1px dashed #ddd; background: #fffdf5; }
th.fu-stade { font-weight: 400; font-size: .7rem; color: #a15c07; }
.fu-chaux { margin: 1rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.fu-form { display: grid; gap: .5rem; }
label.fu-champ { display: grid; grid-template-columns: 14rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; margin: 0; }
.fu-elements { display: flex; flex-wrap: wrap; gap: .5rem; }
.fu-elements label { display: flex; flex-direction: column; margin: 0; font-size: .85rem; }
.fu-nouveau label { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.fu-nouveau select { width: auto; }
@media (max-width: 640px) { label.fu-champ { grid-template-columns: 1fr; } }
/* Contrôle de la base */
.ct-resume { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: .6rem 0 1rem; font-weight: 600; }
.ct-resume .ct-erreur { color: var(--erreur); } .ct-resume .ct-avert { color: #a15c07; } .ct-resume .ct-info { color: var(--discret); }
details.ct-bloc { border: 1px solid var(--bord); border-left-width: 5px; border-radius: 6px; padding: .5rem .8rem; margin: .5rem 0; background: #fff; }
details.ct-bloc summary { cursor: pointer; }
details.ct-bloc .ct-titre { font-weight: 600; }
details.ct-bloc .ct-nb { font-size: .88rem; color: var(--discret); }
details.ct-erreur { border-left-color: var(--erreur); } details.ct-erreur .ct-nb { color: var(--erreur); font-weight: 600; }
details.ct-avert { border-left-color: #d08a1e; } details.ct-avert .ct-nb { color: #a15c07; font-weight: 600; }
details.ct-info { border-left-color: #9aa5b1; } details.ct-ok { border-left-color: #7fb069; }
table.ct-table { font-size: .86rem; }
table.ct-table select { width: auto; max-width: 18rem; margin: 0; padding: .2rem .35rem; font-size: .85rem; }

/* Fiche parcelle (analyses de sol) : bouton Fermer aussi en haut. */
.so-fiche-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.so-fiche-entete h2 { margin-top: 0; }
.so-fiche-entete button { flex: none; }

/* Import de l'historique des scores (CSV). */
.hi-resume { margin: .5rem 0 1rem; }
.hi-codes input.hi-nom { min-width: 16rem; }
.hi-codes input.hi-coef { width: 4.5rem; text-align: right; }
.hi-codes tr.hi-a-completer td { background: #fdf0d5; }

/* Analyse des scores, onglet EDN : écarts à N-1, extrêmes par colonne, matrices colorées. */
.edn-ecart { font-size: .8em; font-weight: 500; white-space: nowrap; }
.edn-mieux { color: #1a7f55; }
.edn-moins { color: var(--alerte); }
td.edn-bon { background: #e3f4ea; }
td.edn-mauvais { background: #fbe4e1; }
td.edn-total { font-weight: 600; border-top: 2px solid var(--axe); }
.edn-matrice td.edn-c0 { background: #e3f4ea; }
.edn-matrice td.edn-c2 { background: #fdf0d5; }
.edn-matrice td.edn-c3 { background: #fbe4e1; }
.edn-matrice th[scope="row"] { text-align: left; white-space: nowrap; }

/* Écrans des stations (réglages). */
.ec-carte { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 1rem 1.2rem; margin: 1rem 0; }
.ec-carte h2 { margin-top: 0; }
.ec-carte h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.ec-lien { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ec-url { flex: 1 1 22rem; font-family: monospace; font-size: .85rem; }
.ec-carte textarea { width: 100%; }
.ec-diapos { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .2rem 1rem; margin-bottom: .5rem; }
.ec-conseils td:first-child { width: 14rem; }
