    /* ==================================================================
       DESIGN TOKENS (refonte 3.0)
       Une seule source de vérité pour les couleurs, la typographie et
       les rayons. Les anciens noms (--bg-dark, --bg-card, --text-muted…)
       sont conservés comme alias pour que tout le CSS existant continue
       de fonctionner ; les nouveaux composants (css/design.css) utilisent
       les tokens courts (--bg, --surface, --text-2…). Le thème clair
       redéfinit les mêmes tokens dans css/ui.css.
       ================================================================== */
    :root {
      /* Surfaces : neutres, légèrement bleutées, sans gradient */
      --bg: #0f1115;
      --surface: #161920;
      --surface-2: #1c2029;
      --surface-3: #232833;
      --border: #262b36;
      --border-strong: #343b49;
      /* Relief doux (07/10/2026) : deux niveaux de plus, de part et d'autre
         de la carte. `--raised` = ce qui dépasse (pastille d'un filtre),
         `--sunk` = ce qui est creusé (piste d'un filtre, touche enfoncée). */
      --raised: #262c37;
      --sunk: #0b0d11;

      /* Texte : 3 niveaux suffisent */
      --text: #e8eaee;
      --text-2: #9aa3b2;
      --text-3: #6b7484;

      /* Accent unique (liens, focus, sélection) + sémantique */
      --accent: #4f8cff;
      --accent-soft: rgba(79, 140, 255, 0.14);
      /* Fond du bouton principal : `--accent` est réglé pour être LU sur
         fond sombre, il est trop clair pour porter du texte blanc (3,3:1).
         Celui-ci passe 4,9:1 avec `--on-accent`. */
      --accent-strong: #2f6be0;
      --on-accent: #ffffff;
      --success: #34c77b;
      --success-soft: rgba(52, 199, 123, 0.14);
      --warning: #f0a82d;
      --warning-soft: rgba(240, 168, 45, 0.14);
      --danger: #ef5a6f;
      --danger-soft: rgba(239, 90, 111, 0.14);

      /* Disciplines : 3 teintes distinctes, lisibles sur fond sombre */
      --sport-swim: #22b8cf;
      --sport-bike: #9d8cf5;
      --sport-run: #f5913e;
      /* Ce qui se fait au pas (marche, randonnée) : ni la course ni le
         vélo, d'où une quatrième teinte — cf. js/free-activity.js. */
      --sport-walk: #3fbf95;
      /* Renforcement / PPG (cf. js/ppg.js) : une cinquième teinte, loin du
         violet du vélo et de l'orange de la course. */
      --sport-renfo: #e46fb4;
      --sport-rest: #4a5262;

      /* Vert du logo TriPulse (pastille d'arrivée de la courbe) : marque,
         pas sémantique — ne pas l'utiliser pour « réussi » (--success). */
      --brand-green: #1fb57a;

      /* Zones cardiaques : convention gris → bleu → vert → orange → rouge */
      --zone-1: #8b96a8;
      --zone-2: #4f8cff;
      --zone-3: #34c77b;
      --zone-4: #f0a82d;
      --zone-5: #ef5a6f;

      /* Typographie */
      --font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
      --fs-xs: 12px;
      --fs-sm: 13px;
      --fs-md: 14px;
      --fs-lg: 16px;
      --fs-xl: 20px;
      --fs-2xl: 26px;
      --fs-3xl: 34px;
      /* Chiffres : un chiffre clé de carte, et LE chiffre de l'écran (J-x). */
      --fs-kpi: 28px;
      --fs-hero: 44px;

      /* Rayons & ombres : sobres */
      --r-sm: 6px;
      --r-md: 10px;
      --r-lg: 16px;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
      /* Relief doux : une ombre claire en haut à gauche, une sombre en bas à
         droite. Réservé aux cartes de premier niveau, aux boutons et aux
         filtres — listes, tableaux et kanban restent à plat (cf. design.css).
         Sur fond sombre la lueur claire ne se voit presque pas : c'est la
         bordure qui délimite, l'ombre ne fait qu'asseoir. */
      --shadow-hi: rgba(255, 255, 255, 0.035);
      --shadow-lo: rgba(0, 0, 0, 0.5);
      --elev-raised: 6px 6px 16px var(--shadow-lo), -6px -6px 16px var(--shadow-hi);
      --elev-raised-sm: 2px 2px 6px var(--shadow-lo), -2px -2px 6px var(--shadow-hi);
      --elev-pressed: inset 3px 3px 7px var(--shadow-lo), inset -3px -3px 7px var(--shadow-hi);

      /* ---- Alias historiques (ne pas supprimer) ---- */
      --bg-dark: var(--bg);
      --bg-deep: var(--surface-2);
      --bg-card: var(--surface);
      --border-color: var(--border);
      --text-main: var(--text);
      --text-muted: var(--text-3);
      --text-light: var(--text-2);

      --color-swim: var(--sport-swim);
      --color-bike: var(--sport-bike);
      --color-run: var(--sport-run);
      --color-walk: var(--sport-walk);
      --color-repos: var(--sport-rest);

      --color-z1: var(--zone-1);
      --color-z2: var(--zone-2);
      --color-z3: var(--zone-3);
      --color-z4: var(--zone-4);
      --color-z5: var(--zone-5);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      background-color: var(--bg-dark);
      font-family: 'DM Sans', 'Segoe UI', sans-serif;
      color: var(--text-main);
      min-height: 100vh;
      padding-bottom: 80px;
      line-height: 1.5;
    }

    /* En-tête */
    .header {
      background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 50%, var(--surface) 100%);
      border-bottom: 1px solid var(--border-color);
      padding: 48px 24px 36px;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .header::before {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 70%);
      pointer-events: none;
    }

    .header-icons {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .header-icons span {
      font-size: 32px;
      filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 40%, transparent));
    }

    .header h1 {
      margin: 0 0 8px;
      font-size: clamp(24px, 5vw, 36px);
      font-weight: 700;
      letter-spacing: -0.03em;
      background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .header p {
      margin: 0;
      color: var(--text-muted);
      font-size: 14px;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      font-weight: 600;
    }

    .container {
      max-width: 860px;
      margin: 0 auto;
      padding: 0 16px;
    }

    /* Style général des cartes */
    .card {
      background-color: var(--bg-card);
      border-radius: 16px;
      border: 1px solid var(--border-color);
      padding: 24px;
      margin-top: 24px;
    }

    .card-title {
      margin: 0 0 16px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    /* Sélecteur de Format */
    .formats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 12px;
    }

    .format-btn {
      background-color: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 16px;
      cursor: pointer;
      text-align: left;
      transition: all 0.2s ease;
      color: var(--text-main);
    }

    .format-btn:hover {
      border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    }

    .format-btn.active {
      background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface) 100%);
      border: 2px solid var(--accent);
    }

    .format-btn .format-key {
      font-weight: 700;
      font-size: 20px;
      color: var(--text-main);
    }

    .format-btn.active .format-key {
      color: var(--color-bike);
    }

    .format-btn .format-name {
      font-weight: 700;
      font-size: 13px;
      margin-top: 4px;
    }

    .format-btn .format-details {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 8px;
      line-height: 1.5;
    }

    .format-btn .format-vol {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      margin-top: 10px;
    }

    .format-btn.active .format-vol {
      color: var(--color-swim);
    }

    /* Calculateur de FCM */
    .fcm-container {
      display: flex;
      align-items: center;
      gap: 20px;
      flex-wrap: wrap;
    }

    .fcm-slider-wrapper {
      flex: 1;
      min-width: 200px;
    }

    .fcm-slider {
      width: 100%;
      accent-color: var(--accent);
      cursor: pointer;
    }

    .fcm-slider-labels {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--text-3);
      margin-top: 4px;
    }

    .fcm-value-box {
      text-align: center;
      min-width: 80px;
    }

    .fcm-value {
      font-size: 48px;
      font-weight: 700;
      color: var(--color-bike);
      letter-spacing: -0.04em;
      line-height: 1;
    }

    .fcm-unit {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 4px;
    }

    .fcm-info {
      font-size: 13px;
      color: var(--text-muted);
      flex: 1;
      min-width: 160px;
    }

    .fcm-info span {
      color: var(--text-main);
    }

    /* Entrées de navigation. La barre d'onglets horizontale qu'elles
       formaient a laissé place à une colonne (cf. css/design.css) ; ces
       règles-ci sont entièrement reprises là-bas. */
    .tab-btn {
      padding: 10px 18px;
      border-radius: 10px 10px 0 0;
      border: none;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      background-color: transparent;
      color: var(--text-muted);
      border-bottom: 2px solid transparent;
      transition: all 0.2s ease;
    }

    .tab-btn:hover {
      color: var(--text-main);
    }

    .tab-btn.active {
      background-color: var(--surface-3);
      color: var(--color-bike);
      border-bottom: 2px solid var(--accent);
    }

    .tab-content {
      display: none;
      margin-top: 24px;
    }

    .tab-content.active {
      display: block;
    }

    /* Onglet : Zones cardiaques */
    .zones-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .zone-card {
      background-color: var(--bg-card);
      border-radius: 14px;
      border: 1px solid var(--border-color);
      padding: 18px 20px;
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .zone-badge {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .zone-info {
      flex: 1;
      min-width: 0;
    }

    .zone-name {
      font-weight: 700;
      font-size: 14px;
      color: var(--text-main);
      margin-bottom: 3px;
    }

    .zone-desc {
      font-size: 12px;
      color: var(--text-muted);
    }

    .zone-bar-bg {
      margin-top: 8px;
      height: 4px;
      border-radius: 2px;
      background-color: var(--border-color);
      overflow: hidden;
    }

    .zone-bar-fill {
      height: 100%;
      border-radius: 2px;
    }

    .zone-val-box {
      text-align: right;
      flex-shrink: 0;
    }

    .zone-bpm {
      font-size: 20px;
      font-weight: 700;
    }

    .zone-bpm-unit {
      font-size: 11px;
      color: var(--text-muted);
    }

    .zone-pct {
      margin-top: 4px;
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 20px;
      font-weight: 600;
      display: inline-block;
    }

    /* Répartition cible */
    .distrib-card {
      background-color: var(--bg-card);
      border-radius: 14px;
      border: 1px solid var(--border-color);
      padding: 20px;
      margin-top: 8px;
    }

    .distrib-title {
      font-weight: 700;
      margin-bottom: 12px;
      color: var(--text-main);
      font-size: 14px;
    }

    .distrib-bar {
      display: flex;
      height: 24px;
      border-radius: 8px;
      overflow: hidden;
      gap: 2px;
    }

    .distrib-block {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      color: var(--bg);
    }

    .distrib-legend {
      display: flex;
      gap: 16px;
      margin-top: 10px;
      flex-wrap: wrap;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 2px;
    }

    /* Onglet : Semaine détaillée */
    .timeline-card {
      background-color: var(--bg-card);
      border-radius: 16px;
      border: 1px solid var(--border-color);
      padding: 20px;
      margin-bottom: 16px;
    }

    .timeline-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
      flex-wrap: wrap;
      gap: 8px;
    }

    .timeline-title {
      margin: 0;
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
    }

    .vol-badge {
      font-size: 12px;
      background-color: color-mix(in srgb, var(--accent) 8%, transparent);
      color: var(--color-bike);
      border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
      padding: 4px 10px;
      border-radius: 20px;
      font-weight: 700;
    }

    .timeline-track {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 8px;
      scrollbar-width: thin;
    }

    .timeline-week-btn {
      flex: 1 0 40px;
      height: 46px;
      background-color: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      alignItems: center;
      justify-content: center;
      transition: all 0.2s ease;
      color: var(--text-main);
    }

    .timeline-week-btn span.w-label {
      font-size: 11px;
      font-weight: 700;
    }

    .timeline-week-btn span.w-status {
      font-size: 9px;
      font-weight: 700;
      margin-top: 2px;
    }

    .timeline-footer {
      margin-top: 16px;
      border-top: 1px solid var(--border-color);
      padding-top: 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13px;
      color: var(--text-muted);
    }

    .phase-indicator {
      font-weight: 700;
    }

    /* Focus de la semaine (cf. app.js, week-focus-banner) */
    .week-focus-banner {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 14px;
      background: color-mix(in srgb, var(--accent) 6%, transparent);
      border: 1px solid var(--border-color);
    }
    .week-focus-banner:empty { display: none; }
    .week-focus-icon { font-size: 17px; line-height: 1.4; flex-shrink: 0; }
    .week-focus-text { font-size: 12.5px; line-height: 1.5; color: var(--text-light); }

    /* Séances de la semaine */
    .week-sessions {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .session-row {
      background-color: var(--bg-card);
      border-radius: 14px;
      border: 1px solid var(--border-color);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .session-day-col {
      width: 70px;
      flex-shrink: 0;
    }

    .session-icon {
      font-size: 18px;
      margin-bottom: 2px;
    }

    .session-day-name {
      font-size: 13px;
      font-weight: 700;
    }

    .session-bar {
      width: 4px;
      height: 48px;
      border-radius: 2px;
      flex-shrink: 0;
    }

    .session-body {
      flex: 1;
    }

    .session-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 4px;
    }

    .session-sport {
      font-weight: 700;
      font-size: 14px;
    }

    .session-zone-badge {
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 20px;
      font-weight: 600;
    }

    .session-desc {
      font-size: 12px;
      color: var(--text-light);
      line-height: 1.5;
    }

    .session-duration {
      font-size: 13px;
      font-weight: 700;
      text-align: right;
      flex-shrink: 0;
    }

    .sports-legend {
      display: flex;
      gap: 12px;
      margin-top: 16px;
      flex-wrap: wrap;
    }

    .sport-dot-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .sport-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }

    /* Onglet : Les 4 phases */
    .phases-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-bottom: 20px;
    }

    .phase-btn {
      background-color: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 16px;
      cursor: pointer;
      text-align: left;
      transition: all 0.2s ease;
      color: var(--text-main);
    }

    .phase-btn .phase-icon {
      font-size: 20px;
      margin-bottom: 6px;
    }

    .phase-btn .phase-name {
      font-weight: 700;
      font-size: 14px;
    }

    .phase-btn .phase-weeks {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .phase-detail-card {
      background-color: var(--bg-card);
      border-radius: 16px;
      border: 1px solid transparent;
      padding: 24px;
    }

    .phase-detail-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
    }

    .phase-detail-badge {
      font-size: 28px;
    }

    .phase-detail-title {
      margin: 0;
      font-size: 18px;
      font-weight: 700;
    }

    .phase-detail-weeks {
      font-size: 13px;
      color: var(--text-muted);
    }

    .phase-detail-desc {
      margin: 0 0 20px;
      font-size: 14px;
      color: var(--text-light);
      line-height: 1.7;
    }

    .phase-vol-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border-radius: 8px;
      padding: 8px 14px;
      margin-bottom: 20px;
      font-size: 12px;
    }

    .phase-vol-badge span.v-label {
      color: var(--text-muted);
    }

    .phase-vol-badge span.v-val {
      font-weight: 700;
    }

    .phase-focus-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .phase-focus-item {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 10px 14px;
      background-color: var(--bg-dark);
      border-radius: 10px;
      font-size: 13px;
      color: var(--text-light);
    }

    .phase-focus-arrow {
      flex-shrink: 0;
    }

    /* Frise chronologique */
    .progress-bar-card {
      margin-top: 20px;
      background-color: var(--bg-card);
      border-radius: 16px;
      border: 1px solid var(--border-color);
      padding: 20px;
    }

    .progress-title {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 14px;
      font-weight: 600;
    }

    .progress-track {
      display: flex;
      gap: 3px;
    }

    .progress-segment {
      flex: 1;
      height: 40px;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 700;
      cursor: default;
      transition: all 0.2s ease;
      border: 1px solid transparent;
    }

    .progress-legend {
      display: flex;
      gap: 16px;
      margin-top: 10px;
      flex-wrap: wrap;
    }

    /* Onglet : Principes clés */
    .principles-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 12px;
    }

    .principle-card {
      background-color: var(--bg-card);
      border-radius: 14px;
      border: 1px solid var(--border-color);
      padding: 20px;
    }

    .principle-icon {
      font-size: 24px;
      margin-bottom: 10px;
    }

    .principle-name {
      font-weight: 700;
      font-size: 14px;
      color: var(--text-main);
      margin-bottom: 8px;
    }

    .principle-desc {
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.65;
    }

    .swim-tips-card {
      margin-top: 16px;
      background-color: color-mix(in srgb, var(--success) 5%, transparent);
      border-radius: 14px;
      border: 1px solid color-mix(in srgb, var(--success) 15%, transparent);
      padding: 20px;
    }

    .swim-tips-title {
      font-weight: 700;
      color: var(--color-swim);
      margin-bottom: 12px;
      font-size: 15px;
    }

    .tips-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .tip-row {
      display: flex;
      gap: 10px;
      font-size: 13px;
      color: var(--text-light);
    }

    .tip-check {
      color: var(--color-swim);
      flex-shrink: 0;
    }

    .danger-tips-card {
      margin-top: 16px;
      background-color: color-mix(in srgb, var(--danger) 5%, transparent);
      border-radius: 14px;
      border: 1px solid color-mix(in srgb, var(--danger) 15%, transparent);
      padding: 20px;
    }

    .danger-tips-title {
      font-weight: 700;
      color: var(--color-z5);
      margin-bottom: 12px;
      font-size: 15px;
    }

    .danger-check {
      color: var(--color-z5);
      flex-shrink: 0;
    }

    /* Styles pour la validation des séances */
    .session-row.completed {
      opacity: 0.55;
      border-color: color-mix(in srgb, var(--success) 30%, transparent) !important;
      background-color: rgba(20, 25, 38, 0.4);
    }
    
    .session-row.completed .session-desc {
      text-decoration: line-through;
      color: var(--text-muted);
    }

    .check-btn {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      border: 2px solid var(--border-color);
      background-color: transparent;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      flex-shrink: 0;
      color: transparent;
      font-size: 11px;
      font-weight: 700;
    }

    .check-btn:hover {
      border-color: var(--color-swim);
      background-color: color-mix(in srgb, var(--success) 10%, transparent);
    }

    .check-btn.checked {
      background-color: var(--success);
      border-color: var(--color-swim);
      color: var(--bg);
    }

    /* ========================================
       COMPOSANT CALENDRIER SHADCN-STYLE
       ======================================== */

    /* Wrapper global du calendrier */
    .cal-wrapper {
      margin-top: 20px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 20px;
      overflow: hidden;
    }

    /* En-tête libre : plus de grille jour par jour */
    .cal-header {
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 12px 14px;
      background: rgba(30, 37, 53, 0.6);
      border-bottom: 1px solid var(--border-color);
    }

    .cal-header-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-main);
    }

    .cal-header-sub {
      font-size: 11.5px;
      color: var(--text-muted);
    }

    /* Rappel discret quand la date d'épreuve manque (cf. js/app.js) */
    .plan-banner-missing-date {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 14px;
      margin-bottom: 10px;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-main);
      background: color-mix(in srgb, var(--warning) 10%, transparent);
      border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
      border-radius: 14px;
      cursor: pointer;
      line-height: 1.4;
    }
    .plan-banner-missing-date:hover { background: color-mix(in srgb, var(--warning) 16%, transparent); }
    .plan-banner-missing-date strong { color: var(--warning); }

    /* Liste libre des séances (organisation laissée à l'athlète) */
    .cal-body {
      display: flex;
      flex-wrap: wrap;
      gap: 1px;
      background: var(--border-color);
    }

    .cal-day-cell {
      background: var(--bg-card);
      padding: 12px 8px 14px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      position: relative;
      transition: background 0.15s ease;
      min-height: 96px;
      flex: 1 1 25%;
      min-width: 84px;
      user-select: none;
    }

    .cal-day-cell:hover {
      background: rgba(255, 255, 255, 0.03);
    }

    .cal-day-cell.cal-selected {
      background: color-mix(in srgb, var(--accent) 6%, transparent);
    }

    /* Cercle indicateur du sport (dot) */
    .cal-sport-dot {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      flex-shrink: 0;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      border: 1px solid transparent;
    }

    .cal-day-cell:hover .cal-sport-dot {
      transform: scale(1.08);
    }

    .cal-selected .cal-sport-dot {
      transform: scale(1.12);
      box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px currentColor;
    }

    /* Label du sport + durée */
    .cal-sport-label {
      font-size: 10px;
      font-weight: 700;
      text-align: center;
      line-height: 1.2;
    }

    .cal-duration-label {
      font-size: 9px;
      font-weight: 600;
      color: var(--text-muted);
    }

    /* Trait de sélection en bas */
    .cal-day-cell::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 16px;
      right: 16px;
      height: 2px;
      border-radius: 2px 2px 0 0;
      background: transparent;
      transition: background 0.2s;
    }

    .cal-selected::after {
      background: var(--accent);
    }

    /* Badge de validation ✓ en coin */
    .cal-check-badge {
      position: absolute;
      top: 6px;
      right: 6px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--success);
      color: var(--bg);
      font-size: 9px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 8px color-mix(in srgb, var(--success) 40%, transparent);
      animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    }

    @keyframes popIn {
      from { transform: scale(0); opacity: 0; }
      to   { transform: scale(1); opacity: 1; }
    }

    /* ========================================
       PANNEAU DE DÉTAIL SHADCN-STYLE
       ======================================== */

    .session-detail-panel {
      margin-top: 0;
      border-top: 1px solid var(--border-color);
      padding: 24px;
      animation: slideDown 0.2s ease both;
    }

    @keyframes slideDown {
      from { opacity: 0; transform: translateY(-8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .sdp-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }

    .sdp-title-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .sdp-sport-chip {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      flex-shrink: 0;
    }

    .sdp-title {
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--text-main);
      line-height: 1.2;
    }

    .sdp-day-label {
      font-size: 12px;
      color: var(--text-muted);
      font-weight: 600;
      margin-top: 2px;
    }

    /* Badges de méta-données */
    .sdp-badges {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }

    .sdp-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: rgba(255,255,255,0.03);
      color: var(--text-light);
    }

    .sdp-badge-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
    }

    /* Divider */
    .sdp-divider {
      height: 1px;
      background: var(--border-color);
      margin: 16px 0;
    }

    /* Corps du plan de séance */
    .sdp-body {
      font-size: 13.5px;
      line-height: 1.7;
      color: var(--text-light);
      background: rgba(13, 15, 20, 0.6);
      border-radius: 12px;
      padding: 16px 18px;
      border-left: 3px solid transparent;
      margin-bottom: 16px;
    }

    /* Bouton de validation principal */
    .sdp-validate-btn {
      width: 100%;
      padding: 12px 20px;
      border-radius: 10px;
      border: none;
      cursor: pointer;
      font-family: 'DM Sans', sans-serif;
      font-weight: 700;
      font-size: 13px;
      letter-spacing: 0.01em;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.18s ease;
      position: relative;
      overflow: hidden;
    }

    .sdp-validate-btn::before {
      content: '';
      position: absolute;
      inset: 0;
      background: rgba(255,255,255,0);
      transition: background 0.18s;
    }

    .sdp-validate-btn:hover::before {
      background: rgba(255,255,255,0.06);
    }

    .sdp-validate-btn:active {
      transform: scale(0.98);
    }

    .sdp-validate-btn.state-todo {
      background: color-mix(in srgb, var(--success) 10%, transparent);
      color: var(--color-swim);
      border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
    }

    .sdp-validate-btn.state-done {
      background: var(--success);
      color: var(--bg);
      border: 1px solid var(--success);
      box-shadow: 0 4px 16px color-mix(in srgb, var(--success) 25%, transparent);
    }

    /* Repos panel */
    .sdp-rest-card {
      display: flex;
      align-items: center;
      gap: 16px;
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
      padding: 18px;
      border: 1px dashed var(--border-color);
      margin-bottom: 16px;
    }

    .sdp-rest-icon {
      font-size: 32px;
      flex-shrink: 0;
    }

    .sdp-rest-text {
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.6;
    }

    /* Barre de progression hebdomadaire */
    .weekly-progress-wrapper {
      margin-top: 14px;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .weekly-progress-bar-bg {
      flex: 1;
      height: 8px;
      background-color: var(--bg-deep);
      border-radius: 4px;
      overflow: hidden;
      border: 1px solid var(--border-color);
    }

    .weekly-progress-bar-fill {
      height: 100%;
      background-color: var(--success);
      width: 0%;
      transition: width 0.3s ease;
    }

    .weekly-progress-text {
      font-size: 13px;
      font-weight: 700;
      color: var(--color-swim);
      min-width: 45px;
      text-align: right;
    }

    /* Barre de progression sous le bouton de semaine de la frise */
    .week-progress-bar-bg {
      width: 100%;
      height: 3px;
      background-color: rgba(255, 255, 255, 0.05);
      position: absolute;
      bottom: 0;
      left: 0;
      border-radius: 0 0 8px 8px;
      overflow: hidden;
    }

    .week-progress-bar-fill {
      height: 100%;
      background-color: var(--success);
      width: 0%;
      transition: width 0.3s ease;
    }

    .timeline-week-btn {
      position: relative;
      overflow: hidden;
      align-items: center;
    }

    /* ========================================
       PROFIL UTILISATEUR & BADGE
       ======================================== */
    .profile-badge-header {
      position: absolute;
      top: 30px;
      right: 30px;
      display: flex;
      align-items: center;
      gap: 12px;
      background: rgba(20, 25, 38, 0.6);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 10px 16px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 10;
    }

    .profile-badge-header:hover {
      border-color: color-mix(in srgb, var(--accent) 60%, transparent);
      background: rgba(30, 37, 53, 0.85);
      transform: translateY(-2px);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .profile-badge-avatar {
      font-size: 24px;
      background: rgba(255, 255, 255, 0.05);
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .profile-badge-info {
      text-align: left;
      display: flex;
      flex-direction: column;
    }

    .profile-badge-name {
      font-weight: 700;
      color: var(--text-main);
      font-size: 14px;
      letter-spacing: -0.01em;
    }

    .profile-badge-sub {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 150px;
    }

    @media (max-width: 768px) {
      .profile-badge-header {
        position: static;
        margin: 16px auto 0;
        display: inline-flex;
        transform: none;
      }
      .profile-badge-header:hover {
        transform: none;
      }
    }

    .profile-container {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 32px;
      margin-top: 8px;
    }

    @media (max-width: 768px) {
      .profile-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
      }
    }

    .profile-card-inner {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .form-input, .form-select {
      background-color: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 10px;
      padding: 11px 14px;
      color: var(--text-main);
      font-family: 'DM Sans', sans-serif;
      font-size: 14px;
      transition: all 0.2s ease;
      width: 100%;
    }

    .form-input:focus, .form-select:focus {
      outline: none;
      border-color: var(--color-bike);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    }

    .avatar-selector {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .avatar-option {
      width: 38px;
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      background-color: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .avatar-option:hover {
      border-color: color-mix(in srgb, var(--accent) 50%, transparent);
      transform: scale(1.05);
    }

    .avatar-option.active {
      background-color: color-mix(in srgb, var(--accent) 12%, transparent);
      border-color: var(--color-bike);
      box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent);
    }

    .schedule-pref-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 8px;
    }

    .schedule-day-row {
      display: grid;
      grid-template-columns: 100px 1fr;
      align-items: center;
      gap: 16px;
      background-color: rgba(13, 15, 20, 0.5);
      padding: 8px 16px;
      border-radius: 12px;
      border: 1px solid var(--border-color);
      transition: border-color 0.2s ease;
    }

    .schedule-day-row:hover {
      border-color: rgba(255, 255, 255, 0.08);
    }

    .schedule-day-name {
      font-weight: 700;
      font-size: 13.5px;
      color: var(--text-light);
    }

    .schedule-select {
      background-color: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 8px 12px;
      color: var(--text-main);
      font-family: 'DM Sans', sans-serif;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .schedule-select:focus {
      outline: none;
      border-color: var(--color-bike);
    }

    .btn-profile-save {
      background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent) 0%, color-mix(in srgb, var(--success) 10%, transparent) 100%);
      border: 1px solid var(--accent);
      border-radius: 12px;
      padding: 12px 20px;
      color: var(--color-bike);
      font-family: 'DM Sans', sans-serif;
      font-weight: 700;
      font-size: 13.5px;
      cursor: pointer;
      transition: all 0.2s ease;
      margin-top: 16px;
      width: 100%;
    }

    .btn-profile-save:hover {
      background: var(--accent);
      color: var(--bg);
      box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 25%, transparent);
    }

    .btn-profile-reset {
      background-color: transparent;
      border: 1px dashed var(--border-color);
      border-radius: 12px;
      padding: 10px 20px;
      color: var(--text-muted);
      font-family: 'DM Sans', sans-serif;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      margin-top: 10px;
      width: 100%;
      font-size: 12px;
    }

    .btn-profile-reset:hover {
      color: var(--color-z5);
      border-color: var(--color-z5);
      background-color: color-mix(in srgb, var(--danger) 5%, transparent);
    }

    .sdp-action-row {
      display: flex;
      gap: 10px;
      margin-top: 16px;
      flex-wrap: wrap;
    }

    .sdp-action-row .sdp-validate-btn {
      margin-top: 0;
      flex: 1 1 0;
      min-width: 140px;
    }

    /* ========================================
       DÉCOUPAGE STRUCTURÉ DES SÉANCES
       ======================================== */
    .sdp-steps {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin: 4px 0 8px;
    }

    .sdp-step {
      display: flex;
      gap: 14px;
      background: var(--bg-dark);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 14px 16px;
    }

    .sdp-step-rail {
      width: 4px;
      border-radius: 2px;
      flex-shrink: 0;
      opacity: 0.85;
    }

    .sdp-step-main {
      flex: 1;
      min-width: 0;
    }

    .sdp-step-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 10px;
      margin-bottom: 5px;
      flex-wrap: wrap;
    }

    .sdp-step-name {
      font-weight: 700;
      font-size: 13.5px;
      color: var(--text-main);
    }

    .sdp-step-meta {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      white-space: nowrap;
    }

    .sdp-step-detail {
      font-size: 12.5px;
      line-height: 1.55;
      color: var(--text-light);
    }

    .sdp-tips {
      margin-top: 6px;
      background: color-mix(in srgb, var(--warning) 5%, transparent);
      border: 1px solid color-mix(in srgb, var(--warning) 18%, transparent);
      border-radius: 12px;
      padding: 14px 18px;
    }

    .sdp-tips-title {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--color-z3);
      margin-bottom: 8px;
    }

    .sdp-tips-list {
      margin: 0;
      padding-left: 18px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .sdp-tips-list li {
      font-size: 12.5px;
      line-height: 1.5;
      color: var(--text-light);
    }

    /* ========================================
       ONGLET PROGRESSION & BADGES
       ======================================== */
    .prog-hero {
      display: flex;
      align-items: center;
      gap: 24px;
      background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 100%);
      border: 1px solid var(--border-color);
      border-radius: 18px;
      padding: 24px;
      flex-wrap: wrap;
    }

    .prog-ring-wrap {
      position: relative;
      width: 120px;
      height: 120px;
      flex-shrink: 0;
    }

    .prog-ring {
      transform: rotate(-90deg);
    }

    .prog-ring-bg {
      fill: none;
      stroke: var(--border-color);
      stroke-width: 10;
    }

    .prog-ring-fill {
      fill: none;
      stroke: var(--success);
      stroke-width: 10;
      stroke-linecap: round;
      transition: stroke-dasharray 0.6s ease;
      filter: drop-shadow(0 0 6px color-mix(in srgb, var(--success) 40%, transparent));
    }

    .prog-ring-label {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    .prog-ring-pct {
      font-size: 30px;
      font-weight: 700;
      color: var(--color-swim);
      line-height: 1;
    }

    .prog-ring-sub {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .prog-hero-info {
      flex: 1;
      min-width: 220px;
    }

    .prog-hero-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 4px;
    }

    .prog-hero-text {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 16px;
      line-height: 1.5;
    }

    .sport-donut-row {
      display: flex;
      align-items: center;
      gap: 20px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .sport-donut-seg {
      fill: none;
      stroke-width: 10;
      transition: stroke-dasharray 0.6s ease;
    }

    .prog-stat-grid {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
    }

    .prog-stat {
      background: var(--bg-dark);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 10px 18px;
      text-align: center;
      flex: 1;
      min-width: 80px;
    }

    .prog-stat-val {
      font-size: 24px;
      font-weight: 700;
      color: var(--text-main);
      line-height: 1;
    }

    .prog-stat-unit {
      font-size: 13px;
      color: var(--text-muted);
      font-weight: 600;
    }

    .prog-stat-lab {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 5px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .prog-sport-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-top: 16px;
    }

    .prog-sport-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 16px;
      text-align: center;
    }

    .prog-sport-icon {
      font-size: 22px;
      margin-bottom: 6px;
    }

    .prog-sport-count {
      font-size: 26px;
      font-weight: 700;
      line-height: 1;
    }

    .prog-sport-label {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 5px;
    }

    .badge-group {
      margin-top: 28px;
    }

    .badge-group-title {
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 14px;
    }

    .badge-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 12px;
    }

    .badge-card {
      display: flex;
      gap: 14px;
      align-items: flex-start;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 16px;
      transition: transform 0.15s ease, border-color 0.2s ease;
    }

    .badge-card.badge-earned {
      background: linear-gradient(135deg, #161d2b 0%, #0f1626 100%);
    }

    .badge-card.badge-earned:hover {
      transform: translateY(-2px);
    }

    .badge-card.badge-locked {
      opacity: 0.7;
    }

    .badge-icon {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.03);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      flex-shrink: 0;
    }

    .badge-card.badge-locked .badge-icon {
      filter: grayscale(1);
      opacity: 0.55;
    }

    .badge-body {
      flex: 1;
      min-width: 0;
    }

    .badge-name {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .badge-check {
      font-size: 13px;
      font-weight: 700;
    }

    .badge-desc {
      font-size: 12px;
      color: var(--text-muted);
      margin: 3px 0 8px;
      line-height: 1.45;
    }

    .badge-unlocked {
      font-size: 12px;
      font-weight: 700;
    }

    .badge-prog-bar {
      height: 6px;
      background: var(--bg-dark);
      border-radius: 3px;
      overflow: hidden;
      border: 1px solid var(--border-color);
    }

    .badge-prog-fill {
      height: 100%;
      border-radius: 3px;
      transition: width 0.4s ease;
    }

    .badge-prog-text {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 5px;
      font-weight: 600;
    }

    @media (max-width: 520px) {
      .prog-sport-row { grid-template-columns: repeat(3, 1fr); }
      .badge-grid { grid-template-columns: 1fr; }
    }

    /* ========================================
       NAVIGATION
       ======================================== */
    .tab-btn {
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* ========================================
       RÔLES & SÉLECTEUR D'UTILISATEUR
       ======================================== */
    .role-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      font-weight: 700;
      padding: 2px 9px;
      border-radius: 20px;
      border: 1px solid var(--border-color);
      color: var(--text-muted);
    }

    .role-chip-header {
      margin-top: 5px;
      font-size: 10px;
      display: none;
    }

    .user-switcher {
      position: absolute;
      top: 16px;
      left: 16px;
      display: flex;
      align-items: center;
      gap: 6px;
      z-index: 5;
    }

    .user-switcher-icon {
      font-size: 15px;
    }

    .user-switcher select {
      background: var(--bg-deep);
      color: var(--text-light);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 6px 8px;
      font-size: 12px;
      font-family: inherit;
      cursor: pointer;
      max-width: 170px;
    }

    /* ========================================
       PANNEAU SÉANCE — NOTES COACH & RESSENTI
       ======================================== */
    .sdp-coach-notes {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 10px;
    }

    .sdp-coach-note {
      background: color-mix(in srgb, var(--warning) 6%, transparent);
      border: 1px solid color-mix(in srgb, var(--warning) 22%, transparent);
      border-radius: 10px;
      padding: 10px 14px;
      font-size: 12.5px;
      color: var(--text-light);
      line-height: 1.5;
    }

    .sdp-coach-note-head {
      display: block;
      font-size: 11px;
      font-weight: 700;
      color: var(--color-z3);
      margin-bottom: 3px;
      letter-spacing: 0.03em;
    }

    .sdp-feel-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      flex-wrap: wrap;
    }

    .sdp-feel-label {
      font-size: 12px;
      color: var(--text-muted);
      font-weight: 600;
    }

    .sdp-feel-btn {
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      font-size: 18px;
      padding: 6px 12px;
      cursor: pointer;
      transition: all 0.15s ease;
      filter: grayscale(0.6);
    }

    .sdp-feel-btn:hover {
      filter: grayscale(0);
      transform: translateY(-1px);
    }

    .sdp-feel-btn.active {
      filter: grayscale(0);
      border-color: var(--color-swim);
      background: color-mix(in srgb, var(--success) 10%, transparent);
    }

    /* Échelle RPE 1–10 (effort perçu) */
    .sdp-rpe-scale {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
    }

    .sdp-rpe-btn {
      min-width: 30px;
      padding: 5px 0;
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 8px;
      color: var(--text-muted);
      font-size: 12.5px;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .sdp-rpe-btn:hover { transform: translateY(-1px); color: var(--text-main); }
    .sdp-rpe-btn.active.rpe-z1 { border-color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
    .sdp-rpe-btn.active.rpe-z2 { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
    .sdp-rpe-btn.active.rpe-z3 { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
    .sdp-rpe-btn.active.rpe-z4 { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }

    /* Note libre post-séance */
    .sdp-note-row {
      display: flex;
      gap: 8px;
      margin-top: 10px;
    }

    .sdp-note-input {
      flex: 1;
      min-width: 0;
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      padding: 8px 12px;
      color: var(--text-main);
      font-size: 13px;
      font-family: inherit;
    }

    .sdp-note-input::placeholder { color: var(--text-muted); }

    .sdp-note-send {
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      padding: 8px 14px;
      color: var(--text-light);
      font-size: 12.5px;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
      flex-shrink: 0;
    }

    .sdp-note-send:hover { border-color: var(--color-swim); color: var(--color-swim); }

    /* Durée réelle / distance / allure calculée */
    .sdp-perf-row {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .sdp-perf-input {
      width: 70px;
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      padding: 8px 10px;
      color: var(--text-main);
      font-size: 13px;
      font-family: inherit;
    }

    .sdp-perf-unit {
      font-size: 12px;
      color: var(--text-muted);
      font-weight: 600;
      margin-right: 6px;
    }

    .sdp-perf-result {
      margin-top: 8px;
      font-size: 13px;
      color: var(--color-swim);
      background: color-mix(in srgb, var(--success) 8%, transparent);
      border-radius: 8px;
      padding: 7px 12px;
      display: inline-block;
    }

    /* ========================================
       PROGRESSION — LE MOT DU COACH
       ======================================== */
    .advice-card { margin-bottom: 20px; }

    .advice-line {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      font-size: 13px;
      line-height: 1.55;
      color: var(--text-light);
      background: var(--bg-dark);
      border-left: 3px solid var(--border-color);
      border-radius: 0 10px 10px 0;
      padding: 9px 12px;
      margin-bottom: 8px;
    }

    .advice-line:last-child { margin-bottom: 0; }
    .advice-icon { flex-shrink: 0; font-size: 15px; }
    .advice-recap { border-left-color: var(--color-swim); }
    .advice-good { border-left-color: var(--success); }
    .advice-warn { border-left-color: var(--warning); }

    /* ========================================
       PROGRESSION — ÉVOLUTION DES PERFORMANCES
       ======================================== */
    .perf-card { margin-bottom: 20px; }

    .perf-block { margin-bottom: 16px; }
    .perf-block:last-child { margin-bottom: 0; }

    .perf-block-head {
      display: flex;
      align-items: baseline;
      gap: 10px;
      font-size: 13px;
      font-weight: 700;
      margin-bottom: 8px;
    }

    .perf-latest { font-size: 15px; font-weight: 700; }
    .perf-trend { font-size: 11.5px; font-weight: 600; margin-left: auto; }

    .perf-chips {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 2px;
    }

    .perf-chip {
      flex-shrink: 0;
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 99px;
      padding: 5px 12px;
      white-space: nowrap;
    }

    .perf-chip-last { font-weight: 700; }

    /* ========================================
       PROGRESSION — SUIVI DE CHARGE
       ======================================== */
    .charge-card { margin-bottom: 20px; }

    .charge-kpis {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 16px;
    }

    .charge-chart {
      display: flex;
      gap: 4px;
      align-items: flex-end;
      height: 130px;
      padding: 4px 0 0;
    }

    .charge-col {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      height: 100%;
      min-width: 0;
      border-radius: 6px;
      padding: 2px 1px 0;
    }

    .charge-col.charge-cur { background: color-mix(in srgb, var(--accent) 8%, transparent); }

    .charge-bar-zone {
      position: relative;
      flex: 1;
      width: 100%;
      display: flex;
      align-items: flex-end;
      justify-content: center;
    }

    .charge-bar-planned,
    .charge-bar-done,
    .charge-bar-bonus {
      position: absolute;
      bottom: 0;
      width: 70%;
      border-radius: 4px 4px 0 0;
    }

    .charge-bar-planned { background: var(--border-color); opacity: 0.55; }
    .charge-bar-done { background: var(--color-swim); width: 45%; }
    /* Activité hors plan : empilée au-dessus du réalisé (le `bottom` est
       calculé en ligne, à la hauteur de la barre « réalisé »). */
    .charge-bar-bonus { background: var(--color-run); width: 45%; opacity: 0.9; }

    .charge-rpe-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      margin: 4px 0 2px;
      flex-shrink: 0;
    }

    .charge-week-label {
      font-size: 9px;
      color: var(--text-muted);
      font-weight: 600;
    }

    .charge-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 16px;
      margin-top: 10px;
      font-size: 11.5px;
      color: var(--text-muted);
    }

    .charge-leg-swatch {
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 3px;
      margin-right: 4px;
      vertical-align: -1px;
    }

    .charge-leg-planned { background: var(--border-color); }
    .charge-leg-bonus { background: var(--color-run); }
    .charge-leg-done { background: var(--color-swim); }
    .charge-leg-rpe { background: var(--warning); border-radius: 50%; }

    .charge-hint {
      margin-top: 10px;
      font-size: 12.5px;
      color: var(--text-muted);
      background: var(--bg-dark);
      border-radius: 8px;
      padding: 8px 12px;
    }

    @media (max-width: 560px) {
      .charge-week-label { font-size: 7.5px; }
      .charge-kpis { grid-template-columns: 1fr; }
    }

    /* ========================================
       PROGRESSION — NIVEAU & XP
       ======================================== */
    .prog-level-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }

    .level-chip {
      font-size: 12px;
      font-weight: 700;
      color: var(--color-z3);
      background: color-mix(in srgb, var(--warning) 10%, transparent);
      border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
      border-radius: 20px;
      padding: 4px 12px;
      white-space: nowrap;
    }

    .level-bar-bg {
      flex: 1;
      min-width: 100px;
      height: 8px;
      background: var(--bg-dark);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      overflow: hidden;
    }

    .level-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--warning), var(--warning));
      border-radius: 4px;
      transition: width 0.5s ease;
    }

    .level-xp {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
      white-space: nowrap;
    }

    /* ========================================
       ONGLET CLUB
       ======================================== */
    .club-hero {
      display: flex;
      align-items: center;
      gap: 16px;
      background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 100%);
      border: 1px solid var(--border-color);
      border-radius: 18px;
      padding: 22px 24px;
    }

    .club-hero-icon {
      font-size: 34px;
    }

    .club-hero-title {
      font-size: 19px;
      font-weight: 700;
      color: var(--text-main);
    }

    .club-hero-sub {
      font-size: 13px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .club-sim-note {
      margin-top: 12px;
      background: color-mix(in srgb, var(--accent) 5%, transparent);
      border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
      border-radius: 12px;
      padding: 12px 16px;
      font-size: 12.5px;
      color: var(--text-light);
      line-height: 1.55;
    }

    /* Leaderboard */
    .lb-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .lb-row {
      display: flex;
      align-items: center;
      gap: 14px;
      background: var(--bg-dark);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 12px 16px;
      flex-wrap: wrap;
    }

    .lb-row.lb-me {
      border-color: color-mix(in srgb, var(--success) 40%, transparent);
      background: color-mix(in srgb, var(--success) 4%, transparent);
    }

    .lb-rank {
      font-size: 17px;
      font-weight: 700;
      min-width: 30px;
      text-align: center;
      color: var(--text-muted);
    }

    .lb-avatar {
      font-size: 22px;
    }

    .lb-id {
      flex: 1;
      min-width: 120px;
    }

    .lb-name {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 3px;
    }

    .lb-you {
      font-size: 11px;
      color: var(--color-swim);
      font-weight: 600;
    }

    .lb-level {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--color-z3);
      white-space: nowrap;
    }

    .lb-stats {
      display: flex;
      gap: 14px;
      font-size: 12px;
      color: var(--text-muted);
      flex-wrap: wrap;
    }

    .lb-stats strong {
      color: var(--text-main);
    }

    /* Espace coach */
    .athlete-chips {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .athlete-chip {
      background: var(--bg-dark);
      border: 1.5px solid var(--border-color);
      border-radius: 20px;
      color: var(--text-light);
      font-size: 13px;
      font-weight: 600;
      font-family: inherit;
      padding: 8px 16px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .athlete-chip:hover {
      border-color: color-mix(in srgb, var(--warning) 50%, transparent);
    }

    .athlete-chip.active {
      border-color: var(--color-z3);
      background: color-mix(in srgb, var(--warning) 10%, transparent);
      color: var(--color-z3);
    }

    .coach-week-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }

    .coach-week-note {
      font-size: 12px;
      color: var(--text-muted);
    }

    .coach-days {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .coach-day {
      background: var(--bg-dark);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 14px 16px;
    }

    .coach-day-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }

    .coach-day-title {
      font-size: 13px;
      color: var(--text-light);
    }

    .coach-day-status {
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .coach-note-line {
      font-size: 12px;
      color: var(--text-light);
      background: color-mix(in srgb, var(--warning) 5%, transparent);
      border-left: 2px solid color-mix(in srgb, var(--warning) 40%, transparent);
      border-radius: 0 8px 8px 0;
      padding: 7px 12px;
      margin-bottom: 6px;
      line-height: 1.5;
    }

    .coach-comment-row {
      display: flex;
      gap: 8px;
      margin-top: 6px;
    }

    .coach-comment-input {
      flex: 1;
      background: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      color: var(--text-main);
      font-size: 12.5px;
      font-family: inherit;
      padding: 9px 12px;
      outline: none;
    }

    .coach-comment-input:focus {
      border-color: color-mix(in srgb, var(--warning) 50%, transparent);
    }

    .coach-comment-send {
      background: color-mix(in srgb, var(--warning) 12%, transparent);
      border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
      border-radius: 8px;
      color: var(--color-z3);
      font-size: 12px;
      font-weight: 700;
      font-family: inherit;
      padding: 0 16px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .coach-comment-send:hover {
      background: color-mix(in srgb, var(--warning) 22%, transparent);
    }

    /* Alertes coach */
    .coach-alerts { display: flex; flex-direction: column; gap: 8px; }

    .coach-alerts-empty {
      font-size: 13px;
      color: var(--text-muted);
      padding: 8px 4px;
    }

    .coach-alert {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 5px;
      width: 100%;
      text-align: left;
      background: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 10px;
      padding: 10px 14px;
      color: var(--text-main);
      font-size: 12.5px;
      font-family: inherit;
      cursor: pointer;
      transition: border-color 0.15s ease;
    }

    .coach-alert:hover { border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
    .coach-alert-who { font-size: 13px; }
    .coach-alert-line { display: block; line-height: 1.45; }
    .coach-alert-warn { color: var(--color-z4, var(--warning)); }
    .coach-alert-info { color: var(--text-light); }

    /* Fil de discussion coach ↔ athlète */
    .thread-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-light);
      margin: 18px 0 8px;
    }

    .thread-box { display: flex; flex-direction: column; gap: 8px; }

    .thread-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 260px;
      overflow-y: auto;
      padding: 2px;
    }

    .thread-empty { font-size: 12.5px; color: var(--text-muted); padding: 6px 2px; }

    .thread-msg { max-width: 85%; align-self: flex-start; }
    .thread-msg.thread-mine { align-self: flex-end; text-align: right; }

    .thread-meta {
      font-size: 10.5px;
      color: var(--text-muted);
      margin-bottom: 2px;
      font-weight: 600;
    }

    .thread-bubble {
      display: inline-block;
      text-align: left;
      background: var(--bg-deep);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 13px;
      color: var(--text-main);
      line-height: 1.5;
    }

    .thread-mine .thread-bubble {
      background: color-mix(in srgb, var(--accent) 10%, transparent);
      border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    }

    /* Espace admin */
    .member-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 16px;
    }

    .member-row {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--bg-dark);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 10px 14px;
      flex-wrap: wrap;
    }

    .member-avatar {
      font-size: 20px;
    }

    .member-name {
      flex: 1;
      min-width: 110px;
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
    }

    .member-demo {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
      border: 1px solid var(--border-color);
      border-radius: 20px;
      padding: 1px 8px;
      vertical-align: middle;
    }

    .member-role-select {
      max-width: 150px;
    }

    .member-self {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
      padding: 0 8px;
    }

    .member-remove {
      background: color-mix(in srgb, var(--danger) 8%, transparent);
      border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
      border-radius: 8px;
      color: var(--color-z5);
      font-size: 13px;
      font-weight: 700;
      width: 30px;
      height: 30px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .member-remove:hover {
      background: color-mix(in srgb, var(--danger) 20%, transparent);
    }

    .member-add-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      border-top: 1px solid var(--border-color);
      padding-top: 16px;
    }

    .member-add-input {
      flex: 1;
      min-width: 160px;
      width: auto;
    }

    .member-add-btn {
      background: color-mix(in srgb, var(--success) 10%, transparent);
      border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
      border-radius: 10px;
      color: var(--color-swim);
      font-size: 13px;
      font-weight: 700;
      font-family: inherit;
      padding: 10px 18px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .member-add-btn:hover {
      background: color-mix(in srgb, var(--success) 20%, transparent);
    }
