/* Training — thème sombre mobile-first, gros chiffres, utilisable en salle */
:root {
  --fond: #0e1116;
  --fond2: #171c24;
  --fond3: #222936;
  --texte: #eef1f6;
  --texte2: #9aa4b2;
  --accent: #c8f04c;
  --accent-fonce: #9dc42e;
  --danger: #ff6b6b;
  --bordure: #2a3240;
  --rayon: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: var(--texte); }

#barre-haut {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px calc(10px);
  background: linear-gradient(var(--fond) 82%, transparent);
  padding-top: calc(14px + env(safe-area-inset-top));
}
#titre-ecran { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
#action-haut button {
  background: var(--fond3); border-radius: 10px; padding: 8px 12px;
  font-weight: 600; font-size: 14px;
}

#ecran { padding: 4px 16px 20px; }

#barre-bas {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #131820f2; backdrop-filter: blur(8px);
  border-top: 1px solid var(--bordure);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
#barre-bas button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 8px; font-size: 11px; color: var(--texte2);
  border-top: 2px solid transparent;
}
#barre-bas button span { font-weight: 600; }
#barre-bas button.actif { color: var(--accent); border-top-color: var(--accent); }

/* Cartes générales */
.carte {
  background: var(--fond2); border: 1px solid var(--bordure);
  border-radius: var(--rayon); padding: 14px 16px; margin-bottom: 12px;
}
.carte h3 { font-size: 17px; font-weight: 700; }
.sous-titre { color: var(--texte2); font-size: 13px; margin-top: 2px; }
.liste > .carte { cursor: pointer; transition: transform .08s; }
.liste > .carte:active { transform: scale(.985); }
.fleche { float: right; color: var(--texte2); font-size: 18px; }

/* Compteur de semaine */
.semaine-cycle {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 6px 0 16px;
}
.semaine-cycle .val { font-size: 18px; font-weight: 800; min-width: 130px; text-align: center; }
.semaine-cycle button {
  width: 42px; height: 42px; border-radius: 12px; background: var(--fond3);
  font-size: 20px; font-weight: 800; color: var(--accent);
}

