/* biome-ignore-all lint/style/noHexColors: palette historique comparee par tests et contrats front. */

/* ============================================================
   ONGLET COACH (#131) — design R1 « Hiérarchie typo »
   Réimplémentation fidèle du Labo (design-labo.html?v=1, variante R1).
   Police Fraunces pour les grands chiffres, Inter/Spline Sans pour le reste.
   Issue #134 — extrait de index.html (était inline <style>).
   ============================================================ */

/* En-tête de section (label + badge droit) */
.section-meta {
  font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); padding: 22px 0 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-meta .right { font-size: 9px; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--green); }

/* Carte kcal + macros */
.kcal-strip {
  background: var(--paper); border-radius: var(--r); border: 1px solid var(--line);
  padding: 18px; margin-bottom: 10px; overflow: hidden;
  box-shadow: var(--shadow);
}
.kcal-hero { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.kcal-hero .big {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 60px; font-weight: 700; line-height: .9; letter-spacing: -.02em;
  color: var(--ink);
}
.kcal-hero .unit { font-size: 14px; font-weight: 400; color: var(--ink-faint); }
.kcal-sub { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 16px; }

/* Grille macros 3 colonnes */
.macro-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); margin: 0 -18px;
}
.mcell { padding: 12px 8px; text-align: center; border-right: 1px solid var(--line); }
.mcell:last-child { border-right: none; }
.mcell .mk {
  font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 3px;
}
.mcell .mv {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px; font-weight: 700; line-height: 1;
}
.mcell .mu { font-size: 9px; color: var(--ink-faint); }
.mcell.prot .mv { color: var(--green); }
.mcell.lip  .mv { color: var(--amber); }
.mcell.gluc .mv { color: var(--ink-soft); }

