/* Site de gestion agricole – style moderne et épuré */

:root {
  --fond: #f5f6f3;
  --surface: #ffffff;
  --texte: #1f2a1f;
  --doux: #66705f;
  --ligne: #e1e4dc;
  --accent: #3f6b3a;       /* vert verger */
  --accent-clair: #e8f0e5;
  --danger: #a33a2a;
  --rayon: 12px;
  --barre: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--fond);
  color: var(--texte);
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }

/* Barre du haut */
.barre {
  position: sticky; top: 0; z-index: 20;
  height: var(--barre);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--ligne);
}
.logo { font-weight: 700; color: var(--texte); text-decoration: none; white-space: nowrap; }
.menu-haut { display: flex; gap: .25rem; overflow-x: auto; }
.menu-haut a, .menu-haut span {
  padding: .45rem .8rem; border-radius: 8px;
  text-decoration: none; color: var(--doux); white-space: nowrap;
}
.menu-haut a:hover { background: var(--fond); color: var(--texte); }
.menu-haut a.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
.menu-haut .bientot { opacity: .45; cursor: default; }
.bouton-menu {
  display: none; border: 0; background: none; font-size: 1.4rem; cursor: pointer; padding: .25rem;
}

/* Cadre : menu gauche + contenu */
.cadre { display: flex; min-height: calc(100vh - var(--barre)); }
.menu-gauche {
  width: 220px; flex-shrink: 0;
  padding: 1rem .75rem;
  background: var(--surface);
  border-right: 1px solid var(--ligne);
}
.menu-gauche a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; margin-bottom: 2px; border-radius: 8px;
  text-decoration: none; color: var(--texte);
}
.menu-gauche a:hover { background: var(--fond); }
.menu-gauche a.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
.menu-gauche .ic { width: 1.4em; text-align: center; }
.contenu { flex: 1; min-width: 0; padding: 1.5rem; max-width: 1200px; }

/* Messages */
.message {
  background: var(--accent-clair); color: var(--accent);
  padding: .75rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem;
}
.erreurs {
  background: #fbecea; color: var(--danger);
  padding: .75rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem;
}
.erreurs p { margin: .2rem 0; }
.vide { color: var(--doux); }

/* ---------- Accueil ---------- */
.accueil { max-width: 1120px; }
.accueil-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-bottom: 1.25rem; }
.accueil-tete h1 { font-size: 1.75rem; margin: 0; letter-spacing: -.01em; }
.accueil-date { margin: .15rem 0 0; color: var(--doux); }
.accueil-grille { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.meteo-compacte { margin-bottom: 1rem; }
.jour-colonnes { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 2rem; }
.jour-colonnes > div > .jour-sous-titre:first-child { margin-top: .2rem; }
.accueil-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 1.75rem 0 .75rem; }

.carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 1.1rem 1.25rem 1.2rem; box-shadow: 0 1px 2px rgba(31,42,31,.04); }
.carte-tete { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-bottom: .75rem; }
.carte-titre { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); font-weight: 700; }
.carte-info { color: var(--doux); font-size: .82rem; text-align: right; }
.carte-lien { display: inline-flex; align-items: center; gap: .15rem; font-size: .88rem; text-decoration: none; font-weight: 600; white-space: nowrap; }
.carte-note { color: var(--doux); font-size: .85rem; margin: .6rem 0 0; }
.ico { flex-shrink: 0; }

/* Aujourd'hui */
.rappel { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .8rem; border-radius: 12px; margin-bottom: .9rem; }
.rappel strong { display: block; font-size: .93rem; }
.rappel span { font-size: .85rem; }
.rappel-ok { background: var(--accent-clair); color: var(--accent); }
.rappel-attention { background: #fbefd9; color: #8a5a12; }
.rappel-attention a { color: inherit; font-weight: 600; }
.jour-sous-titre { display: flex; align-items: center; gap: .4rem; font-size: .92rem; margin: .9rem 0 .45rem; color: var(--texte); }
.jour-sous-titre span { margin-left: auto; color: var(--doux); font-weight: 400; font-size: .82rem; }
.jour-carte .vide { font-size: .9rem; margin: 0; }
.equipe, .chantiers-jour { list-style: none; margin: 0; padding: 0; }
.equipe li { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; padding: .45rem 0; border-top: 1px solid #f0f2ec; }
.equipe li:first-child { border-top: 0; }
.eq-nom { font-weight: 600; min-width: 8.5rem; font-size: .92rem; }
.eq-taches { display: flex; flex-wrap: wrap; gap: .3rem; }
.puce { font-size: .78rem; padding: .15rem .5rem; border-radius: 99px; background: color-mix(in srgb, var(--c) 13%, white); color: color-mix(in srgb, var(--c) 70%, black); border: 1px solid color-mix(in srgb, var(--c) 30%, white); white-space: nowrap; }
.chantiers-jour li { display: flex; align-items: center; gap: .55rem; padding: .4rem 0; border-top: 1px solid #f0f2ec; font-size: .92rem; }
.chantiers-jour li:first-child { border-top: 0; }
.chantiers-jour i { width: .6rem; height: .6rem; border-radius: 3px; flex-shrink: 0; }
.cj-nom { font-weight: 600; color: var(--texte); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cj-nom:hover { color: var(--accent); }
.cj-quand { margin-left: auto; color: var(--doux); font-size: .82rem; white-space: nowrap; }

/* Vue d'ensemble Gestion */
.tuiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tuile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem;
  padding: 1rem; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon);
  text-decoration: none; color: var(--texte);
}
.tuile:hover { border-color: var(--accent); }
.tuile-icone { font-size: 1.6rem; }
.tuile-nom { font-weight: 600; }
.tuile-n { color: var(--doux); font-variant-numeric: tabular-nums; }

/* Listes */
.titre-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.titre-ligne h1 { margin: 0; }
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin: 0 0 1rem; }
.compte { color: var(--doux); font-size: .9rem; margin-left: auto; }
table.liste {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden;
}
.liste th, .liste td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
.liste th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); background: #fafbf8; }
.liste tr:last-child td { border-bottom: 0; }
.liste td.boutons { white-space: nowrap; text-align: right; }
.liste td.boutons form { display: inline; margin-left: .75rem; }

/* Boutons */
.principal, button.principal {
  display: inline-block; border: 0; cursor: pointer;
  padding: .65rem 1.1rem; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600; text-decoration: none;
}
.principal:hover { filter: brightness(1.08); }
.secondaire { padding: .65rem 1rem; color: var(--doux); text-decoration: none; }
.lien-discret, .lien-danger { border: 0; background: none; padding: 0; cursor: pointer; font-size: 1rem; color: var(--doux); }
.lien-danger { color: var(--danger); }
.lien-discret:hover, .lien-danger:hover { text-decoration: underline; }

/* Fiche (formulaire) */
.fil { margin: 0 0 .5rem; }
.fil a { text-decoration: none; }
.fiche {
  display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1.25rem;
}
.champ { display: flex; flex-direction: column; gap: .3rem; }
.champ label { font-weight: 600; font-size: .92rem; }
.champ .unite { font-weight: 400; color: var(--doux); }
.champ small { color: var(--doux); font-size: .82rem; }
.champ:has(textarea) { grid-column: 1 / -1; }
.champ.en-erreur input, .champ.en-erreur select { border-color: var(--danger); }
input, select, textarea {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--ligne); border-radius: 8px; background: #fff; color: var(--texte);
  min-height: 44px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-clair); border-color: var(--accent); }
.filtres select { width: auto; }
label.case { display: flex; align-items: center; gap: .5rem; font-weight: 600; cursor: pointer; }
label.case input { width: 1.2rem; min-height: 0; height: 1.2rem; }
.fiche .actions { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; }

/* Pièces du matériel */
.bloc { margin-top: 1.5rem; }
.ajout-piece {
  display: grid; gap: .5rem; grid-template-columns: 1fr 1fr 1.5fr auto; margin-top: .75rem;
}
.aide-bas { color: var(--doux); font-size: .9rem; }

