:root {
    --bg-main: #f6f6f4;
    --bg-card: #ffffff;
    --text-main: #1d1d1b;
    --text-muted: #787774;
    --border-color: #e8e7e3;
    --primary: #589e42; /* Vert Trail par défaut */
    --primary-light: #eef6eb;
    --accent-pink: #d81b46; /* Rouge/Rose pour la carte Séance Clé */
    --c-footing: #2e90fa;
    --c-cle: #d81b46;
    --c-sl: #d99b52;
    --c-renfo: #c59b27;
}

body.mode-route {
    --primary: #e62e4d; /* Rouge Route 42 */
    --primary-light: #fdecef;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); display: flex; min-height: 100vh; }

/* Barre latérale gauche */
.sidebar {
    width: 240px; background: var(--bg-card); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; justify-content: space-between;
    position: fixed; height: 100vh; padding: 16px 12px; z-index: 10;
}

.mode-switch {
    display: flex; background: var(--bg-main); border-radius: 10px; padding: 4px; margin-bottom: 20px;
}
.mode-switch a {
    flex: 1; text-align: center; padding: 7px 6px; font-size: 12px; font-weight: 600;
    text-decoration: none; color: var(--text-muted); border-radius: 7px; transition: 0.2s;
}
.mode-switch a.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.nav-links { list-style: none; }
.nav-links li { margin-bottom: 4px; }
.nav-links a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    text-decoration: none; color: var(--text-main); font-size: 14px; font-weight: 500; border-radius: 8px;
}
.nav-links a:hover { background: var(--bg-main); }
.nav-links a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.badge-coach { background: var(--accent-pink); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; margin-left: auto; }

/* Widgets bas de sidebar */
.sidebar-widgets { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-color); }
.xp-box { background: var(--bg-main); padding: 12px; border-radius: 10px; margin-bottom: 12px; }
.xp-circle {
    width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; margin-right: 8px;
}
.week-dots { display: flex; justify-content: space-between; margin: 10px 0; }
.dot-col { text-align: center; font-size: 10px; color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #dcdbd7; margin: 4px auto 0; }
.dot.done { background: var(--primary); }
.dot.today { border: 2px solid var(--c-sl); background: transparent; width: 10px; height: 10px; }

.user-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; border-top: 1px solid var(--border-color); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2c2c2a; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }

/* Zone principale */
.main-wrapper { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }

.topbar {
    background: var(--bg-card); border-bottom: 1px solid var(--border-color);
    padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-left h1 { font-size: 22px; font-weight: 800; }
.topbar-left p { font-size: 12px; color: var(--text-muted); }

.btn-primary {
    background: var(--primary); color: #fff; border: none; padding: 9px 16px;
    border-radius: 20px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}

.content-container { max-width: 1040px; width: 100%; margin: 24px auto; padding: 0 24px; }

/* Grille Aujourd'hui */
.today-grid { display: grid; grid-template-columns: 1.75fr 1fr; gap: 18px; margin-bottom: 24px; }

.hero-workout-card {
    background: var(--accent-pink); color: #fff; border-radius: 16px; padding: 24px;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 290px;
}
.hero-tag { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.hero-header { display: flex; justify-content: space-between; align-items: flex-start; margin: 14px 0; }
.hero-title { font-size: 24px; font-weight: 800; }
.hero-metrics { display: flex; gap: 16px; text-align: right; }
.hero-metrics strong { font-size: 19px; display: block; }
.hero-metrics span { font-size: 11px; opacity: 0.85; }
.hero-why { border-top: 1px solid rgba(255,255,255,0.25); padding-top: 14px; margin: 16px 0; font-size: 13px; line-height: 1.5; }
.hero-why-label { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: 0.8; margin-bottom: 4px; }
.hero-actions { display: flex; gap: 12px; }
.btn-done { background: #fff; color: var(--accent-pink); border: none; padding: 10px 22px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.btn-change { background: rgba(0,0,0,0.2); color: #fff; border: none; padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; }

.side-cards { display: flex; flex-direction: column; gap: 12px; }
.white-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; padding: 16px; }

/* Barre "Ta semaine" (7 colonnes) */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 14px; }
.day-mini-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px;
    font-size: 12px; position: relative;
}
.day-mini-card.is-today { border: 2px solid var(--accent-pink); background: #fff9fa; }
.day-bar { height: 4px; border-radius: 2px; margin: 8px 0; background: var(--c-footing); }
.day-bar.seance_cle { background: var(--c-cle); }
.day-bar.sortie_longue { background: var(--c-sl); }
.day-bar.renfo { background: var(--c-renfo); }