/* ================= CoachFitMax — DA type Tasq ================= */
:root{
  --bg:        #0a0b10;
  --bg-2:      #0d0e15;
  --panel:     rgba(255,255,255,.035);
  --panel-2:   rgba(255,255,255,.055);
  --border:    rgba(255,255,255,.08);
  --border-2:  rgba(255,255,255,.14);
  --text:      #e8eaf0;
  --muted:     #8b90a3;
  --lime:      #b6f23c;
  --lime-soft: rgba(182,242,60,.14);
  /* Statut FIXE (fait/pas fait) — jamais modifie par le branding coach */
  --ok:        #4ade80;
  --ok-soft:   rgba(74,222,128,.15);
  --violet:    #7c5cff;
  --violet-2:  #9b7bff;
  --amber:     #f5b544;
  --amber-soft:rgba(245,181,68,.16);
  --red:       #ff5c6c;
  --red-soft:  rgba(255,92,108,.16);
  --teal:      #16d6c4;
  --orange:    #ff7a3d;
  --radius:    16px;
  --radius-sm: 10px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  /* Police des titres : par défaut identique au corps (--font).
     Le coach peut la surcharger dans sa personnalisation. */
  --font-head: var(--font);
  font-family: var(--font);
}

/* Les titres suivent la police de titre choisie par le coach */
.hero h1, .panel-head h2, .panel h3{ font-family: var(--font-head); }

