/* Mobile d'abord ; paliers 1280 / 1040 / 760 / 480. Police du système (aucune police déclarée). */
:root {
  --fond: #f4f6f4; --carte: #fff; --texte: #1d2b22; --doux: #5b6b61; --trait: #d6ddd8;
  --vert: #1f7a3f; --vert-fonce: #155c2e; --alerte: #b3261e;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
label { display: block; margin: .6rem 0; font-weight: 600; }
input, select { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--trait); border-radius: 6px; background: #fff; margin-top: .25rem; }
button { font: inherit; padding: .6rem 1rem; border: 0; border-radius: 6px; background: var(--vert); color: #fff; cursor: pointer; min-height: 44px; }
button:hover { background: var(--vert-fonce); }
button.secondaire { background: #e7ece9; color: var(--texte); }
button.lien { background: none; color: var(--vert); padding: .4rem 0; }
button.mini { min-height: 0; padding: 0 .35rem; background: none; color: var(--alerte); font-weight: 700; }
.message { color: var(--alerte); min-height: 1.2em; }
.message.ok { color: var(--vert-fonce); }
.aide, .sous-titre { color: var(--doux); font-weight: 400; }
.carte-centre { max-width: 26rem; margin: 2rem auto; padding: 1.5rem; background: var(--carte); border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.carte-centre button[type=submit] { width: 100%; margin-top: .5rem; }
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .75rem 1rem; padding-top: calc(.75rem + env(safe-area-inset-top, 0px)); background: var(--carte); border-bottom: 1px solid var(--trait); }
.marque { font-weight: 700; color: var(--vert); }
#nav { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; }
#nav button { background: none; color: var(--texte); }
#nav button.actif { background: #e3f0e7; color: var(--vert-fonce); font-weight: 600; }
.session { display: flex; align-items: center; gap: .5rem; color: var(--doux); }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.vue { background: var(--carte); border-radius: 10px; padding: 1rem; }
/* Texte libre hors des tableaux défilants (motif d'une note donnée à la main ou d'un signalement, 300 caractères sans espace possible) : coupé
   n'importe où plutôt que d'élargir toute la page */
.vue p, .vue li { overflow-wrap: anywhere; }
.bloc { max-width: 40rem; margin-bottom: 1rem; }
fieldset { border: 1px solid var(--trait); border-radius: 6px; margin: .6rem 0; }
.choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .25rem .75rem; }
label.case { display: flex; align-items: center; gap: .4rem; margin: .2rem 0; font-weight: 400; }
label.case input { width: auto; margin: 0; }
.barre { display: flex; justify-content: flex-end; margin: .5rem 0; }
.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 46rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: .85rem; color: var(--doux); }
td select { width: auto; margin: 0 .4rem .3rem 0; padding: .35rem; }
.puce { display: inline-block; background: #eef3ef; border-radius: 999px; padding: .1rem .55rem; margin: .1rem 0; font-size: .85rem; white-space: nowrap; }
.pied { text-align: center; color: var(--doux); font-size: .8rem; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); }

/* Écrans de la prime (lot 8) */
h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.logo { display: block; height: 56px; margin: 0 auto .75rem; }
.logo-mini { height: 26px; vertical-align: middle; }
.barre-cycle { display: flex; flex-wrap: wrap; align-items: end; gap: .25rem 1.5rem; max-width: 1200px; margin: 0 auto; padding: .5rem 1rem 0; }
label.en-ligne { display: inline-flex; align-items: center; gap: .5rem; }
#ouvrir-cycle summary { cursor: pointer; color: var(--vert-fonce); font-weight: 600; padding: .6rem 0; }
label.en-ligne input, label.en-ligne select { width: auto; margin: 0; }
#message:empty { display: none; }
#message { position: fixed; left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 10; max-width: 40rem; margin: 0 auto;
  padding: .7rem 1rem; background: #fff; border: 1px solid var(--trait); border-left: 4px solid var(--alerte); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); cursor: pointer; }
#message.ok { border-left-color: var(--vert); }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .4rem 0; }
.ligne input { width: auto; flex: 1 1 12rem; margin: 0; }
.etat { font-weight: 700; color: var(--vert-fonce); margin: 0 0 .25rem; }
.cartes { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; margin: .8rem 0; }
.carte { border: 1px solid var(--trait); border-radius: 8px; padding: .6rem .7rem; color: var(--doux); font-size: .85rem; }
.carte b { display: block; font-size: 1.3rem; color: var(--vert-fonce); margin-top: .15rem; }
.alertes { margin: .3rem 0 .8rem; padding-left: 1.2rem; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover, tr.cliquable:focus-within { background: #eef6f0; }
.feuille { border: 1px solid var(--trait); border-radius: 8px; padding: .75rem; margin: .7rem 0; }
.feuille h4 { margin: 0 0 .4rem; font-size: .95rem; }
.feuille p { margin: .25rem 0; }
.bascule { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .35rem 0; }
.bascule > span { min-width: 12rem; font-weight: 600; }
.bascule button { min-width: 4.5rem; }
button.choisi { background: var(--vert-fonce); color: #fff; box-shadow: 0 0 0 3px #f2b705; }
button:disabled { opacity: .55; cursor: default; }
.suggestion { color: var(--doux); font-style: italic; }
.plaintes { margin: .3rem 0; padding-left: 1.2rem; color: var(--alerte); }
li.retire { color: var(--doux); text-decoration: line-through; }
.grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 .75rem; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: .1rem .75rem; max-height: 50vh; overflow-y: auto; border: 1px solid var(--trait); border-radius: 6px; padding: .4rem .6rem; margin-bottom: .6rem; }
textarea { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--trait); border-radius: 6px; margin-top: .25rem; }
.vue .bloc { max-width: none; }
/* Notes données à la main par la DT (agents sans feuille de route) : axe, note, motif, boutons ; qui et quand dessous */
.f-note-manuelle .axe { min-width: 9rem; font-weight: 600; }
.f-note-manuelle input[type=number] { flex: 0 0 6.5rem; }
.f-note-manuelle small { flex-basis: 100%; }

@media (max-width: 1280px) { main { max-width: 100%; } .cartes { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1040px) { .entete { gap: .5rem 1rem; } th, td { padding: .45rem .5rem; } .grille { grid-template-columns: repeat(2, 1fr); } .cases { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .entete { flex-direction: column; align-items: stretch; }
  .session { justify-content: space-between; }
  main { padding: .75rem; }
  .vue { padding: .75rem; }
  .barre-cycle { padding: .5rem .75rem 0; }
  .cartes { grid-template-columns: repeat(2, 1fr); }
  .bascule > span { min-width: 100%; }
  .bascule button { flex: 1; }
  .bascule small { flex-basis: 100%; }
  .f-note-manuelle .axe, .f-note-manuelle input[name=motif] { min-width: 100%; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .carte-centre { margin: 0; border-radius: 0; min-height: 100vh; box-shadow: none; }
  main { padding: .5rem; }
  .vue { border-radius: 0; padding: .6rem; }
  .barre button, .bloc button[type=submit] { width: 100%; }
  .choix { grid-template-columns: 1fr; }
  .grille, .cases { grid-template-columns: 1fr; }
  .barre-cycle, .barre-cycle form, label.en-ligne { width: 100%; }
  label.en-ligne select, label.en-ligne input { flex: 1; }
  #nav button { flex: 1 1 45%; }
}
