/* AgriWeb 1.0 — feuille de style unique.
   Typographies : Young Serif (titres), Inter (texte), Caveat (touches manuscrites). */


:root {
  --foret: #1d5b38;
  --foret-fonce: #123d27;
  --foret-nuit: #0d2e1d;
  --pousse: #a7c548;
  --pousse-pale: #eef4dc;
  --fond: #f2f4f0;
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --encre: #18241d;
  --gris: #5b675f;
  --gris-clair: #8a958d;
  --trait: #dde3da;
  --trait-fort: #c6cfc3;
  --alerte: #b13d2b;
  --alerte-pale: #fbe9e5;
  --ambre: #9a6512;
  --ambre-pale: #fbf0dc;
  --info: #2b5c87;
  --info-pale: #e5eef6;
  --ok: #1d6b3d;
  --ok-pale: #e3f1e6;
  --ombre: 0 1px 2px rgba(18, 61, 39, .06), 0 4px 16px rgba(18, 61, 39, .05);
  --ombre-forte: 0 12px 40px rgba(13, 46, 29, .22);
  --r: 8px;
  --r-bloc: 12px;
  --titres: "Bricolage", "Atkinson", system-ui, sans-serif;
  --texte: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --menu: 248px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 15px/1.5 var(--texte); }
h1, h2, h3 { font-family: var(--titres); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
a { color: var(--foret); text-underline-offset: 2px; }
a:hover { color: var(--foret-fonce); }
img { max-width: 100%; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--pousse); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -999px; top: 8px; background: var(--foret); color: #fff; padding: 8px 14px; border-radius: var(--r); z-index: 99; }
.evitement:focus { left: 8px; }
.muted { color: var(--gris); }
.ic { flex: none; }

/* ---------- Boutons et champs ---------- */
.bouton, button.bouton, a.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--trait-fort); border-radius: var(--r); background: var(--surface); color: var(--encre);
  font: 700 .9rem/1.2 var(--texte); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.bouton:hover { background: var(--surface-2); border-color: var(--gris-clair); color: var(--encre); }
.bouton.principal { background: var(--foret); border-color: var(--foret); color: #fff; }
.bouton.principal:hover { background: var(--foret-fonce); }
.bouton.danger { color: var(--alerte); border-color: #e4b9b0; }
.bouton.petit { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
.bouton.grand { min-height: 46px; width: 100%; font-size: 1rem; }
.bouton:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.bouton-icone { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--gris); cursor: pointer; padding: 0; font-size: 1rem; }
.bouton-icone:hover { background: var(--surface-2); color: var(--encre); border-color: var(--trait); }
.lien-bouton { background: none; border: 0; padding: 0; color: var(--foret); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--trait-fort); border-radius: var(--r);
  background: var(--surface); color: var(--encre); font: 15px/1.4 var(--texte);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--foret); box-shadow: 0 0 0 3px rgba(167, 197, 72, .45); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--foret); margin: 0; flex: none; }
input[type="color"] { padding: 3px; }
input[readonly] { background: var(--surface-2); }

.champ { display: grid; gap: 5px; align-content: start; min-width: 0; border: 0; margin: 0; padding: 0; }
.champ > span, .champ > legend { font-weight: 700; font-size: .86rem; color: var(--encre); padding: 0; }
.champ small { color: var(--gris); font-size: .82rem; }
.champ.large, .champ-case.large { grid-column: 1 / -1; }
.requis { color: var(--alerte); font-weight: 400; }
.champ-case { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; padding: 8px 0; cursor: pointer; }
.champ-case input { margin-top: 2px; }
.grille-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.avec-ajout { display: flex; gap: 6px; }
.avec-ajout select { flex: 1; min-width: 0; }
.avec-ajout .bouton-icone { border-color: var(--trait-fort); height: 40px; width: 40px; }
.choix-multiples { display: flex; flex-wrap: wrap; gap: 8px; }
.choix-multiples.defilant { max-height: 190px; overflow: auto; padding: 4px; border: 1px solid var(--trait); border-radius: var(--r); }
.puce-choix { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--trait-fort); border-radius: 999px; cursor: pointer; font-size: .9rem; background: var(--surface); }
.puce-choix:has(input:checked) { border-color: var(--foret); background: var(--pousse-pale); }
.erreur { color: var(--alerte); font-weight: 700; margin: 0; }
.aide { color: var(--gris); font-size: .9rem; }
.note { color: var(--gris); font-size: .86rem; margin-top: 14px; max-width: 80ch; }