/* ============ MODE CLAIR (jour) ============ */
html[data-theme="light"]{
  --bg:        #f2f4f8;
  --bg-2:      #e9ebf1;
  --panel:     #ffffff;
  --panel-2:   #f1f3f7;
  --border:    rgba(0,0,0,.10);
  --border-2:  rgba(0,0,0,.17);
  --text:      #171922;
  --muted:     #5b6070;
  --lime-soft: rgba(74,222,128,.16);
  --ok-soft:   rgba(74,222,128,.18);
  --violet-2:  #6a4cff;
}
/* Surfaces au fond codé en dur -> clair */
html[data-theme="light"] .topbar{ background:rgba(255,255,255,.85); }
html[data-theme="light"] .mobilenav{ background:rgba(255,255,255,.97) !important; }
html[data-theme="light"] .timer-bar{ background:rgba(255,255,255,.97); }
html[data-theme="light"] body::before,
html[data-theme="light"] body::after{ opacity:.10; }
/* Panneaux : ombre douce plutôt que bord translucide */
html[data-theme="light"] .panel{ box-shadow:0 1px 3px rgba(0,0,0,.06); }
html[data-theme="light"] .brand .logo,
html[data-theme="light"] .btn-lime{ color:#0a2f16; }

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{
  background: var(--bg);
  color: var(--text);
  min-height:100vh;
  line-height:1.5;
  position:relative;
  overflow-x:hidden;
}
/* Glows colorés en fond (comme Tasq) */
body::before, body::after{
  content:""; position:fixed; z-index:0; pointer-events:none;
  width:60vw; height:60vh; border-radius:50%; filter:blur(120px); opacity:.20;
}
body::before{ top:-10%; right:-5%;
  background: radial-gradient(circle, var(--orange), transparent 65%); }
body::after{ bottom:-15%; left:-5%;
  background: radial-gradient(circle, var(--teal), transparent 65%); }

a{ color:inherit; text-decoration:none; }
.container{ max-width:1240px; margin:0 auto; padding:0 24px; position:relative; z-index:1; }

/* ---------------- Topbar ---------------- */
.topbar{
  position:sticky; top:0; z-index:20;
  background: rgba(10,11,16,.82); backdrop-filter: blur(14px);
  border-bottom:1px solid var(--border);
  /* Réserve la barre d'état du téléphone (iPhone à encoche, viewport-fit=cover) */
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner{ display:flex; align-items:center; gap:16px; height:60px; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:18px;
  flex:none; white-space:nowrap; }
.brand .logo{
  width:32px; height:32px; border-radius:9px;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  display:grid; place-items:center; color:#0a0b10; font-weight:900; font-size:16px;
}
.brand b{ color:var(--lime); }
/* Nav sur une seule ligne : defilement horizontal discret plutot qu'un retour a la ligne */
.nav{ display:flex; gap:3px; flex:1; min-width:0; flex-wrap:nowrap;
  overflow-x:auto; scrollbar-width:none; }
.nav::-webkit-scrollbar{ display:none; }
.nav a{
  padding:8px 12px; border-radius:10px; color:var(--muted); white-space:nowrap;
  font-size:14px; font-weight:600; transition:.15s;
}
.nav a:hover{ color:var(--text); background:var(--panel); }
.nav a.active{ color:var(--text); background:var(--panel-2); }
.topbar .right{ display:flex; align-items:center; gap:12px; flex:none; }
#theme-toggle{ flex:none; }

/* ---------------- Boutons ---------------- */
.btn{
  display:inline-flex; align-items:center; gap:8px; cursor:pointer;
  border:none; border-radius:11px; padding:10px 16px;
  font-size:14px; font-weight:700; transition:.15s; font-family:inherit;
}
.btn-primary{ background: linear-gradient(135deg, var(--violet), var(--violet-2)); color:#fff; }
.btn-primary:hover{ filter:brightness(1.1); transform:translateY(-1px); }
.btn-lime{ background: var(--lime); color:#0a0b10; }
.btn-lime:hover{ filter:brightness(1.05); transform:translateY(-1px); }
.btn-ghost{ background: var(--panel); color:var(--text); border:1px solid var(--border); }
.btn-ghost:hover{ background: var(--panel-2); }
.btn-danger{ background:var(--red-soft); color:var(--red); }
.btn-danger:hover{ background:var(--red); color:#fff; }
.btn-sm{ padding:6px 11px; font-size:13px; border-radius:9px; }
.btn-block{ width:100%; justify-content:center; }

/* ---------------- Cartes / panneaux ---------------- */
.grid{ display:grid; gap:18px; }
.panel{
  background: var(--panel); border:1px solid var(--border);
  border-radius: var(--radius); padding:22px;
}
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px; }
.panel-head h2{ font-size:16px; font-weight:800; display:flex; gap:9px; align-items:center; }
.panel h3{ font-size:15px; font-weight:700; }

/* ---------------- Hero titre ---------------- */
.hero h1{ font-size:30px; font-weight:900; letter-spacing:-.5px; }
.hero h1 .green{ color:var(--lime); }
.hero .sub{ color:var(--muted); margin-top:4px; font-size:14px; }

/* ---------------- Stat pills ---------------- */
.stats{ display:flex; gap:12px; flex-wrap:wrap; margin:22px 0; }
.stat{
  background: var(--panel); border:1px solid var(--border);
  border-radius:14px; padding:14px 20px; min-width:120px;
  display:flex; flex-direction:column; gap:2px;
}
.stat .n{ font-size:24px; font-weight:900; }
.stat .l{ font-size:12px; color:var(--muted); font-weight:600; }
.stat.lime .n{ color:var(--lime); }
.stat.amber .n{ color:var(--amber); }
.stat.violet .n{ color:var(--violet-2); }
.stat.glow{ background: radial-gradient(120% 120% at 100% 0, rgba(255,122,61,.16), var(--panel)); }

/* ---------------- Chips / badges ---------------- */
.chip{
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:800;
  letter-spacing:.4px; text-transform:uppercase;
}
.chip-lime{ background:var(--lime-soft); color:var(--lime); }
.chip-amber{ background:var(--amber-soft); color:var(--amber); }
.chip-red{ background:var(--red-soft); color:var(--red); }
.chip-violet{ background:rgba(124,92,255,.16); color:var(--violet-2); }
.chip-ghost{ background:var(--panel-2); color:var(--muted); border:1px solid var(--border); }

/* ---------------- Listes séances / exos ---------------- */
.row-item{
  display:flex; align-items:center; gap:14px;
  padding:14px 16px; border:1px solid var(--border); border-radius:12px;
  background: var(--bg-2); transition:.15s;
}
.row-item:hover{ border-color:var(--border-2); }
.row-item + .row-item{ margin-top:10px; }
.row-item .grow{ flex:1; min-width:0; }
.row-item .title{ font-weight:700; font-size:15px; }
.row-item .meta{ color:var(--muted); font-size:13px; margin-top:2px; }

/* Grande carte séance cliquable */
.seance-card{
  display:block; padding:20px; border-radius:16px; border:1px solid var(--border);
  background: linear-gradient(135deg, rgba(124,92,255,.10), var(--panel));
  transition:.18s;
}
.seance-card:hover{ transform:translateY(-3px); border-color:var(--violet); }
.seance-card .day{ color:var(--lime); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.6px; }
.seance-card .name{ font-size:18px; font-weight:800; margin:6px 0 10px; }

/* ---------------- Forms ---------------- */
label{ display:block; font-size:13px; font-weight:600; color:var(--muted); margin-bottom:6px; }
input, textarea, select{
  width:100%; background: var(--bg-2); border:1px solid var(--border);
  color:var(--text); border-radius:10px; padding:11px 13px; font-size:14px;
  font-family:inherit; transition:.15s;
}
input:focus, textarea:focus, select:focus{ outline:none; border-color:var(--violet); }
textarea{ resize:vertical; min-height:90px; }
.field{ margin-bottom:14px; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-row-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.form-row-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }

/* ---------------- Flash ---------------- */
.flash{ padding:12px 16px; border-radius:11px; margin-bottom:16px; font-weight:600; font-size:14px; }
.flash.ok{ background:var(--lime-soft); color:var(--lime); }
.flash.error{ background:var(--red-soft); color:var(--red); }

/* ---------------- Tables ---------------- */
table{ width:100%; border-collapse:collapse; font-size:14px; }
th{ text-align:left; color:var(--muted); font-size:12px; text-transform:uppercase;
    letter-spacing:.5px; padding:10px 12px; border-bottom:1px solid var(--border); }
td{ padding:12px; border-bottom:1px solid var(--border); }
tr:last-child td{ border-bottom:none; }

/* --- Vue "aujourd'hui" sur les cartes clients (dashboard coach) --- */
.card-day-ok{ border-left:4px solid var(--ok) !important; }
.card-day-todo{ border-left:4px solid var(--red) !important; }
.today-row{ display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
.today-chip{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700;
  padding:5px 10px; border-radius:9px; border:1px solid var(--border); background:var(--panel-2); color:var(--muted); }
.today-chip.done{ color:var(--ok); border-color:rgba(74,222,128,.45); background:var(--ok-soft); }
.today-chip.todo{ color:var(--red);  border-color:rgba(255,92,108,.45); background:var(--red-soft); }
.today-chip.rest{ color:var(--muted); }

/* Édition inline d'un exercice (fiche coach) */
.exo-edit{ padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--bg-2); margin-bottom:10px; }
.exo-edit input, .exo-edit select{ font-size:13px; padding:8px 10px; }

/* Sélecteur RPE (ressenti de séance) */
.rpe-dot{ width:42px; height:42px; border-radius:10px; border:1px solid var(--border);
  background:var(--bg-2); color:var(--muted); font-weight:800; cursor:pointer; font-family:inherit; font-size:15px; }
.rpe-dot.on{ background:var(--amber); color:#0a0b10; border-color:var(--amber); }

/* Minuteur de repos (séance) */
#rest-bar{ display:none; position:fixed; left:50%; transform:translateX(-50%); bottom:82px; z-index:45;
  gap:16px; align-items:center; padding:12px 20px; border-radius:14px;
  background:rgba(13,14,21,.97); backdrop-filter:blur(10px); border:1px solid var(--teal);
  box-shadow:0 8px 30px rgba(0,0,0,.45); }
#rest-time{ font-size:26px; font-weight:900; color:var(--teal); font-variant-numeric:tabular-nums; }
/* Record battu (surcharge progressive) */
.set-line.pr .in-poids{ border-color:var(--lime); box-shadow:0 0 0 2px var(--lime-soft); }
.set-line.pr .snum{ color:var(--lime); }

/* Progression de séance */
.seance-progress{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.sp-bar{ flex:1; height:10px; background:var(--panel-2); border-radius:99px; overflow:hidden; }
.sp-bar > span{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--lime),var(--teal)); border-radius:99px; transition:width .3s; }

/* Steppers +/- (poids & reps) */
.stepper{ display:flex; align-items:center; gap:5px; }
.stepper .st{ width:40px; height:46px; flex:none; border:1px solid var(--border); background:var(--bg-2);
  color:var(--text); border-radius:10px; font-size:22px; font-weight:800; cursor:pointer; font-family:inherit; line-height:1; }
.stepper .st:active{ background:var(--lime); color:#0a0b10; border-color:var(--lime); }
.stepper input{ text-align:center; height:46px; font-size:17px; min-width:0; padding:8px 4px; }
.set-line .check{ width:46px; height:46px; font-size:20px; }
@media(max-width:420px){ .stepper .st{ width:32px; height:44px; font-size:19px; } .stepper input{ font-size:15px; } }

/* Overlay résumé de fin de séance */
.overlay{ display:none; position:fixed; inset:0; z-index:60; background:rgba(6,7,11,.86);
  backdrop-filter:blur(6px); align-items:center; justify-content:center; padding:20px; }
.overlay-card{ background:var(--bg-2); border:1px solid var(--border); border-radius:18px; padding:26px; max-width:440px; width:100%; }
.recap-stat{ display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid var(--border); font-size:15px; }
.recap-stat:last-of-type{ border-bottom:none; }
.recap-stat b{ font-size:19px; }

/* Modal vidéo */
.vmodal{ display:none; position:fixed; inset:0; z-index:60; background:rgba(6,7,11,.92); align-items:center; justify-content:center; padding:20px; }
.vmodal iframe, .vmodal video{ width:100%; aspect-ratio:16/9; border:none; border-radius:14px; background:#000; }
.vmodal-inner{ width:100%; max-width:820px; }
.vmodal-head{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:10px; color:var(--text); font-weight:700; }
.brand-logo{ height:34px; width:auto; max-width:120px; border-radius:8px; object-fit:contain;
  vertical-align:middle; }

/* Classement / defis */
.lead-row{ display:flex; align-items:center; gap:12px; padding:11px 0;
  border-top:1px solid var(--border); }
.lead-row:first-of-type{ border-top:none; }
.lead-rang{ width:34px; text-align:center; font-weight:900; font-size:17px; flex:none; }
.lead-val{ font-weight:800; font-size:16px; min-width:44px; text-align:right; }
.lead-me{ background:var(--lime-soft); border-radius:12px; padding-left:10px; padding-right:10px;
  margin:2px 0; border-top:none; }

/* Ressenti post-seance (echelles 1-5) */
.ressenti-line{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:8px 0; font-size:14px; font-weight:600; }
.scale{ display:flex; gap:6px; }
.scale-dot{ width:38px; height:38px; border-radius:10px; border:1px solid var(--border);
  background:var(--panel-2); color:var(--muted); font-weight:800; cursor:pointer; }
.scale-dot.on{ background:var(--lime); color:#0a0b10; border-color:var(--lime); }

/* Comparateur avant/apres */
.cmp{ position:relative; width:100%; max-width:460px; margin:14px auto 0;
  aspect-ratio:3/4; border-radius:14px; overflow:hidden; background:#000; }
.cmp-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.cmp-before{ clip-path:inset(0 50% 0 0); }
.cmp-handle{ position:absolute; top:0; bottom:0; left:50%; width:3px;
  background:#fff; box-shadow:0 0 8px rgba(0,0,0,.6); transform:translateX(-1.5px); pointer-events:none; }

/* Planning de la semaine */
.planning-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
.plan-day{ background:var(--panel); border:1px solid var(--border); border-radius:12px;
  padding:8px 6px; min-height:110px; }
.plan-today{ border-color:var(--lime); box-shadow:0 0 0 1px var(--lime) inset; }
.plan-head{ display:flex; align-items:center; gap:4px; margin-bottom:6px; }
.plan-nom{ font-size:11px; text-transform:uppercase; color:var(--muted); font-weight:800; }
.plan-num{ font-size:15px; font-weight:900; }
.plan-ok{ margin-left:auto; font-size:12px; }
.plan-item{ font-size:11px; background:var(--panel-2); border-radius:7px; padding:5px 6px;
  margin-bottom:5px; line-height:1.3; }
.plan-item.repos{ color:var(--muted); }
.plan-item.rdv{ background:rgba(124,92,255,.16); color:var(--violet-2); }
.plan-empty{ color:var(--muted); font-size:12px; text-align:center; padding-top:14px; }

/* Niveaux & XP */
.xp-head{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  flex-wrap:wrap; margin-bottom:10px; }
.xp-niv{ font-weight:900; font-size:17px; color:var(--lime); }
.xp-bar{ height:12px; border-radius:20px; background:var(--panel-2);
  border:1px solid var(--border); overflow:hidden; }
.xp-fill{ height:100%; border-radius:20px;
  background:linear-gradient(90deg, var(--lime), var(--teal)); transition:width .5s; }
@media(max-width:640px){
  .planning-grid{ grid-template-columns:1fr; }
  .plan-day{ min-height:0; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .plan-head{ margin-bottom:0; min-width:70px; }
  .plan-item{ margin-bottom:0; }
}

/* Célébration record */
@keyframes pop{ 0%{transform:scale(.4);opacity:0} 60%{transform:scale(1.2)} 100%{transform:scale(1);opacity:1} }
.pr-burst{ font-size:44px; text-align:center; animation:pop .55s ease; }

/* Barre de progression d'objectif */
.goal-bar{ height:12px; background:var(--panel-2); border-radius:99px; overflow:hidden; margin:8px 0; }
.goal-bar > span{ display:block; height:100%; background:linear-gradient(90deg,var(--lime),var(--teal)); border-radius:99px; }

/* Lignes macros (nutrition) */
.macro{ margin-bottom:16px; }
.macro-head{ display:flex; justify-content:space-between; align-items:baseline; font-size:14px; }
.macro-head b{ font-size:16px; }

/* Liste de courses */
.course-item{ display:flex; align-items:center; gap:9px; padding:7px 0; font-size:14px; break-inside:avoid; cursor:pointer; }
.course-item input{ width:18px; height:18px; flex:none; }
@media(max-width:560px){ .panel div[style*="columns:2"]{ columns:1 !important; } }

/* Graphique : conteneur a hauteur fixe (rendu net a toutes les largeurs) */
.chart-box{ position:relative; height:230px; width:100%; }
/* Tableau large : scroll horizontal propre si besoin (desktop = pleine largeur) */
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* ---------------- Login ---------------- */
.auth-wrap{ min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card{ width:100%; max-width:400px; }
.auth-card .brand{ justify-content:center; font-size:24px; margin-bottom:6px; }
.auth-card .brand .logo{ width:44px; height:44px; font-size:22px; border-radius:12px; }
.demo-creds{ margin-top:18px; font-size:12.5px; color:var(--muted); text-align:center; line-height:1.7; }
.demo-creds code{ background:var(--panel-2); padding:2px 7px; border-radius:6px; color:var(--lime); }
.cred-btn{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; width:100%;
  margin-top:8px; padding:9px 12px; border:1px solid var(--border); border-radius:10px;
  background:var(--panel-2); color:var(--muted); font-size:12.5px; text-align:left;
  cursor:pointer; transition:.15s; }
.cred-btn:hover{ border-color:var(--lime); background:var(--lime-soft); }
.cred-role{ font-weight:800; color:var(--text); min-width:78px; }
.google-btn{ background:#fff; color:#1f1f1f; border:none; font-weight:600; }
.google-btn:hover{ background:#f2f2f2; }
.sep{ display:flex; align-items:center; gap:12px; margin:16px 0; color:var(--muted); font-size:12px; }
.sep::before, .sep::after{ content:""; flex:1; height:1px; background:var(--border); }

/* ---------------- Séance live ---------------- */
.timer-bar{
  position:sticky; top:calc(60px + env(safe-area-inset-top, 0px)); z-index:15;
  background: linear-gradient(135deg, rgba(182,242,60,.14), var(--bg-2));
  border:1px solid var(--border); border-radius:14px;
  padding:14px 20px; display:flex; align-items:center; justify-content:space-between;
  margin-bottom:20px;
}
.timer-bar .time{ font-size:32px; font-weight:900; font-variant-numeric:tabular-nums; color:var(--lime); }
.exo-block{ margin-bottom:16px; }
.exo-block .exo-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; gap:10px; }
.exo-block .exo-name{ font-size:16px; font-weight:800; }
.exo-block .exo-target{ font-size:13px; color:var(--muted); }
.set-line{
  display:grid; grid-template-columns:44px 1fr 1fr 46px; gap:10px; align-items:center;
  padding:8px 0;
}
.set-line .snum{ color:var(--muted); font-weight:700; font-size:13px; text-align:center; }
.set-line input{ padding:9px 11px; text-align:center; }
.set-line .check{
  width:40px; height:40px; border-radius:10px; border:1px solid var(--border);
  background:var(--bg-2); cursor:pointer; display:grid; place-items:center;
  font-size:18px; color:var(--muted); transition:.15s;
}
.set-line .check.on{ background:var(--lime); color:#0a0b10; border-color:var(--lime); }
.set-head{ display:grid; grid-template-columns:44px 1fr 1fr 46px; gap:10px;
  font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.5px;
  padding-bottom:4px; font-weight:700; }
.last-hint{ font-size:12px; color:var(--violet-2); }

/* ---------------- Chat / check-in ---------------- */
.chat{ display:flex; flex-direction:column; gap:12px; margin-bottom:18px; }
.bubble{ max-width:78%; padding:12px 16px; border-radius:16px; font-size:14px; }
.bubble .who{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; margin-bottom:4px; opacity:.8; }
.bubble.client{ align-self:flex-end; background:var(--violet); color:#fff; border-bottom-right-radius:5px; }
.bubble.coach{ align-self:flex-start; background:var(--panel-2); border:1px solid var(--border); border-bottom-left-radius:5px; }
.bubble .time{ font-size:10.5px; opacity:.6; margin-top:5px; }

/* ---------------- Progress bar ---------------- */
.progress{ height:8px; background:var(--panel-2); border-radius:99px; overflow:hidden; }
.progress > span{ display:block; height:100%; background:linear-gradient(90deg,var(--lime),var(--teal)); border-radius:99px; }

/* ---------------- Divers ---------------- */
.page{ padding:28px 0 60px; }
.section + .section{ margin-top:20px; }
.muted{ color:var(--muted); }
.empty{ text-align:center; padding:40px 20px; color:var(--muted); }
.empty .big{ font-size:42px; margin-bottom:10px; }
.photo-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.photo-grid img{ width:100%; height:180px; object-fit:cover; border-radius:12px; border:1px solid var(--border); }
.tabs{ display:flex; gap:6px; margin-bottom:20px; flex-wrap:wrap; border-bottom:1px solid var(--border); padding-bottom:0; }
.tabs a{ padding:10px 16px; color:var(--muted); font-weight:700; font-size:14px; border-bottom:2px solid transparent; }
.tabs a.active{ color:var(--lime); border-bottom-color:var(--lime); }
.avatar{ width:40px; height:40px; border-radius:11px; background:linear-gradient(135deg,var(--violet),var(--teal));
  display:grid; place-items:center; font-weight:800; color:#fff; flex-shrink:0; }
.avatar.lg{ width:56px; height:56px; font-size:20px; border-radius:14px; }

/* Grille 2 colonnes qui se replie en 1 sur mobile (remplace les styles inline) */
.grid-2{ display:grid; gap:18px; grid-template-columns:1.4fr 1fr; }

/* Barre de navigation mobile (bottom bar facon appli) */
.mobilenav{ display:none; }
.hide-mobile{ display:inline-flex; }

@media(max-width:860px){
  .grid-2{ grid-template-columns:1fr; }
}

@media(max-width:720px){
  .container{ padding:0 16px; }
  .form-row, .form-row-3, .form-row-4{ grid-template-columns:1fr; }
  .hero h1{ font-size:23px; }
  .nav{ display:none; }               /* la nav du haut passe en bas (mobilenav) */
  .hide-mobile{ display:none; }

  /* Graphique un peu plus compact sur mobile */
  .chart-box{ height:190px; }

  /* Tableaux marques .cards -> cartes empilees lisibles (label : valeur) */
  table.cards, table.cards thead, table.cards tbody, table.cards tr, table.cards td{ display:block; width:auto; }
  table.cards thead{ display:none; }
  table.cards tr{ border:1px solid var(--border); border-radius:12px; background:var(--bg-2);
    padding:4px 14px; margin-bottom:10px; }
  table.cards td{ display:flex; justify-content:space-between; align-items:center; gap:16px;
    border:none; padding:10px 0; font-size:14px; text-align:right; }
  table.cards td + td{ border-top:1px solid var(--border); }
  table.cards td::before{ content:attr(data-label); color:var(--muted); font-weight:700;
    font-size:11px; text-transform:uppercase; letter-spacing:.4px; text-align:left; }

  /* Onglets fiche coach : scroll horizontal sur une ligne */
  .tabs{ flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .tabs a{ white-space:nowrap; }

  /* Chrono séance : un peu plus compact */
  .timer-bar{ top:56px; padding:12px 14px; }
  .timer-bar .time{ font-size:26px; }
  .bubble{ max-width:88%; }
  .panel{ padding:18px; }

  /* Espace en bas pour ne pas passer sous la barre de nav mobile */
  .page{ padding-bottom:88px; }

  .mobilenav{
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:40;
    background:rgba(13,14,21,.97); backdrop-filter:blur(16px);
    border-top:1px solid var(--border);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .mobilenav a{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
    min-height:52px; justify-content:center;
    font-size:10.5px; font-weight:700; color:var(--muted);
    padding:6px 2px; border-radius:12px; transition:.15s;
  }
  .mobilenav a span{ font-size:20px; line-height:1; }
  .mobilenav a.active{ color:var(--lime); background:var(--lime-soft); }

  /* Perf mobile : flous décoratifs allégés (evite le jank sur petits appareils) */
  body::before, body::after{ filter:blur(70px); opacity:.14; width:85vw; height:38vh; }
  .topbar{ backdrop-filter:none; background:rgba(10,11,16,.94); }
  .mobilenav{ backdrop-filter:none; background:rgba(13,14,21,.98); }
}

/* ---- Visuel illustre des recettes (fallback quand pas de photo) ---- */
.recette-illus{
  width:100%; height:160px; border-radius:12px; margin-bottom:12px;
  display:flex; align-items:center; justify-content:center;
  font-size:64px; line-height:1;
  background:
    radial-gradient(120% 120% at 20% 15%, rgba(124,92,255,.38), transparent 55%),
    radial-gradient(120% 120% at 85% 90%, rgba(22,214,196,.34), transparent 55%),
    linear-gradient(135deg, #16182210, #1b1e2a);
  border:1px solid var(--border);
  box-shadow: inset 0 0 40px rgba(124,92,255,.10);
}
.recette-illus-sm{
  width:48px; height:48px; flex:none; margin:0;
  font-size:26px; border-radius:10px;
}

@media(max-width:420px){
  .hero h1{ font-size:21px; }
  .stat{ min-width:calc(50% - 6px); flex:1; }   /* 2 stats par ligne */
  .set-line{ grid-template-columns:34px 1fr 1fr 42px; gap:7px; }
  .timer-bar .time{ font-size:23px; }
}

/* ---- Etage admin ---- */
.text-red, .red{ color:var(--red); }
.text-green, .green{ color:var(--lime); }

.imp-banner{
  background: linear-gradient(90deg, rgba(245,181,68,.16), rgba(245,181,68,.06));
  border-bottom:1px solid rgba(245,181,68,.4);
}
.imp-inner{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 16px; font-size:13.5px; font-weight:600; color:var(--amber); }
.imp-inner .btn{ background:var(--amber); color:#1a1400; border:none; font-weight:800; white-space:nowrap; }

.avatar-mini{
  width:40px; height:40px; flex:none; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:16px; color:#0a0b10;
  background: linear-gradient(135deg, var(--lime), var(--teal));
}
label.check{ display:flex; align-items:center; gap:8px; font-size:14px; color:var(--muted);
  font-weight:600; cursor:pointer; margin-top:6px; }
label.check input{ width:auto; }
.input-sm{ padding:8px 10px; font-size:13px; border-radius:9px;
  background:var(--panel-2); border:1px solid var(--border); color:var(--text); }

/* Facturation */
.fact-bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.month-nav{ display:flex; align-items:center; gap:10px; }
.month-cur{ font-weight:800; font-size:16px; min-width:84px; text-align:center; }
.fact-coach{ margin-bottom:14px; }
.fact-line{ display:flex; align-items:center; gap:12px; padding:10px 0;
  border-top:1px solid var(--border); }
.fact-type{ flex:1; font-weight:700; font-size:14px; }
.fact-montant{ min-width:120px; text-align:right; font-weight:800; }
.fact-ca{ display:flex; align-items:end; gap:10px; flex-wrap:wrap;
  margin-top:12px; padding-top:12px; border-top:1px dashed var(--border); }
.fact-ca .field{ margin:0; }
.fact-ca label{ font-size:12px; }
.fact-ca input{ max-width:160px; }
@media(max-width:560px){
  .fact-line{ flex-wrap:wrap; }
  .fact-montant{ min-width:0; text-align:left; }
}