/* Carte synthèse */
.synthese-card {
  background: var(--paper); border-radius: var(--r); border: 1px solid var(--line);
  padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.synthese-txt { font-size: 12.5px; color: var(--ink-soft); line-height: 1.65; }

/* Carte programme de séances */
.prog-card {
  background: var(--paper); border-radius: var(--r); border: 1px solid var(--line);
  margin-bottom: 10px; overflow: hidden;
  box-shadow: var(--shadow);
}
.prog-hd {
  padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between;
}
.prog-hd .title {
  font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.prog-hd .badge {
  font-size: 9px; font-weight: 600; color: var(--green);
  background: var(--green-bg); padding: 2px 8px; border-radius: 8px;
}

/* Lignes du tableau des séances */
.jour-row {
  display: grid; grid-template-columns: 44px 1fr auto;
  align-items: center; gap: 10px; padding: 11px 16px;
  border-top: 1px solid var(--line);
}
.jour-row:first-child { border-top: none; }
.jour-dow {
  font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}
.jour-row.today .jour-dow { color: var(--green); }
.jour-seance { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.jour-detail { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.jour-row.repos .jour-seance { color: var(--ink-faint); font-weight: 400; font-size: 13px; }
.jour-duree { font-size: 11px; font-weight: 600; color: var(--green); white-space: nowrap; }

/* Bouton régénérer */
.btn-regen {
  width: 100%; min-height: 48px; border-radius: var(--r-sm); border: none;
  background: var(--green); color: #fff;
  font-family: 'Spline Sans', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px;
  transition: opacity .15s;
}
.btn-regen:active { opacity: .82; }
.btn-regen:disabled { opacity: .5; cursor: wait; }

/* Message d'état régénération */
.regen-etat {
  font-size: 12px; color: var(--red); text-align: center;
  padding: 8px 0; margin-bottom: 8px;
}

/* Écran vide (pas encore de plan) */
.plan-vide {
  background: var(--paper); border-radius: var(--r); border: 1px solid var(--line);
  padding: 32px 20px; text-align: center; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.plan-vide-ico { font-size: 36px; margin-bottom: 12px; }
.plan-vide-titre {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 8px;
}
.plan-vide-txt { font-size: 13px; color: var(--ink-soft); line-height: 1.65; }

/* Conteneur des boutons plan : [Profil, Exporter] (#309) */
.plan-actions {
  display: flex; gap: 10px; margin-bottom: 10px;
}
.plan-actions .btn-regen {
  flex: 1; margin-bottom: 0;
}
.btn-regen-primaire {
  background: var(--green);
}
.btn-regen-secondaire {
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-regen-secondaire:hover { background: var(--line-soft, #f0f0f0); }
/* #309 : boutons « Ajuster » / « Annuler » + encart de motif retirés
   (génération/ajustement du plan sortis de l'appli, faits par Jarvis). */

/* ============================================================
   TABLEAU SEMAINE 7×4 — Prévu / Réalisé (issue #170)
   Colonnes : DOW | Prévu Ent | Prévu Nut | Réalisé Ent | Réalisé Nut
   ============================================================ */

/* Navigation ‹ semaine › */
.sr-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.sr-nav-btn {
  background: none; border: none; cursor: pointer;
  font-size: 22px; font-weight: 700; color: var(--ink-soft);
  padding: 4px 8px; border-radius: 8px; line-height: 1;
  transition: background .15s, color .15s;
  min-width: 32px; text-align: center;
}
.sr-nav-btn:active { background: var(--cream); color: var(--ink); }
.sr-nav-info { text-align: center; flex: 1; }
.sr-nav-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1px;
}
.sr-nav-dates { font-size: 13px; font-weight: 600; color: var(--ink); }

/* Tableau */
.sr-table {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-bottom: 10px;
  box-shadow: var(--shadow);
}

/* En-tête colonnes */
.sr-header, .sr-row {
  display: grid;
  grid-template-columns: 38px 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.sr-header { background: var(--cream); }
.sr-row:last-child { border-bottom: none; }
.sr-dow-hd { /* vide */ }
.sr-col-hd {
  font-size: 8px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 7px 4px; text-align: center;
  border-left: 1px solid var(--line);
}
/* Séparateur visuel entre Prévu et Réalisé */
.sr-col-r-ent { border-left: 2px solid var(--line); }

/* Lignes jours */
.sr-dow {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 8px 0;
  position: relative;
}
.sr-today .sr-dow { color: var(--green); }
.sr-today-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--green); display: block;
}
.sr-past { opacity: .75; }

.sr-cell {
  padding: 8px 5px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center;
  gap: 2px; min-height: 44px;
  font-size: 11px;
}
.sr-cell-r-ent { border-left: 2px solid var(--line); }

/* Pastilles couleur */
.col-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 3px; flex-shrink: 0; vertical-align: middle;
}
.c-vert   { background: var(--green); }
.c-jaune  { background: var(--amber); }
.c-rouge  { background: var(--red);   }
.c-neutre { background: var(--line);  }

/* Contenu des cellules */
.cell-repos { font-size: 10px; color: var(--ink-faint); font-style: italic; }
.cell-na    { font-size: 10px; color: var(--ink-faint); }
.cell-seance {
  display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-soft);
  line-height: 1.3;
}
.cell-seance em { font-style: normal; color: var(--green); font-size: 10px; }
/* Séance demandée NON validée (réalisé < 90 % durée) : marquée rouge côté prévu (#239) */
.cell-seance-nonvalidee { color: var(--red); }
.cell-seance-nonvalidee em { color: var(--red); }
.cell-kcal { font-size: 12px; font-weight: 700; color: var(--ink); }
.cell-kcal-unit { font-size: 9px; color: var(--ink-faint); }

/* Teintes de cases réalisées (#222 — remplace les pastilles col-dot dans le tableau) */
.sr-cell-tint-vert  { background: rgba(46, 107, 79, 0.10); }
.sr-cell-tint-jaune { background: rgba(180, 124, 24, 0.10); }
.sr-cell-tint-rouge { background: rgba(184, 44, 27, 0.08); }

/* Case réalisée d'un jour futur : vide visuellement */
.sr-futur-vide { background: transparent; }

/* Synthèse sous le tableau */
.sr-synthese { margin-top: 4px; }

/* États de chargement / erreur */
.sr-loading {
  text-align: center; color: var(--ink-faint);
  font-size: 13px; padding: 32px 0;
}
.sr-erreur {
  text-align: center; color: var(--red);
  font-size: 13px; padding: 16px;
}

/* ============================================================
   MODALE DÉTAIL au clic (#222) — bottom-sheet au premier plan
   ============================================================ */

/* Fond semi-opaque */
.sr-modal-bg {
  position: fixed; inset: 0;
  background: rgba(24, 24, 15, .45);
  z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .26s;
}
.sr-modal-bg.on { opacity: 1; pointer-events: auto; }

/* Card bottom-sheet */
.sr-modal {
  background: var(--paper, #fbfaf6);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px;
  padding: 22px 20px 30px;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.34, 1.2, .5, 1);
}
.sr-modal-bg.on .sr-modal { transform: translateY(0); }

.sr-modal-date {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint, #999); margin-bottom: 6px;
}
.sr-modal-titre {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; font-weight: 700; color: var(--ink, #18180f);
  margin: 0 0 8px;
}
.sr-modal-detail {
  font-size: 13.5px; color: var(--ink-soft, #555);
  line-height: 1.7; white-space: pre-wrap; margin: 0 0 20px;
}
.sr-modal-fermer {
  width: 100%; min-height: 44px; border-radius: 12px;
  border: none; background: var(--enc, #18180f);
  color: #fbfaf6; font-size: 14px; font-weight: 600;
  cursor: pointer;
  font-family: 'Spline Sans', sans-serif;
}