/* ---------- Structure de l'application ---------- */
#espace { min-height: 100vh; }
#menu {
  position: fixed; inset: 0 auto 0 0; width: var(--menu); background: var(--foret-nuit); color: #e9dfd0;
  display: flex; flex-direction: column; z-index: 30; overflow-y: auto; scrollbar-width: thin;
}
.menu-tete { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px; }
.marque { display: inline-flex; background: #fff; border-radius: var(--r); padding: 7px 10px; }
.marque img { display: block; height: 26px; width: auto; }
.fermer-menu { display: none; color: #e9dfd0; }
#nav { padding: 0 10px 24px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-groupe { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; }
.nav-groupe + .nav-groupe { border-top: 1px solid rgba(255, 255, 255, .07); }
.nav-titre { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: .78rem; font-weight: 700; color: #b9a993; list-style: none; cursor: default; }
summary.nav-titre { cursor: pointer; }
summary.nav-titre::-webkit-details-marker { display: none; }
summary.nav-titre::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
details[open] > summary.nav-titre::after { transform: rotate(45deg); }
.nav-titre .lien-bouton { color: #d8c8b4; font-size: .78rem; text-decoration: none; }
.nav-aide { font-size: .82rem; color: #a8998a; padding: 2px 10px 6px; margin: 0; }
.nav-lien { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r); color: #e9dfd0; text-decoration: none; font-size: .93rem; position: relative; }
.nav-lien:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-lien[aria-current="page"] { background: rgba(167, 197, 72, .16); color: #fff; font-weight: 700; }
.nav-lien[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--pousse); }
.nav-lien .ic { color: #b9a993; }
.nav-lien[aria-current="page"] .ic { color: var(--pousse); }
.nav-bas { margin-top: auto; }
.voile { display: none; }

.colonne { margin-left: var(--menu); min-height: 100vh; display: flex; flex-direction: column; }
.barre {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 28px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait);
}
.barre-espace { min-width: 0; }
.nom-espace { font-family: var(--titres); font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 260px; }
#choix-espace { min-height: 36px; font-weight: 700; max-width: 260px; }
#recherche-globale { flex: 1; max-width: 560px; margin-left: auto; position: relative; display: flex; align-items: center; }
#recherche-globale svg { position: absolute; left: 12px; color: var(--gris); pointer-events: none; }
#recherche-globale input { padding-left: 36px; background: var(--fond); border-color: transparent; min-height: 38px; }
#recherche-globale input:focus { background: #fff; border-color: var(--foret); }
.compte { position: relative; }
.compte summary { list-style: none; cursor: pointer; }
.compte summary::-webkit-details-marker { display: none; }
.initiales { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--foret); color: #fff; font-weight: 700; font-size: .82rem; }
.compte-menu { position: absolute; right: 0; top: 44px; width: 260px; background: #fff; border: 1px solid var(--trait); border-radius: var(--r-bloc); box-shadow: var(--ombre-forte); padding: 8px; display: grid; }
.compte-menu p { padding: 8px 10px 10px; border-bottom: 1px solid var(--trait); margin-bottom: 4px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.compte-menu p span { color: var(--gris); font-size: .86rem; }
.compte-menu a, .compte-menu button { display: block; text-align: left; padding: 9px 10px; border-radius: 6px; color: var(--encre); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.compte-menu a:hover, .compte-menu button:hover { background: var(--surface-2); }

main#principal { flex: 1; outline: none; }
#app { padding: 26px 28px 56px; max-width: 1480px; width: 100%; margin: 0 auto; }
.pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; padding: 18px 28px; border-top: 1px solid var(--trait); color: var(--gris); font-size: .82rem; }
.pied nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pied a { color: var(--gris); }
#barre-mobile { display: none; }

.progression { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--pousse); z-index: 60; transition: width .3s; }
body.chargement .progression { width: 70%; transition: width 4s cubic-bezier(.1, .7, .2, 1); }
body.chargement #app { opacity: .65; transition: opacity .2s .1s; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80;
  background: var(--foret-nuit); color: #fff; padding: 11px 18px; border-radius: var(--r); box-shadow: var(--ombre-forte); max-width: min(560px, calc(100vw - 32px)); transition: .2s; font-weight: 700; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.erreur { background: var(--alerte); }

/* ---------- En-têtes, onglets, blocs ---------- */
.tete-page { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 24px; margin-bottom: 20px; }
.tete-texte { flex: 1 1 340px; min-width: 0; }
.tete-texte p { color: var(--gris); margin: 6px 0 0; max-width: 72ch; }
.tete-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.retour { flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; color: var(--gris); font-weight: 700; font-size: .88rem; text-decoration: none; margin-bottom: -6px; }
.retour:hover { color: var(--foret); }
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--trait); margin: -4px 0 20px; overflow-x: auto; scrollbar-width: none; }
.onglets a { padding: 10px 14px; color: var(--gris); text-decoration: none; font-weight: 700; font-size: .9rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets a:hover { color: var(--encre); }
.onglets a[aria-current="page"] { color: var(--foret); border-bottom-color: var(--foret); }

.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-bloc); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--ombre); min-width: 0; }
.bloc-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bloc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bloc > h2 { margin-bottom: 10px; }
.colonnes-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.colonnes-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.colonnes-2 > .bloc, .colonnes-3 > .bloc { margin-bottom: 0; }
.colonnes-2, .colonnes-3 { margin-bottom: 18px; }
.espace-haut { margin-top: 18px; }
.pile { display: grid; gap: 18px; align-content: start; }
.pile > .bloc { margin-bottom: 0; }
.espace-bas { margin-bottom: 18px; }
.texte-long { white-space: pre-wrap; margin: 0; overflow-wrap: anywhere; }

.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.indicateur { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-bloc); padding: 14px 16px; display: flex; flex-direction: column-reverse; gap: 2px; }
.indicateur strong { font-family: var(--titres); font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.indicateur span { color: var(--gris); font-size: .86rem; }
.indicateur.alerte strong { color: var(--alerte); }
.indicateur.accent { background: var(--foret); border-color: var(--foret); }
.indicateur.accent strong { color: #fff; }
.indicateur.accent span { color: #d8c8b4; }

.bandeau { display: flex; align-items: center; gap: 14px; background: var(--info-pale); color: var(--encre); border: 1px solid #c9d9e8; border-radius: var(--r-bloc); padding: 12px 16px; margin-bottom: 18px; }
.bandeau > .ic { color: var(--info); }
.bandeau div { flex: 1; min-width: 0; }
.bandeau p { margin: 2px 0 0; color: var(--gris); font-size: .9rem; overflow-wrap: anywhere; }
.bandeau.alerte { background: var(--alerte-pale); border-color: #efc6bd; }
.bandeau.alerte > .ic { color: var(--alerte); }
.bandeau.accueil { background: var(--pousse-pale); border-color: #dfd3a8; }
.bandeau.accueil > .ic { color: var(--foret); }

.vide { text-align: center; padding: 34px 20px; color: var(--gris); border: 1px dashed var(--trait-fort); border-radius: var(--r-bloc); background: var(--surface-2); }
.vide > div { margin-top: 14px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.pastille { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #f1ebe0; color: #4f453c; white-space: nowrap; }
.pastille.ok { background: var(--ok-pale); color: var(--ok); }
.pastille.alerte { background: var(--alerte-pale); color: var(--alerte); }
.pastille.info { background: var(--info-pale); color: var(--info); }
.pastille.ambre { background: var(--ambre-pale); color: var(--ambre); }

.definitions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; margin: 0; }
.definitions dt { color: var(--gris); font-size: .82rem; }
.definitions dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Listes ---------- */
.outils-liste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.recherche-liste { position: relative; flex: 1 1 260px; max-width: 380px; display: flex; align-items: center; }
.recherche-liste .ic { position: absolute; left: 11px; color: var(--gris); }
.recherche-liste input { padding-left: 34px; min-height: 36px; }
.compte-liste { color: var(--gris); font-size: .86rem; }
.outils-droite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.outils-droite select { width: auto; min-height: 34px; padding: 5px 10px; font-size: .88rem; max-width: 220px; }
.segment { display: inline-flex; border: 1px solid var(--trait-fort); border-radius: var(--r); overflow: hidden; }
.segment button { border: 0; background: #fff; padding: 6px 10px; cursor: pointer; color: var(--gris); display: inline-flex; align-items: center; gap: 4px; font: 700 .86rem var(--texte); }
.segment button + button { border-left: 1px solid var(--trait-fort); }
.segment button[aria-pressed="true"] { background: var(--pousse-pale); color: var(--foret); }

.tableau-cadre { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-bloc); overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th { text-align: left; font-weight: 700; color: var(--gris); font-size: .8rem; background: var(--surface-2); border-bottom: 1px solid var(--trait); padding: 0; white-space: nowrap; position: sticky; top: 0; }
.tableau th .tri { background: none; border: 0; font: inherit; color: inherit; padding: 10px 12px; cursor: pointer; width: 100%; text-align: left; }
.tableau th .tri:hover { color: var(--encre); }
.tableau th[scope]:last-child { width: 1%; }
.tableau td { padding: 10px 12px; border-bottom: 1px solid #efe8dc; vertical-align: top; overflow-wrap: anywhere; max-width: 340px; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau td:first-child { min-width: 150px; }
.tableau tbody tr:hover { background: #fbf8f2; }
.tableau .actions-ligne { white-space: nowrap; text-align: right; }
.actions-ligne { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td.actions-ligne { display: table-cell; }
td.actions-ligne > * { margin-left: 4px; }
.lien-fiche { font-weight: 700; color: var(--encre); text-decoration: none; }
.lien-fiche:hover { color: var(--foret); text-decoration: underline; }
.lien-discret { color: inherit; }
.ligne-groupe td { background: var(--surface-2); font-weight: 700; color: var(--foret); font-size: .84rem; padding: 7px 12px; }
.ligne-groupe.retard td { color: var(--alerte); }
.cartes-fiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.carte-fiche { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-bloc); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.carte-fiche dl { margin: 0; display: grid; gap: 6px; }
.carte-fiche dt { color: var(--gris); font-size: .78rem; }
.carte-fiche dd { margin: 0; overflow-wrap: anywhere; }
.carte-fiche .actions-ligne { margin-top: auto; justify-content: flex-start; }

/* ---------- Panneaux et fenêtres ---------- */
dialog { border: 0; padding: 0; color: var(--encre); background: var(--surface); }
dialog::backdrop { background: rgba(13, 46, 29, .42); }
dialog.panneau { position: fixed; max-width: none; margin: 0 0 0 auto; inset: 0 0 0 auto; height: 100dvh; max-height: none; width: min(560px, 100vw); box-shadow: var(--ombre-forte); }
dialog.panneau.panneau-large { width: min(980px, 100vw); }
dialog.panneau[open] { animation: entrer-droite .22s ease-out; }
dialog.fenetre { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); border-radius: var(--r-bloc); box-shadow: var(--ombre-forte); display: none; }
dialog.fenetre[open] { display: flex; flex-direction: column; }
dialog.fenetre.fenetre-large { width: min(1080px, calc(100vw - 24px)); }
@keyframes entrer-droite { from { transform: translateX(40px); opacity: 0; } }
dialog.panneau form { height: 100%; display: flex; flex-direction: column; }
.panneau-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--trait); }
.panneau-corps, .fenetre-corps { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.panneau-corps > * + * { margin-top: 16px; }
.panneau-corps > .grille-champs + * { margin-top: 18px; }
.panneau-pied { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--trait); background: var(--surface-2); flex-wrap: wrap; }
.panneau-pied .erreur { flex: 1 1 100%; }
.panneau-pied .erreur:empty { display: none; }
.texte-confirmation { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; }
.liste-colonnes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.liste-colonnes li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border: 1px solid var(--trait); border-radius: var(--r); }
.liste-colonnes label { display: flex; gap: 10px; align-items: center; cursor: pointer; flex: 1; }
.code { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px; overflow: auto; max-height: 50vh; }
textarea.code { min-height: 300px; font-family: ui-monospace, Menlo, monospace; font-size: .82rem; }

/* ---------- Écrans d'accès ---------- */
#acces:not([hidden]) { min-height: 100vh; }
.chargement-initial { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--gris); }
.acces { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 0.9fr) 1.3fr; }
.acces-recit { background: var(--foret-nuit); color: #e9dfd0; padding: 40px clamp(28px, 4vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.acces-recit::after { content: ""; position: absolute; inset: auto -20% -38% -20%; height: 70%; background: repeating-linear-gradient(-12deg, rgba(167, 197, 72, .09) 0 2px, transparent 2px 26px); transform: perspective(500px) rotateX(55deg); pointer-events: none; }
.acces-logo { display: inline-flex; background: #fff; padding: 9px 12px; border-radius: var(--r); align-self: flex-start; }
.acces-logo img { display: block; height: 32px; width: auto; }
.acces-recit h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.12; color: #fff; max-width: 15ch; margin-bottom: 14px; }
.acces-recit p { color: #d8c8b4; max-width: 40ch; }
.acces-recit ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.acces-recit li { display: flex; gap: 10px; align-items: center; }
.acces-recit li .ic { color: var(--pousse); }
.acces-contenu { display: grid; place-items: center; padding: 40px 24px; }
.acces-boite { width: min(440px, 100%); }
.acces-boite-large { width: min(860px, 100%); }
.acces-boite h1 { font-size: 1.9rem; margin-bottom: 8px; }
.acces-boite h2 { margin: 26px 0 12px; }
.chapo { color: var(--gris); font-size: 1.02rem; margin-bottom: 22px; }
.contexte { background: var(--pousse-pale); padding: 8px 12px; border-radius: var(--r); font-weight: 700; }
#form-acces { display: grid; gap: 14px; }
.message-acces { min-height: 1.4em; color: var(--foret); font-weight: 700; margin: 0; }
.liens-acces { display: flex; justify-content: space-between; margin-top: 18px; gap: 12px; flex-wrap: wrap; }
.attente { color: var(--gris); font-size: 1.05rem; }
.arguments { list-style: none; padding: 0; display: grid; gap: 10px; margin: 0 0 24px; }
.arguments li { display: flex; gap: 10px; align-items: flex-start; }
.arguments .ic { color: var(--foret); margin-top: 2px; }
.actions-pile { display: grid; gap: 10px; margin-bottom: 12px; }
.offres-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 26px; }
.offres-mini div { border: 1px solid var(--trait); border-radius: var(--r); padding: 10px; display: grid; gap: 2px; font-size: .86rem; }
.offres-mini .actuelle { border-color: var(--foret); background: var(--pousse-pale); }
.offres-mini small { color: var(--gris); }
.invitation { display: flex; gap: 12px; align-items: center; border: 1px solid var(--pousse); background: var(--pousse-pale); padding: 12px 14px; border-radius: var(--r-bloc); margin-bottom: 14px; }
.invitation div { flex: 1; display: grid; }
.invitation span { color: var(--gris); font-size: .88rem; }
#form-espace .bouton.grand { margin-top: 18px; }
.selection-modules { border: 0; padding: 0; margin: 22px 0 0; }
.selection-modules legend { font-family: var(--titres); font-weight: 700; font-size: 1.12rem; padding: 0; margin-bottom: 4px; }
.compteur-modules { font-weight: 700; color: var(--foret); }
.grille-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.module-choix { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--trait-fort); border-radius: var(--r); padding: 10px 12px; cursor: pointer; background: #fff; }
.module-choix input { margin-top: 3px; }
.module-choix span { display: grid; gap: 2px; }
.module-choix small { color: var(--gris); font-size: .82rem; line-height: 1.35; }
.module-choix:has(input:checked) { border-color: var(--foret); background: var(--pousse-pale); }
.module-choix:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* ---------- Tableau de bord ---------- */
.accueil-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 22px; }
.accueil-tete h1 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); }
.accueil-tete p { color: var(--gris); margin: 4px 0 0; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; }
.agenda li { display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: start; padding: 11px 0; border-top: 1px solid #efe8dc; }
.agenda li:first-child { border-top: 0; }
.agenda-date { font-family: var(--titres); font-weight: 700; font-size: .9rem; color: var(--gris); line-height: 1.25; }
.agenda-date.retard { color: var(--alerte); }
.agenda-date.jour { color: var(--foret); }
.agenda-texte { min-width: 0; }
.agenda-texte strong, .agenda-texte a { display: block; overflow-wrap: anywhere; }
.agenda-texte span { color: var(--gris); font-size: .86rem; }
.agenda-montant { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entonnoir { display: grid; gap: 10px; }
.entonnoir-ligne { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; font-size: .9rem; }
.entonnoir-piste { height: 10px; background: #efe8dc; border-radius: 999px; overflow: hidden; }
.entonnoir-piste span { display: block; height: 100%; background: var(--foret); border-radius: 999px; min-width: 2px; }
.entonnoir-ligne strong { font-variant-numeric: tabular-nums; }
.fil { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fil li { display: grid; gap: 1px; padding-left: 14px; border-left: 2px solid var(--trait); }
.fil time { color: var(--gris); font-size: .8rem; }
.raccourcis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.raccourci { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--trait); border-radius: var(--r); text-decoration: none; color: var(--encre); background: #fff; }
.raccourci:hover { border-color: var(--foret); color: var(--encre); }
.raccourci .ic { color: var(--foret); margin-top: 2px; }
.raccourci small { display: block; color: var(--gris); font-size: .82rem; }

/* ---------- Dossier client ---------- */
.dossier { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.mini-liste { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-liste li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #efe8dc; align-items: baseline; }
.mini-liste li:first-child { border-top: 0; }
.mini-liste small { color: var(--gris); }
.actions-rapides { display: flex; flex-wrap: wrap; gap: 6px; }
.filtres-relation { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filtres-relation a { padding: 6px 12px; border: 1px solid var(--trait-fort); border-radius: 999px; text-decoration: none; color: var(--encre); font-size: .88rem; font-weight: 700; background: #fff; }
.filtres-relation a[aria-current="true"] { background: var(--foret); border-color: var(--foret); color: #fff; }
.section-titre { margin: 26px 0 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Pipeline ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filtres label { display: grid; gap: 3px; font-size: .8rem; font-weight: 700; color: var(--gris); }
.filtres select, .filtres input { width: auto; min-height: 36px; padding: 5px 10px; font-size: .9rem; min-width: 150px; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.etape { background: #ece4d6; border-radius: var(--r-bloc); padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; transition: background .15s, box-shadow .15s; }
.etape.survol { background: var(--pousse-pale); box-shadow: inset 0 0 0 2px var(--pousse); }
.etape-tete { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 4px; gap: 8px; }
.etape-tete h2 { font-size: .95rem; }
.etape-tete span { color: var(--gris); font-size: .82rem; font-variant-numeric: tabular-nums; }
.carte-affaire { background: #fff; border: 1px solid var(--trait); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 6px; cursor: grab; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.carte-affaire:active { cursor: grabbing; }
.carte-affaire.glisse { opacity: .45; }
.carte-affaire-haut { display: flex; justify-content: space-between; gap: 6px; font-size: .82rem; }
.carte-affaire-haut a { color: var(--gris); font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-affaire p { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.carte-affaire .montant { font-family: var(--titres); font-weight: 700; font-variant-numeric: tabular-nums; }
.carte-affaire .suite { font-size: .84rem; color: var(--gris); }
.carte-affaire .suite.retard { color: var(--alerte); font-weight: 700; }
.carte-affaire-bas { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; font-size: .82rem; color: var(--gris); }
.ajout-etape { border: 1px dashed var(--trait-fort); background: transparent; border-radius: var(--r); padding: 7px; color: var(--gris); font: 700 .86rem var(--texte); cursor: pointer; }
.ajout-etape:hover { border-color: var(--foret); color: var(--foret); background: #fff; }
.issues { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.issue { background: #fff; border: 1px solid var(--trait); border-radius: var(--r-bloc); padding: 10px 14px; }
.issue summary { display: flex; justify-content: space-between; cursor: pointer; font-weight: 700; gap: 10px; }
.issue[open] summary { margin-bottom: 10px; }
.issue > div { display: grid; gap: 8px; }
.issue.survol { box-shadow: inset 0 0 0 2px var(--pousse); }

/* ---------- Divers modules ---------- */
.lignes-editeur { display: grid; gap: 8px; }
.ligne-devis { display: grid; grid-template-columns: minmax(0, 3fr) 90px 110px 90px 36px; gap: 6px; align-items: center; }
.total { font-family: var(--titres); font-weight: 700; font-size: 1.15rem; text-align: right; margin-top: 8px; }
.document-imprimable { background: #fff; border: 1px solid var(--trait); border-radius: var(--r-bloc); padding: clamp(18px, 4vw, 44px); max-width: 900px; }
.document-imprimable header { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.progres { height: 8px; background: #efe8dc; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progres i { display: block; height: 100%; background: var(--foret); }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.carte { background: #fff; border: 1px solid var(--trait); border-radius: var(--r-bloc); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.carte h3 { overflow-wrap: anywhere; }
.carte p { margin: 0; color: var(--gris); font-size: .9rem; }
.carte .actions-ligne { justify-content: flex-start; margin-top: auto; padding-top: 6px; }
.carte.inactive { background: var(--surface-2); }
.carte.actuelle { border-color: var(--foret); box-shadow: inset 0 0 0 1px var(--foret); }
.prix { font-family: var(--titres); font-size: 1.6rem; font-weight: 700; margin: 4px 0; }
.prix small { font-size: .9rem; font-weight: 500; color: var(--gris); }
.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendrier .jour-semaine { font-weight: 700; color: var(--gris); font-size: .8rem; text-align: center; padding: 4px; }
.calendrier .case { min-height: 92px; background: #fff; border: 1px solid var(--trait); border-radius: 6px; padding: 5px; display: grid; align-content: start; gap: 3px; font-size: .78rem; min-width: 0; }
.calendrier .case.aujourdhui { border-color: var(--foret); }
.calendrier .case a { display: block; background: var(--pousse-pale); border-radius: 4px; padding: 2px 4px; text-decoration: none; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graphique { width: 100%; height: auto; color: var(--foret); }
.alerte-ligne { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #efe8dc; }
.alerte-ligne:first-child { border-top: 0; }
.alerte-ligne .ic { color: var(--ambre); margin-top: 2px; }
.apercu-site { width: 100%; height: 70vh; border: 1px solid var(--trait); border-radius: var(--r); background: #fff; transition: width .2s; }
.apercu-site.mobile { width: 390px; max-width: 100%; display: block; margin: 0 auto; }
.editeur-site { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 18px; }
.bloc-site { border: 1px solid var(--trait); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; background: var(--surface-2); }
.miniature-modele { height: 120px; border-radius: var(--r); background-size: cover; background-position: center; position: relative; overflow: hidden; }
.miniature-modele span { position: absolute; left: 10px; bottom: 10px; background: rgba(255, 255, 255, .92); padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: .82rem; }
.apercu-social { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--r); padding: 12px; font-size: .92rem; overflow-wrap: anywhere; }
.json { white-space: pre-wrap; font-size: .8rem; max-height: 300px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: var(--r); }
.avertissement { background: var(--ambre-pale); color: var(--ambre); padding: 8px 12px; border-radius: var(--r); font-weight: 700; }
.compare td { vertical-align: top; }
.compare pre { white-space: pre-wrap; margin: 0; font-family: inherit; }
.etapes-depart { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.etape-depart { border: 1px solid var(--trait); border-radius: var(--r); padding: 12px; display: grid; gap: 6px; }
.etape-depart.faite { border-color: var(--pousse); background: var(--pousse-pale); }
.etape-depart b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--foret); color: #fff; font-size: .82rem; }

/* ---------- Écrans moyens ---------- */
@media (max-width: 1180px) {
  .dossier { grid-template-columns: 1fr; }
  .colonnes-3 { grid-template-columns: 1fr 1fr; }
  .editeur-site { grid-template-columns: 1fr; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  body { font-size: 15.5px; }
  #menu { transform: translateX(-100%); transition: transform .22s ease; width: min(300px, 86vw); box-shadow: var(--ombre-forte); }
  body.menu-ouvert #menu { transform: none; }
  body.menu-ouvert .voile { display: block; position: fixed; inset: 0; background: rgba(13, 46, 29, .45); z-index: 25; }
  .fermer-menu { display: inline-grid; }
  .colonne { margin-left: 0; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .barre { padding: 8px 14px; gap: 10px; }
  #recherche-globale { display: none; }
  .barre-espace { flex: 1; }
  #app { padding: 18px 16px 40px; }
  .pied { padding: 16px; }
  #barre-mobile {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 28;
    background: #fff; border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom);
  }
  #barre-mobile a, #barre-mobile button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; font: 700 .7rem var(--texte); color: var(--gris); text-decoration: none; background: none; border: 0; }
  #barre-mobile [aria-current="page"] { color: var(--foret); }
  .grille-champs, .colonnes-2, .colonnes-3, .issues, .etapes-depart { grid-template-columns: 1fr; }
  .tete-page { align-items: stretch; }
  .tete-actions { width: 100%; }
  .tete-actions .bouton { flex: 1 1 auto; }
  .indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .indicateur strong { font-size: 1.25rem; }
  .outils-droite { margin-left: 0; width: 100%; }
  .recherche-liste { max-width: none; }
  /* Les tableaux deviennent des cartes empilées */
  .tableau-cadre { background: none; border: 0; overflow: visible; }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { display: none; }
  .tableau tr { background: #fff; border: 1px solid var(--trait); border-radius: var(--r-bloc); margin-bottom: 10px; padding: 8px 12px; }
  .tableau td { border: 0; padding: 4px 0; max-width: none; display: grid; grid-template-columns: 40% 1fr; gap: 10px; }
  .tableau td::before { content: attr(data-label); color: var(--gris); font-size: .8rem; }
  .tableau td:first-child { grid-template-columns: 1fr; font-size: 1.02rem; padding-bottom: 6px; }
  .tableau td:first-child::before { display: none; }
  .tableau td.actions-ligne { display: flex; justify-content: flex-start; grid-template-columns: none; padding-top: 8px; }
  .tableau td.actions-ligne::before { display: none; }
  .tableau td:not([data-label]) { grid-template-columns: 1fr; }
  .tableau td:not([data-label])::before { display: none; }
  .ligne-groupe { background: none !important; border: 0 !important; padding: 8px 0 2px !important; }
  .ligne-groupe td { background: none; padding: 0; }
  dialog.panneau, dialog.panneau.panneau-large { width: 100vw; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  dialog.panneau[open] { animation: entrer-bas .22s ease-out; }
  .acces { grid-template-columns: 1fr; }
  .acces-recit { padding: 22px; gap: 18px; }
  .acces-recit h2 { font-size: 1.35rem; max-width: none; }
  .acces-recit ul, .acces-recit p { display: none; }
  .acces-recit::after { display: none; }
  .acces-contenu { place-items: start center; padding: 26px 16px 40px; }
  .agenda li { grid-template-columns: 64px 1fr; }
  .agenda-montant { grid-column: 2; }
  .entonnoir-ligne { grid-template-columns: 90px 1fr auto; }
  .ligne-devis { grid-template-columns: 1fr 1fr 1fr 36px; }
  .ligne-devis > :first-child { grid-column: 1 / -1; }
  .calendrier .case { min-height: 60px; }
  .offres-mini { grid-template-columns: 1fr; }
  .masquer-mobile { display: none; }
}
@keyframes entrer-bas { from { transform: translateY(30px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Impression ---------- */
@media print {
  #menu, .barre, .pied, #barre-mobile, .tete-actions, .onglets, .outils-liste, .actions-ligne, .bandeau, .toast, .retour, .bloc-actions { display: none !important; }
  .colonne { margin: 0; }
  #app { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .bloc, .tableau-cadre, .document-imprimable { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
.editeur-site > div:last-child { position: sticky; top: 0; align-self: start; }

/* =====================================================================
   Thème Terroir (inspiré d'O'Terroir) : crème, brun, vert AgriWeb, Young Serif + Inter + Caveat
   ===================================================================== */

@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Young Serif"; src: url("fonts/young-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Vert AgriWeb, repris du logo, réchauffé */
  --foret: #2c6b3c;
  --foret-fonce: #22532f;
  --foret-nuit: #2a221c;        /* menu : brun « terre » d'O'Terroir */
  --pousse: #a5c251;
  --pousse-pale: #eef1dc;
  /* Papier crème et encre brune */
  --fond: #f4efe6;
  --surface: #ffffff;
  --surface-2: #fbf8f2;
  --encre: #2a221c;
  --gris: #6b5d50;
  --gris-clair: #a8998a;
  --trait: #e2d8c8;
  --trait-fort: #d8c8b4;
  /* Terre cuite pour ce qui demande de l'attention */
  --alerte: #a8432a;
  --alerte-pale: #fbe7df;
  --ambre: #8f5d14;
  --ambre-pale: #f8ecd6;
  --info: #3f5f6e;
  --info-pale: #e8eeee;
  --ok: #2c6b3c;
  --ok-pale: #e6efe0;
  --ombre: none;
  --ombre-forte: 0 18px 50px rgba(42, 34, 28, .22);
  --r: 10px;
  --r-bloc: 16px;
  --titres: "Young Serif", Georgia, serif;
  --texte: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --main: "Caveat", "Segoe Script", cursive;
}

body { font-size: 15px; }
h1, h2, h3 { font-weight: 400; letter-spacing: 0; }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.12; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
:focus-visible { outline-color: #e08a6a; }

/* Touche manuscrite */
.main, em.main { font-family: var(--main); font-style: normal; font-weight: 700; color: var(--foret); font-size: 1.12em; line-height: 1; }
.surtitre { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem !important; font-weight: 600; color: var(--gris) !important; margin: 0 0 10px !important; }

/* Boutons en pastille, comme sur O'Terroir */
.bouton, button.bouton, a.bouton { border-radius: 999px; font-weight: 600; padding: 7px 18px; border-color: var(--encre); background: transparent; }
.bouton:hover { background: #fff; border-color: var(--encre); }
.bouton.principal { background: var(--foret); border-color: var(--foret); }
.bouton.principal:hover { background: var(--foret-fonce); border-color: var(--foret-fonce); }
.bouton.petit { padding: 4px 13px; border-color: var(--trait-fort); background: #fff; }
.bouton.petit:hover { border-color: var(--encre); }
.bouton.danger { border-color: #e9b8a6; }
input, select, textarea { border-radius: var(--r); border-color: var(--trait-fort); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(165, 194, 81, .35); }
.champ > span, .champ > legend { font-weight: 600; }

/* Menu brun, texte crème */
#menu { color: #e9dfd0; }
.marque { background: transparent; padding: 0; }
.marque img { height: 30px; filter: none; background: #fbf8f2; border-radius: 10px; padding: 6px 10px; box-sizing: content-box; }
.nav-titre { color: #b9a993; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 600; }
.nav-titre .lien-bouton { color: #d8c8b4; text-transform: none; letter-spacing: 0; }
.nav-aide { color: #a8998a; }
.nav-groupe + .nav-groupe { border-top-color: rgba(244, 239, 230, .09); }
.nav-lien { color: #e9dfd0; border-radius: 999px; padding: 8px 14px; }
.nav-lien .ic { color: #b9a993; }
.nav-lien:hover { background: rgba(244, 239, 230, .07); }
.nav-lien[aria-current="page"] { background: #f4efe6; color: var(--encre); font-weight: 600; }
.nav-lien[aria-current="page"]::before { display: none; }
.nav-lien[aria-current="page"] .ic { color: var(--foret); }
.fermer-menu { color: #e9dfd0; }

/* Barre du haut sur papier */
.barre { background: rgba(244, 239, 230, .9); border-bottom-color: var(--trait); }
.nom-espace { font-weight: 400; font-size: 1.05rem; }
#recherche-globale input { background: #fff; border-color: var(--trait); border-radius: 999px; }
.initiales { background: var(--encre); }
.compte-menu { border-radius: var(--r-bloc); }

/* Blocs : cartes blanches, filet chaud, sans ombre */
.bloc, .carte, .carte-fiche, .indicateur { border-color: var(--trait); box-shadow: none; }
.bloc { padding: 22px 24px; }
.bloc-tete h2, .bloc > h2 { font-size: 1.22rem; }
.tete-page { margin-bottom: 26px; }
.tete-texte p, .accueil-tete p { color: var(--gris); }
.onglets a { font-weight: 600; }
.onglets a[aria-current="page"] { color: var(--encre); border-bottom-color: var(--foret); }

/* Indicateurs : grands chiffres, la carte forte en brun comme la formule « Boutique » */
.indicateur { padding: 18px 20px; }
.indicateur strong { font-family: var(--texte); font-weight: 700; font-size: 1.65rem; letter-spacing: -.01em; }
.indicateur span { font-size: .84rem; }
.indicateur.accent { background: var(--encre); border-color: var(--encre); }
.indicateur.accent strong { color: #fff; }
.indicateur.accent span { color: #d8c8b4; }
.indicateur.alerte strong { color: var(--alerte); }

/* Pastilles */
.pastille { background: #f1ebe0; color: #4f453c; font-weight: 600; }

/* Tableau de bord */
.accueil-tete { margin-bottom: 28px; align-items: flex-end; }
.accueil-tete h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
.entonnoir-piste { background: #efe8dc !important; }
.entonnoir-piste span { background: var(--foret) !important; }

/* Tableaux */
th { color: var(--gris); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
tbody tr:hover { background: var(--surface-2); }

/* Pipeline */
.carte-affaire { border-radius: 12px; border-color: var(--trait); }

/* Pied et toasts */
.pied { border-top-color: var(--trait); }
.toast { background: var(--encre); border-radius: 999px; font-weight: 600; }
.progression { background: var(--foret); }

/* Écrans de connexion */
#acces h1 { font-weight: 400; }

/* Mobile */
@media (max-width: 900px) {
  #barre-mobile { background: rgba(251, 248, 242, .97) !important; border-top-color: var(--trait) !important; }
  #barre-mobile a, #barre-mobile button { font-weight: 600 !important; }
  .accueil-tete h1 { font-size: 2rem; }
}

/* Chiffres en Inter (les chiffres « elzéviriens » du titre sont peu lisibles en tableau) */
.agenda-date, .carte-affaire .montant, .total, .prix, .nom-espace { font-family: var(--texte); font-weight: 700; }
.agenda-date { font-size: .84rem; }
.etape > h2, .etape h3, .etape-tete { font-variant-numeric: lining-nums; }
.bandeau.accueil { background: #fbf8f2; }
@media (max-width: 520px) { .indicateur strong { font-size: 1.3rem; } .indicateur { padding: 14px 16px; } }

/* =====================================================================
   Prospection (reprise d'O'Terroir) : relances, chauds, audit, aides, doublons
   ===================================================================== */
.compteur { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--foret); color: #fff; font: 700 .72rem/20px var(--texte); text-align: center; }
.compteur.chaud { background: #c2552f; }
#menu .nav-lien[aria-current="page"] .compteur { background: var(--foret); }
#barre-mobile .compteur { margin-left: 2px; height: 16px; min-width: 16px; line-height: 16px; font-size: .62rem; padding: 0 4px; vertical-align: 1px; }
.pastille.chaud { background: #fbe1d3; color: #9c3a17; display: inline-flex; align-items: center; gap: 3px; }
.pastille.ambre { background: var(--ambre-pale); color: var(--ambre); }
.badges-ligne { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.badges-tete { display: flex; flex-wrap: wrap; gap: 6px; margin: -14px 0 16px; }
.badges-tete:empty { display: none; }
.filtres-suivi { margin-top: -8px; }
.filtres-suivi a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; background: transparent; }
.filtres-suivi a[aria-current="true"] { background: var(--encre); border-color: var(--encre); }

/* Sélection multiple dans les listes */
.col-selection { width: 1%; padding-left: 12px !important; padding-right: 4px !important; text-align: center; white-space: nowrap; }
.case-selection, .col-selection input { width: 18px; height: 18px; accent-color: var(--foret); cursor: pointer; }
.carte-fiche h3 .case-selection { margin-right: 6px; vertical-align: -2px; }
.barre-selection { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px; background: var(--encre); color: #fff; border-radius: var(--r-bloc); }
.barre-selection .bouton.petit { background: #fff; border-color: #fff; color: var(--encre); }
.barre-selection .lien-bouton { color: #e9dfd0; margin-left: auto; }

/* Relances */
.carte-relance p { margin: 0 0 10px; }
.carte-relance.en-retard { border-left: 3px solid var(--alerte); padding-left: 12px; }
.actions-rapides .bouton.actif { background: var(--foret); border-color: var(--foret); color: #fff; }
.liste-relances { list-style: none; margin: 0; padding: 0; }
.ligne-relance { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--trait); }
.ligne-relance:first-child { border-top: 0; padding-top: 2px; }
.relance-info { min-width: 0; flex: 1 1 320px; }
.relance-info .nom { font-weight: 700; color: var(--encre); }
.relance-info .sous { color: var(--gris); font-size: .88rem; margin-top: 2px; }
.relance-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.relances-retard { border-top: 3px solid var(--alerte); }
.relances-jour { border-top: 3px solid var(--foret); }
.vide-grand { text-align: center; padding: 34px 24px; }
.vide-grand h2 { font-size: 1.35rem; margin-bottom: 8px; }
.vide-grand p { max-width: 62ch; margin: 0 auto 14px; color: var(--gris); }
.segment-texte button { padding: 7px 14px; }

/* Historique des échanges */
.fil-echanges li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.fil-echanges li > div { flex: 1; min-width: 0; }
.fil-echanges p { margin: 3px 0 0; overflow-wrap: anywhere; }
.type-echange { font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--foret); }
.echange-reponse, .echange-chaud { border-left-color: #c2552f !important; }
.echange-reponse .type-echange, .echange-chaud .type-echange { color: #9c3a17; }
.echange-statut, .echange-import, .echange-audit, .echange-fusion { opacity: .8; }
.echange-statut .type-echange, .echange-import .type-echange, .echange-audit .type-echange, .echange-fusion .type-echange { color: var(--gris); }
.bouton-icone.petit { width: 28px; height: 28px; }
.fil-alertes li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fil-alertes .alerte-nouvelle { border-left-color: #c2552f; }
.fil-alertes .alerte-lue { opacity: .65; }
.fil-alertes p { margin: 3px 0 0; }
.bandeau-chaud { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r-bloc); background: #fbe1d3; color: #5c2410; }
.bandeau-chaud .ic { color: #c2552f; }
.bandeau-chaud p { margin: 2px 0 0; }

/* Audit */
.audit-tete { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.audit-tete strong { overflow-wrap: anywhere; }
.score-audit { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font: 700 1.35rem/1 var(--texte); background: #f1ebe0; color: var(--encre); }
.score-audit small { font-size: .62rem; color: var(--gris); }
.score-audit.ok { background: var(--ok-pale); color: var(--ok); }
.score-audit.ambre { background: var(--ambre-pale); color: var(--ambre); }
.score-audit.alerte { background: var(--alerte-pale); color: var(--alerte); }
.sous-titre { font-family: var(--texte); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); margin: 12px 0 6px; }
.arguments { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .92rem; }
.details-audit summary { cursor: pointer; color: var(--gris); font-size: .88rem; margin-top: 10px; }
.controles-audit { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: .88rem; }
.controles-audit li { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; align-items: center; }
.controles-audit small { color: var(--gris); }
.controles-audit .ok .ic { color: var(--ok); }
.controles-audit .ko .ic { color: var(--alerte); }
.controles-audit .moyen .ic { color: var(--ambre); }
.progression-audit { height: 8px; border-radius: 999px; background: #efe8dc; overflow: hidden; margin-bottom: 8px; }
.progression-audit span { display: block; height: 100%; background: var(--foret); transition: width .3s; }

/* Aides */
.liste-aides { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.liste-aides li { display: grid; gap: 3px; padding-bottom: 12px; border-bottom: 1px solid var(--trait); }
.liste-aides li:last-child { border-bottom: 0; padding-bottom: 0; }
.liste-aides .aide-tete { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.liste-aides .actions-ligne { justify-content: flex-start; margin-top: 4px; }
.aide-fermee { opacity: .55; }
.argument-aide { background: var(--surface-2); border: 1px dashed var(--trait-fort); border-radius: var(--r); padding: 10px 12px; font-size: .92rem; }
.argument-aide .main { margin-right: 6px; }

/* Recherche d'entreprises */
.form-recherche details { margin-top: 12px; }
.form-recherche summary { cursor: pointer; font-weight: 600; color: var(--foret); }
.grille-recherche { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; }
.form-recherche .groupe-cases { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.form-recherche .groupe-cases legend { font-weight: 600; font-size: .86rem; margin-bottom: 6px; padding: 0; }
.pied-recherche { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--trait); }
.barre-ajout { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.barre-ajout input { flex: 1 1 220px; width: auto; }
.barre-ajout select { width: auto; }
.pagination { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; }
.ligne-formulaire { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne-formulaire input { flex: 1 1 260px; width: auto; }
.tableau-entreprises td small { line-height: 1.35; }

/* Pipeline des comptes */
.pipeline-comptes { grid-template-columns: repeat(7, minmax(220px, 1fr)); }
.carte-compte { position: relative; }
.carte-compte .carte-affaire-haut a { color: var(--encre); text-decoration: none; }
.carte-compte .badges-ligne { margin-left: 0; }
.deplacer-compte { width: auto; min-height: 30px; padding: 2px 6px; font-size: .8rem; border-radius: 999px; }
.filtres-pipeline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filtres-pipeline .recherche-liste { flex: 1 1 240px; }
.filtres-pipeline select { width: auto; }

/* Doublons */
.groupe-doublons input[type="radio"] { width: 18px; height: 18px; accent-color: var(--foret); }
.liste-aide { padding-left: 18px; color: var(--gris); font-size: .92rem; }
.formulaire-notifications { display: grid; gap: 4px; }

@media (max-width: 900px) {
  .barre-selection { top: 8px; }
  .ligne-relance { align-items: flex-start; }
  .score-audit { width: 54px; height: 54px; font-size: 1.15rem; }
}
.colonne, main#principal, #app { min-width: 0; }
.bouton.petit.principal { background: var(--foret); border-color: var(--foret); color: #fff; }
.bouton.petit.principal:hover { background: var(--foret-fonce); border-color: var(--foret-fonce); color: #fff; }
.bouton.petit.danger { color: var(--alerte); }
.tableau td.col-selection, .tableau th.col-selection { min-width: 0; width: 44px; }

/* ---------- Équipes IA (1.1.0) ---------- */
.pipeline-ia { grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 10px; }
.pipeline-ia .etape { padding: 8px; }
.carte-ia .carte-affaire-haut { flex-wrap: wrap; }
.pole-ia .definitions dd { font-weight: 400; }
.etape-ia .aide { margin: 2px 4px; font-size: .84rem; }
.carte-ia .carte-affaire-haut > span:first-child { color: var(--gris); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-ia p a { color: var(--encre); }
.controles-ia { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.controles-ia li { display: flex; align-items: center; gap: 8px; }
.controles-ia li.ok .ic { color: var(--ok); }
.controles-ia li.manque .ic { color: var(--ambre); }
.controles-ia li.manque span { color: var(--gris); }
.preuves-ia { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.liste-alertes { margin: 6px 0 0; padding-left: 18px; color: var(--gris); font-size: .9rem; display: grid; gap: 3px; }
.collage-ia { display: grid; gap: 8px; justify-items: start; margin-bottom: 18px; padding: 12px; border: 1px dashed var(--trait-fort); border-radius: var(--r); background: var(--surface-2); }
.collage-ia .champ { width: 100%; }
.tableau-perf td.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau-perf th { white-space: normal; }
.filtres-pipeline .champ-case { align-self: center; }
@media (max-width: 760px) { .pipeline-ia { grid-template-columns: repeat(6, minmax(78vw, 1fr)); } }
