/* AgriPilot — interface pensée pour le terrain : contraste fort, gros boutons, couleurs de champ. */
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

:root {
  --fond: #f4f1e8; --fond-2: #ebe6d6; --surface: #ffffff; --surface-2: #faf8f2;
  --texte: #1b261c; --texte-2: #4d5a4c; --texte-3: #6f7a6c; --bord: #d8d2c0; --bord-fort: #b9b19a;
  --vert: #2e6b30; --vert-fonce: #1f4f22; --vert-clair: #e3efdc; --vert-texte: #fff;
  --ble: #c99318; --ble-clair: #f8ecc8; --ble-texte: #3a2a00;
  --terre: #8a5a2b; --terre-clair: #f1e4d4;
  --rouge: #b3261e; --rouge-clair: #fbe3e0; --orange: #b45309; --orange-clair: #fdebd3; --bleu: #1f5e7a; --bleu-clair: #dcedf4;
  --ombre: 0 1px 2px rgba(40, 35, 20, .08), 0 4px 14px rgba(40, 35, 20, .06);
  --ombre-forte: 0 10px 40px rgba(30, 25, 10, .22);
  --rayon: 12px; --rayon-petit: 8px;
  --cible: 48px;
  --police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --titre: "Archivo", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
html[data-theme="nuit"] {
  --fond: #0e130e; --fond-2: #151c15; --surface: #182019; --surface-2: #1d271e;
  --texte: #eef0e6; --texte-2: #c3cbbd; --texte-3: #94a08f; --bord: #2c382c; --bord-fort: #3e4d3e;
  --vert: #6fbf5f; --vert-fonce: #8fd67f; --vert-clair: #1f3320; --vert-texte: #0b150b;
  --ble: #f0c04a; --ble-clair: #3a2f10; --ble-texte: #1c1400;
  --terre: #d4a373; --terre-clair: #33261a;
  --rouge: #ff7a6e; --rouge-clair: #3b1714; --orange: #ffb55c; --orange-clair: #3a2610; --bleu: #7cc3e0; --bleu-clair: #142c37;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4); --ombre-forte: 0 10px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
@media (min-width: 1600px) { html { font-size: clamp(16px, calc(16px + (100vw - 1600px) / 160), 21px); } }
body { margin: 0; font-family: var(--police); background: var(--fond); color: var(--texte); font-size: 1rem; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--titre); font-stretch: 92%; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
a { color: var(--vert); }
p { margin: 0 0 .75em; }
small, .petit { font-size: .85rem; color: var(--texte-3); }
.chiffre { font-family: var(--titre); font-variant-numeric: tabular-nums; font-stretch: 95%; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
svg.ic { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
:focus-visible { outline: 3px solid var(--ble); outline-offset: 2px; border-radius: 6px; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: var(--cible); padding: .55em 1.1em; border-radius: var(--rayon-petit);
  border: 2px solid var(--bord-fort); background: var(--surface); color: var(--texte); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; user-select: none; }
.btn:hover { border-color: var(--texte-2); }
.btn:active { transform: translateY(1px); }
.btn.principal { background: var(--vert); border-color: var(--vert); color: var(--vert-texte); }
.btn.principal:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn.ble { background: var(--ble); border-color: var(--ble); color: var(--ble-texte); }
.btn.danger { color: var(--rouge); border-color: var(--rouge); background: transparent; }
.btn.danger.plein { background: var(--rouge); color: #fff; }
.btn.discret { border-color: transparent; background: transparent; }
.btn.discret:hover { background: var(--fond-2); }
.btn.petit { min-height: 36px; padding: .3em .75em; font-size: .9rem; }
.btn.bloc { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btns.droite { justify-content: flex-end; }

/* ---------- structure ---------- */
.appli { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.barre { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--vert-fonce); color: #f2f5ec; display: flex; flex-direction: column; padding: 1rem .75rem; }
html[data-theme="nuit"] .barre { background: #0a0f0a; border-right: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; color: inherit; text-decoration: none; }
.marque .logo { width: 40px; height: 40px; border-radius: 10px; background: var(--ble); display: grid; place-items: center; color: #2a1d00; flex: none; }
.marque .logo svg { width: 26px; height: 26px; stroke-width: 2.1; }
.marque b { font-family: var(--titre); font-size: 1.35rem; font-weight: 850; font-stretch: 105%; letter-spacing: -.02em; display: block; }
.marque span { font-size: .75rem; opacity: .75; }
.choix-org { margin: 0 .25rem 1rem; }
.choix-org select { width: 100%; min-height: 42px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: inherit; padding: 0 .6rem; font: inherit; }
.choix-org option { color: #111; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 9px; color: inherit; text-decoration: none; font-weight: 560; opacity: .88; }
.nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.nav a.actif { background: rgba(255,255,255,.14); opacity: 1; box-shadow: inset 4px 0 0 var(--ble); }
.nav .sep { height: 1px; background: rgba(255,255,255,.14); margin: .5rem .5rem; }
.barre .pied { display: flex; gap: .25rem; align-items: center; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.14); }
.barre .pied .qui { flex: 1; min-width: 0; font-size: .85rem; }
.barre .pied .qui b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre .pied button { color: inherit; border: 0; background: transparent; width: 42px; height: 42px; border-radius: 8px; cursor: pointer; }
.barre .pied button:hover { background: rgba(255,255,255,.1); }
.contenu { min-width: 0; padding: 1.5rem clamp(1rem, 2.5vw, 2.5rem) 3rem; max-width: 1800px; }
.tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.tete h1 { margin: 0; }
.tete .sous { color: var(--texte-3); margin-top: .2rem; }
.onglets-bas { display: none; }
.bandeau { padding: .7rem 1rem; border-radius: var(--rayon-petit); margin-bottom: 1rem; display: flex; gap: .75rem; align-items: center; font-weight: 550; }
.bandeau > svg.ic { flex: none; }
.bandeau .btn { margin-left: auto; }
.bandeau.info { background: var(--bleu-clair); color: var(--bleu); }
.bandeau.attente { background: var(--ble-clair); color: var(--ble-texte); }
html[data-theme="nuit"] .bandeau.attente { color: var(--ble); }
.bandeau.alerte { background: var(--rouge-clair); color: var(--rouge); }
.bandeau.demo { background: var(--terre-clair); color: var(--terre); }

/* ---------- cartes ---------- */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.1rem 1.25rem; box-shadow: var(--ombre); }
.carte + .carte { margin-top: 1rem; }
.grille > .carte + .carte, .grille > a.carte + a.carte { margin-top: 0; }
a.carte { text-decoration: none; color: inherit; display: block; }
a.carte:hover { border-color: var(--vert); }
.carte h2, .carte h3 { display: flex; align-items: center; gap: .5rem; }
.carte .entete-carte { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.carte .entete-carte h2, .carte .entete-carte h3 { margin: 0; }
.grille { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.col-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.col-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kpi { position: relative; overflow: hidden; }
.kpi .lib { color: var(--texte-2); font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.kpi .val { font-family: var(--titre); font-weight: 800; font-size: 2rem; font-stretch: 90%; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi .det { color: var(--texte-3); font-size: .85rem; }
.kpi::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--vert-clair); opacity: .7; }
.kpi.ble::after { background: var(--ble-clair); }
.kpi.terre::after { background: var(--terre-clair); }
.kpi.rouge::after { background: var(--rouge-clair); }
.vide { text-align: center; padding: 2rem 1rem; color: var(--texte-3); }
.vide svg.ic { width: 3rem; height: 3rem; stroke-width: 1.4; color: var(--bord-fort); display: block; margin: 0 auto .5rem; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .2em .65em; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--fond-2); color: var(--texte-2); }
.badge::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.badge.s-brouillon { background: var(--fond-2); color: var(--texte-3); }
.badge.s-a_planifier { background: var(--ble-clair); color: var(--orange); }
.badge.s-planifie { background: var(--bleu-clair); color: var(--bleu); }
.badge.s-en_cours { background: var(--vert-clair); color: var(--vert); }
.badge.s-suspendu { background: var(--orange-clair); color: var(--orange); }
.badge.s-termine { background: var(--vert); color: var(--vert-texte); }
.badge.s-annule, .badge.s-annulee, .badge.s-refuse, .badge.s-expire { background: var(--fond-2); color: var(--texte-3); text-decoration: line-through; }
.badge.s-envoye, .badge.s-emise { background: var(--bleu-clair); color: var(--bleu); }
.badge.s-accepte, .badge.s-payee { background: var(--vert-clair); color: var(--vert); }
.badge.s-retard, .badge.s-panne, .badge.s-depasse { background: var(--rouge-clair); color: var(--rouge); }
.badge.s-immobilisee, .badge.s-bientot { background: var(--orange-clair); color: var(--orange); }
.badge.s-disponible, .badge.s-ok { background: var(--vert-clair); color: var(--vert); }
.badge.neutre::before { display: none; }

/* ---------- listes et tableaux ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--rayon-petit); }
table.tab { width: 100%; border-collapse: collapse; }
.tab th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-3); font-weight: 700; padding: .6rem .7rem; border-bottom: 2px solid var(--bord); white-space: nowrap; }
.tab td { padding: .7rem; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tab tr.cliquable { cursor: pointer; }
.tab tr.cliquable:hover td { background: var(--surface-2); }
.tab .titre-ligne { font-weight: 650; }
.tab .sous-ligne { color: var(--texte-3); font-size: .85rem; }
.liste { display: flex; flex-direction: column; }
.liste .el { display: flex; align-items: center; gap: .85rem; padding: .8rem .25rem; border-bottom: 1px solid var(--bord); text-decoration: none; color: inherit; }
.liste .el:last-child { border-bottom: 0; }
.liste a.el:hover { background: var(--surface-2); }
.liste .el .corps { flex: 1; min-width: 0; }
.liste .el .corps b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .el .corps span { color: var(--texte-3); font-size: .88rem; }
.pastille { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--vert-clair); color: var(--vert); flex: none; }
.pastille.ble { background: var(--ble-clair); color: var(--orange); }
.pastille.terre { background: var(--terre-clair); color: var(--terre); }
.pastille.rouge { background: var(--rouge-clair); color: var(--rouge); }
.pastille.bleu { background: var(--bleu-clair); color: var(--bleu); }
.pastille svg.ic { width: 24px; height: 24px; }
.puces { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.puce { min-height: 40px; padding: .35rem .9rem; border-radius: 999px; border: 2px solid var(--bord); background: var(--surface); color: var(--texte-2); font: inherit; font-weight: 600; cursor: pointer; }
.puce.actif { border-color: var(--vert); background: var(--vert); color: var(--vert-texte); }
.recherche { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.recherche input { padding-left: 2.6rem; }
.recherche svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--texte-3); }
.def { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.def dt { color: var(--texte-3); }
.def dd { margin: 0; font-weight: 550; }

/* ---------- formulaires ---------- */
label.champ { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .92rem; color: var(--texte-2); min-width: 0; }
label.champ .aide { font-weight: 400; color: var(--texte-3); font-size: .82rem; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--surface); border: 2px solid var(--bord); border-radius: var(--rayon-petit); padding: .6rem .75rem; min-height: var(--cible); width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--vert); outline: none; box-shadow: 0 0 0 3px var(--vert-clair); }
input.erreur, select.erreur { border-color: var(--rouge); }
.case { display: flex; gap: .6rem; align-items: center; font-weight: 550; cursor: pointer; min-height: 44px; }
.case input { width: 24px; height: 24px; min-height: 0; accent-color: var(--vert); flex: none; }
.form { display: grid; gap: 1rem; }
.form .ligne { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form fieldset { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem; margin: 0; display: grid; gap: 1rem; }
.form legend { font-family: var(--titre); font-weight: 750; padding: 0 .4rem; }
.unite { position: relative; }
.unite input { padding-right: 3.6rem; }
.unite i { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--texte-3); font-size: .85rem; pointer-events: none; }
.erreur-msg { color: var(--rouge); font-weight: 600; }
.lignes-edit { display: grid; gap: .6rem; }
.lignes-edit .l { display: grid; gap: .5rem; align-items: end; background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: .6rem; }
.lignes-edit .l.aff { grid-template-columns: 1fr 1fr auto; }
.lignes-edit .l.doc { grid-template-columns: minmax(180px, 3fr) 90px 100px 120px 90px auto; }
.lignes-edit .l.doc .detail { grid-column: 1 / -2; }
.parcelles-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.parcelles-choix label { display: flex; gap: .6rem; align-items: center; border: 2px solid var(--bord); border-radius: var(--rayon-petit); padding: .55rem .7rem; cursor: pointer; background: var(--surface); }
.parcelles-choix label.coche { border-color: var(--vert); background: var(--vert-clair); }
.parcelles-choix input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--vert); }
.parcelles-choix input[type=text] { width: 80px; min-height: 36px; padding: .2rem .4rem; margin-left: auto; text-align: right; }

/* ---------- fenêtre ---------- */
.voile { position: fixed; inset: 0; background: rgba(15, 20, 12, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 50; overflow-y: auto; }
.fenetre { background: var(--surface); border-radius: 16px; width: min(720px, 100%); box-shadow: var(--ombre-forte); }
.fenetre.large { width: min(1040px, 100%); }
.fenetre .haut { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bord); }
.fenetre .haut h2 { margin: 0; }
.fenetre .corps { padding: 1.25rem; }
.fenetre .bas { padding: 1rem 1.25rem; border-top: 1px solid var(--bord); display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.notif-zone { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 80; width: min(560px, calc(100% - 2rem)); }
.notif { background: var(--texte); color: var(--fond); padding: .85rem 1.1rem; border-radius: 12px; box-shadow: var(--ombre-forte); font-weight: 600; animation: monte .2s ease-out; }
.notif.erreur { background: var(--rouge); color: #fff; }
@keyframes monte { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- accueil / connexion ---------- */
.accueil { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.accueil .visuel { position: relative; background: linear-gradient(170deg, #f7e9b8 0%, #e5c86a 38%, #8fae57 62%, #3d7a35 82%, #23532a 100%); color: #fff; padding: clamp(2rem, 5vw, 4.5rem); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.accueil .visuel svg.paysage { position: absolute; inset: auto 0 0 0; width: 100%; height: 62%; }
.accueil .visuel .txt { position: relative; max-width: 620px; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.accueil .visuel h1 { font-size: clamp(2.2rem, 4.2vw, 3.8rem); font-weight: 900; font-stretch: 88%; }
.accueil .visuel p { font-size: 1.15rem; max-width: 520px; }
.accueil .visuel .marque { position: absolute; top: clamp(1.5rem, 3vw, 3rem); left: clamp(2rem, 5vw, 4.5rem); color: #23411f; text-shadow: none; padding: 0; }
.accueil .visuel .marque span { opacity: .85; }
.accueil .forme { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--fond); }
.accueil .forme .boite { width: min(440px, 100%); }
.accueil .forme h2 { font-size: 1.6rem; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--vert); font-weight: 600; cursor: pointer; text-decoration: underline; }
.atouts { display: grid; gap: .5rem; margin-top: 1.25rem; }
.atouts div { display: flex; gap: .6rem; align-items: center; font-weight: 600; }

/* ---------- planning ---------- */
.planning { overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.planning .g { display: grid; grid-template-columns: 200px repeat(var(--jours, 7), minmax(130px, 1fr)); min-width: calc(200px + var(--jours, 7) * 130px); }
.planning .c { border-right: 1px solid var(--bord); border-bottom: 1px solid var(--bord); padding: .4rem; min-height: 64px; position: relative; }
.planning .c.tete-j { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; text-align: center; min-height: 0; z-index: 2; }
.planning .c.tete-j.auj { background: var(--ble-clair); color: var(--ble-texte); }
html[data-theme="nuit"] .planning .c.tete-j.auj { color: var(--ble); }
.planning .c.ress { position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 600; display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.planning .c.ress .badge { font-size: .7rem; }
.planning .c.we { background: var(--surface-2); }
.planning .c.survol { background: var(--vert-clair); }
.bloc-ch { display: block; border-radius: 8px; padding: .35rem .5rem; margin-bottom: .3rem; font-size: .82rem; line-height: 1.25; background: var(--bleu-clair); color: var(--bleu); border-left: 4px solid var(--bleu); text-decoration: none; cursor: grab; }
.bloc-ch b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloc-ch.st-en_cours { background: var(--vert-clair); color: var(--vert); border-color: var(--vert); }
.bloc-ch.st-termine { background: var(--fond-2); color: var(--texte-3); border-color: var(--bord-fort); }
.bloc-ch.st-suspendu { background: var(--orange-clair); color: var(--orange); border-color: var(--orange); }
.bloc-ch.conflit { box-shadow: 0 0 0 2px var(--rouge); }
.non-planifies { display: flex; flex-wrap: wrap; gap: .5rem; }
.non-planifies .bloc-ch { background: var(--ble-clair); color: var(--ble-texte); border-color: var(--ble); }
html[data-theme="nuit"] .non-planifies .bloc-ch { color: var(--ble); }

/* ---------- simulateur ---------- */
.simu { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); gap: 1.25rem; align-items: start; }
.simu .resultats { position: sticky; top: 1rem; }
.gros-chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.gros-chiffres .gc { border-radius: var(--rayon-petit); background: var(--surface-2); border: 1px solid var(--bord); padding: .75rem .9rem; }
.gros-chiffres .gc .lib { font-size: .82rem; color: var(--texte-3); font-weight: 650; }
.gros-chiffres .gc .val { font-family: var(--titre); font-size: 1.6rem; font-weight: 800; font-stretch: 90%; font-variant-numeric: tabular-nums; }
.gros-chiffres .gc .four { font-size: .8rem; color: var(--texte-3); }
.gros-chiffres .gc.marge { grid-column: 1 / -1; background: var(--vert-clair); border-color: transparent; }
.gros-chiffres .gc.marge.negative { background: var(--rouge-clair); }
.gros-chiffres .gc.marge.negative .val { color: var(--rouge); }
.barre-cout { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin: .6rem 0; background: var(--fond-2); }
.barre-cout span { width: var(--part, 0%); }
.leg { display: grid; grid-template-columns: auto 1fr auto; gap: .3rem .6rem; font-size: .9rem; align-items: center; }
.leg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.c-carb { background: #c99318; } .c-mo { background: #2e6b30; } .c-mach { background: #1f5e7a; } .c-ent { background: #7aa95c; } .c-int { background: #8a5a2b; } .c-ann { background: #9a9482; }
.fourchette { position: relative; height: 8px; border-radius: 4px; background: var(--fond-2); margin: .45rem 0 .2rem; }
.fourchette span { position: absolute; top: 0; bottom: 0; left: var(--de, 0%); width: var(--lg, 0%); background: var(--ble); border-radius: 4px; }
.fourchette b { position: absolute; top: -4px; width: 4px; height: 16px; left: var(--c, 50%); background: var(--texte); border-radius: 2px; }
.prix-conseil { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.prix-conseil div { border: 2px solid var(--bord); border-radius: var(--rayon-petit); padding: .55rem .3rem; }
.prix-conseil div.mis { border-color: var(--ble); }
.prix-conseil b { display: block; font-family: var(--titre); font-size: 1.25rem; }
.prix-conseil small { display: block; }
.ensemble { border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem; background: var(--surface-2); display: grid; gap: .7rem; }
.ensemble .t { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.ensemble .t input { font-weight: 650; }
.ensemble .p { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
details.plie { border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: .2rem .9rem; background: var(--surface); }
details.plie summary { cursor: pointer; font-weight: 650; padding: .55rem 0; min-height: 40px; }
.ecart.alerte { color: var(--rouge); font-weight: 750; }
.ecart.bon { color: var(--vert); font-weight: 700; }
.avert { background: var(--orange-clair); color: var(--orange); border-radius: var(--rayon-petit); padding: .6rem .8rem; font-weight: 600; }
.comparaison { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: .75rem; }

/* ---------- machines ---------- */
.machine-carte { display: flex; flex-direction: column; gap: .6rem; cursor: pointer; text-decoration: none; color: inherit; }
.machine-carte:hover { border-color: var(--vert); }
.machine-carte .haut-m { display: flex; gap: .75rem; align-items: center; }
.machine-carte .haut-m .pastille { width: 54px; height: 54px; }
.machine-carte .haut-m .pastille svg.ic { width: 32px; height: 32px; }
.machine-carte .comp { font-family: var(--titre); font-size: 1.4rem; font-weight: 800; }

/* ---------- terrain (chauffeur) ---------- */
.terrain { max-width: 760px; margin: 0 auto; }
.mission { display: block; text-decoration: none; color: inherit; border-left: 6px solid var(--bleu); }
.mission.st-en_cours { border-left-color: var(--vert); }
.mission.st-suspendu { border-left-color: var(--orange); }
.mission .quand { font-family: var(--titre); font-weight: 800; font-size: 1.05rem; color: var(--texte-2); }
.mission h2 { margin: .25rem 0; }
.mission .infos { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--texte-2); font-weight: 550; }
.chrono { text-align: center; padding: 1.25rem 1rem; border-radius: 16px; background: var(--surface-2); border: 2px solid var(--bord); }
.chrono .etat { font-weight: 750; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; color: var(--texte-3); }
.chrono .temps { font-family: var(--titre); font-weight: 850; font-size: clamp(2.8rem, 12vw, 4.2rem); font-variant-numeric: tabular-nums; line-height: 1.05; font-stretch: 85%; }
.chrono.marche { border-color: var(--vert); background: var(--vert-clair); }
.chrono.marche .etat { color: var(--vert); }
.chrono.pause { border-color: var(--orange); background: var(--orange-clair); }
.gros-btns { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.gros-btns .btn { min-height: 76px; font-size: 1.15rem; border-radius: 14px; flex-direction: column; gap: .2rem; }
.gros-btns .btn svg.ic { width: 1.7em; height: 1.7em; }
.gros-btns .large { grid-column: 1 / -1; }
.saisies { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.saisies .btn { min-height: 84px; flex-direction: column; font-size: .95rem; border-radius: 14px; }
.saisies .btn svg.ic { width: 1.9em; height: 1.9em; color: var(--vert); }
.journal-terrain .el { font-size: .95rem; }
.parcelle-check { display: flex; align-items: center; gap: .8rem; padding: .75rem; border: 2px solid var(--bord); border-radius: 12px; margin-bottom: .5rem; cursor: pointer; background: var(--surface); }
.parcelle-check.fait { border-color: var(--vert); background: var(--vert-clair); }
.parcelle-check .corps { flex: 1; }
.infos-mission { font-weight: 600; color: var(--texte-2); }
.parcelle-check input { width: 30px; height: 30px; min-height: 0; accent-color: var(--vert); }
.clavier input { font-size: 1.6rem; font-family: var(--titre); text-align: center; min-height: 64px; font-weight: 800; }

/* ---------- écrans moyens / mobiles ---------- */
@media (max-width: 1200px) {
  .simu { grid-template-columns: 1fr; }
  .simu .resultats { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .appli { grid-template-columns: 1fr; }
  .barre { display: none; }
  .contenu { padding: 1rem .9rem 6.5rem; }
  .entete-mobile { display: flex !important; }
  .onglets-bas { display: grid; position: fixed; bottom: 0; left: 0; right: 0; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--bord);
    padding-bottom: env(safe-area-inset-bottom); z-index: 40; box-shadow: 0 -4px 20px rgba(0,0,0,.06); }
  .onglets-bas a, .onglets-bas button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; color: var(--texte-3);
    text-decoration: none; font-size: .72rem; font-weight: 650; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .onglets-bas a.actif { color: var(--vert); }
  .onglets-bas svg.ic { width: 26px; height: 26px; }
  .col-2-1, .col-1-1, .g3 { grid-template-columns: 1fr; }
  .accueil { grid-template-columns: 1fr; }
  .accueil .visuel { min-height: 300px; }
  .accueil .visuel .marque { position: static; margin-bottom: auto; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .g2, .g4 { grid-template-columns: 1fr 1fr; }
  .kpi .val { font-size: 1.5rem; }
  .carte { padding: .9rem; }
  .tab.reflow thead { display: none; }
  .tab.reflow tr { display: grid; grid-template-columns: 1fr auto; padding: .6rem 0; border-bottom: 1px solid var(--bord); }
  .tab.reflow td { border: 0; padding: .15rem .3rem; }
  .tab.reflow td.cache-m { display: none; }
  .lignes-edit .l.doc { grid-template-columns: 1fr 1fr; }
  .lignes-edit .l.doc .lib, .lignes-edit .l.doc .detail { grid-column: 1 / -1; }
  .lignes-edit .l.aff { grid-template-columns: 1fr 1fr; }
  .saisies { grid-template-columns: repeat(2, 1fr); }
  .gros-chiffres .gc .val { font-size: 1.3rem; }
  .fenetre { border-radius: 14px; }
  .voile { padding: 0; align-items: flex-end; }
  .voile .fenetre { border-radius: 18px 18px 0 0; max-height: 94vh; overflow-y: auto; }
}
.entete-mobile { display: none; align-items: center; justify-content: space-between; gap: .5rem; margin: -.25rem 0 1rem; }
.entete-mobile .marque { padding: 0; color: var(--texte); }
.entete-mobile .marque b { font-size: 1.15rem; }
.entete-mobile .marque .logo { width: 34px; height: 34px; }
.entete-mobile select { width: auto; max-width: 52vw; min-height: 40px; padding: .2rem .5rem; }
@media print { .barre, .onglets-bas, .btns, .entete-mobile { display: none !important; } .appli { display: block; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- v2 : cartes ---------- */
.zone-carte { height: calc(100vh - 230px); min-height: 420px; border-radius: var(--rayon-petit); overflow: hidden; background: #cfd8c4; z-index: 0; }
.zone-carte.moyenne { height: 380px; min-height: 0; }
.fenetre .zone-carte.moyenne { height: min(60vh, 520px); }
.carte-pleine { padding: .75rem; }
.barre-carte { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: end; margin-bottom: .75rem; }
.barre-carte label.champ { min-width: 220px; }
.aide-carte { display: inline-flex; gap: .35rem; align-items: center; }
.marque-carte .pastille { width: 36px; height: 36px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.marque-carte .pastille svg.ic { width: 20px; height: 20px; }
.leaflet-container { font-family: var(--police); font-size: .9rem; }
.leaflet-popup-content { font-size: .95rem; line-height: 1.45; }
.leaflet-control-layers-toggle { width: 44px; height: 44px; }
.leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
html[data-theme="nuit"] .leaflet-popup-content-wrapper, html[data-theme="nuit"] .leaflet-popup-tip, html[data-theme="nuit"] .leaflet-control-layers { background: var(--surface); color: var(--texte); }

/* ---------- v2 : météo ---------- */
.meteo-jours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(70px, 1fr); gap: .4rem; margin-top: .6rem; overflow-x: auto; padding-bottom: .3rem; }
.mj { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem .25rem; border-radius: 10px; background: var(--surface-2); border: 2px solid var(--bord); font-size: .82rem; text-align: center; }
.mj svg.ic { width: 28px; height: 28px; margin: .15rem 0; }
.mj .t { font-family: var(--titre); font-weight: 800; font-size: 1.05rem; }
.mj .p, .mj .v { color: var(--texte-3); display: inline-flex; gap: .2rem; align-items: center; }
.mj .v svg.ic { width: 14px; height: 14px; margin: 0; }
.mj.prevu { border-color: var(--texte-2); box-shadow: 0 0 0 1px var(--texte-2); }
.mj.n-attention { background: var(--orange-clair); }
.mj.n-defavorable { background: var(--rouge-clair); }
.mj.n-defavorable svg.ic, .mj.n-attention svg.ic { color: inherit; }
.mj .src { font-size: .62rem; line-height: 1.1; color: var(--texte-3); text-transform: uppercase; letter-spacing: .02em; margin-top: .15rem; }
.mj .vig { font-size: .66rem; font-weight: 800; line-height: 1.1; padding: .1rem .3rem; border-radius: 6px; margin-top: .15rem; color: #1d1d1b; }
.vig-jaune { background: #f6d32d; }
.vig-orange { background: #f08a24; }
.vig-rouge { background: #c8102e; color: #fff !important; }
.pm { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .1rem .45rem; margin: .15rem 0; background: var(--vert-clair); color: var(--vert); }
.pm svg.ic { width: 16px; height: 16px; }
.pm.n-attention { background: var(--orange-clair); color: var(--orange); }
.pm.n-defavorable { background: var(--rouge-clair); color: var(--rouge); }
.bloc-ch .pm { display: flex; width: fit-content; }

/* ---------- v2 : analyses ---------- */
.mini-barre { display: block; height: 6px; border-radius: 3px; background: var(--fond-2); margin-top: .35rem; max-width: 260px; }
.mini-barre span { display: block; height: 100%; width: var(--part, 0%); border-radius: 3px; background: var(--vert); }
@media (max-width: 1020px) { .zone-carte { height: calc(100vh - 260px); } }