/* Compte dans la barre */
.compte-barre { margin-left: auto; display: flex; align-items: center; gap: 1rem; white-space: nowrap; }
.compte-barre form { margin: 0; }
.nom-utilisateur { color: var(--texte); text-decoration: none; font-weight: 600; }
.pastille { font-size: .75rem; background: var(--accent-clair); color: var(--accent); padding: .1rem .45rem; border-radius: 99px; }
.role { font-size: .85rem; padding: .15rem .55rem; border-radius: 99px; background: var(--fond); }
.role-gestion { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
.fiche.etroite { max-width: 640px; grid-template-columns: 1fr; }

/* Pages sans menus : connexion, premier compte */
body.page-simple { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.carte-simple {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 2rem 1.5rem;
}
.carte-simple h1 { margin-bottom: .25rem; }
.sous-titre { color: var(--doux); margin: 0 0 1.25rem; }
.formulaire-simple { display: flex; flex-direction: column; gap: .4rem; }
.formulaire-simple label { font-weight: 600; font-size: .92rem; margin-top: .5rem; }
.formulaire-simple label.case { font-weight: 400; margin: .75rem 0 .25rem; }
.principal.large { width: 100%; margin-top: .75rem; padding: .85rem; font-size: 1.05rem; }
.note { color: var(--doux); font-size: .88rem; margin: 1.25rem 0 0; }

/* Divers formulaires */
.pastille-couleur { display: inline-block; width: 1.4rem; height: 1.4rem; border-radius: 6px; border: 1px solid var(--ligne); vertical-align: middle; }
input.couleur { padding: .2rem; width: 5rem; height: 44px; }
.secondaire-bouton {
  display: inline-block; cursor: pointer; padding: .6rem 1rem; border-radius: 10px; font: inherit; font-weight: 600;
  background: var(--surface); color: var(--accent); border: 1px solid var(--accent); text-decoration: none;
}
.zone-suppression { margin-top: 1.25rem; }
.large-champ { grid-column: 1 / -1; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.sous { font-weight: 400; color: var(--doux); font-size: 1rem; }

/* Barre de navigation (semaine / année) */
.nav-semaine { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .25rem 0 1rem; }
.nav-semaine form { margin: 0; }
.bouton-nav {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 .8rem;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 10px; color: var(--texte); text-decoration: none; font-weight: 600;
}
.bouton-nav:hover { border-color: var(--accent); }
.aller-a input { width: auto; }
.copier { margin-left: auto !important; }
.mode { display: inline-block; padding: .3rem .75rem; border-radius: 99px; background: var(--accent-clair); color: var(--accent); font-weight: 600; font-size: .9rem; margin: 0; }
.mode-recolte { background: #fbefd9; color: #8a5a12; }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: 0 0 .9rem; color: var(--doux); font-size: .88rem; }
.legende span { display: inline-flex; align-items: center; gap: .4rem; }
.legende i { width: .85rem; height: .85rem; border-radius: 4px; display: inline-block; }
.bascule { display: inline-flex; border: 1px solid var(--ligne); border-radius: 10px; overflow: hidden; background: var(--surface); }
.bascule a { padding: 0 .9rem; line-height: 42px; text-decoration: none; color: var(--doux); }
.bascule a.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
.filtres-gantt { display: flex; gap: .5rem; flex-wrap: wrap; }
.filtres-gantt select { width: auto; }

/* Grille de la semaine */
.grille-defile { overflow-x: auto; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
table.grille { border-collapse: collapse; width: 100%; min-width: 960px; table-layout: fixed; }
.grille th, .grille td { border-bottom: 1px solid var(--ligne); border-left: 1px solid var(--ligne); padding: .35rem; vertical-align: top; }
.grille thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); background: #fafbf8; text-align: left; padding: .55rem .5rem; }
.grille thead th span { color: var(--texte); font-size: 1rem; text-transform: none; margin-left: .2rem; }
.grille .col-salarie { width: 150px; text-align: left; font-weight: 600; border-left: 0; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.grille thead .col-salarie { background: #fafbf8; }
.grille .col-salarie small { display: block; font-weight: 400; color: var(--doux); font-size: .8rem; }
.grille .col-total { width: 64px; text-align: right; color: var(--doux); font-variant-numeric: tabular-nums; }
.grille td { min-height: 64px; }
.grille .weekend { background: #fafbf8; }
.grille .aujourdhui { background: #f2f7ef; }
.grille thead th.aujourdhui span { color: var(--accent); }
.grille tbody tr:last-child > * { border-bottom: 0; }
.tache {
  display: block; margin-bottom: .3rem; padding: .3rem .45rem; border-radius: 7px; text-decoration: none; color: var(--texte);
  background: color-mix(in srgb, var(--c) 13%, white); border-left: 4px solid var(--c); font-size: .84rem; line-height: 1.3;
}
a.tache:hover { background: color-mix(in srgb, var(--c) 22%, white); }
.b-h { font-weight: 700; }
.b-s { display: block; color: color-mix(in srgb, var(--c) 75%, black); font-size: .76rem; font-weight: 600; }
.b-d { display: block; color: var(--doux); font-size: .74rem; }
.grille .ajout { display: block; text-align: center; color: var(--doux); text-decoration: none; border: 1px dashed var(--ligne); border-radius: 7px; line-height: 1.6; opacity: .55; }
.grille td:hover .ajout { opacity: 1; border-color: var(--accent); color: var(--accent); }
.vue-jours { display: none; }

/* Gantt */
.gantt {
  --libelle: 230px; margin-bottom: .75rem;
  overflow-x: auto; position: relative; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface);
}
.g-tete, .g-ligne { display: flex; width: calc(var(--libelle) + var(--largeur)); }
.g-tete { position: sticky; top: 0; z-index: 4; background: #fafbf8; border-bottom: 1px solid var(--ligne); height: 46px; }
.g-coin, .g-libelle {
  position: sticky; left: 0; z-index: 3; width: var(--libelle); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--ligne);
}
.g-coin { background: #fafbf8; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); padding: .8rem; font-weight: 600; }
.g-echelle { position: relative; width: var(--largeur); flex-shrink: 0; }
.g-mois { position: absolute; top: 0; height: 24px; padding: 4px 6px; font-size: .8rem; font-weight: 600; color: var(--texte); border-left: 1px solid var(--ligne); white-space: nowrap; overflow: hidden; }
.g-sem { position: absolute; top: 24px; font-size: .7rem; color: var(--doux); padding-left: 3px; border-left: 1px solid #eef0ea; height: 22px; line-height: 22px; }
.g-corps { position: relative; }
.g-fonds { position: absolute; top: 0; bottom: 0; left: var(--libelle); width: var(--largeur); pointer-events: none; }
.g-recolte { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #fbefd9 0 6px, #fdf6ea 6px 12px); }
.g-trait { position: absolute; top: 0; bottom: 0; border-left: 1px solid #eef0ea; }
.g-aujourdhui { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--danger); opacity: .6; }
.g-ligne { height: var(--ligne); border-bottom: 1px solid #f0f2ec; }
.g-libelle { display: flex; flex-direction: column; justify-content: center; padding: 0 .75rem; text-decoration: none; color: var(--texte); overflow: hidden; }
a.g-libelle:hover .g-nom { color: var(--accent); text-decoration: underline; }
.g-nom { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-libelle small { color: var(--doux); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: .3rem; }
.g-libelle small i { width: .6rem; height: .6rem; border-radius: 3px; flex-shrink: 0; }
.g-piste { position: relative; width: var(--largeur); flex-shrink: 0; }
.g-barre {
  position: absolute; top: 8px; height: 24px; border-radius: 6px; background: var(--c); z-index: 2;
  color: #fff; font-size: .75rem; font-weight: 600; text-decoration: none; overflow: hidden; white-space: nowrap;
  display: flex; align-items: center; padding: 0 6px; box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.g-barre.termine { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 70%, white) 5px 10px); opacity: .7; }
a.g-barre:hover { filter: brightness(1.1); }
.g-barre span { overflow: hidden; text-overflow: ellipsis; }
.g-fleches { position: absolute; top: 0; left: var(--libelle); pointer-events: none; z-index: 1; overflow: visible; }
.g-barre { z-index: 3 !important; }
.g-libelle { z-index: 4 !important; }
.g-lien path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.g-lien .halo { stroke: #fff; stroke-width: 5; opacity: .85; }
.g-lien .trait { stroke: #4f6b48; stroke-width: 1.8; }
.g-lien.chevauchement .trait { stroke-dasharray: 5 4; }
.g-lien.probleme .trait { stroke: #c0392b; stroke-width: 2.2; }
.l-recolte { background: repeating-linear-gradient(45deg, #f3d9a8 0 3px, #fdf6ea 3px 6px); }
.l-fleche { height: 2px !important; border-radius: 0 !important; background: #4f6b48; width: 1.4rem !important; }
.l-fleche.pointillé { background: repeating-linear-gradient(90deg, #4f6b48 0 5px, transparent 5px 9px); }

/* Fiche chantier : enchaînements */
.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem 1.25rem; }
.dep { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--ligne); }
.dep:last-child { border-bottom: 0; }
.dep small { display: block; color: var(--doux); }
.dep form { margin: 0; }
.ajout-dep { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.ajout-dep select { width: auto; flex: 1 1 180px; }
.decalage { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.decalage input { width: 4.5rem; text-align: center; }
.cases-parcelles { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: .25rem 0; }
.cases-parcelles .case { font-weight: 400; }

/* Saisie des heures (page autonome, téléphone d'abord) */
body.page-saisie { background: var(--fond); }
.saisie-tete {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  height: 52px; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--ligne);
}
.saisie-retour { text-decoration: none; font-weight: 600; }
.saisie { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.saisie h1 { font-size: 1.35rem; margin: .5rem 0 .25rem; }
.saisie-jour { display: flex; gap: .5rem; align-items: center; }
.saisie-jour form { flex: 1; margin: 0; }
.saisie-jour input { width: 100%; text-align: center; font-weight: 600; }
.bouton-nav.inactif { opacity: .35; }
.etat { color: var(--doux); font-size: .92rem; margin: .25rem 0 1rem; }
.etat-realise { color: var(--accent); font-weight: 600; }
.carte-salarie { background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: .75rem; margin-bottom: .75rem; }
.carte-salarie.en-erreur, .carte-salarie.trop { border-color: var(--danger); }
.carte-salarie.sans-ligne { background: #fafbf8; }
.cs-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.cs-nom { font-weight: 700; font-size: 1.05rem; }
.cs-total { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.sans-ligne .cs-total { color: var(--doux); font-weight: 400; }
.trop .cs-total { color: var(--danger); }
.cs-erreur { color: var(--danger); font-size: .88rem; margin: 0 0 .4rem; }
.ls {
  display: grid; grid-template-columns: 4.2rem 1fr 1fr 2.4rem; gap: .4rem; align-items: center;
  padding: .45rem .45rem .45rem .6rem; margin-bottom: .45rem; border-radius: 10px;
  border-left: 5px solid var(--c); background: color-mix(in srgb, var(--c) 8%, white);
}
.ls select, .ls input { min-height: 44px; padding: .45rem .5rem; font-size: 1rem; }
.ls-h { text-align: center; font-weight: 700; grid-row: span 2; height: 100%; font-size: 1.15rem !important; }
.ls-t { grid-column: 2 / 4; }
.ls-s { grid-column: 2; }
.ls-m { grid-column: 3; }
.ls-x { grid-column: 4; grid-row: 1 / span 2; border: 0; background: none; font-size: 1.6rem; color: var(--doux); cursor: pointer; height: 100%; }
.cs-ajout { border: 1px dashed var(--ligne); background: none; border-radius: 10px; width: 100%; min-height: 44px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.saisie-pied {
  position: fixed; left: 0; right: 0; bottom: 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.95); border-top: 1px solid var(--ligne); backdrop-filter: blur(6px);
}
.saisie-pied .principal { max-width: 640px; margin: 0 auto; display: block; }

/* Réglages météo */
.bloc-reglage { margin-bottom: 1.25rem; }
.bloc-reglage h2 { margin-bottom: .4rem; }
.bloc-reglage .aide-bas { margin: 0 0 .6rem; }
.curseur input[type=range] { padding: 0; min-height: 32px; accent-color: var(--accent); }
.curseur output { color: var(--accent); font-weight: 700; }
.cases-meteo { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem 1rem; margin-top: .4rem; }
.cases-meteo .case, .case.petite { font-weight: 400; }
.libelle-groupe { font-weight: 600; font-size: .92rem; }
.actions-reglages { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; }
.actions-reglages .aide-bas { margin: 0; }

/* Récapitulatif */
.recap-table td.nb, .recap-table th.nb { text-align: right; font-variant-numeric: tabular-nums; }
.recap-table tfoot td { font-weight: 700; background: #fafbf8; border-top: 2px solid var(--ligne); }
.recap-filtres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.recap-filtres input, .recap-filtres select { width: auto; }
.recap-section { margin-top: 1.5rem; }
.ecart-pos { color: var(--accent); }
.ecart-neg { color: var(--danger); }

/* Téléphone */

@media (max-width: 760px) {
  .barre { gap: .75rem; padding: 0 .75rem; }
  .logo { display: none; }
  .menu-haut .bientot { display: none; }
  .nom-txt { display: none; }
  .compte-barre { gap: .6rem; }
  .bouton-menu { display: block; }
  .menu-gauche {
    position: fixed; top: var(--barre); left: 0; bottom: 0; z-index: 15;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 4px 0 16px rgba(0,0,0,.08);
  }
  .menu-ouvert .menu-gauche { transform: none; }
  .contenu { padding: 1rem; }
  .accueil-grille { grid-template-columns: 1fr; }
  .accueil-tete h1 { font-size: 1.45rem; }
  .eq-nom { min-width: 0; width: 100%; }

  /* Listes en cartes */
  table.liste, .liste tbody, .liste tr, .liste td { display: block; width: 100%; }
  .liste thead { display: none; }
  table.liste { background: none; border: 0; }
  .liste tr { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); margin-bottom: .6rem; padding: .4rem 0; }
  .liste td { border: 0; padding: .25rem .9rem; display: flex; gap: .75rem; }
  .liste td:empty { display: none; }
  .liste td[data-l]::before { content: attr(data-l); color: var(--doux); font-size: .85rem; min-width: 8.5rem; }
  .liste td.boutons { text-align: left; padding-top: .5rem; }
  .ajout-piece { grid-template-columns: 1fr; }

  /* Planning : vue par jour au lieu de la grille */
  .grille-defile { display: none; }
  .vue-jours { display: block; }
  .jour { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .75rem .9rem; margin-bottom: .75rem; }
  .jour.aujourdhui { border-color: var(--accent); }
  .jour h2 { font-size: 1rem; margin: 0 0 .5rem; }
  .jour-salarie { padding: .45rem 0; border-top: 1px solid var(--ligne); }
  .js-nom { font-weight: 600; margin-bottom: .3rem; }
  .vue-jours .ajout { display: inline-block; color: var(--accent); text-decoration: none; font-size: .9rem; padding: .25rem 0; }
  .copier { margin-left: 0 !important; }
  .gantt { --libelle: 130px; }
  .deux-col { grid-template-columns: 1fr; }
  .compte { margin-left: 0; }
}

/* ---------- Identité Inovarbo ---------- */
.logo { display: inline-flex; align-items: center; gap: .5rem; }
.logo img { width: 30px; height: 30px; object-fit: contain; }
.logo span { font-weight: 800; letter-spacing: -.01em; color: #1f4d1c; }
.pied-site { margin: 2.5rem 0 .5rem; padding-top: 1rem; border-top: 1px solid var(--ligne); color: var(--doux); font-size: .8rem; text-align: center; }
body.page-simple { flex-direction: column; }
.pied-simple { border-top: 0; margin: 1.25rem 0 0; }
.logo-connexion { display: block; margin: 0 auto .5rem; width: 170px; height: auto; }
.sous-titre.centre { text-align: center; }

/* Écran d'introduction : le logo apparaît puis se fond dans le blanc (≈ 2 s) */
.intro-ecran { display: none; }
html.avec-intro .intro-ecran {
  display: flex; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center;
  background: #fff; cursor: pointer; animation: intro-fond 2.1s ease-in-out forwards;
}
html.avec-intro body { overflow: hidden; }
.intro-ecran img { width: min(62vw, 420px); height: auto; animation: intro-logo 2.1s ease-in-out forwards; }
@keyframes intro-logo {
  0% { opacity: 0; transform: scale(.94); }
  22% { opacity: 1; transform: scale(1); }
  55% { opacity: 1; transform: scale(1.01); }
  100% { opacity: 0; transform: scale(1.04); }
}
@keyframes intro-fond { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html.avec-intro .intro-ecran, .intro-ecran img { animation-duration: .8s; }
}

/* Filigrane du logo sur l'accueil */
.page-accueil .filigrane {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("logo/inovarbo-logo-transparent.webp") center 58% / min(72vmin, 620px) no-repeat;
  opacity: .08;
}
.page-accueil .contenu { position: relative; z-index: 1; }
.page-accueil .carte { background: rgba(255, 255, 255, .78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* ---------- Bannière météo compacte ---------- */
.meteo { transition: background-color .3s, border-color .3s; }
.meteo-compacte {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem;
  padding: .9rem 1.2rem 1.3rem;
}
.meteo-vide p { margin: .4rem 0 0; color: var(--doux); }
.meteo-illu { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 190px; height: auto; pointer-events: none; z-index: 0; }
.illu-soleil circle { fill: #f2b233; opacity: .32; }
.illu-soleil line { stroke: #f2b233; stroke-width: 4; stroke-linecap: round; opacity: .32; }
.illu-lune { fill: #7c86a8; opacity: .24; }
.illu-nuage { fill: #8f9aa6; opacity: .28; }
.illu-pluie line { stroke: #4a86b5; stroke-width: 3.5; stroke-linecap: round; opacity: .38; }
.illu-vent path { fill: none; stroke: #6f8a94; stroke-width: 4; stroke-linecap: round; opacity: .32; }
.meteo-compacte > *:not(.meteo-illu):not(.mc-heure) { position: relative; z-index: 1; }
.mc-temp { display: flex; flex-direction: column; line-height: 1; }
.meteo-temp { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.meteo-temp .deg { font-size: 1rem; font-weight: 600; color: var(--doux); margin-left: .1rem; vertical-align: top; position: relative; top: .3rem; }
.mc-sous { display: flex; gap: .6rem; margin-top: .3rem; font-size: .8rem; color: var(--doux); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem 1.4rem; flex: 1 1 260px; max-width: calc(100% - 200px); }
.mc-stats li { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-stats .ico { color: var(--doux); }
.mc-stats li.val-ok .ico, .mc-stats li.val-moyen .ico, .mc-stats li.val-fort .ico { color: inherit; }
.mc-heure { position: absolute; right: 1rem; bottom: .4rem; z-index: 1; font-size: .72rem; color: var(--doux); }
.mc-note { flex-basis: 100%; font-size: .78rem; color: var(--doux); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meteo-ancienne { color: var(--danger); font-style: normal; }
/* Fond selon les conditions pour traiter (translucide pour laisser voir le filigrane) */
.carte.meteo.fond-ok { background: rgba(232, 244, 227, .86); border-color: #cfe3c8; }
.carte.meteo.fond-moyen { background: rgba(253, 240, 220, .88); border-color: #f0d9ad; }
.carte.meteo.fond-fort { background: rgba(252, 232, 228, .88); border-color: #f1c6be; }
.val-ok { color: #2f7a35 !important; }
.val-moyen { color: #c06a0a !important; }
.val-fort { color: #c0392b !important; }
@media (max-width: 760px) {
  .meteo-compacte { padding: .8rem 1rem 1.4rem; }
  .meteo-illu { width: 150px; right: -14px; }
  .mc-stats { max-width: none; gap: .4rem .9rem; }
  .jour-colonnes { grid-template-columns: 1fr; }
  .meteo-temp { font-size: 2.1rem; }
}

/* ---------- Bandeau d'actualités (gestion) ---------- */
.actus {
  display: flex; gap: 1rem; align-items: flex-start; margin: -.4rem 0 1.1rem; padding: .65rem .9rem;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--ligne); border-radius: 14px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.actus-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--doux); padding-top: .2rem; white-space: nowrap; }
.actus ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; min-width: 0; flex: 1; }
.actus li { display: flex; align-items: baseline; gap: .55rem; min-width: 0; font-size: .9rem; }
.actus li a { color: var(--texte); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.actus li a:hover { color: var(--accent); text-decoration: underline; }
.actus-echelle { flex-shrink: 0; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; background: var(--accent-clair); color: var(--accent); }
.echelle-region { background: #e0ecf3; color: #2f6f8f; }
.echelle-national { background: #ebe6f4; color: #6b5a96; }
.echelle-europe { background: #f8ecd6; color: #a5651a; }
.actus-source { flex-shrink: 0; margin-left: auto; color: var(--doux); font-size: .75rem; white-space: nowrap; }
.actus-vide { margin: 0; color: var(--doux); font-size: .88rem; }

/* ---------- Bandeau Conseils ---------- */
.conseils { margin-top: 1rem; }
.conseils-source { margin-left: .35rem; font-size: .68rem; padding: .08rem .45rem; border-radius: 99px; background: var(--accent-clair); color: var(--accent); letter-spacing: .03em; }
.conseils-actualiser { margin: 0; }
.lien-bouton { border: 0; background: none; cursor: pointer; padding: 0; font: inherit; font-size: .88rem; color: var(--accent); font-weight: 600; }
.conseils-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .5rem .9rem; }
.conseils-liste li { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .7rem; border-radius: 12px; font-size: .92rem; line-height: 1.35; background: rgba(240, 242, 236, .7); }
.conseils-liste .ico { margin-top: .05rem; }
.conseil-alerte { background: rgba(252, 232, 228, .85) !important; color: #9b2f22; }
.conseil-attention { background: rgba(253, 240, 220, .85) !important; color: #8a5a12; }
.conseil-info { color: var(--texte); }
.conseil-info .ico { color: var(--accent); }
.conseils-erreur { color: #8a5a12; }

/* ---------- Accès rapides : pastilles rondes translucides ---------- */
.bureau { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 1.1rem .6rem; max-width: 900px; }
.appli {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--texte); text-align: center; padding: .2rem;
}
.appli-icone {
  display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 6px 18px rgba(31, 42, 31, .10), inset 0 1px 0 rgba(255, 255, 255, .8);
  backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%);
  transition: transform .15s, box-shadow .15s;
}
a.appli:hover .appli-icone { transform: translateY(-3px) scale(1.04); box-shadow: 0 10px 24px rgba(31, 42, 31, .16), inset 0 1px 0 rgba(255,255,255,.8); }
.appli-nom { font-weight: 600; font-size: .84rem; line-height: 1.2; max-width: 9rem; }
.appli.inactive { opacity: .45; }
.appli-bientot { position: absolute; top: -.2rem; left: calc(50% + 18px); font-size: .62rem; padding: .05rem .35rem; border-radius: 99px; background: rgba(255,255,255,.85); color: var(--doux); border: 1px solid var(--ligne); }
.teinte-vert { background: rgba(63, 107, 58, .16); color: #2f5a2c; }
.teinte-bleu { background: rgba(47, 111, 143, .15); color: #255d78; }
.teinte-ambre { background: rgba(195, 125, 30, .16); color: #93571a; }
.teinte-sarcelle { background: rgba(43, 123, 112, .15); color: #23685f; }
.teinte-violet { background: rgba(107, 90, 150, .15); color: #5b4b85; }
.teinte-ardoise { background: rgba(76, 90, 74, .14); color: #3f4c3d; }
.teinte-brun { background: rgba(138, 90, 60, .15); color: #774b31; }

/* ---------- Réglages IA : tableau des sources ---------- */
.table-sources { display: grid; gap: .4rem; margin: .6rem 0; }
.ts-tete, .ts-ligne { display: grid; grid-template-columns: 1.1fr .8fr 2.4fr 3.4rem 3.4rem; gap: .4rem; align-items: center; }
.ts-tete { font-size: .75rem; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; }
.ts-ligne .case { justify-content: center; }
code { background: #eef0ea; padding: .05rem .35rem; border-radius: 5px; font-size: .88em; }

@media (max-width: 760px) {
  .actus { flex-direction: column; gap: .35rem; }
  .actus li { flex-wrap: wrap; }
  .actus li a { white-space: normal; }
  .actus-source { margin-left: 0; }
  .bureau { grid-template-columns: repeat(3, 1fr); gap: 1rem .3rem; }
  .appli-icone { width: 60px; height: 60px; }
  .conseils-liste { grid-template-columns: 1fr; }
  .ts-tete { display: none; }
  .ts-ligne { grid-template-columns: 1fr 1fr; padding: .5rem; border: 1px solid var(--ligne); border-radius: 10px; }
  .ts-ligne input[name$="[url]"] { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .barre .logo { display: inline-flex; }
  .barre .logo span { display: none; }
}

/* ---------- Accueil : salutation + actualités sur la même ligne ---------- */
.accueil-tete { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1rem 2rem; }
.accueil-salut .mode { display: inline-block; margin-top: .55rem; }
.accueil-tete .actus { margin: 0; align-self: stretch; align-items: stretch; }
.actus-nb { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: 99px; background: var(--ligne); color: var(--texte); font-size: .68rem; }
/* Le cadre montre 3 actualités ; les suivantes en faisant défiler (barre de défilement à droite) */
.actus-liste {
  --ligne-actu: 1.75rem;
  height: calc(var(--ligne-actu) * 3); overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; padding-right: .4rem; gap: 0 !important; display: block !important;
  scrollbar-width: thin; scrollbar-color: #b9c2b2 transparent;
}
.actus-liste li { height: var(--ligne-actu); scroll-snap-align: start; }
.actus-liste::-webkit-scrollbar { width: 6px; }
.actus-liste::-webkit-scrollbar-thumb { background: #b9c2b2; border-radius: 3px; }
.actus-liste:focus-visible { outline: 2px solid var(--accent-clair); border-radius: 6px; }

/* ---------- Météo et Aujourd'hui : deux cadres côte à côte, même largeur, même hauteur ---------- */
.accueil-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.accueil-grille > .carte { margin: 0; height: 100%; }
.accueil-grille .meteo-compacte { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: .9rem; padding: 1.1rem 1.25rem 1.2rem; }
.accueil-grille .mc-tete { margin-bottom: 0; }
.accueil-grille .meteo-illu { top: 2.6rem; right: .4rem; transform: none; width: 210px; }
.accueil-grille .meteo-temp { font-size: 3rem; }
.accueil-grille .mc-sous { font-size: .88rem; }
.accueil-grille .mc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem 1rem; max-width: none; flex: none; margin-top: auto; padding-top: .9rem; border-top: 1px solid rgba(0, 0, 0, .07); }
.accueil-grille .mc-stats li { font-size: 1rem; }
.accueil-grille .jour-colonnes { grid-template-columns: 1fr; }
.accueil-grille .meteo-vide { display: block; }

@media (max-width: 760px) {
  .accueil-tete { grid-template-columns: 1fr; }
  .accueil-grille { grid-template-columns: 1fr; }
  .accueil-grille > .carte { height: auto; }
  .accueil-grille .meteo-illu { width: 150px; top: 2.4rem; right: -10px; }
  .accueil-grille .meteo-temp { font-size: 2.5rem; }
  .accueil-grille .mc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actus-liste { --ligne-actu: 4.2rem; }
  .actus-liste li { flex-wrap: wrap; align-content: flex-start; gap: .1rem .5rem; overflow: hidden; }
  .actus-liste li a { white-space: nowrap; flex-basis: 100%; }
}
/* Correctif : le cadre garde sa hauteur de 3 actualités (sinon il s'étire), et le texte ne déborde pas sur téléphone */
.actus-liste { flex: none !important; width: 100%; min-width: 0; }
@media (max-width: 760px) {
  .accueil-tete .actus { min-width: 0; }
  .actus-liste { --ligne-actu: 5.9rem; }
  .actus-liste li { padding-bottom: .35rem; }
  .actus-liste li a {
    white-space: normal; flex-basis: 100%; min-width: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}
/* Correctif : sur ordinateur, la liste partage la largeur avec le titre « Actualités » (pas 100 %), rien ne dépasse à droite */
.accueil-tete .actus { min-width: 0; overflow: hidden; }
.actus-liste { flex: 1 1 0 !important; width: auto; min-width: 0; }
.actus-liste li { min-width: 0; }
.actus-liste li a { flex: 1 1 auto; }
.actus-source { flex: 0 1 auto; min-width: 0; max-width: 38%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .actus-liste { flex: none !important; width: 100%; }
  .actus-source { max-width: none; }
}
.actus-liste li a { flex: 1 1 0; }
.actus-source { flex: 0 0 auto; max-width: 12rem; }
/* Écrans moyens (tablette) : les actualités passent sous la salutation pour garder des titres lisibles */
@media (max-width: 1000px) {
  .accueil-tete { grid-template-columns: 1fr; }
}

/* ---------- Icônes au trait en pastilles rondes translucides (menus, vue d'ensemble) ---------- */
.pastille-ic {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 2px 6px rgba(31, 42, 31, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
  backdrop-filter: blur(6px) saturate(140%); -webkit-backdrop-filter: blur(6px) saturate(140%);
}
.menu-gauche .ic.pastille-ic { width: 32px; height: 32px; }
.menu-gauche a { gap: .65rem; padding: .4rem .6rem; }
.menu-gauche a.actif .pastille-ic { box-shadow: 0 0 0 2px var(--accent-clair), 0 2px 6px rgba(31,42,31,.1); }
.tuile { grid-template-columns: auto 1fr auto; }
.tuile-icone.pastille-ic { width: 46px; height: 46px; font-size: 0; }
.tuile:hover .pastille-ic { transform: scale(1.05); }
.pastille-ic { transition: transform .15s; }
@media (max-width: 760px) {
  .menu-haut a, .menu-haut span { padding: .4rem .45rem; font-size: .9rem; }
  .compte-barre .lien-discret { font-size: .82rem; }
  .barre { gap: .5rem; }
}

/* ---------------- Traitements ---------------- */
[hidden] { display: none !important; }
.principal.petit, .secondaire-bouton.petit { padding: .4rem .75rem; font-size: .9rem; }
.principal.vert { background: #2f7d4a; }
.nb { text-align: right !important; }
.liste .nb input { text-align: right; }
.doux { color: var(--doux); }
.manque { color: var(--danger); }
.ok { color: #2f7d4a; }
.statut { display: inline-block; vertical-align: middle; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; margin-left: .3rem; }
.statut-prevu { background: #eef2fb; color: #3a5a9b; }
.statut-realise, .statut-livree { background: #e5f3e8; color: #2f7d4a; }
.statut-annule { background: #f3eeee; color: #8a6b6b; text-decoration: line-through; }
.statut-brouillon { background: #f1f1ee; color: #666; }
.statut-commandee { background: #fdf2dc; color: #946200; }
.badge-alerte, .badge-coef { font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; }
.badge-alerte { background: #fde7e3; color: #a33a2a; }
.badge-coef { background: #efe9fb; color: #6243a8; }
.boutons-titre { display: flex; gap: .5rem; flex-wrap: wrap; }
.boutons-titre form, .titre-ligne form { margin: 0; }
.copier { margin: 0 0 0 .5rem; }

/* Programme d'hiver */
.programme { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .5rem 0; margin-bottom: 1rem; }
.prog-mois, .prog-ligne { display: grid; grid-template-columns: minmax(220px, 26%) 1fr 240px; gap: 0 1rem; align-items: center; padding: .55rem 1rem; }
.prog-mois { padding-top: .2rem; padding-bottom: .2rem; }
.prog-mois div { display: grid; grid-template-columns: repeat(12, 1fr); font-size: .75rem; color: var(--doux); text-transform: uppercase; }
.prog-mois div span { border-left: 1px solid var(--ligne); padding-left: .25rem; }
.prog-ligne { border-top: 1px solid var(--ligne); }
.prog-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.prog-cible { font-weight: 700; text-decoration: none; color: var(--texte); font-size: 1.02rem; }
.prog-cat, .prog-compte, .prog-produits { font-size: .82rem; color: var(--doux); }
.prog-produits { color: #6243a8; }
.prog-frise { position: relative; height: 34px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 12 - 1px), var(--ligne) calc(100% / 12 - 1px), var(--ligne) calc(100% / 12)); border-radius: 6px; }
.prog-fenetre { position: absolute; top: 9px; height: 16px; border-radius: 8px; background: #d9e8d4; border: 1px solid #a9c9a0; }
.prog-point { position: absolute; top: 7px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; border: 3px solid var(--c); background: #fff; z-index: 2; }
.prog-point.realise { background: var(--c); }
.prog-auj { position: absolute; top: 0; bottom: 0; width: 2px; background: #c0392b; opacity: .6; }
.prog-actions { display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.alerte-form { position: relative; }
.alerte-form summary { list-style: none; cursor: pointer; }
.alerte-form summary::-webkit-details-marker { display: none; }
.alerte-form form { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; width: 300px; display: flex; flex-direction: column; gap: .45rem;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.alerte-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.alerte-form label.case { flex-direction: row; align-items: center; gap: .4rem; }
.libelle-groupe { font-size: .85rem; font-weight: 600; color: var(--doux); margin-top: .2rem; }
.legende .l-fenetre { background: #d9e8d4; border: 1px solid #a9c9a0; width: 1.4rem; }
.legende .l-point { border-radius: 50%; border: 2px solid var(--doux); background: #fff; }
.legende .l-point.plein { background: var(--doux); }

/* Passage */
.resume-passage { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1.25rem; }
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1rem; }
.chiffres > div { background: var(--fond); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; }
.chiffre { font-size: 1.3rem; font-weight: 700; }
.chiffres .lib { font-size: .82rem; color: var(--doux); }
.liste.mini td, .liste.mini th { padding: .45rem .65rem; }
.liste tfoot td { background: #fafbf8; font-size: .92rem; }
.infos-passage { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .8rem 0 0; font-size: .93rem; }
.alerte-ligne { margin: 0 0 .5rem; padding: .5rem .8rem; border-radius: 8px; font-size: .93rem; }
.alerte-ligne.niveau-moyen { background: #fdf2dc; color: #7a5200; }
.alerte-ligne.niveau-fort { background: #fde7e3; color: #8e2a1c; }
.passage-form h2 { margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--ligne); }
.lignes-melange { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.ligne-melange { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 6rem 7.5rem 2rem; gap: .5rem; align-items: center; }
.ligne-melange .ls-x { grid-column: auto; grid-row: auto; height: auto; }
.dupliquer { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1.25rem; }
.dupliquer select { width: auto; }

/* Commandes, stocks, fumure */
.tableau-defile { overflow-x: auto; margin-bottom: .75rem; }
.petit-nb { width: 6rem; }
.grille-commande th .pastille-couleur { width: .8rem; height: .8rem; margin-right: .3rem; border-radius: 50%; }
.ajout-ligne { margin: .5rem 0; }
.ajout-ligne select { width: auto; }
.commande-form .fiche { margin-bottom: 1.25rem; }
.liste tr.groupe td { background: var(--accent-clair); font-weight: 700; font-size: .9rem; }
.npk-n strong { color: #3a5a9b; }
.npk-p strong { color: #946200; }
.npk-k strong { color: #6243a8; }

@media (max-width: 760px) {
  .prog-mois { display: none; }
  .prog-ligne { grid-template-columns: 1fr; gap: .5rem; }
  .prog-actions { justify-content: flex-start; }
  .alerte-form form { position: static; width: auto; margin-top: .5rem; box-shadow: none; }
  .chiffres { grid-template-columns: 1fr 1fr; }
  .ligne-melange { grid-template-columns: 1fr 1fr 2rem; }
  .ligne-melange select[name="ligne_produit[]"] { grid-column: 1 / 3; }
  .ligne-melange .ls-x { grid-column: 3; grid-row: 1; }
  .liste tfoot { display: block; }
  .liste tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: .45rem .9rem; }
  .liste tfoot td { display: block; width: auto; padding: 0; background: none; }
  .liste tfoot td[data-l]::before { margin-right: .5rem; }
  .liste tfoot td[colspan] { font-weight: 600; }
  .liste tr.groupe { background: var(--accent-clair); }
  .liste td.nb { text-align: left !important; }
  .petit-nb { width: 7rem; }
  .tableau-defile { overflow: visible; }
}

/* Consignes */
.sans-marge { margin: 0; }
.meteo-consigne { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; padding: .75rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem; }
.meteo-consigne.niveau-ok { background: #e5f3e8; }
.meteo-consigne.niveau-moyen { background: #fdf2dc; }
.meteo-consigne.niveau-fort { background: #fde7e3; }
.niv-ok { color: #2f7d4a; } .niv-moyen { color: #b26b00; } .niv-fort { color: var(--danger); }
.bloc-interdit { background: #fde7e3; border: 1px solid #f2b8ad; border-radius: var(--rayon); padding: .8rem 1rem; margin-bottom: 1rem; }
.bloc-interdit h2 { display: flex; align-items: center; gap: .4rem; color: #8e2a1c; margin: 0 0 .4rem; }
.bloc-interdit ul { margin: 0; padding-left: 1.2rem; }
.consigne { background: var(--surface); border: 1px solid var(--ligne); border-left: 5px solid var(--c); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1rem; }
.consigne-tete { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.consigne-tete h2 { margin: .15rem 0 .5rem; }
.consigne-date { font-size: .85rem; font-weight: 700; color: var(--doux); text-transform: uppercase; letter-spacing: .03em; }
.consigne-date.auj { color: var(--accent); }
.consigne-date.retard { color: var(--danger); }
.consigne-infos { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin: 0 0 .75rem; font-size: .95rem; }
.consigne-securite { margin-top: .8rem; background: #fff8e8; border-radius: 10px; padding: .7rem .9rem; }
.consigne-securite h3 { display: flex; align-items: center; gap: .35rem; color: #7a5200; }
.consigne-securite ul { margin: 0; padding-left: 1.2rem; font-size: .93rem; }
.consigne-remarque { margin: .7rem 0 0; color: var(--doux); font-style: italic; }
.liste-simple { padding-left: 1.2rem; }

/* Recherche */
.recherche-champ { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: .4rem .4rem .4rem .9rem; color: var(--doux); }
.recherche-champ input[type=search] { flex: 1; border: 0; outline: 0; font-size: 1.05rem; min-width: 0; background: none; padding: .5rem 0; }
.recherche-champ select { width: auto; border: 0; background: var(--fond); }
.recherche-groupee { margin: 1rem 0; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .7rem 1rem; }
.recherche-groupee summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.rg-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; margin-top: .8rem; }
.rg-grille form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rg-grille h3 { width: 100%; margin: 0; }
.rg-grille select { width: auto; max-width: 100%; }
.compte-resultats { color: var(--doux); }
.resultats { margin-bottom: 1.25rem; }
.resultats h2 { margin-bottom: .4rem; }
.r-liste { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.r-liste li + li { border-top: 1px solid var(--ligne); }
.r-liste a { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; padding: .6rem .9rem; text-decoration: none; color: var(--texte); }
.r-liste a:hover { background: var(--accent-clair); }
.r-titre { font-weight: 700; }
.r-structure { font-size: .78rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 15%, white); color: color-mix(in srgb, var(--c) 80%, black); }
.r-date { font-size: .85rem; color: var(--doux); }
.r-detail { flex-basis: 100%; font-size: .88rem; color: var(--doux); }
@media (max-width: 760px) {
  .recherche-champ { flex-wrap: wrap; }
  .recherche-champ input[type=search] { flex-basis: calc(100% - 2rem); }
  .recherche-champ select, .recherche-champ button { flex: 1; }
  .rg-grille { grid-template-columns: 1fr; }
}

/* Export */
.onglets-export { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.onglets-export a { padding: .5rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne); text-decoration: none; color: var(--texte); font-weight: 600; }
.onglets-export a.actif { background: var(--accent); border-color: var(--accent); color: #fff; }
.export-form .actions .principal { display: inline-flex; align-items: center; gap: .35rem; }
.apercu table { font-size: .85rem; white-space: nowrap; }
@media (max-width: 760px) { .apercu table { white-space: normal; } .apercu tr:nth-child(n+4) { display: none; } }

/* ---------- Actualités : barre de défilement toujours visible (dessinée par le site) ---------- */
.actus-defile { display: flex; gap: .45rem; flex: 1 1 0; min-width: 0; align-items: stretch; }
.actus-defile .actus-liste { flex: 1 1 0 !important; width: auto !important; min-width: 0; padding-right: 0; scrollbar-width: none; }
.actus-defile .actus-liste::-webkit-scrollbar { display: none; width: 0; }
.actus-rail { flex: 0 0 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; height: calc(var(--ligne-actu, 1.75rem) * 3); }
.actus-defile .actus-liste, .actus-rail { --ligne-actu: 1.75rem; }
.actus-fleche { border: 0; background: none; padding: 0; width: 14px; height: 12px; line-height: 12px; font-size: 11px; color: #7d8a74; cursor: pointer; }
.actus-fleche:hover { color: var(--accent); }
.actus-piste { flex: 1; width: 8px; border-radius: 4px; background: rgba(60, 80, 50, .13); position: relative; cursor: pointer; touch-action: none; }
.actus-curseur { position: absolute; left: 0; top: 0; width: 8px; border-radius: 4px; background: #6f8a5f; cursor: grab; }
.actus-curseur:active { cursor: grabbing; background: var(--accent); }
.actus-rail.inactif .actus-curseur { background: #b9c2b2; }
.actus-rail.inactif .actus-fleche { opacity: .35; cursor: default; }
@media (max-width: 760px) {
  .actus-defile { flex: none; width: 100%; }
}
@media (max-width: 760px) {
  .actus-defile .actus-liste, .actus-rail { --ligne-actu: 5.9rem; }
  .actus-rail { flex-basis: 18px; }
  .actus-piste, .actus-curseur { width: 10px; border-radius: 5px; }
  .actus-fleche { width: 18px; height: 16px; font-size: 13px; }
  .actus-defile .actus-liste li { flex-wrap: wrap; }
  .actus-defile .actus-liste li a { flex: 1 1 100%; }
  .actus-defile .actus-source { margin-left: 0; max-width: none; }
}

/* ---------- Barre du haut : fichiers et messagerie ---------- */
.ic-barre { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--texte); text-decoration: none; transition: background .15s; }
.ic-barre:hover, .ic-barre.actif { background: var(--accent-clair); color: var(--accent); }
.pastille-nonlus { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d64532; color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface, #fff); }
.nom-utilisateur { display: inline-flex; align-items: center; gap: .3rem; }
.compte-barre { gap: .5rem; }
.compte-barre .nom-utilisateur { margin-right: .4rem; }
@media (max-width: 760px) {
  .ic-barre { width: 32px; height: 32px; }
  .compte-barre { gap: .15rem; }
}

/* ---------- Messagerie ---------- */
.boite { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.boite-liste, .boite-lecture { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); min-width: 0; }
.boite-liste { overflow: hidden; }
.boite-tete { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem .4rem; }
.boite-tete h1 { margin: 0; font-size: 1.3rem; }
.boite-tete .principal { display: inline-flex; align-items: center; gap: .3rem; }
.boite-recherche { padding: 0 1rem .7rem; }
.boite-recherche input { width: 100%; }
.boite-vide { padding: 1rem; }
.boite-messages { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 220px); overflow-y: auto; }
.boite-messages li { border-top: 1px solid var(--ligne); }
.boite-messages a { display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; padding: .65rem 1rem; text-decoration: none; color: var(--texte); }
.boite-messages a:hover { background: #f6f8f3; }
.boite-messages li.courant a { background: var(--accent-clair); }
.boite-messages li.non-lu a { box-shadow: inset 3px 0 0 var(--accent); }
.boite-messages li.non-lu .bm-qui, .boite-messages li.non-lu .bm-sujet { font-weight: 700; }
.bm-qui { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bm-date { font-size: .8rem; color: var(--doux); }
.bm-sujet { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .93rem; display: flex; align-items: center; gap: .2rem; }
.bm-extrait { grid-column: 1 / -1; color: var(--doux); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boite-lecture { padding: 1.1rem 1.3rem; min-height: 320px; }
.boite-retour { display: none; margin-bottom: .6rem; }
.boite-accueil { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 280px; color: var(--doux); gap: .5rem; }
.pastille-ic.grande { width: 72px; height: 72px; }
.message-lu h2 { margin: 0 0 .8rem; }
.ml-entete { display: flex; gap: .75rem; align-items: flex-start; padding-bottom: .8rem; border-bottom: 1px solid var(--ligne); }
.ml-avatar { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--accent-clair); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.ml-fil { font-size: .88rem; color: var(--doux); margin: .6rem 0 0; }
.ml-corps { padding: 1rem 0; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.ml-pieces { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ml-pieces li { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; padding: .5rem .7rem; border: 1px solid var(--ligne); border-radius: 10px; }
.ml-pieces a { display: inline-flex; align-items: center; gap: .25rem; font-size: .9rem; }
.ml-nom { flex: 1; min-width: 10rem; overflow-wrap: anywhere; }
.ml-ic { color: var(--doux); display: inline-flex; }
.ml-vignette img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.ml-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .8rem; border-top: 1px solid var(--ligne); }
.ml-actions form { margin: 0; }
.ml-actions .principal, .ml-actions .secondaire-bouton { display: inline-flex; align-items: center; gap: .3rem; }
.lien-discret.danger { color: var(--danger); display: inline-flex; align-items: center; gap: .25rem; }
.form-message .champ { margin-bottom: .9rem; }
.form-message .libelle { display: block; font-weight: 600; margin-bottom: .35rem; }
.form-message textarea { width: 100%; }
.form-message .principal { display: inline-flex; align-items: center; gap: .35rem; }
.dest-choix { display: flex; flex-wrap: wrap; gap: .4rem; }
.dest-puce { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border: 1px solid var(--ligne); border-radius: 999px; background: #fafbf8; cursor: pointer; font-size: .92rem; }
.dest-puce:has(input:checked) { background: var(--accent-clair); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.dest-puce.tous { border-style: dashed; }
@media (max-width: 860px) {
  .boite { grid-template-columns: 1fr; }
  .boite.boite-ouverte .boite-liste { display: none; }
  .boite:not(.boite-ouverte) .boite-lecture { display: none; }
  .boite-retour { display: inline-block; }
  .boite-messages { max-height: none; }
  .boite-lecture { padding: 1rem; }
}

/* ---------- Fichiers partagés ---------- */
.depot { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.zone-depot { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.4rem 1rem; border: 2px dashed #c4cdbd; border-radius: 12px; color: var(--doux); text-align: center; cursor: pointer; }
.zone-depot.survol, .zone-depot:hover { border-color: var(--accent); background: var(--accent-clair); color: var(--accent); }
.zone-depot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#depot-texte { font-weight: 600; color: var(--texte); overflow-wrap: anywhere; }
.fichiers-liste { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.fichiers-liste li { display: flex; align-items: center; gap: .9rem; padding: .6rem .9rem; }
.fichiers-liste li + li { border-top: 1px solid var(--ligne); }
.fl-vignette { flex: 0 0 52px; height: 52px; border-radius: 10px; background: #f1f4ee; color: #6b7a62; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; overflow: hidden; }
.fl-vignette.photo img { width: 100%; height: 100%; object-fit: cover; }
.fl-ext { font-size: .6rem; font-weight: 700; letter-spacing: .03em; margin-top: -2px; max-width: 48px; overflow: hidden; }
.fl-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fl-nom { font-weight: 600; overflow-wrap: anywhere; }
.fl-desc { font-size: .88rem; }
.fl-meta { font-size: .8rem; color: var(--doux); }
.fl-actions { display: flex; gap: .2rem; align-items: center; }
.fl-actions form { margin: 0; }
.ic-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--texte); cursor: pointer; }
.ic-action:hover { background: var(--accent-clair); color: var(--accent); }
.ic-action.danger:hover { background: #fde7e3; color: var(--danger); }
.deconnexion { display: inline-flex; align-items: center; gap: .3rem; }
.deconnexion .ico { display: none; }
@media (max-width: 760px) {
  .deconnexion span { display: none; }
  .deconnexion .ico { display: inline-block; }
  .deconnexion { width: 32px; height: 32px; justify-content: center; }
  .menu-haut { overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .menu-haut::-webkit-scrollbar { display: none; }
  .compte-barre .nom-utilisateur { margin-right: 0; }
}

/* ---------- Lien E-Phy ---------- */
.lien-ephy { display: inline-flex; align-items: center; gap: .2rem; font-size: .8rem; font-weight: 600; white-space: nowrap; padding: .05rem .45rem; border-radius: 999px; background: #eaf1fb; color: #2f5d9b; text-decoration: none; vertical-align: middle; }
.lien-ephy:hover { background: #d9e6f8; }
.liens-ephy { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .35rem; font-size: .9rem; }
.liens-ephy a { display: inline-flex; align-items: center; gap: .25rem; }

/* ---------- Liste des produits compacte ---------- */
.liste-produits { table-layout: auto; width: 100%; }
.liste-produits th, .liste-produits td { white-space: nowrap; padding: .5rem .6rem; }
.liste-produits .lp-nom { white-space: nowrap; max-width: 0; width: 40%; }
.lp-nom-bloc { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.lp-nom-txt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.lp-nom-bloc .lien-ephy { flex: none; }
.liste-produits .lien-ephy { margin-left: .3rem; font-size: .72rem; }
.lp-type { font-size: .85rem; }
.liste-produits .boutons { width: 1%; }
@media (max-width: 760px) {
  .liste-produits .lp-nom { max-width: none; width: auto; }
  .liste-produits td { white-space: normal; }
  .lp-nom-txt { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: left; }
  .lp-nom-bloc { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-width: 0; }
  .liste-produits .lien-ephy { margin-left: 0; }
}

/* ---------- Accueil : Météo et Aujourd'hui repliés à mi-hauteur, dépliés au survol (ordinateur seulement) ---------- */
.accueil-grille.condense > .carte { max-height: var(--h-replie); overflow: hidden; position: relative; transition: max-height .35s ease; }
.accueil-grille.condense > .carte::after {
  content: '▾'; position: absolute; left: 0; right: 0; bottom: 0; height: 3.2rem; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: .25rem; font-size: .85rem; color: var(--doux); pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .92) 70%); transition: opacity .25s; z-index: 2;
}
.accueil-grille.condense > .meteo.fond-ok::after { background: linear-gradient(to bottom, rgba(232, 244, 227, 0), rgba(232, 244, 227, .97) 70%); }
.accueil-grille.condense > .meteo.fond-moyen::after { background: linear-gradient(to bottom, rgba(253, 240, 220, 0), rgba(253, 240, 220, .97) 70%); }
.accueil-grille.condense > .meteo.fond-fort::after { background: linear-gradient(to bottom, rgba(252, 232, 228, 0), rgba(252, 232, 228, .97) 70%); }
.accueil-grille.condense:hover > .carte, .accueil-grille.condense:focus-within > .carte { max-height: var(--h-plein); }
.accueil-grille.condense:hover > .carte::after, .accueil-grille.condense:focus-within > .carte::after { opacity: 0; }
.accueil-grille.condense .mc-stats { margin-top: 0; }

/* Pluie sur 24 h : petit « 24 » sur la goutte pour la distinguer de la pluie du jour */
.ic-24 { position: relative; display: inline-flex; margin-right: 7px; }
.ic-24-n { position: absolute; right: -8px; bottom: -5px; font-size: .58rem; font-weight: 800; line-height: 1; color: inherit;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; letter-spacing: -.02em; }

/* Accès rapide : toutes les icônes sur une ligne, sur toute la largeur des bandeaux (ordinateur) */
@media (min-width: 900px) {
  .bureau { max-width: none; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .6rem .4rem; }
}
@media (min-width: 761px) and (max-width: 899px) {
  .bureau { max-width: none; }
}
.r-liste .r-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; padding: .6rem .9rem; }

/* ---------- Événement (ordinateur) ---------- */
.ic-evenement { color: #d9731a; }
.ic-evenement:hover, .ic-evenement.actif { background: #fdeedd; color: #c05f0c; }

/* ---------- Téléphone : barre fine + menu hamburger, barre du bas pour le terrain ---------- */
.bouton-tiroir, .tiroir, .tiroir-fond, .barre-bas { display: none; }
@media (max-width: 760px) {
  .connecte .barre { height: 52px; justify-content: space-between; }
  .connecte .barre .logo { display: inline-flex; align-items: center; gap: .45rem; }
  .connecte .barre .logo span { display: inline; font-size: 1.05rem; }
  .connecte .barre .logo img { width: 30px; height: 30px; }
  .connecte .menu-haut, .connecte .compte-barre, .connecte .bouton-menu { display: none !important; }
  .connecte.avec-menu .menu-gauche { display: none; }
  .bouton-tiroir { display: inline-flex; position: relative; align-items: center; justify-content: center; width: 46px; height: 46px; margin-right: -.4rem; border: 0; background: none; color: var(--texte); border-radius: 12px; cursor: pointer; }
  .bouton-tiroir:active { background: var(--accent-clair); }
  .bouton-tiroir .pastille-nonlus { top: 4px; right: 2px; }
  .tiroir-fond { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(20, 30, 20, .35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .tiroir { display: flex; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(86vw, 330px); overflow-y: auto;
            background: var(--surface); box-shadow: -8px 0 30px rgba(0,0,0,.15); transform: translateX(102%); transition: transform .22s ease; padding: 0 0 1.5rem; }
  .tiroir-ouvert .tiroir { transform: none; }
  .tiroir-ouvert .tiroir-fond { opacity: 1; pointer-events: auto; }
  .tiroir-ouvert { overflow: hidden; }
  .tiroir-tete { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem .6rem; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--ligne); }
  .tiroir-fermer { border: 0; background: none; font-size: 1.8rem; line-height: 1; width: 44px; height: 44px; cursor: pointer; color: var(--doux); }
  .tiroir-titre { margin: 1rem 1rem .25rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
  .tiroir a, .tiroir-sortie button { display: flex; align-items: center; gap: .8rem; min-height: 48px; padding: 0 1rem; color: var(--texte); text-decoration: none; font-size: 1rem; }
  .tiroir a.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
  .tiroir a:active { background: var(--fond); }
  .tiroir .ic { display: inline-flex; color: var(--accent); width: 22px; justify-content: center; }
  .tiroir .pastille-nonlus.en-ligne { position: static; margin-left: auto; box-shadow: none; }
  .tiroir-sortie { margin: 1rem 0 0; border-top: 1px solid var(--ligne); padding-top: .5rem; }
  .tiroir-sortie button { width: 100%; border: 0; background: none; cursor: pointer; font-family: inherit; color: var(--danger); }
  .tiroir-sortie .ic { color: var(--danger); }

  .barre-bas { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: .5rem; padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
               background: rgba(255, 255, 255, .96); border-top: 1px solid var(--ligne); box-shadow: 0 -4px 18px rgba(0,0,0,.06); backdrop-filter: blur(8px); }
  .barre-bas a { flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
                 border-radius: 16px; background: var(--fond); color: var(--texte); text-decoration: none; font-weight: 700; font-size: .92rem; }
  .barre-bas a.actif { background: var(--accent-clair); color: var(--accent); }
  .barre-bas a.bb-evenement { background: #e8771f; color: #fff; box-shadow: 0 4px 12px rgba(232, 119, 31, .35); }
  .barre-bas a.bb-evenement.actif { background: #c9600f; }
  .connecte .cadre { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media print { .barre, .barre-bas, .tiroir, .tiroir-fond, .menu-gauche, .pied-site { display: none !important; } .connecte .cadre { padding-bottom: 0; } }
.libelle-champ { display: block; font-weight: 600; margin-bottom: .35rem; }
.bouton-gps { margin-top: .4rem; display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Événements indésirables ---------- */
.titre-evenement { display: flex; align-items: center; gap: .6rem; }
.pastille-alerte { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: #fdeedd; color: #d9731a; }
.bouton-orange { background: #e8771f !important; border-color: #e8771f !important; display: inline-flex; align-items: center; gap: .35rem; }
.form-evenement { display: flex; flex-direction: column; gap: 1.1rem; max-width: 640px; }
.types-evenement { min-width: 0; border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.types-evenement legend { font-weight: 700; margin-bottom: .5rem; font-size: 1.05rem; }
.type-tuile { position: relative; }
.type-tuile input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.type-tuile span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 84px; padding: .5rem; text-align: center;
  border: 2px solid var(--ligne); border-radius: 14px; background: var(--surface); font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--texte); }
.type-tuile span svg { color: #d9731a; }
.type-tuile input:checked + span { border-color: #e8771f; background: #fdeedd; color: #a24d06; box-shadow: 0 0 0 2px rgba(232, 119, 31, .25); }
.type-tuile input:focus-visible + span { outline: 3px solid #e8771f; outline-offset: 2px; }
.boutons-photos { display: flex; gap: .6rem; }
.gros-bouton { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 60px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.gros-bouton.secondaire-gros { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
.apercus { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.apercu { position: relative; width: 88px; height: 88px; }
.apercu img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.apercu button { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #d64532; color: #fff; font-size: 1.1rem; cursor: pointer; }
.etat-gps { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-size: .92rem; color: var(--doux); }
.bloc-position select { width: 100%; min-height: 48px; }
.principal.gros-envoyer { min-height: 60px; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: #e8771f; border-color: #e8771f; }
.statut-ev { display: inline-block; vertical-align: middle; font-size: .75rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; }
.ev-nouveau { background: #fde7e3; color: #a33a2a; }
.ev-en_cours { background: #fdf2dc; color: #946200; }
.ev-resolu { background: #e5f3e8; color: #2f7d4a; }
.ev-infos { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.ev-infos span { display: inline-flex; align-items: center; gap: .3rem; }
.ev-commentaire { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .8rem 1rem; margin-bottom: 1rem; }
.ev-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.ev-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.ev-carte { height: 260px; border-radius: var(--rayon); border: 1px solid var(--ligne); margin-bottom: .5rem; z-index: 0; background: #eef1ea; }
.ev-carte.grande { height: 360px; margin-bottom: 1rem; }
.ev-suivi { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .6rem; }
.ev-suivi li { border-left: 3px solid var(--ligne); padding-left: .8rem; }
.ev-liste { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.ev-liste li + li { border-top: 1px solid var(--ligne); }
.ev-liste a { display: flex; gap: .8rem; align-items: center; padding: .7rem .9rem; color: var(--texte); text-decoration: none; }
.ev-liste a:hover { background: #f6f8f3; }
.ev-vignette { flex: 0 0 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #fdeedd; color: #d9731a; display: flex; align-items: center; justify-content: center; }
.ev-vignette img { width: 100%; height: 100%; object-fit: cover; }
.ev-texte { min-width: 0; }
.ev-extrait { font-size: .9rem; }
@media (max-width: 760px) { .types-evenement { grid-template-columns: repeat(2, 1fr); } .ev-carte.grande { height: 280px; } }

/* ---------- Pulvérisation ---------- */
.calculateur { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1rem; }
.calc-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem 1rem; }
.calc-mode { border: 0; padding: 0; margin: .9rem 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; min-width: 0; }
.calc-mode legend { font-weight: 700; margin-bottom: .3rem; }
.calc-resultat { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1rem; }
.chiffres .cherche { background: var(--accent-clair); box-shadow: inset 0 0 0 2px var(--accent); }
.alerte-ligne.niveau-info { background: #eaf1fb; color: #23497a; }
.buses-table .pos-nom { width: 9rem; }
.buses-table select { width: 100%; }
.generer { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .9rem; }
.generer select { width: auto; max-width: 100%; }
.historique-buses { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .7rem; }
.historique-buses ul { list-style: none; padding-left: .8rem; margin: .2rem 0 0; font-size: .9rem; }
.historique-buses .ajout { color: #2f7d4a; }
.historique-buses .retrait { color: var(--danger); }

/* ---------- Fiche traitement (salariés) ---------- */
.fiche-outils { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.fiche-outils span { display: flex; gap: .5rem; }
.fiche-traitement { background: #fff; border: 2px solid var(--texte); border-radius: 14px; padding: 1.2rem 1.4rem; max-width: 900px; font-size: 1.2rem; }
.ft-tete { border-bottom: 2px solid var(--texte); padding-bottom: .6rem; margin-bottom: .8rem; }
.ft-structure { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.ft-tete h1 { font-size: 2rem; margin: .1rem 0 0; }
.ft-avertissement { background: #e8771f; color: #fff; font-size: 1.15rem; padding: .7rem 1rem; border-radius: 10px; margin: 0 0 .8rem; }
.ft-lignes { list-style: none; counter-reset: ft; margin: 0; padding: 0; }
.ft-lignes > li { counter-increment: ft; display: grid; grid-template-columns: 2.2rem 12rem 1fr; gap: .5rem; padding: .65rem 0; border-bottom: 1px solid #d9ded4; align-items: baseline; }
.ft-lignes > li::before { content: counter(ft); font-weight: 800; color: #fff; background: var(--accent); width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.ft-lib { font-weight: 700; color: var(--doux); font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; }
.ft-val { font-size: 1.35rem; font-weight: 600; display: flex; flex-direction: column; gap: .2rem; }
.ft-petit { font-size: .95rem; font-weight: 400; color: var(--doux); }
.ft-produit strong, .ft-reglage strong { font-weight: 800; }
.ft-cuves { font-weight: 800; }
.ft-reglage-groupe { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; align-items: baseline; }
.ft-reglage { display: inline-flex; gap: .4rem; align-items: baseline; }
.ft-alerte { color: var(--danger); font-size: 1rem; flex-basis: 100%; }
.ft-securite { margin-top: 1rem; background: #fff8e8; border-radius: 10px; padding: .6rem 1rem; font-size: 1rem; }
.ft-securite p { margin: .25rem 0; }
.ft-remarque { font-style: italic; color: var(--doux); font-size: 1rem; }
.grand-format .fiche-traitement { max-width: none; font-size: 1.6rem; }
.grand-format .ft-val { font-size: 2rem; }
.grand-format .ft-tete h1 { font-size: 2.8rem; }
.grand-format .ft-lignes > li { grid-template-columns: 3rem 16rem 1fr; }
.grand-format .menu-gauche, .grand-format .barre { display: none; }
@media (max-width: 760px) {
  .fiche-traitement { padding: .9rem; font-size: 1rem; }
  .ft-tete h1 { font-size: 1.5rem; }
  .ft-lignes > li { grid-template-columns: 2rem 1fr; }
  .ft-lignes > li .ft-val { grid-column: 2; }
  .ft-val { font-size: 1.15rem; }
}
@media print {
  .fiche-outils, .aide-bas { display: none !important; }
  .fiche-traitement { border: 2px solid #000; max-width: none; font-size: 14pt; }
  .ft-val { font-size: 16pt; }
  .ft-avertissement { color: #000; background: none; border: 3px solid #000; }
  .contenu { padding: 0 !important; }
}
.boutons-consigne { display: flex; gap: .4rem; flex-shrink: 0; }
.tache.avec-fiche .b-fiche { display: block; font-size: .75rem; font-weight: 700; margin-top: .15rem; }

/* ---------- Import ---------- */
.etapes-import { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: et; flex-wrap: wrap; }
.etapes-import li { counter-increment: et; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne); color: var(--doux); font-weight: 600; font-size: .9rem; }
.etapes-import li::before { content: counter(et) ". "; }
.etapes-import li.actif { background: var(--accent); border-color: var(--accent); color: #fff; }
.etapes-import li.fait { color: var(--accent); }
.modeles-import { display: flex; flex-wrap: wrap; gap: .5rem; }
.modeles-import a { display: inline-flex; align-items: center; gap: .3rem; }
.colonnes-import select { width: 100%; }
.colonnes-import tr.associee td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.resume-import { grid-template-columns: repeat(3, 1fr); max-width: 560px; }
.apercu-import tr.imp-rejet td { background: #fdf0ee; }
.apercu-import tr.imp-maj td { background: #f6f8ee; }
.apercu-import small { color: var(--danger); }
tr.annule td { opacity: .55; }
.ligne-modele { display: flex; gap: .5rem; align-items: center; margin: .3rem 0; }

/* Saisie d'une intervention (page autonome, téléphone d'abord, sur le modèle de la saisie des heures) */
.page-saisie-intervention .carte-salarie { display: grid; gap: .5rem; }
.page-saisie-intervention .cs-tete { margin-bottom: 0; }
.si-choix { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .25rem 0 .75rem; }
.si-bascule, .si-structure, .si-puce { position: relative; cursor: pointer; }
.si-bascule input, .si-structure input, .si-puce input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.si-bascule span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px;
  border: 1px solid var(--ligne); background: var(--surface); font-weight: 700; font-size: 1.05rem;
}
.si-bascule input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.si-bascule input:focus-visible + span, .si-structure input:focus-visible + span, .si-puce input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.si-jour input { flex: 1; min-height: 44px; width: 100%; text-align: center; font-weight: 600; }
.si-structures { display: flex; flex-wrap: wrap; gap: .5rem; }
.si-structure { flex: 1 1 8rem; }
.si-structure span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: .3rem .6rem;
  border-radius: 12px; border: 2px solid color-mix(in srgb, var(--c) 45%, white); background: color-mix(in srgb, var(--c) 8%, white); font-weight: 600;
}
.si-structure input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, white); }
.si-parcelles { display: flex; flex-wrap: wrap; gap: .4rem; }
.si-puce[hidden] { display: none; }
.si-puce span {
  display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .8rem; border-radius: 999px;
  border: 1px solid var(--ligne); background: var(--surface); font-size: .95rem;
}
.si-puce input:checked + span { background: color-mix(in srgb, var(--accent) 14%, white); border-color: var(--accent); font-weight: 600; }
.si-puce input:checked + span::before { content: '✓ '; white-space: pre; color: var(--accent); }
.si-actions-puces { margin: 0; font-size: .9rem; }
.page-saisie-intervention select, .page-saisie-intervention input:not([type="radio"]):not([type="checkbox"]), .page-saisie-intervention textarea {
  min-height: 44px; font-size: 1rem; width: 100%; min-width: 0; box-sizing: border-box;
}
.si-ligne {
  display: grid; grid-template-columns: 1fr 5.5rem 2.4rem; gap: .4rem; align-items: center;
  padding: .45rem; border-radius: 10px; background: color-mix(in srgb, var(--accent) 5%, white); border: 1px solid var(--ligne);
}
.si-ligne + .si-ligne { margin-top: .45rem; }
.si-produit { grid-column: 1 / 3; }
.si-ligne .ls-x { grid-column: 3; grid-row: 1; height: 44px; }
.si-dose { grid-column: 1; grid-row: 2; text-align: center; font-weight: 700; }
.si-unite { grid-column: 2 / 4; grid-row: 2; }
.si-cible { grid-column: 1 / 4; grid-row: 3; }
.si-deux { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.si-deux label, .si-plus label { display: grid; gap: .2rem; font-weight: 600; font-size: .92rem; }
.si-aide { color: var(--doux); font-size: .88rem; margin: 0; }
.si-plus summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.si-plus[open] { display: grid; gap: .5rem; }
.si-fait { border-color: var(--accent); }
.si-fait p { margin: 0; }
.si-liens a { font-weight: 600; }
#bloc-meteo[hidden] { display: none; }

/* Type d'intervention : trois grosses cases, une seule cochée ; le formulaire ne montre que les champs utiles */
.ti-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .25rem 0 .75rem; }
.ti-case { position: relative; cursor: pointer; min-width: 0; }
.ti-case input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ti-case span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  min-height: 84px; padding: .5rem .35rem; border-radius: 14px; border: 2px solid var(--ligne); background: var(--surface);
  font-weight: 700; font-size: 1rem; line-height: 1.15; color: var(--texte, inherit);
}
.ti-case-phyto { --c: #6b5aa6; } .ti-case-desherbage { --c: #b07a2a; } .ti-case-fumure { --c: #3f7a3a; }
.ti-case span .ico { color: var(--c); }
.ti-case input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, white); box-shadow: 0 0 0 1px var(--c) inset; }
.ti-case input:focus-visible + span { outline: 2px solid var(--c); outline-offset: 2px; }
.ti-consigne { display: none; color: var(--doux); font-weight: 600; text-align: center; margin: .5rem 0 1rem; }
.ti-sans-type .ti-consigne { display: block; }
.ti-sans-type .ti-reste { display: none !important; }
.ti-pour-fumure { display: none; }
.ti-fumure .ti-pour-fumure { display: block; }
.ti-fumure .ti-cuve, .ti-fumure .ti-meteo, .ti-fumure [name="ligne_cible[]"] { display: none !important; }
.ti-fumure .si-unite { pointer-events: none; background: #f4f5f1; }
.fiche .ti-cases { grid-column: 1 / -1; max-width: 640px; }
.badge-type { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.badge-type-phyto { background: #ece8f6; color: #4e3f86; } .badge-type-desherbage { background: #f6ecdc; color: #7a5317; } .badge-type-fumure { background: #e3efe1; color: #2f5d2b; }
.fiche .ti-reste { display: contents; }
.ti-sans-type .saisie-pied, .ti-sans-type > .actions { display: none; }

/* Gestion : modifier / archiver / supprimer */
.bouton-modifier { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; padding: .2rem .55rem; border: 1px solid var(--ligne); border-radius: 8px; text-decoration: none; }
.bouton-modifier:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); text-decoration: none; }
.supprimer-impossible { margin-left: .75rem; opacity: .45; cursor: help; text-decoration: line-through; }
.zone-suppression { border-color: color-mix(in srgb, var(--danger) 35%, var(--ligne)); }
.zone-suppression p { max-width: 70ch; }
.boutons-suppression { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.bouton-danger { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .4rem .9rem; border-radius: 10px; border: 1px solid var(--danger); background: none; color: var(--danger); font: inherit; font-weight: 600; cursor: pointer; }
.bouton-danger:hover { background: var(--danger); color: #fff; }

/* Menu de gauche : titres de groupes, séparateur, sous-pages des Réglages */
.menu-gauche .mg-titre { margin: .9rem .6rem .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--doux); }
.menu-gauche .mg-titre:first-child { margin-top: .1rem; }
.menu-gauche .mg-separateur { margin: .6rem .6rem; height: 1px; background: var(--ligne); padding: 0; }
.menu-gauche a.mg-sous { margin-left: 1.1rem; padding-top: .25rem; padding-bottom: .25rem; font-size: .95rem; }
.menu-gauche a.mg-sous .ic.pastille-ic { width: 26px; height: 26px; }
.teinte-gris { background: linear-gradient(180deg, #8e9399, #6c7178); color: #fff; }

/* Réglages, façon Réglages du Mac : icônes carrées arrondies en dégradé, par groupes */
.reglages-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: .5rem; }
.reglages-recherche { display: inline-flex; align-items: center; gap: .4rem; padding: 0 .7rem; min-height: 38px; border: 1px solid var(--ligne); border-radius: 10px; background: var(--surface, #fff); color: var(--doux); width: min(100%, 280px); }
.reglages-recherche input { border: 0; outline: 0; background: none; font: inherit; flex: 1; min-width: 0; padding: .35rem 0; color: var(--texte); }
.reglages-recherche:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-clair); }
.reglages-groupe { margin-top: 1.4rem; }
.reglages-groupe h2 { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--doux); margin: 0 0 .6rem; }
.reglages-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; padding: 1rem; border-radius: 14px; background: color-mix(in srgb, var(--ligne) 35%, transparent); border: 1px solid var(--ligne); }
.reglage { display: grid; justify-items: center; align-content: start; gap: .3rem; text-align: center; padding: .9rem .5rem .8rem; border-radius: 12px; color: var(--texte); text-decoration: none; transition: background .15s; }
.reglage:hover, .reglage:focus-visible { background: var(--surface, #fff); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); text-decoration: none; }
.reglage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reglage[hidden], .reglages-groupe[hidden] { display: none; }
.reglage-icone { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 5px rgba(0, 0, 0, .18); margin-bottom: .2rem; }
.reglage-icone svg { stroke: #fff; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }
.reglage-sarcelle { background: linear-gradient(180deg, #3ba596, #23766a); }
.reglage-bleu     { background: linear-gradient(180deg, #4ea3e0, #2266a8); }
.reglage-ambre    { background: linear-gradient(180deg, #f2b84a, #cf7d16); }
.reglage-violet   { background: linear-gradient(180deg, #9a83d6, #6447a8); }
.reglage-vert     { background: linear-gradient(180deg, #6fbf5f, #3d7f34); }
.reglage-ardoise  { background: linear-gradient(180deg, #8e9399, #5d6268); }
.reglage-nom { font-weight: 700; font-size: .98rem; }
.reglage-desc { font-size: .82rem; color: var(--doux); line-height: 1.3; }
.reglage-etat { white-space: nowrap; font-size: .76rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: rgba(63, 107, 58, .12); color: #2f5a2c; margin-top: .15rem; }
.reglage-etat.a-configurer { background: rgba(195, 125, 30, .16); color: #93571a; }
@media (max-width: 760px) {
  .reglages-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .6rem; gap: .4rem; }
  .reglage-icone { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .reglage { transition: none; } }

/* Groupes repliables du menu de gauche */
.menu-gauche .mg-bascule { display: flex; width: calc(100% - 1.2rem); align-items: center; justify-content: space-between; gap: .5rem; border: 0; background: none; cursor: pointer; font-family: inherit; text-align: left; padding: .3rem 0; border-radius: 6px; }
.menu-gauche .mg-bascule:hover { color: var(--texte); }
.menu-gauche .mg-bascule:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-gauche .mg-groupe:first-child .mg-bascule { margin-top: .1rem; }
.mg-fleche { flex: none; transition: transform .15s; opacity: .7; }
.mg-replie .mg-fleche { transform: rotate(-90deg); }
.mg-replie .mg-liens { display: none; }
.mg-liens { display: block; }
@media (prefers-reduced-motion: reduce) { .mg-fleche { transition: none; } }

/* Listes de Gestion : une seule ligne par élément, texte trop long coupé avec « … » (texte complet au survol) */
.defile-liste { overflow-x: auto; }
.liste-une-ligne th, .liste-une-ligne td { white-space: nowrap; }
.liste-une-ligne .cellule { display: inline-block; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.liste-une-ligne td.boutons { width: 1%; }
.titre-boutons { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.titre-boutons form { margin: 0; }
@media (max-width: 760px) {
  .liste-une-ligne td { white-space: nowrap; min-width: 0; }
  .liste-une-ligne .cellule { max-width: 100%; }
  .liste-une-ligne td[data-l] { display: flex; gap: .75rem; overflow: hidden; }
  .liste-une-ligne td[data-l] .cellule { flex: 1 1 auto; min-width: 0; }
  .liste-produits td { white-space: nowrap; }
  .lp-nom-txt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; -webkit-line-clamp: unset; }
  .lp-nom-bloc { flex-direction: row; align-items: center; min-width: 0; max-width: 100%; }
}

/* Pièces du matériel : formulaire, stock et alertes */
.titre-form-piece { font-size: 1rem; margin: 1.1rem 0 .5rem; }
.form-piece { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem .8rem; align-items: end; }
.form-piece label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; min-width: 0; }
.form-piece input, .form-piece select { width: 100%; min-width: 0; box-sizing: border-box; }
.form-piece .fp-large { grid-column: span 2; }
.form-piece .actions { display: flex; gap: .6rem; align-items: center; }
@media (max-width: 760px) { .form-piece { grid-template-columns: 1fr; } .form-piece .fp-large { grid-column: auto; } }
.lien-fournisseur { display: inline-flex; align-items: center; gap: .25rem; max-width: 12rem; }
.piece-alerte td { background: rgba(195, 125, 30, .1); }
.piece-alerte td:first-child { box-shadow: inset 3px 0 0 #c37d1e; }
.piece-en-edition td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.badge-alerte { display: inline-block; margin-left: .35rem; font-size: .74rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: rgba(195, 125, 30, .18); color: #8a4f12; white-space: nowrap; }
.resume-alerte { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .6rem .9rem; border-radius: 10px; background: rgba(195, 125, 30, .12); color: #7a4a14; }
.stock-rapide { display: inline-flex; align-items: center; gap: .25rem; margin: 0; }
.stock-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--ligne); background: var(--surface, #fff); font: inherit; font-weight: 700; cursor: pointer; }
.stock-btn:hover { background: var(--accent-clair); }
.stock-nb { width: 3rem; text-align: center; font-weight: 700; min-height: 32px; }
@media (max-width: 760px) { .liste-pieces .stock-rapide { flex: none; } .stock-btn { width: 40px; height: 40px; } }
.liste-t-buses .cellule { max-width: 11rem; }
.liste-t-buses td, .liste-t-buses th { padding-left: .5rem; padding-right: .5rem; }

/* Buses montées : choix d'une buse avec recherche */
.choix-buse { position: relative; min-width: 0; width: 100%; }
.cb-saisie { width: 100%; min-width: 0; box-sizing: border-box; min-height: 40px; }
.cb-saisie::placeholder { color: var(--doux); }
.cb-liste { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); max-height: 280px; overflow-y: auto; margin: 0; padding: .25rem 0; list-style: none;
  background: var(--surface, #fff); border: 1px solid var(--ligne); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.cb-liste li { padding: .45rem .7rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.cb-liste li[data-i="0"] { color: var(--doux); font-style: italic; border-bottom: 1px solid var(--ligne); }
.cb-liste li.cb-actif, .cb-liste li[data-i]:hover { background: var(--accent-clair); }
.cb-liste li.cb-choisie { font-weight: 700; }
.cb-liste li.cb-vide { color: var(--doux); cursor: default; font-size: .88rem; }
.buses-table td[data-l="Buse"] { min-width: 18rem; }
.generer-buse { display: inline-flex; align-items: center; gap: .4rem; min-width: min(100%, 22rem); }
@media (max-width: 760px) { .buses-table td[data-l="Buse"] { min-width: 0; } .generer-buse { display: grid; width: 100%; } }
.liste-une-ligne th { white-space: normal; vertical-align: bottom; }
.liste-t-buses td[data-l="Type"] .cellule { max-width: 9rem; }
.symetrie-info { padding: .6rem .85rem; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, transparent); margin: .5rem 0 .75rem; max-width: 70ch; }
.pos-sym { white-space: nowrap; font-weight: 600; }
.pos-sym .doux { font-weight: 400; }
.cb-saisie.cb-colore { font-weight: 700; border-color: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.cb-saisie.cb-colore:focus { background: var(--surface, #fff) !important; color: var(--texte) !important; font-weight: 400; }
.cb-pastille { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .45em; vertical-align: -.05em; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }

/* Photo du matériel */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.col-photo { width: 52px; padding-right: 0 !important; }
.vignette-materiel { display: block; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--fond); border: 1px solid var(--ligne); }
.vignette-materiel.vide-photo { display: grid; place-items: center; color: var(--doux); opacity: .55; }
.photo-zone { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-start; }
.photo-apercu img { display: block; width: 180px; height: 135px; object-fit: cover; border-radius: 10px; border: 1px solid var(--ligne); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.photo-actions { display: grid; gap: .35rem; min-width: 0; flex: 1 1 220px; }
.photo-actions input[type=file] { max-width: 100%; }
@media (max-width: 760px) {
  .liste-t-materiel td.col-photo { display: block; width: auto; padding: .4rem .9rem 0 !important; }
  .liste-t-materiel .vignette-materiel { width: 64px; height: 64px; }
}
/* Icône Réglages façon macOS : carré arrondi gris dégradé, engrenage argenté */
.pastille-ic.teinte-mac { background: linear-gradient(180deg, #d5d7da, #8a8e94); border-radius: 26%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 3px rgba(0, 0, 0, .22); }
.menu-gauche .ic.pastille-ic.teinte-mac svg { width: 24px; height: 24px; }
.liste-une-ligne td, .liste-une-ligne th { padding-left: .55rem; padding-right: .55rem; }
.liste-t-materiel .cellule { max-width: 10rem; }
.liste-une-ligne td.boutons form { margin-left: .5rem; }
/* Boutons toujours visibles à droite, même si le tableau doit défiler (ordinateur) */
@media (min-width: 761px) {
  .liste-une-ligne .cellule { max-width: 12rem; }
  .liste-une-ligne td.boutons, .liste-une-ligne thead th:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); }
  .liste-une-ligne td.boutons { box-shadow: -8px 0 10px -8px rgba(0, 0, 0, .18); }
  .liste-une-ligne tr.piece-alerte td.boutons { background: #fbf3e7; }
}
@media (min-width: 761px) {
  .defile-liste { border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
  .defile-liste > table.liste-une-ligne { overflow: visible; border: 0; border-radius: 0; }
}
@media (min-width: 761px) { .liste-une-ligne thead th:last-child { background: #fafbf8; } }

/* Calculateur : curseurs liés pression / vitesse / volume */
.curseurs { display: grid; gap: .8rem; }
.curseur { display: grid; grid-template-columns: 6.5rem 1fr 9rem; gap: .8rem; align-items: center; }
.curseur label { font-weight: 700; }
.curseur input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.curseur-val { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; color: var(--doux); }
.curseur-val input { width: 4.6rem; text-align: right; font-weight: 700; font-size: 1.05rem; color: var(--texte); min-height: 38px; }
.curseur-infos { margin: 0; font-weight: 600; }
.bouton-calculateur { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 10px; background: var(--accent); color: #fff !important; text-decoration: none; font-weight: 600; }
.bouton-calculateur:hover { filter: brightness(1.08); text-decoration: none; }
@media (max-width: 760px) { .curseur { grid-template-columns: 1fr auto; } .curseur input[type=range] { grid-column: 1 / -1; grid-row: 2; } }

/* Historiques repliés par défaut : un titre cliquable pour les déplier */
details.historique-replie > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; min-height: 40px; }
details.historique-replie > summary::-webkit-details-marker { display: none; }
details.historique-replie > summary h2 { margin: 0; }
details.historique-replie > summary::before { content: ''; width: .55rem; height: .55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; color: var(--accent); flex: none; margin-right: .1rem; }
details.historique-replie[open] > summary::before { transform: rotate(45deg); }
details.historique-replie[open] > summary { margin-bottom: .8rem; }
.replie-nb { font-size: .8rem; font-weight: 600; background: var(--fond); color: var(--doux); border-radius: 999px; padding: .1rem .55rem; }
.curseurs > h2 { margin-bottom: .3rem; } .curseurs > .aide-bas { margin-top: 0; }

/* Calculateur : sauvegarder la configuration */
.sauver-reglage { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 .8rem; }
.sauver-reglage input[type=text] { flex: 1 1 14rem; min-width: 0; max-width: 24rem; }
.sauver-reglage button { display: inline-flex; align-items: center; gap: .4rem; }
@media (max-width: 600px) { .sauver-reglage input[type=text], .sauver-reglage button { flex: 1 1 100%; max-width: none; justify-content: center; } }
/* Buses montées : configurations sauvegardées */
.reglages-liste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.reglages-liste li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .7rem .9rem; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
.reglages-liste .rg-nom { font-weight: 600; flex: 1 1 12rem; min-width: 0; }
.reglages-liste .rg-chiffres { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-variant-numeric: tabular-nums; }
.reglages-liste .rg-qui { flex-basis: 100%; font-size: .85rem; color: var(--doux); }
.reglages-liste .rg-actions { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.reglages-liste .rg-actions form { margin: 0; }
.rg-alerte { flex-basis: 100%; font-size: .85rem; color: #a35a00; }

/* Gestion : nom cliquable et fiche en lecture seule */
button.lien-fiche { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; max-width: 100%; }
button.lien-fiche:hover { text-decoration-color: currentColor; }
button.lien-fiche.cellule { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.fiche-fenetre { border: 0; border-radius: 16px; padding: 0; width: min(36rem, calc(100vw - 2rem)); max-height: min(85vh, 50rem); background: var(--surface); color: var(--texte); box-shadow: 0 20px 60px rgba(0,0,0,.25); display: none; flex-direction: column; }
.fiche-fenetre[open] { display: flex; }
.fiche-fenetre::backdrop { background: rgba(20, 28, 20, .45); }
.fiche-corps { flex: 1 1 auto; overflow-y: auto; padding: 1.3rem 1.4rem .6rem; }
.fiche-tete { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fiche-titre { margin: 0; font-size: 1.3rem; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.fiche-photo { width: 100%; max-height: 16rem; object-fit: cover; border-radius: 10px; }
.fiche-pastille { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }
.fiche-liste { margin: 0; display: grid; gap: 0; }
.fiche-liste > div { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--ligne); }
.fiche-liste dt { color: var(--doux); font-size: .92rem; }
.fiche-liste dd { margin: 0; overflow-wrap: anywhere; }
.fiche-liste .pastille-couleur { vertical-align: -2px; }
.fiche-boutons { display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 1.4rem; border-top: 1px solid var(--ligne); }
.fiche-boutons .principal { display: inline-flex; align-items: center; gap: .4rem; }
.badge-archive { font-size: .75rem; background: var(--fond); color: var(--doux); padding: .1rem .5rem; border-radius: 999px; }
@media (max-width: 600px) {
  .fiche-fenetre { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .fiche-liste > div { grid-template-columns: 1fr; gap: .15rem; }
  .fiche-boutons { padding-bottom: calc(.9rem + env(safe-area-inset-bottom)); }
  .fiche-boutons > * { flex: 1; justify-content: center; text-align: center; }
  .fiche-boutons > span:empty { display: none; }
  .fiche-boutons > span > a { width: 100%; justify-content: center; }
}
