/* =====================================================================
   RAVIT DBO — habillage (vert RAVIT, mise en page Gestion GSR : fond blanc, filet chromé, gros boutons terrain).
   Chargé après socle.css : il ne fait que changer les variables et ajouter les classes de l'appli.
   ===================================================================== */
:root {
  --fond: #ffffff;
  --surface: #ffffff;
  --encre: #111827;
  --encre-douce: #4b5563;
  --trait: #d5dae0;
  --marque: #0a3a1e;
  --marque-encre: #ffffff;
  --accent: #15803d;
  --alerte: #b91c1c;
  --ok: #15803d;
  --attente: #92400e;
  --chrome: #c9ced3;
  --vert-clair: #f3faf5;
  --rayon: 12px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --titre: "Arial Narrow", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
}
.barre { border-bottom: 3px solid var(--chrome); flex-wrap: wrap; row-gap: .2rem; }
.marque img { border: 1px solid var(--chrome); border-radius: 8px; }
.marque b { font-family: var(--titre); letter-spacing: .04em; font-size: 1.15rem; }
#nav { order: 5; flex-basis: 100%; margin: 0; padding-bottom: .1rem; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a { border-radius: 0; padding: .55rem .7rem; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; opacity: .78; border-bottom: 3px solid transparent; }
#nav a.actif { background: none; border-bottom-color: #4ade80; opacity: 1; }
@media (max-width: 719px) {
  #nav { position: static; background: none; border: 0; padding: 0; justify-content: flex-start; color: inherit; }
  #nav a { flex: none; }
  #nav a.actif { background: none; color: #fff; }
  .toast { bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); }
}
main { padding-bottom: 3rem; }
h1, h2, .titre { font-family: var(--titre); letter-spacing: .02em; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.2rem; }
.btn { min-height: 48px; }
.btn.principal { background: var(--accent); border-color: var(--accent); }
.btn.gros { width: 100%; min-height: 56px; font-size: 1.05rem; }
.btn.contour { border: 2px solid var(--accent); color: var(--accent); background: #fff; }
.btn.noir { background: #111827; border-color: #111827; color: #fff; }

/* blocs */
.bloc { border: 1px solid var(--trait); border-radius: 14px; padding: 14px; margin-bottom: 16px; background: #fff; }
.bloc > h2:first-child, .bloc .tete-bloc h2 { margin: 0; }
.tete-bloc { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; flex-wrap: wrap; }
.info { border: 1px solid var(--accent); background: var(--vert-clair); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-bottom: .8rem; }
.titre-centre { text-align: center; margin: 1.3rem 0 .7rem; }
.petit { font-size: .82rem; color: var(--encre-douce); }
.etiquette { font-size: .72rem; font-weight: 700; color: var(--encre-douce); text-transform: uppercase; letter-spacing: .03em; }
.vert { color: var(--accent); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 3px 7px; white-space: nowrap; }
.badge.ok { background: #dcfce7; color: #14532d; }
.badge.att { background: #fef3c7; color: #78350f; }
.badge.ko { background: #fee2e2; color: #7f1d1d; }
.badge.bleu { background: #dbeafe; color: #1e3a8a; }
.badge.gris { background: #e5e7eb; color: #374151; }

/* jauge de la cuve */
.jauge { height: 14px; background: #e8ecef; border-radius: 7px; overflow: hidden; }
.jauge > div { height: 100%; background: var(--accent); }
.gros-chiffre { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.cuve { display: flex; gap: 14px; }
.cuve .reservoir { width: 64px; height: 150px; border: 3px solid #9ca3af; border-radius: 12px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: #f3f4f6; flex: none; }
.cuve .reservoir div { background: var(--accent); }

/* onglets internes (Roulage / Chargeuse…) */
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #f1f3f5; border-radius: 10px; padding: 4px; margin-bottom: .7rem; }
.segments button { border: 0; background: transparent; color: var(--encre-douce); padding: 9px 2px; border-radius: 8px; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; min-height: 40px; }
.segments button[aria-pressed="true"] { background: #fff; color: var(--marque); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.pastilles button { border: 1px solid var(--chrome); background: #fff; color: #374151; border-radius: 999px; padding: 8px 12px; font: inherit; font-size: .78rem; font-weight: 600; min-height: 38px; cursor: pointer; }
.pastilles button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pastilles.sombre button[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); }
.defile { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.defile button, .defile a { flex: none; }

/* cartes */
.carte .litres { grid-column: 2; grid-row: 1 / span 3; font-weight: 700; white-space: nowrap; }
.carte .sur { font-size: .72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.carte.alerte-o { border: 2px solid #b45309; }
.carte.alerte-r { border: 2px solid var(--alerte); }
.carte.enattente { background: #fffbeb; }
.chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: .75rem; grid-column: 1 / -1; margin-top: .4rem; color: var(--encre-douce); }
.chiffres div { background: #f7f8f9; border-radius: 8px; padding: 6px 2px; }
.chiffres b { display: block; font-size: .95rem; color: var(--encre); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpis > div { border: 1px solid var(--trait); border-radius: 12px; padding: 12px; }
.kpis b { display: block; font-size: 1.4rem; }
.bandeau-vert { background: var(--marque); color: #fff; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.bandeau-vert .gros-chiffre { color: #fff; }
.bandeau-vert .kpis { margin: 10px 0 0; }
.bandeau-vert .kpis > div { border: 0; background: #14532d; }

/* barres (graphiques simples) */
.barres { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; height: 140px; border-bottom: 1px solid var(--chrome); }
.barres .paire { display: flex; gap: 3px; align-items: flex-end; justify-content: center; height: 100%; }
.barres .paire div { width: 14px; border-radius: 3px 3px 0 0; }
.legende { display: flex; gap: 14px; font-size: .8rem; margin-bottom: 8px; }
.legende span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.axe { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; text-align: center; font-size: .72rem; color: var(--encre-douce); margin-top: 4px; }
.repartition { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 4.6rem; gap: 8px; align-items: center; font-size: .82rem; }
.repartition .b { height: 12px; background: var(--accent); border-radius: 3px; }
.repartition b { text-align: right; }

/* formulaires */
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.champ-gros input { font-size: 1.5rem; font-weight: 700; min-height: 56px; }
.choix3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.choix3 button { min-height: 40px; border-radius: 8px; font: inherit; font-size: .78rem; font-weight: 700; border: 1px solid var(--chrome); background: #fff; color: #374151; cursor: pointer; }
.choix3 button[aria-pressed="true"].c { background: var(--accent); border-color: var(--accent); color: #fff; }
.choix3 button[aria-pressed="true"].nc { background: var(--alerte); border-color: var(--alerte); color: #fff; }
.choix3 button[aria-pressed="true"].na { background: #4b5563; border-color: #4b5563; color: #fff; }
.point { border: 1px solid var(--trait); border-radius: 12px; padding: 10px; display: grid; gap: 8px; margin-bottom: 8px; }
.point p { margin: 0; font-size: .9rem; }
.signature { position: relative; border: 2px dashed #9ca3af; border-radius: 10px; height: 150px; background: #fff; touch-action: none; }
.signature canvas { width: 100%; height: 100%; display: block; }
.signature button { position: absolute; right: 6px; top: 6px; }
.signature .vide-sig { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9ca3af; pointer-events: none; font-size: .9rem; }
.consigne { background: #f1f3f5; border-radius: 10px; padding: 10px 12px; font-size: .82rem; line-height: 1.45; color: #374151; margin: 1rem 0; }
.ligne { display: flex; justify-content: space-between; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid #e8ecef; font-size: .9rem; }
.ligne:last-child { border-bottom: 0; }
.photo-ticket { width: 100%; min-height: 64px; border: 2px dashed #9ca3af; border-radius: 12px; background: #f9fafb; display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; cursor: pointer; }
.photo-ticket img { max-height: 120px; border-radius: 8px; }
@media (min-width: 720px) { .large2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } }
