/* BovinaTech — saisie terrain. Contraste élevé et grandes cibles pour un usage en extérieur. */
:root {
  --fond: #F4F2EC;
  --encre: #1B1F1A;
  --discret: #4A5248;
  --vert: #2F5D3A;
  --vert-fonce: #1E3D26;
  --vert-pale: #E3ECE4;
  --bord: #B8B3A6;
  --ligne: #D9D5CA;
  --alerte-fond: #FFF4E5;
  --alerte: #8A4A0B;
  --danger: #7A2323;
  --blanc: #FFFFFF;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px; line-height: 1.4;
}
a { color: var(--vert); }
a:hover { color: var(--vert-fonce); }
.page { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.page.large { max-width: 960px; }

/* En-tête */
.entete { background: var(--vert); color: var(--blanc); padding: 12px 12px 16px; display: flex; align-items: center; gap: 8px; }
.entete.danger { background: var(--danger); }
.entete h1 { margin: 0; font-size: 22px; }
.entete .retour { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--blanc); text-decoration: none; }
.entete-accueil { background: var(--vert); color: var(--blanc); padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.entete-accueil .ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.marque { font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.entete-accueil .sous { font-size: 15px; color: var(--vert-pale); }
.entete-accueil .sous a { color: var(--vert-pale); }
.choix-site select { min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.6); background: transparent; color: var(--blanc); font: inherit; font-size: 15px; }
.choix-site option { color: var(--encre); }

main { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
h2 { margin: 0; font-size: 15px; font-weight: 700; }
.discret { color: var(--discret); font-size: 15px; }

/* Messages */
.message { padding: 12px 16px; border-radius: 12px; font-size: 16px; }
.message.success { background: var(--vert-pale); color: var(--vert-fonce); }
.message.error { background: #F8E1E1; color: var(--danger); }
.message.warning, .message.info { background: var(--alerte-fond); color: var(--encre); }

/* Champs */
label, legend { font-size: 15px; font-weight: 700; }
.champ { display: flex; flex-direction: column; gap: 8px; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; min-height: 52px; padding: 0 14px; border: 2px solid var(--bord); border-radius: 10px;
  background: var(--blanc); font: inherit; font-size: 18px; color: var(--encre);
}
textarea { padding: 10px 14px; min-height: 0; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--vert); outline-offset: 1px; border-color: var(--encre); }
.champ-grand { min-height: 72px !important; font-size: 36px !important; font-weight: 700; text-align: right; border-color: var(--encre) !important; }
.erreurs { color: var(--danger); font-size: 15px; margin: 0; padding-left: 18px; }
fieldset { margin: 0; padding: 0; border: none; }

.recherche { display: flex; gap: 8px; }
.recherche input { flex: 1; min-width: 0; border-color: var(--encre); }
.recherche button { width: 56px; min-height: 52px; border: none; border-radius: 10px; background: var(--encre); color: var(--blanc); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Boutons */
.bouton { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 16px; border: none; border-radius: 12px;
  background: var(--vert); color: var(--blanc); font: inherit; font-size: 18px; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%; }
.bouton:hover { background: var(--vert-fonce); color: var(--blanc); }
.bouton.secondaire { min-height: 48px; background: transparent; color: var(--vert); border: 2px solid var(--vert); font-size: 16px; }
.bouton.danger { background: var(--danger); }
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* Tuiles de l'accueil */
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tuile { min-height: 88px; padding: 16px; border-radius: 14px; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; background: var(--vert); color: var(--blanc); }
.tuile:hover { background: var(--vert-fonce); color: var(--blanc); }
.tuile strong { font-size: 20px; }
.tuile span { font-size: 14px; color: var(--vert-pale); }
.tuile.claire { background: var(--blanc); border: 2px solid var(--vert); color: var(--encre); }
.tuile.claire span { color: var(--discret); }
.tuile.claire:hover { background: var(--vert-pale); color: var(--encre); }
.lien-danger { min-height: 52px; padding: 0 16px; border-radius: 14px; border: 2px solid #9B2C2C; color: #9B2C2C; text-decoration: none; display: flex; align-items: center; font-size: 17px; font-weight: 700; }

.alerte { min-height: 56px; padding: 12px 16px; border-radius: 12px; background: var(--alerte-fond); color: var(--encre); text-decoration: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.alerte:hover { color: var(--encre); outline: 2px solid var(--alerte); }
.alerte .fleche { font-size: 20px; color: var(--alerte); }
.rien { padding: 12px 16px; border-radius: 12px; background: var(--vert-pale); color: var(--vert-fonce); }

/* Cartes et listes */
.carte { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.carte .titre { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.carte .titre strong { font-size: 22px; }
.pastille { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--vert-pale); color: var(--vert-fonce); white-space: nowrap; }
.pastille.quarantaine { background: var(--alerte-fond); color: var(--alerte); }
.pastille.mort, .pastille.vendu { background: #ECEAE4; color: var(--discret); }
.separateur { height: 1px; background: #E6E2D8; }
.deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.valeur { display: flex; flex-direction: column; gap: 2px; }
.valeur small { font-size: 13px; color: var(--discret); }
.valeur b { font-size: 17px; }
.bilan { background: var(--vert-pale); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste a, .liste .element { min-height: 52px; padding: 8px 16px; border-radius: 10px; background: var(--blanc); border: 1px solid var(--ligne); display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--encre); }
.liste a:hover { border-color: var(--vert); }
.coches label { min-height: 52px; padding: 0 16px; border-radius: 10px; background: var(--blanc); border: 1px solid var(--ligne); display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; cursor: pointer; }
.coches input { width: 24px; height: 24px; accent-color: var(--vert); }
.coches ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

table { width: 100%; border-collapse: collapse; background: var(--blanc); border-radius: 12px; overflow: hidden; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--ligne); }
th { font-size: 13px; color: var(--discret); font-weight: 700; }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; }

/* Choix en pastilles (aliment, type de soin, cible) */
.choix > div, .choix ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.choix.deux-col > div, .choix.deux-col ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choix label { position: relative; min-height: 52px; padding: 0 6px; border-radius: 12px; background: var(--blanc); border: 2px solid var(--bord);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center; }
.choix label:has(input:checked) { background: var(--vert); border-color: var(--vert); color: var(--blanc); }
.choix label:has(input:focus-visible) { outline: 3px solid var(--encre); outline-offset: 2px; }
.choix input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
[hidden] { display: none !important; }
.champ-moyen { min-height: 64px !important; font-size: 28px !important; font-weight: 700; text-align: right; }
.encadre-alerte { background: var(--alerte-fond); border: 2px solid var(--alerte); border-radius: 12px; padding: 12px 16px; }
.encadre-alerte strong { color: #6B3A08; }
.liens { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi small { font-size: 13px; color: var(--discret); }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--discret); }
.negatif { color: var(--danger); }
tfoot td { font-weight: 700; border-top: 2px solid var(--encre); }

.pied { padding: 16px 20px 24px; display: flex; justify-content: space-between; font-size: 15px; }
.pied form { margin: 0; }
.pied button { background: none; border: none; color: var(--vert); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
