/* Progrès : statistiques, calendrier, graphique, records, historique et détail d'une séance.
   Toutes les classes propres à cet écran sont préfixées par .pg- */

/* ───────── Commun ───────── */

.pg-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-count { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.pg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Ressenti : couleurs partagées (pastilles, boutons). */
.pg-feel-facile { --pg-feel: var(--ok); --pg-feel-soft: var(--ok-soft); }
.pg-feel-ok { --pg-feel: var(--warn); --pg-feel-soft: var(--warn-soft); }
.pg-feel-dur { --pg-feel: var(--danger); --pg-feel-soft: var(--danger-soft); }
.pg-feel-dot {
  flex: none;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pg-feel, var(--faint));
}

/* ───────── Statistiques ───────── */

.pg-stats { margin-top: 4px; }
.pg-unit { margin-left: 4px; font-size: 14px; font-weight: 650; letter-spacing: 0; color: var(--muted); }
.pg-stat-label { display: flex; align-items: center; gap: 5px; }
.pg-stat-label .icon { color: var(--faint); }
.pg-stat-hot .stat-value { color: var(--accent); }
.pg-stat-hot .pg-stat-label .icon { color: var(--accent); }

@media (min-width: 560px) {
  .pg-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pg-tabs { margin-top: 20px; }
.pg-panel { margin-top: 16px; }

/* ───────── État vide ───────── */

.pg-empty { padding: 56px 16px; }
.pg-empty h3 { margin-bottom: 6px; color: var(--text); }
.pg-empty p { max-width: 320px; margin-left: auto; margin-right: auto; }
.pg-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.pg-empty .pg-empty-icon .icon { margin: 0; color: inherit; }

/* ───────── Calendrier ───────── */

.pg-cal { padding: 10px 10px 8px; }
.pg-cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.pg-cal-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; }
.pg-cal-head .icon-btn:disabled { opacity: 0.28; cursor: default; }

.pg-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.pg-cal-wd { padding: 4px 0 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--faint); }

.pg-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
button.pg-day { cursor: pointer; touch-action: manipulation; }
.pg-day-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform 0.08s ease, background 0.15s ease;
}
.pg-day.is-out { color: var(--faint); }
.pg-day.is-out .pg-day-num { opacity: 0.45; }
.pg-day.is-trained .pg-day-num { background: var(--accent); color: #1a0d08; font-weight: 750; }
.pg-day.is-today .pg-day-num { box-shadow: inset 0 0 0 2px var(--text); font-weight: 750; }
.pg-day.is-today.is-trained .pg-day-num { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
button.pg-day:active .pg-day-num { transform: scale(0.9); }
.pg-day-count {
  position: absolute;
  top: 1px;
  right: calc(50% - 23px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}

.pg-cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-top: 4px;
  padding: 0 6px;
  font-size: 14px;
  color: var(--muted);
}
.pg-link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}

/* ───────── Graphique « Séances par semaine » ───────── */

.pg-chart { padding: 14px 12px 10px; }
.pg-chart-svg { display: block; width: 100%; height: auto; aspect-ratio: 320 / 150; overflow: visible; }
.pg-chart-svg text { font-family: var(--font); font-variant-numeric: tabular-nums; }
.pg-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.pg-axis { stroke: var(--line); stroke-width: 1; }
.pg-bar { fill: var(--accent); fill-opacity: 0.38; }
.pg-bar.is-current { fill-opacity: 1; }
.pg-bar-zero { fill: var(--surface-3); }
.pg-bar-zero.is-current { fill: var(--accent); fill-opacity: 0.5; }
.pg-bar-val { fill: var(--muted); font-size: 12px; font-weight: 700; }
.pg-bar-val.is-current { fill: var(--text); }
.pg-bar-lbl { fill: var(--muted); font-size: 11px; font-weight: 600; }
.pg-bar-lbl.is-current { fill: var(--accent); font-weight: 800; }
.pg-bar-month { fill: var(--faint); font-size: 10px; }

/* ───────── Records ───────── */

.pg-recent { padding: 14px 16px 6px; }
.pg-recent-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 17px; }
.pg-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
}
.pg-recent-item + .pg-recent-item { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.pg-recent-item:active { opacity: 0.7; }

.pg-rec-value { flex: none; font-weight: 750; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pg-rec-side { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ───────── Historique ───────── */

.pg-month + .pg-month { margin-top: 24px; }
.pg-hist-item { min-height: 68px; }
.pg-date {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  padding: 5px 0;
  border-radius: 12px;
  background: var(--surface-2);
  line-height: 1.1;
}
.pg-date-wd { font-size: 10px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pg-date-d { font-family: var(--font-display); font-size: 19px; font-weight: 760; font-variant-numeric: tabular-nums; }
.pg-date-m { font-size: 10px; color: var(--faint); }
.pg-hist-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.pg-badge-sm { padding: 1px 7px; font-size: 11px; }
.pg-more { margin-top: 16px; }
.pg-end { margin-top: 16px; }

/* ───────── Détail d'une séance ───────── */

.pg-head h2 { font-size: 24px; }
.pg-head-date { margin-top: 4px; color: var(--muted); }
.pg-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pg-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.pg-meta-item .icon { color: var(--muted); }
.pg-feel-pill { background: var(--pg-feel-soft); color: var(--pg-feel); }
.pg-prog {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pg-prog:active { opacity: 0.7; }

.pg-recbanner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 650;
}

.pg-totals { margin-top: 12px; }
.pg-totals .stat-value { font-size: 22px; }

.pg-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pg-ex-name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  margin: -10px 0 -6px;
  font-size: 17px;
  font-weight: 700;
}
.pg-ex-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.pg-ex-name:active { opacity: 0.7; }
.pg-rec-badge { flex: none; background: var(--warn-soft); color: var(--warn); }
.pg-ex-target { font-size: 14px; color: var(--muted); }
.pg-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pg-set {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pg-set.is-met { background: var(--ok-soft); color: var(--ok); }
.pg-ex-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.pg-ex-rec { margin-top: 8px; font-size: 13px; font-weight: 650; color: var(--warn); }

.pg-feel-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pg-feel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.pg-feel-btn:active { transform: scale(0.97); }
.pg-feel-btn.active { background: var(--pg-feel-soft); border-color: var(--pg-feel); color: var(--pg-feel); }
.pg-hint { margin-top: 8px; }

.pg-danger { margin-top: 32px; }

/* ───────── Souris (PC) ───────── */

@media (hover: hover) {
  .pg a.list-item:hover { background: var(--surface-2); }
  button.pg-day:hover .pg-day-num { background: var(--surface-3); }
  button.pg-day.is-trained:hover .pg-day-num { background: var(--accent-2); }
  .pg-recent-item:hover .grow .strong,
  a.pg-ex-name:hover > span:first-child,
  .pg-prog:hover .strong { text-decoration: underline; text-underline-offset: 3px; }
  .pg-feel-btn:hover { border-color: var(--pg-feel); }
  .pg-link:hover { text-decoration: underline; }
}
