:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    /* Thème Trail 79 : Ambre / Vert forêt */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #f0fdfa;
    --accent-card: #f8fafc;
    --c-footing: #0284c7;
    --c-cle: #ea580c;
    --c-sl: #7c3aed;
    --c-renfo: #ca8a04;
}

body.mode-route {
    /* Thème Route 79 : Indigo / Saphir */
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
}

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

.svg-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* BARRE LATÉRALE GAUCHE (SIDEBAR) */
.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    height: 100vh;
    padding: 20px 16px;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 18px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 18px;
    text-decoration: none;
    color: var(--text-main);
}
.brand-title { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.mode-switch {
    display: flex; background: var(--bg-main); border-radius: 12px; padding: 4px; margin-bottom: 18px;
    border: 1px solid var(--border-color);
}
.mode-switch a {
    flex: 1; text-align: center; padding: 8px 6px; font-size: 11.5px; font-weight: 700;
    text-decoration: none; color: var(--text-muted); border-radius: 9px; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.mode-switch a.active { background: #ffffff; color: var(--text-main); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nav-links a {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    text-decoration: none; color: var(--text-muted); font-size: 13.5px; font-weight: 600; border-radius: 10px; transition: 0.15s;
}
.nav-links a:hover { background: var(--bg-main); color: var(--text-main); }
.nav-links a.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.nav-links a .svg-icon { color: inherit; opacity: 0.8; }
.nav-links a.active .svg-icon { opacity: 1; }

.badge-tag { background: var(--primary); color: #fff; font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 8px; margin-left: auto; text-transform: uppercase; }

/* 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: 14px; border-radius: 14px; margin-bottom: 12px; border: 1px solid var(--border-color); }
.xp-circle {
    width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; margin-right: 8px;
}
.week-dots { display: flex; justify-content: space-between; margin: 10px 0 4px; }
.dot-col { text-align: center; font-size: 10px; color: var(--text-muted); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin: 5px auto 0; }
.dot.done { background: var(--primary); }
.dot.today { border: 2px solid var(--primary); background: transparent; width: 10px; height: 10px; }

.user-footer { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }

/* ZONE PRINCIPALE */
.main-wrapper { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    background: #ffffff; border-bottom: 1px solid var(--border-color);
    padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
.topbar-left h1 { font-size: 22px; font-weight: 900; letter-spacing: -0.4px; color: var(--text-main); }
.topbar-left p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.btn-primary {
    background: var(--primary); color: #fff; border: none; padding: 10px 18px;
    border-radius: 12px; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.content-container { max-width: 1100px; width: 100%; margin: 28px auto; padding: 0 32px; }

/* GRILLE TABLEAU DE BORD */
.today-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 24px; }

.hero-workout-card {
    background: linear-gradient(135deg, var(--text-main) 0%, #1e293b 100%);
    color: #fff; border-radius: 20px; padding: 26px;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 310px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.hero-tag { background: rgba(255,255,255,0.12); padding: 5px 12px; border-radius: 8px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; }
.hero-header { display: flex; justify-content: space-between; align-items: flex-start; margin: 16px 0; }
.hero-title { font-size: 24px; font-weight: 900; letter-spacing: -0.3px; line-height: 1.2; }
.hero-metrics { display: flex; gap: 18px; text-align: right; }
.hero-metrics strong { font-size: 20px; font-weight: 800; display: block; }
.hero-metrics span { font-size: 11px; opacity: 0.75; font-weight: 600; text-transform: uppercase; }
.hero-why { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 14px; margin: 14px 0; font-size: 13px; line-height: 1.5; color: #cbd5e1; }
.hero-why-label { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--primary); letter-spacing: 0.5px; margin-bottom: 4px; }
.hero-actions { display: flex; gap: 10px; }
.btn-done { background: #ffffff; color: var(--text-main); border: none; padding: 11px 22px; border-radius: 12px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.btn-done:hover { background: var(--primary-light); color: var(--primary); }
.btn-change { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); padding: 11px 18px; border-radius: 12px; font-weight: 700; 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: 16px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }

/* BANDEAU "TA SEMAINE" */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 16px; }
.day-mini-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; padding: 12px 10px;
    font-size: 12px; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.day-mini-card.is-today { border: 2px solid var(--primary); background: var(--primary-light); }
.day-bar { height: 5px; border-radius: 3px; margin: 10px 0 8px; 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); }