/* ===== Reset & base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  /* PWA mobile : couvrir toute la zone d'écran y compris la status bar */
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport — gère la barre d'adresse mobile */
}
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ─── PWA installée : safe-area pour notch / dynamic island / home bar ─── */
/* Détection PWA via display-mode: standalone */
@media all and (display-mode: standalone), all and (display-mode: fullscreen), all and (display-mode: minimal-ui) {
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  header { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  main   { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  footer { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  /* Le rest-timer flottant doit aussi respecter la home bar iOS */
  .rest-timer { bottom: max(20px, env(safe-area-inset-bottom) + 12px); }
}

/* iOS standalone : retire le scroll bounce blanc en haut/bas */
html { background: #030712; overscroll-behavior-y: none; }
body.theme-light, body.theme-light html { background: #f9fafb; }

/* ===== Layout ===== */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===== Header nav ===== */
.nav-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn:hover  { color: #d1d5db; background: #1f2937; }
.nav-btn.active { color: #f97316; background: rgba(249,115,22,0.1); }

.btn-auth {
  background: transparent;
  border: 1px solid #374151;
  color: #9ca3af;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-auth:hover { border-color: #6b7280; color: #d1d5db; }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f97316;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-email {
  font-size: 13px; color: #9ca3af;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== Step indicator ===== */
.step-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  background: #1f2937; border: 2px solid #374151; color: #6b7280;
  transition: all 0.3s;
}
.step-dot.active { background: #f97316; border-color: #f97316; color: white; box-shadow: 0 0 16px rgba(249,115,22,.4); }
.step-dot.done   { background: #16a34a; border-color: #16a34a; color: white; }
.step-line {
  flex: 1; max-width: 80px; height: 2px;
  background: #374151; transition: background 0.3s;
}
.step-line.done { background: #16a34a; }

/* ===== Card ===== */
.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 28px;
}

/* ===== Fields ===== */
.field-group label {
  display: block; font-size: 13px; font-weight: 700;
  color: #9ca3af; text-transform: uppercase; letter-spacing: .05em;
}
.input-with-unit {
  display: flex; align-items: center;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px; overflow: hidden;
  transition: border-color 0.2s; margin-top: 6px;
}
.input-with-unit:focus-within { border-color: #f97316; }
.input-with-unit input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 12px 16px; color: white; font-size: 15px;
}
.input-with-unit span {
  padding: 0 14px; color: #6b7280; font-size: 13px;
  border-left: 1px solid #374151; font-weight: 500; white-space: nowrap;
}
select {
  width: 100%; background: #1f2937; border: 1px solid #374151; border-radius: 10px;
  padding: 12px 16px; color: white; font-size: 14px; outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
select:focus { border-color: #f97316; }
select option { background: #1f2937; }

/* ===== Genre buttons ===== */
.genre-btn {
  flex: 1; padding: 10px 20px; border-radius: 10px;
  border: 2px solid #374151; background: #1f2937;
  color: #9ca3af; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.genre-btn.active { border-color: #f97316; background: rgba(249,115,22,.15); color: #f97316; }
.genre-btn:hover:not(.active) { border-color: #6b7280; color: #d1d5db; }

/* ===== Objectif cards ===== */
.objectif-card {
  background: #1f2937; border: 2px solid #374151; border-radius: 14px;
  padding: 24px 20px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.objectif-card:hover { border-color: #6b7280; transform: translateY(-2px); }
.objectif-card.selected { border-color: #f97316; background: rgba(249,115,22,.1); box-shadow: 0 0 20px rgba(249,115,22,.2); }
.objectif-icon { font-size: 36px; margin-bottom: 12px; }
.objectif-card h3 { font-weight: 700; font-size: 16px; margin-bottom: 8px; color: white; }
.objectif-card p  { font-size: 13px; color: #9ca3af; line-height: 1.5; margin-bottom: 12px; }
.objectif-badge   { display: inline-block; background: #374151; color: #d1d5db; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.objectif-card.selected .objectif-badge { background: rgba(249,115,22,.3); color: #fb923c; }

/* ===== Days selector ===== */
.days-separator { height: 1px; background: #1f2937; margin: 28px 0 24px; }
.days-title { font-size: 13px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; }
.days-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.days-btn {
  width: 56px; height: 48px; border-radius: 10px;
  border: 2px solid #374151; background: #1f2937;
  color: #9ca3af; font-weight: 700; font-size: 15px; cursor: pointer; transition: all 0.2s;
}
.days-btn:hover:not(.active) { border-color: #6b7280; color: #d1d5db; }
.days-btn.active { border-color: #f97316; background: rgba(249,115,22,.15); color: #f97316; }
.days-desc { margin-top: 12px; font-size: 13px; color: #6b7280; line-height: 1.6; min-height: 20px; }

/* ===== Buttons ===== */
.btn-primary {
  background: #f97316; color: white; font-weight: 700;
  padding: 12px 28px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 15px; transition: all 0.2s;
}
.btn-primary:hover { background: #ea580c; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(249,115,22,.3); }
.btn-secondary {
  background: transparent; color: #9ca3af; font-weight: 600;
  padding: 12px 24px; border-radius: 10px; border: 1px solid #374151; cursor: pointer;
  font-size: 15px; transition: all 0.2s;
}
.btn-secondary:hover { border-color: #6b7280; color: #d1d5db; }
.btn-log {
  background: rgba(249,115,22,.12); border: 1px solid rgba(249,115,22,.3);
  color: #fb923c; padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-log:hover { background: rgba(249,115,22,.22); }

/* ===== Today banner ===== */
.today-banner {
  background: linear-gradient(135deg, #1c1917 0%, #1a1f2e 100%);
  border: 1px solid #292524;
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.today-meta  { font-size: 12px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.today-day   { font-size: 22px; font-weight: 800; color: white; margin-bottom: 4px; }
.today-sub   { font-size: 14px; color: #9ca3af; }
.today-btn {
  background: #f97316; color: white; font-weight: 700;
  padding: 14px 28px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 15px; white-space: nowrap; transition: all 0.2s; flex-shrink: 0;
}
.today-btn:hover { background: #ea580c; box-shadow: 0 4px 20px rgba(249,115,22,.4); }

/* ===== Week grid (7 cols) ===== */
.week-grid-7 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px)  { .week-grid-7 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .week-grid-7 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .week-grid-7 { grid-template-columns: repeat(7, 1fr); } }

.day-card { background: #1a2035; border-radius: 12px; overflow: hidden; border: 1px solid #1f2937; }
.day-card.today-highlight { border-color: #f97316; box-shadow: 0 0 16px rgba(249,115,22,.2); }
.day-card.rest-day { opacity: 0.5; }
.day-header { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.day-name   { font-weight: 800; font-size: 13px; color: white; }
.day-type   { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; align-self: flex-start; }
.day-type.training { background: rgba(249,115,22,.2); color: #fb923c; }
.day-type.rest     { background: rgba(99,102,241,.2); color: #818cf8; }
.day-type.cardio   { background: rgba(20,184,166,.2); color: #2dd4bf; }
.exercise-list { padding: 8px 12px 12px; }
.exercise-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 12px; gap: 6px; }
.exercise-item:last-child { border-bottom: none; }
.exercise-name  { color: #d1d5db; font-weight: 500; font-size: 12px; }
.exercise-sets  { color: #f97316; font-weight: 700; font-size: 11px; white-space: nowrap; }
.demo-btn {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid #374151; background: #111827;
  color: #6b7280; font-size: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.demo-btn:hover { background: #f97316; border-color: #f97316; color: white; }

/* ===== Split badge ===== */
.split-badge {
  display: inline-block;
  background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.25);
  color: #fb923c; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em;
}

/* ===== Dashboard bottom grid ===== */
.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (min-width: 900px) {
  .dash-bottom-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ===== Macro bars ===== */
.macro-bars { }
.macro-row  { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.macro-label { width: 100px; font-size: 12px; font-weight: 600; color: #9ca3af; flex-shrink: 0; }
.macro-bar-bg { flex: 1; height: 7px; background: #1f2937; border-radius: 4px; overflow: hidden; }
.macro-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.macro-value { width: 50px; text-align: right; font-size: 12px; font-weight: 700; color: #d1d5db; }

/* ===== Conseils ===== */
.conseil-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #1f2937; font-size: 13px; color: #d1d5db; line-height: 1.5; }
.conseil-item:last-child { border-bottom: none; }
.conseil-icon { flex-shrink: 0; margin-top: 1px; }

/* ===== Profile page ===== */
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) { .profile-stats-grid { grid-template-columns: repeat(3, 1fr); } }

.profile-card-title { font-size: 13px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }
.profile-data-list { display: flex; flex-direction: column; gap: 2px; }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid #1f2937; font-size: 14px; }
.profile-row:last-child { border-bottom: none; }
.profile-row-label { color: #9ca3af; font-weight: 500; }
.profile-row-val   { color: white; font-weight: 700; text-align: right; }

/* ===== Historique ===== */
.history-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #1f2937; }
.history-item:last-child { border-bottom: none; }
.history-date  { font-size: 12px; color: #6b7280; text-transform: capitalize; flex-shrink: 0; min-width: 90px; }
.history-label { font-size: 13px; color: #d1d5db; font-weight: 600; flex: 1; }
.history-meta  { font-size: 12px; color: #f97316; font-weight: 600; white-space: nowrap; }

/* ===== Session logging ===== */
.session-exercise { border-bottom: 1px solid #1f2937; padding-bottom: 16px; margin-bottom: 16px; }
.session-exercise:last-child { border-bottom: none; margin-bottom: 0; }
.session-ex-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.session-ex-name  { font-weight: 700; color: #f1f5f9; font-size: 14px; }
.session-ex-sets-label { font-size: 12px; color: #f97316; font-weight: 700; }
.session-sets-input { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; gap: 10px; }
.set-num { font-size: 12px; color: #6b7280; font-weight: 600; width: 52px; flex-shrink: 0; }
.cardio-done-row { padding: 8px 0; }
.cardio-check-label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #9ca3af; cursor: pointer; }

/* ===== Rest day modal ===== */
.rest-session-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.rest-session-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 12px;
  border: 2px solid #374151; background: #1f2937;
  color: #d1d5db; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.rest-session-btn:hover { border-color: #f97316; background: rgba(249,115,22,.1); color: #f97316; }

/* ===== Auth ===== */
.auth-tab {
  flex: 1; padding: 8px; border-radius: 10px; border: none;
  background: transparent; color: #6b7280; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: #1f2937; color: white; }

/* ===== Modals ===== */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; background: #111827; border: 1px solid #1f2937; border-radius: 16px;
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 28px; z-index: 1;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid #374151; background: #1f2937;
  color: #9ca3af; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: #374151; color: white; }
.modal-title { font-size: 18px; font-weight: 700; color: white; margin-bottom: 20px; padding-right: 40px; }
.modal-body  { min-height: 140px; margin-bottom: 20px; }
.modal-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 0; color: #6b7280; font-size: 14px; }
.spinner { width: 30px; height: 30px; border: 3px solid #374151; border-top-color: #f97316; border-radius: 50%; animation: spin .8s linear infinite; }
.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-images { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.modal-images img { border-radius: 10px; max-width: 100%; max-height: 260px; object-fit: contain; background: #1f2937; }
.modal-source  { margin-top: 10px; font-size: 11px; color: #4b5563; text-align: center; }
.modal-fallback { text-align: center; padding: 32px 0; color: #9ca3af; font-size: 14px; }
.modal-yt-btn  { display: block; text-align: center; background: #ff0000; color: white; font-weight: 700; font-size: 14px; padding: 12px; border-radius: 10px; text-decoration: none; transition: opacity 0.2s; }
.modal-yt-btn:hover { opacity: .85; }

/* ===== Rest timer flottant ===== */
.rest-timer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #1a1f2e, #111827);
  border: 1.5px solid #f97316;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 10px 40px rgba(249,115,22,.35), 0 4px 16px rgba(0,0,0,.5);
  z-index: 60;
  min-width: 240px;
}
.rest-timer-label {
  font-size: 11px; color: #fb923c; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  text-align: center; margin-bottom: 4px;
}
.rest-timer-display {
  font-size: 40px; font-weight: 900; color: white;
  text-align: center; font-variant-numeric: tabular-nums;
  line-height: 1; margin-bottom: 10px;
  font-family: 'Segoe UI', monospace;
}
.rest-timer-progress {
  height: 4px; background: #1f2937; border-radius: 2px; overflow: hidden;
  margin-bottom: 12px;
}
.rest-timer-bar {
  height: 100%; background: linear-gradient(90deg, #fb923c, #f97316);
  transition: width 1s linear; border-radius: 2px;
}
.rest-timer-actions { display: flex; gap: 6px; justify-content: center; }
.rest-timer-actions button {
  background: #1f2937; border: 1px solid #374151;
  color: #d1d5db; padding: 7px 11px; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; min-width: 38px;
}
.rest-timer-actions button:hover { background: #374151; }
.rest-timer-close { color: #f87171 !important; border-color: rgba(220,38,38,.3) !important; }
.rest-timer.finished {
  border-color: #16a34a;
  animation: pulse-rest 0.6s ease-in-out infinite alternate;
}
.rest-timer.finished .rest-timer-display { color: #4ade80; }
.rest-timer.finished .rest-timer-label::after { content: ' — Terminé !'; color: #4ade80; }
@keyframes pulse-rest {
  from { box-shadow: 0 10px 40px rgba(74,222,128,.3); transform: scale(1); }
  to   { box-shadow: 0 10px 50px rgba(74,222,128,.7); transform: scale(1.02); }
}
@media (max-width: 480px) {
  .rest-timer { left: 12px; right: 12px; bottom: 12px; min-width: 0; }
  .rest-timer-display { font-size: 34px; }
}

/* Bouton "démarrer repos" dans la séance */
.btn-rest-start {
  flex: 1; padding: 7px 10px; border-radius: 8px;
  border: 1px solid rgba(249,115,22,.4); background: rgba(249,115,22,.1);
  color: #fb923c; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.btn-rest-start:hover { background: rgba(249,115,22,.2); border-color: #f97316; }

/* ===== Streak / week badges (today-banner) ===== */
.streak-badge, .week-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  margin-left: 6px;
}
.streak-badge {
  background: linear-gradient(135deg, rgba(249,115,22,.2), rgba(220,38,38,.2));
  border: 1px solid rgba(249,115,22,.4);
  color: #fb923c;
}
.week-badge {
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.3);
  color: #a5b4fc;
}
.today-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}

/* ===== Records personnels ===== */
.pr-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 8px;
  background: rgba(249,115,22,.04);
  border-left: 3px solid #f97316;
  border-radius: 8px;
  gap: 14px; flex-wrap: wrap;
}
.pr-row:last-child { margin-bottom: 0; }
.pr-name { font-size: 14px; font-weight: 700; color: #f1f5f9; flex: 1; min-width: 160px; }
.pr-vals { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pr-val {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 14px; font-weight: 800; color: #fb923c;
}
.pr-lab { font-size: 9px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.pr-date { font-size: 11px; color: #6b7280; font-weight: 500; }
@media (max-width: 480px) {
  .pr-row { padding: 10px 12px; }
  .pr-name { min-width: 100%; }
  .pr-vals { width: 100%; justify-content: space-between; }
}

/* ===== Notes de séance ===== */
.session-notes-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid #1f2937; }
.session-notes-label {
  display: block; font-size: 12px; font-weight: 700;
  color: #9ca3af; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 6px;
}
.session-notes-textarea {
  width: 100%; min-height: 60px; resize: vertical;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px;
  color: white; padding: 10px 14px; font-size: 14px;
  font-family: inherit; outline: none; transition: border-color 0.2s;
}
.session-notes-textarea:focus { border-color: #f97316; }

.detail-notes-view {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(165,180,252,.06); border-left: 3px solid #a5b4fc;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}
.detail-notes-icon { font-size: 16px; line-height: 1.4; }
.detail-notes-text { font-size: 13px; color: #d1d5db; line-height: 1.5; white-space: pre-wrap; flex: 1; }
.detail-notes-edit { margin-bottom: 14px; }

.history-note-icon { margin-right: 6px; font-size: 12px; }

/* ===== SVG charts ===== */
.line-chart { display: block; width: 100%; }
.chart-empty { padding: 14px; text-align: center; color: #6b7280; font-size: 12px; }
.chart-single { display: flex; align-items: baseline; gap: 6px; justify-content: center; padding: 14px; }
.chart-single-val { font-size: 28px; font-weight: 800; color: #f97316; }
.chart-single-lab { font-size: 13px; color: #9ca3af; }
.chart-title {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
}
.detail-mini-chart { background: rgba(249,115,22,.04); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }

/* ===== Body weight card ===== */
.bw-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.bw-current { display: flex; align-items: baseline; gap: 4px; }
.bw-val  { font-size: 36px; font-weight: 900; color: white; line-height: 1; }
.bw-unit { font-size: 15px; color: #9ca3af; font-weight: 600; }
.bw-delta { margin-left: 10px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #1f2937; color: #9ca3af; }
.bw-delta.up   { background: rgba(220,38,38,.15);  color: #f87171; }
.bw-delta.down { background: rgba(22,163,74,.15);  color: #4ade80; }
.bw-date { font-size: 11px; color: #6b7280; margin-bottom: 14px; }
.bw-chart { margin: 12px 0 8px; }
.bw-list-toggle {
  font-size: 12px; color: #f97316; cursor: pointer;
  text-align: center; padding: 8px; font-weight: 600;
  border-top: 1px solid #1f2937; margin-top: 8px;
}
.bw-list-toggle:hover { color: #fb923c; }
.bw-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.bw-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: #1a2035; border-radius: 6px;
  font-size: 13px; color: #d1d5db;
}
.bw-list-item span:first-child { flex: 1; color: #9ca3af; }
.bw-rm-btn {
  background: transparent; border: 1px solid #374151; color: #6b7280;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 11px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.bw-rm-btn:hover { background: rgba(220,38,38,.15); border-color: #dc2626; color: #f87171; }

/* ===== PR edit / add ===== */
.pr-add-btn {
  display: block; width: 100%; padding: 10px;
  background: rgba(249,115,22,.08); border: 1.5px dashed rgba(249,115,22,.4);
  color: #fb923c; font-weight: 700; font-size: 13px; cursor: pointer;
  border-radius: 10px; margin-bottom: 12px;
  transition: all 0.2s;
}
.pr-add-btn:hover { background: rgba(249,115,22,.15); border-color: #f97316; }
.pr-edit-btn {
  background: transparent; border: 1px solid #374151; color: #9ca3af;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 12px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pr-edit-btn:hover { border-color: #f97316; color: #f97316; }
.pr-override-badge { font-size: 11px; margin-left: 4px; opacity: 0.7; }

/* ===== Éditeur de programme ===== */
.editor-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.editor-day {
  background: #111827; border: 1px solid #1f2937; border-radius: 14px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.editor-day-training { border-left: 3px solid #f97316; }
.editor-day-cardio   { border-left: 3px solid #2dd4bf; }
.editor-day-rest     { border-left: 3px solid #818cf8; opacity: 0.7; }
.editor-day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.editor-day-name { font-weight: 800; color: white; font-size: 15px; }
.editor-day-type {
  background: #1f2937; border: 1px solid #374151; border-radius: 8px;
  color: white; padding: 6px 10px; font-size: 12px; cursor: pointer; outline: none;
}
.editor-day-label {
  width: 100%; background: #1f2937; border: 1px solid #374151; border-radius: 8px;
  color: white; padding: 9px 12px; font-size: 13px; outline: none;
}
.editor-day-label:focus { border-color: #f97316; }
.editor-ex-list { display: flex; flex-direction: column; gap: 6px; }
.editor-ex-row {
  display: flex; align-items: center; gap: 8px;
  background: #1a2035; border-radius: 8px; padding: 8px 10px;
}
.editor-ex-info { flex: 1; min-width: 0; }
.editor-ex-name { font-size: 13px; color: #f1f5f9; font-weight: 600; }
.editor-ex-meta { font-size: 11px; color: #6b7280; margin-top: 1px; }
.editor-ex-actions { display: flex; gap: 4px; flex-shrink: 0; }
.editor-move-btn, .editor-rm-btn {
  background: #1f2937; border: 1px solid #374151; color: #9ca3af;
  width: 26px; height: 26px; border-radius: 6px;
  font-size: 12px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.editor-move-btn:hover:not(:disabled) { border-color: #f97316; color: #f97316; }
.editor-move-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.editor-rm-btn:hover { background: rgba(220,38,38,.15); border-color: #dc2626; color: #f87171; }
.editor-add-ex {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 9px;
  background: rgba(249,115,22,.08); border: 1px dashed rgba(249,115,22,.4);
  color: #fb923c; font-weight: 700; font-size: 12px; cursor: pointer;
  border-radius: 8px; transition: all 0.2s;
}
.editor-add-ex:hover { background: rgba(249,115,22,.15); border-color: #f97316; }
.editor-actions {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid #1f2937;
}
@media (max-width: 480px) {
  .editor-actions { flex-direction: column-reverse; }
  .editor-actions button { width: 100%; }
}

/* ===== Calendrier / Agenda ===== */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.calendar-nav {
  background: #1f2937; border: 1px solid #374151;
  color: #d1d5db; width: 38px; height: 38px; border-radius: 10px;
  font-size: 16px; cursor: pointer; transition: all 0.2s;
}
.calendar-nav:hover { border-color: #f97316; color: #f97316; }
.calendar-month-title { font-size: 20px; font-weight: 800; color: white; text-align: center; flex: 1; }
.calendar-stats {
  margin-bottom: 12px; padding: 10px 14px;
  background: rgba(249,115,22,.06); border-radius: 8px;
  font-size: 13px; color: #d1d5db; text-align: center;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 14px;
}
.cal-head {
  text-align: center; font-size: 11px; font-weight: 700; color: #6b7280;
  padding: 6px 0; text-transform: uppercase;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  background: #1a2035; border: 1px solid transparent; border-radius: 8px;
  padding: 6px; display: flex; flex-direction: column; justify-content: space-between;
  cursor: default; transition: all 0.15s;
  overflow: hidden;
}
.cal-cell[onclick] { cursor: pointer; }
.cal-cell[onclick]:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.cal-num { font-size: 12px; font-weight: 700; color: white; }
.cal-label {
  font-size: 9px; color: #9ca3af; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cal-out      { opacity: 0.25; }
.cal-today    { border-color: #f97316; box-shadow: 0 0 8px rgba(249,115,22,.3); }
.cal-done     { background: rgba(22,163,74,.12);  border-color: rgba(22,163,74,.3); }
.cal-done .cal-num { color: #4ade80; }
.cal-missed   { background: rgba(220,38,38,.08);  border-color: rgba(220,38,38,.2); }
.cal-missed .cal-num { color: #f87171; }
.cal-rest     { background: rgba(99,102,241,.06); border-color: rgba(99,102,241,.15); opacity: 0.6; }
.cal-rest .cal-num { color: #a5b4fc; }
.cal-planned  { background: rgba(249,115,22,.06); border-color: rgba(249,115,22,.2); }
.cal-planned .cal-num { color: #fb923c; }

.calendar-legend {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  padding-top: 10px; border-top: 1px solid #1f2937;
  font-size: 11px; color: #9ca3af;
}
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-legend-dot.done    { background: rgba(22,163,74,.4); }
.cal-legend-dot.planned { background: rgba(249,115,22,.4); }
.cal-legend-dot.missed  { background: rgba(220,38,38,.3); }
.cal-legend-dot.rest    { background: rgba(99,102,241,.3); }

@media (max-width: 640px) {
  .cal-label { font-size: 8px; -webkit-line-clamp: 1; }
  .cal-num   { font-size: 11px; }
  .cal-cell  { padding: 4px; }
}
@media (max-width: 380px) {
  .cal-label { display: none; }
  .cal-cell  { aspect-ratio: 1 / 1.1; }
}

/* ═══════════════════════════════════════════════════
   TUTORIEL ONBOARDING
   ═══════════════════════════════════════════════════ */
.tutorial-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(2px);
}
.tutorial-positioner {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.tutorial-card {
  pointer-events: auto;
  background: linear-gradient(135deg, #1a1f2e, #111827);
  border: 1.5px solid #f97316;
  border-radius: 18px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(249,115,22,.3), 0 8px 24px rgba(0,0,0,.5);
  animation: tutorial-pop 0.25s ease-out;
}
@keyframes tutorial-pop {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.tutorial-progress {
  display: flex; gap: 5px; justify-content: center;
  margin-bottom: 16px;
}
.tutorial-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #374151; transition: all 0.2s;
}
.tutorial-dot.active { background: #f97316; width: 24px; border-radius: 4px; }
.tutorial-title {
  font-size: 19px; font-weight: 800; color: white;
  margin-bottom: 10px; text-align: center;
}
.tutorial-text {
  font-size: 14px; color: #d1d5db; line-height: 1.5;
  margin-bottom: 20px; text-align: center;
}
.tutorial-text b { color: #fb923c; }
.tutorial-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.tutorial-actions button { padding: 9px 18px; font-size: 13px; }

.tutorial-highlight {
  position: relative;
  z-index: 95 !important;
  box-shadow: 0 0 0 4px rgba(249,115,22,.6), 0 0 30px rgba(249,115,22,.8) !important;
  border-radius: 12px;
  animation: tutorial-pulse 1.5s ease-in-out infinite;
}
@keyframes tutorial-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(249,115,22,.6), 0 0 30px rgba(249,115,22,.8); }
  50%     { box-shadow: 0 0 0 6px rgba(249,115,22,.8), 0 0 50px rgba(249,115,22,1); }
}

/* ═══════════════════════════════════════════════════
   HEAT MAP MUSCLES
   ═══════════════════════════════════════════════════ */
.heatmap-views {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 16px;
}
.heatmap-view {
  background: rgba(255,255,255,.02);
  border-radius: 12px;
  padding: 8px;
}
.heatmap-body { display: block; width: 100%; max-width: 220px; margin: 0 auto; height: auto; }
.heat-legend {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  padding: 10px 0; margin-bottom: 10px;
  border-top: 1px solid #1f2937; border-bottom: 1px solid #1f2937;
}
.heat-leg {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: #9ca3af; font-weight: 600;
}
.heat-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.heat-stats {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.heat-stat {
  background: #1a2035; border-radius: 6px;
  padding: 5px 10px; font-size: 11px; color: #d1d5db;
}
.heat-stat b { color: #f1f5f9; font-weight: 700; margin-right: 4px; }
.heat-note { font-size: 11px; color: #6b7280; line-height: 1.5; }
@media (max-width: 480px) {
  .heatmap-views { gap: 8px; }
  .heat-leg { font-size: 10px; }
  .heat-stat { font-size: 10px; padding: 4px 7px; }
}
body.theme-light .heatmap-view { background: #f9fafb; }
body.theme-light .heat-stat { background: #f3f4f6; }

/* ═══════════════════════════════════════════════════
   FOCUS MODE (séance plein écran)
   ═══════════════════════════════════════════════════ */
.focus-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: #030712;
  display: flex; align-items: stretch; justify-content: center;
  overflow-y: auto;
}
.focus-content {
  width: 100%; max-width: 480px;
  padding: 18px 20px 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.focus-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0;
}
.focus-icon-btn {
  background: #1f2937; border: 1px solid #374151;
  color: #d1d5db; width: 40px; height: 40px; border-radius: 12px;
  font-size: 17px; cursor: pointer; transition: all 0.2s;
}
.focus-icon-btn:hover { background: #f97316; border-color: #f97316; color: white; }
.focus-progress-text {
  font-size: 12px; font-weight: 700; color: #9ca3af;
  text-transform: uppercase; letter-spacing: .08em;
}
.focus-exo { text-align: center; padding: 12px 0; }
.focus-exo-name {
  font-size: 26px; font-weight: 900; color: white;
  line-height: 1.15; margin-bottom: 4px;
}
.focus-exo-muscle { font-size: 13px; color: #9ca3af; font-weight: 600; margin-bottom: 8px; }
.focus-exo-sets-info {
  display: inline-block;
  background: rgba(249,115,22,.12); color: #fb923c;
  font-size: 13px; font-weight: 700;
  padding: 5px 14px; border-radius: 20px;
}
.focus-set-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #111827; border: 1px solid #1f2937;
  padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em;
}
.focus-set-dots { display: flex; gap: 6px; }
.focus-set-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #374151; transition: all 0.2s;
}
.focus-set-dot.current { background: #f97316; box-shadow: 0 0 8px rgba(249,115,22,.6); }
.focus-set-dot.done { background: #16a34a; }
.focus-inputs {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 0;
}
.focus-input-box {
  background: #111827; border: 1.5px solid #374151;
  border-radius: 16px; padding: 12px 6px;
  flex: 1; max-width: 160px;
  transition: border-color 0.2s;
}
.focus-input-box:focus-within { border-color: #f97316; }
.focus-input-box input {
  display: block; width: 100%;
  background: transparent; border: none; outline: none;
  text-align: center;
  font-size: 56px; font-weight: 900; color: white;
  font-variant-numeric: tabular-nums;
  padding: 0; margin: 0;
}
.focus-input-box input::-webkit-outer-spin-button,
.focus-input-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.focus-input-box input[type=number] { -moz-appearance: textfield; }
.focus-input-label {
  text-align: center; font-size: 11px; color: #6b7280;
  text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin-top: 4px;
}
.focus-x { font-size: 28px; color: #4b5563; font-weight: 700; }
.focus-validate {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white; font-weight: 800; font-size: 16px;
  padding: 18px; border-radius: 14px; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(249,115,22,.4);
  transition: all 0.15s;
}
.focus-validate:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(249,115,22,.5); }
.focus-validate:active { transform: translateY(0); }
.focus-navbar {
  display: flex; gap: 8px; margin-top: auto; padding-top: 16px;
}
.focus-nav-btn {
  flex: 1; background: #1f2937; border: 1px solid #374151;
  color: #d1d5db; padding: 14px; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.focus-nav-btn:hover:not(:disabled) { background: #2a3344; border-color: #4b5563; }
.focus-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.focus-nav-btn.focus-finish {
  background: rgba(22,163,74,.15); border-color: rgba(22,163,74,.4); color: #4ade80;
}
.focus-nav-btn.focus-finish:hover { background: rgba(22,163,74,.25); border-color: #16a34a; }

.focus-cardio {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 32px 0;
}
.focus-cardio-label { font-size: 18px; font-weight: 700; color: #d1d5db; }
.focus-cardio-toggle { position: relative; width: 90px; height: 50px; cursor: pointer; }
.focus-cardio-toggle input { opacity: 0; width: 0; height: 0; }
.focus-cardio-slider {
  position: absolute; inset: 0;
  background: #374151; border-radius: 25px;
  transition: background 0.2s;
}
.focus-cardio-slider::before {
  content: ''; position: absolute;
  top: 4px; left: 4px;
  width: 42px; height: 42px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
}
.focus-cardio-toggle input:checked + .focus-cardio-slider { background: #16a34a; }
.focus-cardio-toggle input:checked + .focus-cardio-slider::before { transform: translateX(40px); }

@media (max-width: 480px) {
  .focus-content { padding: 14px 14px 24px; gap: 14px; }
  .focus-exo-name { font-size: 22px; }
  .focus-input-box input { font-size: 44px; }
  .focus-validate { padding: 15px; font-size: 15px; }
}

body.theme-light .focus-overlay { background: #f9fafb; }
body.theme-light .focus-exo-name { color: #111827; }
body.theme-light .focus-input-box { background: #ffffff; border-color: #d1d5db; }
body.theme-light .focus-input-box input { color: #111827; }
body.theme-light .focus-set-bar { background: #ffffff; border-color: #e5e7eb; color: #4b5563; }
body.theme-light .focus-nav-btn { background: #ffffff; border-color: #d1d5db; color: #374151; }

/* ═══════════════════════════════════════════════════
   BANNER EMAIL NON CONFIRMÉ
   ═══════════════════════════════════════════════════ */
.email-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(251,191,36,.15), rgba(245,158,11,.12));
  border: 1px solid rgba(245,158,11,.4);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px; color: #fde68a;
  flex-wrap: wrap;
}
.email-banner-icon { font-size: 18px; flex-shrink: 0; }
.email-banner-text { flex: 1; min-width: 200px; line-height: 1.4; }
.email-banner-btn {
  background: rgba(245,158,11,.2);
  border: 1px solid rgba(245,158,11,.5);
  color: #fbbf24; padding: 6px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.email-banner-btn:hover { background: rgba(245,158,11,.35); border-color: #f59e0b; color: #fff; }

body.theme-light .email-banner {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}
body.theme-light .email-banner-btn { color: #92400e; background: rgba(245,158,11,.2); }

/* ═══════════════════════════════════════════════════
   SETTINGS MODAL
   ═══════════════════════════════════════════════════ */
.settings-section {
  padding: 16px 0;
  border-bottom: 1px solid #1f2937;
}
.settings-section:last-child { border-bottom: none; padding-bottom: 0; }
.settings-section-title {
  font-size: 11px; font-weight: 700; color: #9ca3af;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 12px;
}
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.settings-value { font-size: 14px; font-weight: 700; color: #f1f5f9; }
.settings-meta  { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.settings-danger { background: rgba(220,38,38,.04); border-radius: 10px; padding: 14px; margin-top: 8px; border: 1px solid rgba(220,38,38,.15); }

body.theme-light .settings-section { border-color: #e5e7eb; }
body.theme-light .settings-value { color: #111827; }
body.theme-light .settings-danger { background: #fef2f2; border-color: #fecaca; }

/* ═══════════════════════════════════════════════════
   EMPTY STATES (engageants)
   ═══════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: #9ca3af;
}
.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.85;
}
.empty-state .empty-title {
  font-size: 14px;
  font-weight: 700;
  color: #d1d5db;
  margin-bottom: 6px;
}
.empty-state .empty-desc {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto;
}
.empty-mini { padding: 14px 8px; }
.empty-mini .empty-desc { font-size: 12px; }
body.theme-light .empty-state .empty-title { color: #1f2937; }
body.theme-light .empty-state .empty-desc { color: #6b7280; }

/* ═══════════════════════════════════════════════════
   PAGINATION HISTORIQUE
   ═══════════════════════════════════════════════════ */
.history-more-btn {
  display: block; width: 100%; margin-top: 12px;
  padding: 10px;
  background: rgba(249,115,22,.08);
  border: 1px dashed rgba(249,115,22,.4);
  color: #fb923c; font-weight: 700; font-size: 13px;
  border-radius: 10px; cursor: pointer;
  transition: all 0.2s;
}
.history-more-btn:hover { background: rgba(249,115,22,.15); border-color: #f97316; }
body.theme-light .history-more-btn { color: #c2410c; }

/* ═══════════════════════════════════════════════════
   MENTIONS LÉGALES
   ═══════════════════════════════════════════════════ */
.legal-content {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}
.legal-content h4 {
  font-size: 14px;
  font-weight: 800;
  color: #fb923c;
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1f2937;
}
.legal-content h4:first-child { margin-top: 0; }
.legal-content p {
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 10px;
}
.legal-content ul {
  margin-left: 20px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.7;
}
.legal-content b { color: #f1f5f9; }
.legal-content code {
  background: #1f2937;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #fb923c;
}
body.theme-light .legal-content h4 { color: #ea580c; border-color: #e5e7eb; }
body.theme-light .legal-content p,
body.theme-light .legal-content ul { color: #374151; }
body.theme-light .legal-content b { color: #111827; }
body.theme-light .legal-content code { background: #f3f4f6; color: #ea580c; }

.footer-link {
  background: none; border: none; color: #6b7280;
  font-size: 12px; text-decoration: underline; cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.footer-link:hover { color: #f97316; }

/* ═══════════════════════════════════════════════════
   CHOICE MODAL (compte vs invité)
   ═══════════════════════════════════════════════════ */
.choice-card {
  display: block; width: 100%; text-align: left;
  background: #1a2035;
  border: 1.5px solid #374151;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #d1d5db;
}
.choice-card:hover { transform: translateY(-1px); }
.choice-account {
  border-color: rgba(249,115,22,.5);
  background: linear-gradient(135deg, rgba(249,115,22,.1), rgba(249,115,22,.04));
}
.choice-account:hover { border-color: #f97316; box-shadow: 0 8px 24px rgba(249,115,22,.25); }
.choice-guest:hover { border-color: #6b7280; }
.choice-icon { font-size: 32px; margin-bottom: 6px; }
.choice-title {
  font-size: 16px; font-weight: 800; color: white;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.choice-badge {
  font-size: 10px; font-weight: 800;
  background: #f97316; color: white;
  padding: 2px 8px; border-radius: 20px;
  letter-spacing: .05em;
}
.choice-list {
  list-style: none; padding: 0; margin: 0;
  font-size: 13px; line-height: 1.7; color: #d1d5db;
}
.choice-warn { color: #fbbf24; }
.choice-warn b { color: #f59e0b; }
.choice-guest .choice-title { color: #d1d5db; }

body.theme-light .choice-card { background: #f3f4f6; border-color: #d1d5db; }
body.theme-light .choice-account { background: linear-gradient(135deg, #fff7ed, #ffedd5); border-color: #fdba74; }
body.theme-light .choice-title { color: #111827; }
body.theme-light .choice-list { color: #374151; }
body.theme-light .choice-warn { color: #b45309; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #16a34a; color: white; padding: 12px 24px; border-radius: 30px;
  font-weight: 600; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
  z-index: 100; white-space: nowrap;
}

/* ===== Session : boutons retirer/ajouter série & exo ===== */
.session-rm-btn {
  background: transparent; border: 1px solid #374151;
  color: #9ca3af; width: 28px; height: 28px; border-radius: 50%;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  line-height: 1;
}
.session-rm-btn:hover { background: rgba(220,38,38,.15); border-color: #dc2626; color: #f87171; }

.session-set-actions {
  display: flex; gap: 8px; margin-top: 10px;
}
.btn-set-toggle {
  flex: 1; padding: 7px 10px; border-radius: 8px;
  border: 1px solid #374151; background: #1f2937;
  color: #9ca3af; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.btn-set-toggle:hover:not(:disabled) { border-color: #f97316; color: #f97316; background: rgba(249,115,22,.08); }
.btn-set-toggle:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Historique cliquable ===== */
.history-item {
  cursor: pointer; transition: background 0.2s, transform 0.1s;
  padding-left: 8px; padding-right: 8px;
  margin-left: -8px; margin-right: -8px;
  border-radius: 8px;
}
.history-item:hover { background: rgba(249,115,22,.05); }
.history-item:active { transform: scale(0.99); }

/* ===== Détail séance passée ===== */
.detail-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px;
}
.detail-stat {
  background: rgba(249,115,22,.06); border-radius: 10px;
  padding: 12px 8px; text-align: center;
}
.detail-stat-val { font-size: 20px; font-weight: 800; color: #fb923c; }
.detail-stat-lab { font-size: 10px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

.detail-exercise {
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid #1f2937;
}
.detail-exercise:last-child { border-bottom: none; margin-bottom: 0; }
.detail-ex-name { font-weight: 700; color: #f1f5f9; font-size: 14px; margin-bottom: 8px; }
.detail-sets { display: flex; flex-direction: column; gap: 6px; }
.detail-set {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px; background: #1a2035; border-radius: 8px;
}
.detail-set-num { font-size: 11px; color: #6b7280; font-weight: 700; min-width: 24px; }
.detail-set-val { font-size: 13px; color: #f1f5f9; font-weight: 600; }
.detail-set-val:nth-of-type(2) { color: #f97316; }

/* Mode édition de séance */
.detail-ex-header {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.detail-ex-header .detail-ex-name { margin-bottom: 0; }
.detail-set-edit {
  background: #1f2937;
  padding: 8px 10px;
  gap: 8px;
}
.detail-set-edit .input-with-unit { min-width: 0; }
.detail-set-edit .input-with-unit input { font-size: 13px; padding: 6px 8px; min-width: 0; width: 100%; }
.detail-set-edit .input-with-unit span { padding: 0 8px; font-size: 11px; }
.detail-action-bar {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid #1f2937;
  flex-wrap: wrap;
}
.detail-action-bar .btn-primary,
.detail-action-bar .btn-secondary {
  padding: 9px 18px; font-size: 13px;
}
.detail-action-bar .detail-danger {
  color: #f87171; border-color: rgba(220,38,38,.3);
}
.detail-action-bar .detail-danger:hover {
  background: rgba(220,38,38,.1); border-color: #dc2626; color: #fca5a5;
}

@media (max-width: 480px) {
  .detail-set-edit { flex-wrap: wrap; }
  .detail-set-edit .detail-set-num { width: 100%; margin-bottom: 4px; }
  .detail-action-bar { justify-content: stretch; }
  .detail-action-bar .btn-primary,
  .detail-action-bar .btn-secondary { flex: 1; }
}

/* ===== Niveau buttons (onboarding) ===== */
.niveau-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.niveau-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px; border-radius: 12px;
  border: 2px solid #374151; background: #1f2937;
  color: #9ca3af; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.niveau-btn:hover:not(.active) { border-color: #6b7280; color: #d1d5db; }
.niveau-btn.active { border-color: #f97316; background: rgba(249,115,22,.12); color: #f97316; box-shadow: 0 0 14px rgba(249,115,22,.15); }
.niveau-icon { font-size: 22px; }
.niveau-title { font-size: 13px; font-weight: 700; }
.niveau-sub   { font-size: 11px; color: #6b7280; font-weight: 500; }
.niveau-btn.active .niveau-sub { color: #fb923c; }
@media (max-width: 480px) {
  .niveau-btn { padding: 10px 4px; }
  .niveau-icon { font-size: 18px; }
  .niveau-title { font-size: 11px; }
  .niveau-sub { font-size: 10px; }
}

/* ===== Today greet ===== */
.today-greet {
  font-size: 14px; font-weight: 600; color: #d1d5db;
  margin-bottom: 4px;
}

/* ===== Progression cards ===== */
.prog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.prog-item {
  background: #1a2035; border: 1px solid #1f2937; border-radius: 10px;
  padding: 12px 14px; border-left: 3px solid #4b5563;
}
.prog-item.prog-up   { border-left-color: #16a34a; background: rgba(22,163,74,.04); }
.prog-item.prog-down { border-left-color: #dc2626; background: rgba(220,38,38,.04); }
.prog-item.prog-new  { border-left-color: #f97316; background: rgba(249,115,22,.05); }
.prog-item.prog-flat { border-left-color: #6b7280; }
.prog-name { font-size: 13px; font-weight: 600; color: #d1d5db; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-stats { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prog-vol { font-size: 12px; color: #d1d5db; font-weight: 700; }
.prog-change { font-size: 12px; font-weight: 700; }
.prog-up   .prog-change { color: #4ade80; }
.prog-down .prog-change { color: #f87171; }
.prog-flat .prog-change { color: #9ca3af; }
.prog-new  .prog-change { color: #fb923c; }

/* ===== Swap buttons ===== */
.swap-day-btn {
  background: transparent; border: none; color: #6b7280;
  font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 2px 8px; border-radius: 6px; transition: all 0.2s;
  line-height: 1;
}
.swap-day-btn:hover { background: rgba(249,115,22,.15); color: #f97316; }
.swap-btn { background: #111827; color: #6b7280; }
.swap-btn:hover { background: #f97316; border-color: #f97316; color: white; }

/* ===== Swap modal lists ===== */
.swap-group { margin-bottom: 14px; }
.swap-group-title {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.swap-option {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; margin-bottom: 4px;
  background: #1f2937; border: 1px solid #374151; border-radius: 8px;
  color: #d1d5db; cursor: pointer; transition: all .2s;
  text-align: left;
}
.swap-option:hover { border-color: #f97316; background: rgba(249,115,22,.08); }
.swap-option.active { border-color: #f97316; background: rgba(249,115,22,.15); color: #fb923c; }
.swap-option-name { font-size: 13px; font-weight: 600; }
.swap-option-meta { font-size: 11px; color: #f97316; font-weight: 700; flex-shrink: 0; }

.swap-option-row {
  display: flex; align-items: stretch; gap: 6px; margin-bottom: 4px;
}
.swap-option-row .swap-option { margin-bottom: 0; }
.swap-custom-delete {
  background: #1f2937; border: 1px solid #374151;
  color: #6b7280; padding: 0 12px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s; font-size: 12px;
}
.swap-custom-delete:hover { border-color: #dc2626; color: #f87171; background: rgba(220,38,38,.1); }

.swap-create-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px;
  background: rgba(249,115,22,.08); border: 1.5px dashed rgba(249,115,22,.4);
  color: #fb923c; font-weight: 700; font-size: 13px; cursor: pointer;
  border-radius: 10px; margin-bottom: 10px;
  transition: all 0.2s;
}
.swap-create-btn:hover { background: rgba(249,115,22,.15); border-color: #f97316; }

/* Barre de recherche dans le picker */
.swap-search-wrap {
  display: flex; align-items: center; gap: 6px;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px;
  padding: 4px 10px; margin-bottom: 12px;
  transition: border-color 0.2s;
}
.swap-search-wrap:focus-within { border-color: #f97316; }
.swap-search-icon { font-size: 13px; opacity: 0.6; }
.swap-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: white; padding: 9px 0; font-size: 14px; min-width: 0;
}
.swap-search-clear {
  background: transparent; border: none; color: #6b7280;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  font-size: 11px; transition: all 0.2s;
}
.swap-search-clear:hover { background: #374151; color: #d1d5db; }

/* Accordéon des groupes */
.swap-group-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 11px 14px;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px;
  color: #d1d5db; font-weight: 700; font-size: 13px; cursor: pointer;
  margin-bottom: 6px; transition: all 0.2s;
}
.swap-group-header:hover { background: #2a3344; border-color: #4b5563; }
.swap-group-count {
  display: inline-block; background: rgba(249,115,22,.18);
  color: #fb923c; font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 10px; margin-left: 6px;
}
.swap-group-arrow { font-size: 14px; transition: transform 0.2s; color: #9ca3af; }
.swap-group-arrow.open { transform: rotate(180deg); color: #f97316; }
.swap-group-body { padding: 4px 0 4px 6px; margin-bottom: 8px; }

/* Surlignage du match de recherche */
mark {
  background: rgba(249,115,22,.3); color: #fb923c;
  padding: 0 3px; border-radius: 3px; font-weight: 700;
}

/* Light theme overrides */
body.theme-light .swap-search-wrap { background: #f3f4f6; border-color: #d1d5db; }
body.theme-light .swap-search-input { color: #111827; }
body.theme-light .swap-group-header { background: #f3f4f6; border-color: #d1d5db; color: #1f2937; }
body.theme-light .swap-group-header:hover { background: #e5e7eb; border-color: #9ca3af; }
body.theme-light mark { background: #fef3c7; color: #b45309; }

.swap-day-option {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px; margin-bottom: 8px;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px;
  color: #d1d5db; cursor: pointer; transition: all .2s;
}
.swap-day-option:hover { border-color: #f97316; background: rgba(249,115,22,.08); }
.swap-day-name  { font-weight: 700; color: white; font-size: 14px; }
.swap-day-label { font-size: 12px; color: #9ca3af; text-align: right; }

/* ===================================================
   MOBILE — Optimisations pour smartphones & zoom
   =================================================== */
@media (max-width: 768px) {
  .app-container { padding-left: 14px; padding-right: 14px; }
  .card { padding: 18px; border-radius: 12px; }
  main.app-container { padding-top: 24px; padding-bottom: 24px; }
}

@media (max-width: 640px) {
  /* Header */
  .user-email { display: none; }
  .nav-btn { padding: 6px 10px; font-size: 12px; }
  header .app-container { padding-top: 10px; padding-bottom: 10px; }

  /* Cards & banner */
  .card { padding: 16px; }
  .today-banner { padding: 18px; flex-direction: column; align-items: stretch; }
  .today-day { font-size: 18px; }
  .today-btn { padding: 11px 18px; font-size: 14px; width: 100%; }

  /* Today banner buttons */
  .btn-log { width: 100%; text-align: center; }

  /* Onboarding */
  .step-dot { width: 30px; height: 30px; font-size: 12px; }
  .objectif-card { padding: 18px 14px; }
  .objectif-icon { font-size: 28px; margin-bottom: 8px; }
  .objectif-card h3 { font-size: 14px; }
  .objectif-card p { font-size: 12px; }

  /* Buttons */
  .btn-primary, .btn-secondary { padding: 11px 20px; font-size: 14px; }
  .days-btn { width: 48px; height: 42px; font-size: 14px; }

  /* Inputs */
  .input-with-unit input { padding: 11px 14px; font-size: 14px; }
  select { padding: 11px 14px; font-size: 14px; }

  /* Modals */
  .modal-card { padding: 20px; max-height: 92vh; }
  .modal-title { font-size: 16px; }
  .modal-yt-btn { padding: 11px; font-size: 13px; }
  .rest-session-grid { grid-template-columns: repeat(2, 1fr); }

  /* Day cards — boutons plus accessibles */
  .demo-btn { width: 28px; height: 28px; font-size: 11px; }
  .swap-day-btn { padding: 4px 10px; font-size: 16px; }
  .exercise-item { padding: 8px 0; }
  .exercise-name { font-size: 12px; }

  /* Profile */
  .profile-row { padding: 10px 0; font-size: 13px; }

  /* Historique */
  .history-date { min-width: 70px; font-size: 11px; }
  .history-label { font-size: 12px; }

  /* Session logging */
  .set-row { flex-wrap: wrap; gap: 6px; }
  .set-num { width: 100%; margin-bottom: 4px; }
}

@media (max-width: 380px) {
  .app-container { padding-left: 10px; padding-right: 10px; }
  .card { padding: 14px; border-radius: 10px; }
  .modal-card { padding: 16px; }
  .objectif-card { padding: 14px 10px; }
  .today-day { font-size: 16px; }
  .step-line { max-width: 60px; }
  .days-btn { width: 44px; height: 40px; }
}

/* Touch-friendly : agrandit la zone tactile sur écrans tactiles */
@media (hover: none) and (pointer: coarse) {
  .demo-btn, .swap-btn { min-width: 30px; min-height: 30px; }
  .nav-btn { min-height: 36px; }
}

/* ===== Volume par muscle ===== */
.vol-row {
  display: grid;
  grid-template-columns: 130px 1fr 130px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #1f2937;
}
.vol-row:last-of-type { border-bottom: none; }
.vol-name { font-size: 13px; font-weight: 600; color: #d1d5db; }
.vol-bar-wrap {
  position: relative;
  height: 10px;
  background: #1f2937;
  border-radius: 5px;
  overflow: hidden;
}
.vol-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
}
.vol-target {
  position: absolute; top: -2px; bottom: -2px;
  width: 2px; background: rgba(255,255,255,.4);
  pointer-events: none;
}
.vol-val {
  font-size: 13px; font-weight: 700; text-align: right;
  white-space: nowrap;
}
.vol-target-txt { color: #6b7280; font-weight: 500; font-size: 11px; }
.vol-legend {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #1f2937;
  font-size: 11px; color: #6b7280; line-height: 1.5;
}

@media (max-width: 640px) {
  .vol-row {
    grid-template-columns: 100px 1fr 100px;
    gap: 8px;
  }
  .vol-name { font-size: 12px; }
  .vol-val  { font-size: 12px; }
  .vol-target-txt { display: none; }
}

/* ===== Badges ===== */
.badges-header {
  font-size: 13px; color: #fb923c; font-weight: 700;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid #1f2937;
}
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.badge-item {
  padding: 14px 12px;
  background: #1a2035;
  border: 1px solid #1f2937;
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
  cursor: default;
}
.badge-item.earned {
  background: linear-gradient(135deg, rgba(249,115,22,.12), rgba(249,115,22,.04));
  border-color: rgba(249,115,22,.4);
}
.badge-item.locked { opacity: 0.45; filter: saturate(0.4); }
.badge-icon { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.badge-name { font-size: 12px; font-weight: 800; color: #f1f5f9; margin-bottom: 3px; }
.badge-item.earned .badge-name { color: #fb923c; }
.badge-desc { font-size: 10px; color: #9ca3af; line-height: 1.3; }

@media (max-width: 480px) {
  .badges-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .badge-item { padding: 10px 8px; }
  .badge-icon { font-size: 24px; }
  .badge-name { font-size: 11px; }
  .badge-desc { font-size: 9px; }
}

/* Light theme */
body.theme-light .vol-bar-wrap { background: #e5e7eb; }
body.theme-light .vol-name { color: #1f2937; }
body.theme-light .vol-target { background: rgba(0,0,0,.25); }
body.theme-light .badge-item { background: #ffffff; border-color: #e5e7eb; }
body.theme-light .badge-item.earned {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-color: #fdba74;
}
body.theme-light .badge-name { color: #1f2937; }
body.theme-light .badge-desc { color: #6b7280; }

/* ===== Recherche historique ===== */
.history-search-wrap {
  display: flex; align-items: center; gap: 6px;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px;
  padding: 4px 10px; margin-bottom: 12px;
  transition: border-color 0.2s;
}
.history-search-wrap:focus-within { border-color: #f97316; }
.history-search-icon { font-size: 13px; opacity: 0.6; }
.history-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: white; padding: 9px 0; font-size: 14px; min-width: 0;
}
.history-search-clear {
  background: transparent; border: none; color: #6b7280;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  font-size: 11px; transition: all 0.2s;
}
.history-search-clear:hover { background: #374151; color: #d1d5db; }

/* ===== Stagnation ===== */
.stag-item {
  display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: rgba(245,158,11,.06);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
}
.stag-item:last-child { margin-bottom: 0; }
.stag-icon { font-size: 20px; flex-shrink: 0; }
.stag-content { flex: 1; min-width: 0; }
.stag-name { font-size: 13px; font-weight: 700; color: #f1f5f9; margin-bottom: 3px; }
.stag-msg  { font-size: 12px; color: #9ca3af; line-height: 1.4; }
.stag-msg b { color: #fbbf24; font-weight: 700; }
.stag-more { font-size: 12px; color: #6b7280; text-align: center; margin-top: 8px; }

/* ===== Toggle thème ===== */
.theme-toggle {
  display: inline-flex;
  background: #1f2937; border: 1px solid #374151; border-radius: 10px; padding: 2px;
}
.theme-toggle-btn {
  background: transparent; border: none; padding: 7px 11px;
  font-size: 14px; cursor: pointer; border-radius: 8px;
  color: #6b7280; transition: all 0.2s;
}
.theme-toggle-btn:hover { color: #d1d5db; }
.theme-toggle-btn.active { background: #f97316; color: white; }

/* ===================================================
   MODE CLAIR — Overrides
   =================================================== */
body.theme-light {
  background: #f9fafb !important;
  color: #1f2937 !important;
}
/* Texte par défaut : tout ce qui hérite du body devient sombre */
body.theme-light, body.theme-light * { color: inherit; }
/* Overrides des classes Tailwind qui imposent une couleur claire */
body.theme-light.text-gray-100,
body.theme-light .text-gray-100,
body.theme-light .text-white { color: #111827 !important; }
body.theme-light .text-gray-400 { color: #4b5563 !important; }
body.theme-light .text-gray-500 { color: #6b7280 !important; }
body.theme-light .text-gray-600 { color: #9ca3af !important; }
body.theme-light .text-orange-400 { color: #ea580c !important; }
body.theme-light .text-red-400   { color: #dc2626 !important; }
/* Inline styles agressifs (style="color:#XXX") — on les neutralise sur les grands écrans de texte */
body.theme-light [style*="color:#9ca3af"],
body.theme-light [style*="color: #9ca3af"] { color: #4b5563 !important; }
body.theme-light [style*="color:#6b7280"],
body.theme-light [style*="color: #6b7280"] { color: #6b7280 !important; }
body.theme-light [style*="color:#4b5563"] { color: #6b7280 !important; }
/* Backgrounds rgba foncés inline */
body.theme-light [style*="background:rgba(249,115,22,0.06)"],
body.theme-light [style*="background:rgba(249,115,22,0.08)"] { background: #fff7ed !important; }
body.theme-light [style*="background:rgba(20,184,166,0.08)"] { background: #ccfbf1 !important; }
body.theme-light [style*="background:#0d1117"] { background: #f3f4f6 !important; }
body.theme-light [style*="background:rgba(249,115,22,0.2)"] { background: #fed7aa !important; }
body.theme-light header { background: rgba(255,255,255,.9) !important; border-color: #e5e7eb !important; }
body.theme-light .card,
body.theme-light .modal-card,
body.theme-light .editor-day {
  background: #ffffff !important; border-color: #e5e7eb !important; color: #111827 !important;
}
body.theme-light .today-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%) !important;
  border-color: #fed7aa !important;
}
body.theme-light .today-day { color: #111827 !important; }
body.theme-light .today-sub,
body.theme-light .today-meta,
body.theme-light .today-greet { color: #374151 !important; }
body.theme-light .input-with-unit,
body.theme-light select,
body.theme-light .history-search-wrap,
body.theme-light .session-notes-textarea,
body.theme-light .editor-day-label,
body.theme-light .editor-day-type {
  background: #f3f4f6 !important; border-color: #d1d5db !important; color: #111827 !important;
}
body.theme-light .input-with-unit input,
body.theme-light .history-search-input,
body.theme-light .session-notes-textarea { color: #111827 !important; }
body.theme-light .input-with-unit span { color: #6b7280 !important; border-color: #d1d5db !important; }
body.theme-light .day-card {
  background: #ffffff !important; border-color: #e5e7eb !important;
}
body.theme-light .day-card .day-name,
body.theme-light .exercise-name,
body.theme-light .session-ex-name,
body.theme-light .detail-ex-name,
body.theme-light .detail-stat-val,
body.theme-light .pr-name,
body.theme-light .bw-val,
body.theme-light h1, body.theme-light h2, body.theme-light h3,
body.theme-light .text-white { color: #111827 !important; }
body.theme-light .text-gray-100 { color: #111827 !important; }
body.theme-light .text-gray-400, body.theme-light .text-gray-500 { color: #6b7280 !important; }
body.theme-light .nav-btn { color: #6b7280; }
body.theme-light .nav-btn:hover { color: #111827; background: #f3f4f6; }
body.theme-light .nav-btn.active { color: #f97316; background: #fff7ed; }
body.theme-light .btn-auth { color: #374151; border-color: #d1d5db; }
body.theme-light .btn-auth:hover { color: #111827; border-color: #6b7280; }
body.theme-light .btn-secondary { color: #374151; border-color: #d1d5db; }
body.theme-light .btn-secondary:hover { color: #111827; border-color: #9ca3af; }
body.theme-light .history-item { background: transparent; }
body.theme-light .history-item:hover { background: #fff7ed; }
body.theme-light .history-label { color: #111827; }
body.theme-light .history-date { color: #6b7280; }
body.theme-light .toast { background: #16a34a; color: white; }
body.theme-light .exercise-list { color: #374151; }
body.theme-light .exercise-name { color: #1f2937 !important; }
body.theme-light .prog-item { background: #ffffff; border-color: #e5e7eb; }
body.theme-light .prog-name { color: #1f2937; }
body.theme-light .pr-row { background: #fff7ed; }
body.theme-light .bw-list-item { background: #f3f4f6; color: #1f2937; }
body.theme-light .editor-ex-row { background: #f3f4f6; }
body.theme-light .editor-ex-name { color: #111827; }
body.theme-light .cal-cell { background: #f3f4f6; }
body.theme-light .cal-num { color: #111827; }
body.theme-light .cal-done    { background: #dcfce7; border-color: #86efac; }
body.theme-light .cal-planned { background: #fff7ed; border-color: #fed7aa; }
body.theme-light .cal-missed  { background: #fee2e2; border-color: #fca5a5; }
body.theme-light .cal-rest    { background: #e0e7ff; border-color: #c7d2fe; }
body.theme-light .modal-overlay { background: rgba(0,0,0,.4) !important; }
body.theme-light .detail-set      { background: #f3f4f6; }
body.theme-light .detail-set-val  { color: #111827; }
body.theme-light .detail-summary .detail-stat { background: #fff7ed; }
body.theme-light .detail-notes-view { background: #eef2ff; }
body.theme-light .detail-notes-text { color: #1f2937; }
body.theme-light .split-badge { background: #fff7ed; color: #c2410c; }
body.theme-light .week-badge { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
body.theme-light .swap-option,
body.theme-light .swap-day-option,
body.theme-light .pr-edit-btn,
body.theme-light .session-rm-btn,
body.theme-light .editor-rm-btn,
body.theme-light .editor-move-btn { background: #ffffff; border-color: #d1d5db; color: #374151; }
body.theme-light .demo-btn { background: #ffffff; border-color: #d1d5db; color: #6b7280; }
body.theme-light .btn-set-toggle { background: #ffffff; border-color: #d1d5db; color: #374151; }
body.theme-light .bg-gray-900, body.theme-light .bg-gray-900\/80, body.theme-light .bg-gray-950 { background: #ffffff !important; }
body.theme-light footer { color: #9ca3af; }

/* L'export PDF utilise désormais jsPDF (génération directe). Le @media print est conservé minimal pour Ctrl+P éventuel. */
@media print {
  header, footer, nav, .today-btn, .btn-log, .btn-primary, .btn-secondary,
  #session-card, #toast, #rest-timer { display: none !important; }
  body { background: white !important; color: black !important; }
}