/* Écran séance (saisie) */
.exo-bloc { background: var(--fond2); border: 1px solid var(--bordure); border-radius: var(--rayon); margin-bottom: 14px; overflow: hidden; }
.exo-tete { padding: 12px 14px 8px; }
.exo-tete .ligne1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.exo-tete h3 { font-size: 16px; }
.exo-tete .cible { color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.exo-tete .derniere { color: var(--texte2); font-size: 12.5px; margin-top: 2px; }
.exo-ligne {
  display: grid; grid-template-columns: 26px 1fr 1fr 1.2fr; gap: 8px;
  align-items: center; padding: 7px 14px; border-top: 1px solid var(--bordure);
}
.exo-ligne .num { color: var(--texte2); font-weight: 700; font-size: 13px; text-align: center; }
.stepper { display: flex; align-items: stretch; background: var(--fond3); border-radius: 10px; overflow: hidden; }
.stepper button { width: 34px; font-size: 17px; font-weight: 800; color: var(--accent); padding: 9px 0; }
.stepper button:active { background: #2e3850; }
.stepper input {
  width: 100%; min-width: 0; text-align: center; background: transparent; border: none;
  font-weight: 800; font-size: 16px; padding: 9px 2px;
}
.exo-ligne input.note {
  width: 100%; background: var(--fond3); border: none; border-radius: 10px;
  padding: 9px 8px; font-size: 13px; color: var(--texte);
}
.exo-ligne input.note::placeholder { color: #5c6675; }
.entetes-ligne { display: grid; grid-template-columns: 26px 1fr 1fr 1.2fr; gap: 8px; padding: 2px 14px 6px; color: var(--texte2); font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.entetes-ligne span:nth-child(2), .entetes-ligne span:nth-child(3) { text-align: center; }

#btn-enregistrer {
  position: sticky; bottom: calc(84px + env(safe-area-inset-bottom));
  width: 100%; padding: 16px; border-radius: 14px; margin-top: 6px;
  background: var(--accent); color: #10140a; font-size: 17px; font-weight: 800;
  box-shadow: 0 6px 22px #c8f04c33;
}
#btn-enregistrer:active { background: var(--accent-fonce); }

/* Historique */
.chip-rangee { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  background: var(--fond3); border-radius: 999px; padding: 7px 13px;
  font-size: 13.5px; font-weight: 600; color: var(--texte2);
  border: 1px solid var(--bordure);
}
.chip.actif { background: var(--accent); color: #10140a; border-color: var(--accent); }
.detail-exo .occurrence { border-top: 1px solid var(--bordure); padding: 10px 0; }
.detail-exo .occurrence .origine { font-size: 12.5px; color: var(--texte2); margin-bottom: 4px; }
.detail-exo .serie-hist { display: flex; gap: 10px; align-items: baseline; font-size: 15px; padding: 1px 0; }
.detail-exo .serie-hist .nums { font-weight: 800; font-size: 16px; min-width: 96px; }
.detail-exo .serie-hist .fb { color: var(--texte2); font-size: 13px; }
.pr { color: var(--accent); font-weight: 800; font-size: 12px; }
.spark { margin: 10px 0 4px; }
.spark text { fill: var(--texte2); font-size: 10px; }

/* Programme */
.prog-exo {
  display: flex; align-items: center; gap: 8px; padding: 10px 2px;
  border-top: 1px solid var(--bordure);
}
.prog-exo .nom { flex: 1; font-weight: 600; font-size: 15px; }
.prog-exo .meta { color: var(--texte2); font-size: 12.5px; }
.mini-btn {
  background: var(--fond3); border-radius: 8px; padding: 6px 9px;
  font-size: 13px; font-weight: 700;
}
.mini-btn.danger { color: var(--danger); }
.ajout-ligne { display: flex; gap: 8px; margin-top: 10px; }
.ajout-ligne input, .ajout-ligne select {
  flex: 1; background: var(--fond3); border: 1px solid var(--bordure);
  border-radius: 10px; padding: 9px 10px;
}

/* Données */
.donnees-btns button {
  display: block; width: 100%; text-align: left;
  background: var(--fond2); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 14px 16px; margin-bottom: 10px; font-weight: 600; font-size: 15px;
}
.donnees-btns button.danger { color: var(--danger); }
.donnees-btns .sous-titre { margin-top: 3px; font-weight: 400; }

/* Modal */
#modal { position: fixed; inset: 0; background: #05070ac9; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
#modal.cache { display: none; }
#modal-contenu { background: var(--fond2); border: 1px solid var(--bordure); border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; }
#modal-contenu h3 { margin-bottom: 12px; font-size: 17px; }
#modal-contenu input, #modal-contenu select {
  width: 100%; background: var(--fond3); border: 1px solid var(--bordure);
  border-radius: 10px; padding: 11px 12px; margin-bottom: 10px;
}
#modal-contenu .modal-actions { display: flex; gap: 10px; margin-top: 6px; }
#modal-contenu .modal-actions button { flex: 1; padding: 12px; border-radius: 11px; font-weight: 700; }
#modal-contenu .btn-ok { background: var(--accent); color: #10140a; }
#modal-contenu .btn-non { background: var(--fond3); }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--accent); color: #10140a; font-weight: 700;
  padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; font-size: 14.5px;
  max-width: 88%;
}
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.section-titre { font-size: 13px; font-weight: 800; color: var(--texte2); text-transform: uppercase; letter-spacing: .8px; margin: 18px 2px 10px; }
.vide { color: var(--texte2); text-align: center; padding: 34px 12px; font-size: 14.5px; }
.retour { font-size: 14px; color: var(--accent); font-weight: 700; margin-bottom: 10px; display: inline-block; }

/* Onglet Suivi (check-in, courbes) */
.checkin .checkin-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.checkin input[type="date"] {
  background: var(--fond3); border: 1px solid var(--bordure); border-radius: 10px;
  padding: 7px 10px; color: var(--texte); color-scheme: dark; font-size: 13.5px;
}
.curseur-bloc { margin: 13px 0; }
.curseur-bloc label { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.curseur-bloc label b { color: var(--accent); font-size: 15px; }
.curseur { width: 100%; margin-top: 6px; height: 28px; }
.curseur.rouge { accent-color: #ff6b6b; }
.curseur.orange { accent-color: #f5a623; }
.curseur.vert { accent-color: var(--accent); }
.curseur-bouts { display: flex; justify-content: space-between; color: var(--texte2); font-size: 11.5px; margin-top: 1px; }
.checkin-poids { margin-top: 15px; }
.checkin-poids label { font-size: 14px; font-weight: 600; }
.checkin-poids .stepper { margin-top: 6px; max-width: 230px; }
.note-checkin {
  width: 100%; background: var(--fond3); border: none; border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; color: var(--texte); margin-top: 13px;
}
.note-checkin::placeholder { color: #5c6675; }
#btn-checkin {
  width: 100%; padding: 13px; border-radius: 12px; margin-top: 13px;
  background: var(--accent); color: #10140a; font-weight: 800; font-size: 16px;
}
#btn-checkin:active { background: var(--accent-fonce); }

.graphe-svg text { fill: var(--texte2); font-size: 9px; }
.graphe .graphe-tete { display: flex; justify-content: space-between; align-items: baseline; }
.graphe .delta { font-weight: 800; font-size: 15px; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--texte2); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }

.liste-jours { padding: 4px 0; }
.jour {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-top: 1px solid var(--bordure); font-size: 14px;
}
.liste-jours .jour:first-child { border-top: none; }
.jour .jour-date { font-weight: 700; min-width: 40px; }
.jour .jour-poids { color: #4cc9f0; font-weight: 700; min-width: 62px; }
.jour .badges { display: flex; gap: 9px; flex: 1; flex-wrap: wrap; min-width: 0; }
.jour .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--texte2); }
.jour .badge i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.jour .note-badge { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
