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

:root {
    /* Core palette — dark-first */
    --bg: #0c0f1a;
    --bg-subtle: #111827;
    --card-bg: rgba(10,14,30,0.94);
    --glass: rgba(10,14,30,0.94);
    --glass-border: rgba(255,255,255,0.10);
    --glass-hover: rgba(255,255,255,0.14);

    /* Accents */
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: rgba(249,115,22,0.1);
    --accent-red: #ef4444;
    --accent-violet: #8b5cf6;
    --accent-cyan: #22d3ee;
    --accent-green: #22c55e;
    --accent-gold: #fbbf24;

    /* Legacy compat */
    --secondary: #e5e7eb;
    --accent: #f97316;
    --success: #22c55e;
    --success-light: rgba(34,197,94,0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245,158,11,0.1);
    --error: #ef4444;
    --error-light: rgba(239,68,68,0.1);
    --info: #3498db;
    --info-light: rgba(52,152,219,0.1);

    /* Text */
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --text-dim: #64748b;

    /* Layout */
    --border: rgba(255,255,255,0.06);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 270px;

    /* Fonts */
    --font-display: 'Rajdhani', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Theme colors */
    --theme-institutions: #8b5cf6;
    --theme-collectivites: #22d3ee;
    --theme-sdis: #f97316;
    --theme-fpt: #fbbf24;
    --theme-finances: #22c55e;
    --theme-europe: #a78bfa;
    --theme-police: #3b82f6;
    --theme-gendarmerie: #10b981;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    transition: background var(--transition), color var(--transition);
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #0c0f1a, #120f24);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition);
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(249,115,22,0.3);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(249,115,22,0.3); }
    50% { box-shadow: 0 0 30px rgba(249,115,22,0.45); }
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-title {
    color: white;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-subtitle {
    color: var(--text-light);
    font-size: 0.7rem;
    line-height: 1.3;
}

/* Sidebar search */
.sidebar-search-wrapper {
    padding: 0.75rem 1rem;
    position: relative;
    flex-shrink: 0;
}

.sidebar-search {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.82rem;
    font-family: var(--font-body);
    outline: none;
    transition: all var(--transition);
}

.sidebar-search::placeholder {
    color: var(--text-dim);
}

.sidebar-search:focus {
    background: rgba(255,255,255,0.06);
    border-color: rgba(249,115,22,0.3);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0.75rem;
    right: 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 300;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background var(--transition);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--glass-hover); }

.search-result-item .result-icon { font-size: 0.9rem; flex-shrink: 0; }
.search-result-item .result-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-item .result-type { font-size: 0.7rem; color: var(--text-dim); margin-left: auto; flex-shrink: 0; }

/* Sidebar gamification */
.sidebar-gamification {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-streak-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.streak-fire-icon {
    display: flex;
    align-items: center;
}

.streak-number {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.streak-label {
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.2;
}

.pomodoro-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.6rem;
    color: var(--text-light);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
}

.pomodoro-btn:hover {
    background: var(--glass-hover);
    color: var(--text);
}

.sidebar-xp-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.sidebar-level {
    color: var(--accent-violet);
    font-weight: 600;
}

.sidebar-xp-bar {
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #c084fc);
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(139,92,246,0.3);
    transition: width 0.5s ease;
}

.sidebar-rank-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.rank-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.rank-next {
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-separator {
    height: 1px;
    background: var(--border);
    margin: 0.35rem 0.75rem;
}

.sidebar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.87rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-btn:hover {
    background: rgba(255,255,255,0.04);
    color: #d1d5db;
}

.sidebar-btn.active {
    color: var(--primary);
    background: var(--primary-light);
}

.sidebar-btn.active::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(249,115,22,0.4);
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-btn.active .sidebar-icon {
    stroke: var(--primary);
}

.sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    min-width: 0;
    flex: 1;
}

.sidebar-profile:hover {
    background: rgba(255,255,255,0.03);
}

.sidebar-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(249,115,22,0.2);
    flex-shrink: 0;
    object-fit: cover;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-username {
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-role {
    color: var(--text-light);
    font-size: 0.68rem;
}

/* ===== Sidebar overlay (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* ===== Main wrapper ===== */
.main-wrapper {
    margin-left: 0;
    flex: 1;
    overflow-x: hidden;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Topbar (mobile only) ===== */
.topbar {
    display: none;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.75rem;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition);
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-streak {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
}

/* ===== Main ===== */
main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
    animation: pageIn 0.3s ease;
}

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

footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-dim);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
}

/* ===== Cards (glassmorphism) ===== */
.card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--glass-hover);
}

.card h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: white;
    font-weight: 600;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===== Accueil ===== */
.welcome {
    padding: 0;
}

.welcome-hero {
    background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(139,92,246,0.08));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 2rem 2.5rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.welcome-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(249,115,22,0.1), transparent 70%);
    border-radius: 50%;
}

.welcome-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139,92,246,0.08), transparent 70%);
    border-radius: 50%;
}

.welcome-hero h2 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: white;
    position: relative;
    z-index: 1;
}

.welcome-hero p {
    color: var(--text-light);
    font-size: 0.88rem;
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
}

.hero-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.hero-stat .hn {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.hero-stat .hl {
    font-size: 0.68rem;
    color: var(--text-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.1rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--glass-hover);
}
.stat-card-link {
    cursor: pointer;
}
.stat-card-link:hover {
    border-color: var(--accent);
    background: rgba(249,115,22,0.07);
}

.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* Dashboard panels */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.panel {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.1rem;
    transition: all var(--transition);
}

.panel:hover {
    border-color: var(--glass-hover);
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.65rem;
}

/* Revision list */
.rev-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.rev-item:last-child { border: none; }
.rev-item:hover .rev-q { color: #fff; }

.rev-q {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.15s;
}

.rev-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.rev-tag.hard { background: rgba(239,68,68,0.12); color: #ef4444; }
.rev-tag.med { background: rgba(245,158,11,0.12); color: #f59e0b; }
.rev-tag.easy { background: rgba(34,197,94,0.12); color: #22c55e; }

/* Mastery bars */
.bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.bar-row .bar-label {
    font-size: 0.72rem;
    color: var(--text-light);
    width: 150px;
    flex-shrink: 0;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.04);
    border-radius: 3px;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.bar-pct {
    font-size: 0.68rem;
    font-weight: 600;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* Heatmap */
.heatmap {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 2px;
}

.hd {
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(255,255,255,0.03);
}

.hd.l1 { background: rgba(249,115,22,0.15); }
.hd.l2 { background: rgba(249,115,22,0.3); }
.hd.l3 { background: rgba(249,115,22,0.5); }
.hd.l4 { background: #f97316; }

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.65rem;
    margin-top: 0;
}

.action-card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: rgba(249,115,22,0.2);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.action-card .action-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.action-card h3 {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.1rem;
    font-weight: 600;
}

.action-card p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== Page title ===== */
.page-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

/* ===== Theme grid ===== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.theme-card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.theme-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.theme-card[data-color="institutions"]::before { background: var(--theme-institutions); }
.theme-card[data-color="collectivites"]::before { background: var(--theme-collectivites); }
.theme-card[data-color="sdis"]::before { background: var(--theme-sdis); }
.theme-card[data-color="fpt"]::before { background: var(--theme-fpt); }
.theme-card[data-color="finances"]::before { background: var(--theme-finances); }
.theme-card[data-color="europe"]::before { background: var(--theme-europe); }
.theme-card[data-color="police"]::before { background: var(--theme-police); }
.theme-card[data-color="gendarmerie"]::before { background: var(--theme-gendarmerie); }

/* ===== Super QCM card ===== */
.super-qcm-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(251,191,36,0.12) 0%, rgba(245,158,11,0.08) 100%);
    border: 2px solid rgba(251,191,36,0.45) !important;
    position: relative;
    overflow: hidden;
}
.super-qcm-card::before {
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706) !important;
}
.super-qcm-card::after {
    content: "⭐ RECOMMANDÉ";
    position: absolute;
    top: 0.55rem;
    right: 0.75rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fbbf24;
    background: rgba(251,191,36,0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    border: 1px solid rgba(251,191,36,0.35);
}
.super-qcm-card:hover {
    border-color: rgba(251,191,36,0.75) !important;
    box-shadow: 0 8px 32px rgba(251,191,36,0.2);
}
.super-qcm-card h3 { font-size: 1.15rem !important; }
.super-qcm-card .theme-icon { font-size: 2.4rem !important; }
@media (max-width: 600px) { .super-qcm-card { grid-column: 1 / -1; } }

.theme-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-hover);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.theme-card .theme-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.theme-card h3 { font-size: 1rem; margin-bottom: 0.3rem; color: white; font-weight: 600; }
.theme-card p { font-size: 0.8rem; color: var(--text-light); line-height: 1.4; }

/* ===== QCM numérotés ===== */
.qcm-theme-sub {
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}
.qcm-num-card .qcm-num-icon {
    font-size: 1.5rem !important;
    margin-bottom: 0.35rem;
}
.qcm-num-done {
    border-color: rgba(34,197,94,0.4) !important;
}
.qcm-num-done::before {
    background: #22c55e !important;
}
body.light .qcm-num-done { border-color: rgba(34,197,94,0.5) !important; }

.theme-card .theme-meta {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: var(--text-light);
}

.theme-meta .badge {
    background: rgba(255,255,255,0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 500;
}

/* ===== Cours detail ===== */
.cours-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: all var(--transition);
    flex-shrink: 0;
    font-family: var(--font-body);
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Cours accordion ===== */
.cours-resume-box {
    background: rgba(249,115,22,0.07);
    border: 1px solid rgba(249,115,22,0.3);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.75rem;
}
.cours-resume-label {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 0.55rem;
}
.cours-resume-list {
    margin: 0;
    padding: 0 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.cours-resume-list li {
    font-size: 0.83rem;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.45;
}

.cours-summary { margin-bottom: 0.75rem; }
.cours-summary-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.cours-toc {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.cours-toc-link {
    background: none;
    border: none;
    padding: 0.2rem 0;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    transition: color 0.15s;
}
.cours-toc-link:hover { color: var(--accent); }

.cours-accordion {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.35rem;
    overflow: hidden;
}
.cours-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.cours-accordion-header:hover { background: rgba(255,255,255,0.04); color: var(--accent); }
.cours-accordion.open .cours-accordion-header { color: var(--accent); }
.accord-chevron { flex-shrink: 0; transition: transform 0.25s ease; color: var(--text-light); opacity: 0.7; }
.cours-accordion:hover .accord-chevron { opacity: 1; }
.cours-accordion.open .accord-chevron { transform: rotate(180deg); color: var(--primary); opacity: 1; }
.cours-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.cours-accordion.open .cours-accordion-body { max-height: 12000px; }
.cours-accordion-body .cours-content {
    padding: 0.75rem 0.9rem 1rem;
    border-top: 1px solid var(--border);
}

/* Light mode */
body.light .cours-accordion { background: #fff; border-color: #e2e8f0; }
body.light .cours-accordion-header:hover { background: rgba(0,0,0,0.03); }
body.light .cours-resume-box {
    background: rgba(249,115,22,0.06);
    border-color: rgba(249,115,22,0.25);
}
body.light .cours-resume-list li { color: #1e293b; }

.cours-content {
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

.cours-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    font-family: var(--font-display);
    color: var(--primary);
}

.cours-content ul, .cours-content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.cours-content li { margin-bottom: 0.4rem; }
.cours-content p { margin-bottom: 0.75rem; }
.cours-content table { width: 100%; max-width: 100%; overflow-x: auto; display: block; border-collapse: collapse; font-size: 0.8rem; }
.cours-content th, .cours-content td { padding: 0.35rem 0.5rem; border: 1px solid var(--border); text-align: left; }

.key-point {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
}

.definition {
    background: var(--info-light);
    border-left: 4px solid var(--info);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
}

/* ===== QCM ===== */
.qcm-container { max-width: 700px; margin: 0 auto; }

.question-card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.question-number {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    color: white;
}

.choices { display: flex; flex-direction: column; gap: 0.5rem; }

.choice-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    font-size: 0.92rem;
    transition: all var(--transition);
    line-height: 1.4;
    color: var(--text);
    font-family: var(--font-body);
}

.choice-btn:hover:not(.disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(4px);
}

.choice-btn .choice-letter {
    font-weight: 700;
    color: var(--primary);
    min-width: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-light);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.choice-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.choice-btn.correct { border-color: var(--success); background: var(--success-light); }
.choice-btn.correct .choice-letter { background: var(--success); color: white; }
.choice-btn.incorrect { border-color: var(--error); background: var(--error-light); }
.choice-btn.incorrect .choice-letter { background: var(--error); color: white; }
.choice-btn.disabled { cursor: default; opacity: 0.6; transform: none !important; }
.choice-btn.disabled.correct, .choice-btn.disabled.incorrect { opacity: 1; }

.explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--info-light);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    border-left: 4px solid var(--info);
    display: none;
    line-height: 1.6;
}

.explanation.visible { display: block; animation: fadeIn 0.3s ease; }

/* QCM progress */
.qcm-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.85rem; }
.qcm-step { font-weight: 600; color: var(--text); }
.qcm-score-live { color: var(--text-light); font-weight: 500; }

.qcm-progress-bar-wrapper { background: rgba(255,255,255,0.06); border-radius: 10px; height: 8px; overflow: hidden; margin-bottom: 1.5rem; }
.qcm-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent-red)); border-radius: 10px; transition: width 0.5s ease; }

.qcm-single-card { animation: cardIn 0.35s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.qcm-nav { display: flex; justify-content: center; margin-top: 1.5rem; }

.answer-feedback {
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.answer-feedback.correct { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.answer-feedback.incorrect { background: var(--error-light); color: var(--error); border: 1px solid var(--error); }

/* ===== QCM Results ===== */
.qcm-results { text-align: center; padding: 2rem; }

.score-circle {
    width: 130px; height: 130px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 1rem auto;
    font-family: var(--font-display);
    font-size: 2.2rem; font-weight: 800; color: white;
    box-shadow: var(--shadow-md);
}

.score-circle.good { background: linear-gradient(135deg, #22c55e, #16a34a); }
.score-circle.medium { background: linear-gradient(135deg, #f59e0b, #d97706); }
.score-circle.bad { background: linear-gradient(135deg, #ef4444, #dc2626); }

.result-message { font-size: 1.1rem; font-weight: 600; margin: 0.5rem 0; }

.qcm-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* ===== Examen ===== */
.exam-setup { max-width: 550px; margin: 0 auto; text-align: center; }
.exam-setup > p { color: var(--text-light); margin-bottom: 1.5rem; }
.exam-options { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.5rem 0; }

.exam-option {
    padding: 1rem 1.25rem;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    background: var(--glass);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exam-option:hover { border-color: var(--primary); }
.exam-option.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(249,115,22,0.15); }
.exam-option .exam-icon { font-size: 1.5rem; }
.exam-option h4 { font-size: 0.95rem; margin-bottom: 0.15rem; color: white; }
.exam-option p { font-size: 0.8rem; color: var(--text-light); }

.timer {
    position: sticky; top: 0;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: white;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; z-index: 10;
    font-size: 0.85rem;
}

.timer .time {
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ===== Glossaire ===== */
.glossaire-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: var(--glass);
    color: var(--text);
    transition: border-color var(--transition);
    font-family: var(--font-body);
}

.glossaire-search:focus { outline: none; border-color: var(--primary); }

.glossaire-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.6rem; }

.glossaire-item {
    background: var(--glass);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.glossaire-item:hover { border-color: var(--primary); }
.glossaire-item .sigle { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.glossaire-item .def { font-size: 0.82rem; color: var(--text-light); margin-top: 0.2rem; line-height: 1.4; }
.glossaire-count { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.75rem; }

/* ===== Frise ===== */
.frise-container { position: relative; max-width: 750px; margin: 0 auto; padding-left: 2rem; }
.frise-container::before { content: ""; position: absolute; left: 0.75rem; top: 0; bottom: 0; width: 3px; background: rgba(255,255,255,0.06); border-radius: 3px; }

.frise-item { position: relative; margin-bottom: 1.25rem; padding-left: 1.5rem; animation: fadeIn 0.3s ease; }

.frise-dot {
    position: absolute; left: -1.6rem; top: 0.25rem;
    width: 14px; height: 14px; border-radius: 50%;
    border: 3px solid var(--bg); box-shadow: var(--shadow-sm);
}

.frise-card {
    background: var(--glass);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.frise-card:hover { border-color: var(--glass-hover); transform: translateX(4px); }

.frise-annee { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.frise-titre { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; color: white; }
.frise-desc { font-size: 0.82rem; color: var(--text-light); line-height: 1.5; }

.frise-cat {
    display: inline-block; font-size: 0.7rem; padding: 0.15rem 0.5rem;
    border-radius: 20px; color: white; font-weight: 600; margin-top: 0.4rem;
    text-transform: uppercase; letter-spacing: 0.03em;
}

.frise-filters { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.frise-filter-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--glass);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all var(--transition);
    font-family: var(--font-body);
}

.frise-filter-btn:hover { border-color: var(--primary); color: var(--text); }
.frise-filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== Progression ===== */
.progress-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }

.progress-card {
    background: var(--glass);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.progress-card h3 { font-size: 0.92rem; margin-bottom: 0.75rem; color: white; }

.progress-bar-container { background: rgba(255,255,255,0.06); border-radius: 10px; height: 10px; overflow: hidden; margin-bottom: 0.4rem; }

.progress-bar { height: 100%; border-radius: 10px; transition: width 0.5s ease; }
.progress-bar.good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.medium { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar.bad { background: linear-gradient(90deg, #ef4444, #dc2626); }

.progress-text { font-size: 0.78rem; color: var(--text-light); }

.history-list { list-style: none; }

.history-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}

.history-item:last-child { border-bottom: none; }

/* ===== Parametres ===== */
.settings-container { max-width: 650px; margin: 0 auto; }

.settings-section {
    background: var(--glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.settings-section h3 {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 700;
    margin-bottom: 1rem; color: white;
    display: flex; align-items: center; gap: 0.5rem;
}

.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block; font-size: 0.78rem; font-weight: 600;
    color: var(--text-dim); margin-bottom: 0.35rem;
    text-transform: uppercase; letter-spacing: 0.03em;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    transition: border-color var(--transition);
    font-family: var(--font-body);
}

.form-input:focus { outline: none; border-color: var(--primary); }

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.avatar-option {
    border: 2px solid var(--glass-border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.25rem 0.5rem;
    transition: all var(--transition);
    background: rgba(255,255,255,0.03);
    overflow: hidden;
}

.avatar-option:hover {
    border-color: var(--primary);
    transform: scale(1.04);
    background: rgba(249,115,22,0.06);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: rgba(249,115,22,0.08);
    box-shadow: 0 0 14px rgba(249,115,22,0.28);
}

.avatar-option img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.settings-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

.settings-toast {
    position: fixed; bottom: 2rem; right: 2rem;
    background: var(--success);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
    z-index: 500;
}

@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

/* ===== Buttons ===== */
.btn {
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-red));
    color: white;
    box-shadow: 0 4px 15px rgba(249,115,22,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(249,115,22,0.4);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover { background: var(--glass-hover); border-color: var(--glass-hover); }

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 8px rgba(34,197,94,0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.reset-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
}

.btn-danger:hover { background: var(--error); color: white; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { max-width: 400px; margin: 0 auto; font-size: 0.9rem; }

/* ===== Theme toggle button ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    margin-left: auto;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.theme-icon-moon { display: none; }

/* ===== Light mode (body.light) ===== */
body.light {
    --bg: #f0f4f8;
    --bg-subtle: #ffffff;
    --card-bg: #ffffff;
    --glass: #ffffff;
    --glass-border: rgba(15,23,42,0.09);
    --glass-hover: rgba(15,23,42,0.04);
    --text: #0f172a;
    --text-light: #475569;
    --text-dim: #94a3b8;
    --border: rgba(15,23,42,0.10);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.09);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.11);
}

/* Topbar light */
body.light .topbar { color: var(--text); }
body.light .topbar-title { color: var(--text); }
body.light .hamburger span { background: var(--text); }
body.light .topbar-streak { color: var(--text-light); }

/* Cards — remove glass blur, add clean shadow */
body.light .card,
body.light .stat-card,
body.light .panel,
body.light .action-card,
body.light .theme-card,
body.light .question-card,
body.light .settings-section,
body.light .welcome-hero,
body.light .result-card,
body.light .badge-card,
body.light .glossaire-card,
body.light .frise-item,
body.light .cours-section {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 1px rgba(15,23,42,0.06);
}

/* Hero */
body.light .welcome-hero {
    background: linear-gradient(135deg, rgba(249,115,22,0.07), rgba(139,92,246,0.05));
    border-color: rgba(249,115,22,0.14);
}
body.light .hero-stat .hn { color: var(--text); }
body.light .hero-stat .hl { color: var(--text-light); }

/* Misc text */
body.light .section-title { color: #374151; }
body.light .bar-label { color: var(--text-light); }
body.light .rev-q { color: #1e293b; }
body.light .rev-item { border-color: rgba(0,0,0,0.07); }
body.light .rev-item:hover { background: rgba(249,115,22,0.04); }
body.light .page-title { color: var(--text); }
body.light .back-btn { color: var(--text-light); }
body.light .back-btn:hover { color: var(--text); }
body.light .section-sep { border-color: rgba(0,0,0,0.08); }

/* Heatmap */
body.light .hd { background: rgba(0,0,0,0.06); }
body.light .hd.l1 { background: rgba(249,115,22,0.20); }
body.light .hd.l2 { background: rgba(249,115,22,0.42); }
body.light .hd.l3 { background: rgba(249,115,22,0.68); }
body.light .hd.l4 { background: #f97316; }

/* Forms */
body.light .form-input {
    background: #f8fafc;
    border-color: rgba(15,23,42,0.15);
    color: var(--text);
}
body.light .form-input::placeholder { color: #94a3b8; }
body.light .form-label { color: #374151; }
body.light .settings-section h3 { color: var(--text); }

/* Buttons */
body.light .btn-secondary {
    background: rgba(15,23,42,0.07);
    color: #1e293b;
    border: 1px solid rgba(15,23,42,0.14);
}
body.light .btn-secondary:hover { background: rgba(15,23,42,0.12); }

/* QCM */
body.light .qcm-option { background: #ffffff; border-color: rgba(15,23,42,0.11); color: var(--text); }
body.light .qcm-option:hover { background: rgba(249,115,22,0.05); }
body.light .qcm-option.selected { background: rgba(249,115,22,0.08); }
body.light .qcm-option.correct { background: rgba(34,197,94,0.09); border-color: #22c55e; }
body.light .qcm-option.wrong { background: rgba(239,68,68,0.07); border-color: #ef4444; }
body.light .question-text { color: var(--text); }
body.light .feedback-box { background: rgba(249,115,22,0.07); border-color: rgba(249,115,22,0.2); color: #92400e; }
body.light .feedback-box.correct { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.25); color: #065f46; }
body.light .feedback-box.wrong { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.2); color: #7f1d1d; }

/* Theme cards */
body.light .theme-card h3 { color: var(--text); }
body.light .theme-card p { color: var(--text-light); }
body.light .progress-text { color: var(--text-light); }

/* Cours */
body.light .cours-section h3 { color: var(--text); }
body.light .cours-section p, body.light .cours-section li { color: #334155; }

/* Glossaire */
body.light .glossaire-card { background: #ffffff; }
body.light .glossaire-sigle { color: var(--text); }
body.light .glossaire-def { color: #334155; }

/* Frise */
body.light .frise-item { background: #ffffff; }
body.light .frise-title { color: var(--text); }
body.light .frise-desc { color: #334155; }

/* Sidebar search dropdown */
body.light .search-results { background: #ffffff; border-color: rgba(0,0,0,0.1); }
body.light .search-result-item { color: var(--text); border-color: rgba(0,0,0,0.06); }
body.light .search-result-item:hover { background: rgba(249,115,22,0.05); }

/* Theme toggle light */
body.light .theme-icon-sun { display: none; }
body.light .theme-icon-moon { display: block; }
body.light .theme-toggle {
    background: rgba(15,23,42,0.07);
    border-color: rgba(15,23,42,0.13);
    color: #475569;
}
body.light .theme-toggle:hover { background: rgba(15,23,42,0.11); color: #0f172a; }

/* Sidebar light mode */
body.light .sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(15,23,42,0.10);
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}
body.light .sidebar-header { border-color: rgba(15,23,42,0.08); }
body.light .sidebar-title { color: #0f172a; }
body.light .sidebar-subtitle { color: #64748b; }
body.light .sidebar-search {
    background: #f1f5f9;
    border-color: rgba(15,23,42,0.13);
    color: #0f172a;
}
body.light .sidebar-search::placeholder { color: #94a3b8; }
body.light .sidebar-search:focus { background: #e8eef5; border-color: rgba(249,115,22,0.4); }
body.light .sidebar-gamification { border-color: rgba(15,23,42,0.08); }
body.light .streak-label { color: #64748b; }
body.light .sidebar-level { color: #334155; }
body.light .sidebar-xp-text { color: #64748b; }
body.light .sidebar-xp-bar { background: rgba(15,23,42,0.08); }
body.light .sidebar-rank-next { color: #64748b; }
body.light .pomodoro-btn {
    background: #f1f5f9;
    border-color: rgba(15,23,42,0.12);
    color: #475569;
}
body.light .pomodoro-btn:hover { background: #e2e8f0; }
body.light .sidebar-separator { background: rgba(15,23,42,0.08); }
body.light .sidebar-nav { scrollbar-color: rgba(0,0,0,0.08) transparent; }
body.light .sidebar-btn { color: #334155; }
body.light .sidebar-btn:hover { background: rgba(249,115,22,0.07); color: #0f172a; }
body.light .sidebar-btn.active { color: var(--primary); background: rgba(249,115,22,0.09); }
body.light .sidebar-btn.active .sidebar-icon { stroke: var(--primary); }
body.light .sidebar-label { color: inherit; }
body.light .sidebar-footer { border-color: rgba(15,23,42,0.08); }
body.light .sidebar-username { color: #0f172a; }
body.light .sidebar-role { color: #64748b; }
body.light .sidebar-profile:hover { background: rgba(0,0,0,0.03); }
body.light .sidebar-overlay { background: rgba(0,0,0,0.25); }

/* ===== Exam step-by-step ===== */
.exam-step-header {
    margin-bottom: 1.5rem;
}
.exam-progress-bar {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
body.light .exam-progress-bar { background: rgba(15,23,42,0.10); }
.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ef4444);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.exam-step-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-light);
}
.exam-timer-badge {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(249,115,22,0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}
.exam-timer-badge.urgent { color: #ef4444; background: rgba(239,68,68,0.12); }
.exam-step-card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 760px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}
body.light .exam-step-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.05);
}
.exam-step-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
.exam-feedback {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.55;
    border: 1px solid transparent;
}
.exam-feedback.correct {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.25);
    color: #4ade80;
}
body.light .exam-feedback.correct { background: rgba(34,197,94,0.09); color: #065f46; border-color: rgba(34,197,94,0.22); }
.exam-feedback.wrong {
    background: rgba(239,68,68,0.10);
    border-color: rgba(239,68,68,0.22);
    color: #f87171;
}
body.light .exam-feedback.wrong { background: rgba(239,68,68,0.07); color: #7f1d1d; border-color: rgba(239,68,68,0.18); }
.choice-btn[disabled] { opacity: 0.7; cursor: default; }
.choice-btn.correct { border-color: #22c55e !important; background: rgba(34,197,94,0.12) !important; }
.choice-btn.wrong { border-color: #ef4444 !important; background: rgba(239,68,68,0.10) !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .app-layout { margin-left: 0; }
    .topbar { display: flex; }
    main { padding: 1rem; }
    .theme-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: 1fr; }
    .dashboard-row { grid-template-columns: 1fr; }
    .qcm-actions { flex-direction: column; align-items: center; }
    .welcome-hero { padding: 1.5rem 1rem; }
    .welcome-hero h2 { font-size: 1.4rem; }
    .hero-row { flex-wrap: wrap; gap: 0.75rem; }
    .glossaire-grid { grid-template-columns: 1fr; }
    .avatar-grid { grid-template-columns: repeat(3, 1fr); }
    .settings-actions { flex-direction: column; }
    .settings-toast { left: 1rem; right: 1rem; bottom: 1rem; text-align: center; }
    .concours-grid { grid-template-columns: 1fr 1fr; }
    .concours-select-inner h1 { font-size: 1.8rem; }

    /* Typographie globale réduite */
    body { font-size: 14px; }
    h1, .page-title { font-size: 1.25rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 0.95rem; }

    /* Hero */
    .welcome-hero h2 { font-size: 1.2rem; }
    .welcome-hero p { font-size: 0.82rem; }
    .hn { font-size: 1.4rem; }

    /* Stats */
    .stat-number { font-size: 1.6rem; }
    .stat-label { font-size: 0.68rem; }

    /* Cours content */
    .cours-content { font-size: 0.85rem; line-height: 1.65; }
    .cours-accordion-header { font-size: 0.82rem; }
    .cours-resume-list li { font-size: 0.8rem; }

    /* Cards */
    .theme-card h3 { font-size: 0.95rem; }
    .theme-card p { font-size: 0.78rem; }
    .action-card h3 { font-size: 0.9rem; }
    .action-card p { font-size: 0.75rem; }

    /* QCM */
    .question-text { font-size: 0.95rem; }
    .choice-btn { font-size: 0.85rem; padding: 0.65rem 0.9rem; }

    /* Sidebar gamification */
    .streak-number { font-size: 1rem; }

    /* Topbar */
    .topbar-title { font-size: 0.95rem; }
}

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

/* ===== Concours Selection Overlay ===== */
#concours-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem 1rem;
}
.concours-select-inner {
    max-width: 920px;
    width: 100%;
    text-align: center;
}
.concours-select-inner h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.concours-select-sub {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}
.concours-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    text-align: left;
}
.concours-card {
    background: var(--card-bg);
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.concours-card:hover {
    transform: translateY(-6px);
    border-color: var(--cc, #f97316);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.concours-card-icon {
    font-size: 2.8rem;
    margin-bottom: 0.25rem;
}
.concours-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}
.concours-card p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
    flex: 1;
    line-height: 1.5;
}
.concours-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    padding: 0.22rem 0.7rem;
    border-radius: 20px;
    align-self: flex-start;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
body.light #concours-overlay {
    background: #f8fafc;
}
body.light .concours-card {
    background: #fff;
    border-color: #e2e8f0;
}
body.light .concours-card:hover {
    border-color: var(--cc, #f97316);
}

/* ===== Avis Modal ===== */
#avis-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.avis-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(4px);
}
.avis-box {
    position: relative;
    background: var(--bg);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
    text-align: center;
}
.avis-box h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .35rem; }
.avis-box > p { font-size: .88rem; color: var(--text-dim); margin-bottom: 1.25rem; }
.avis-close {
    position: absolute;
    top: .75rem; right: .75rem;
    background: none; border: none;
    color: var(--text-dim); font-size: 1rem;
    cursor: pointer; padding: .25rem .5rem; border-radius: 6px;
    transition: background .15s;
}
.avis-close:hover { background: rgba(255,255,255,.08); }
.avis-stars {
    display: flex;
    justify-content: center;
    gap: .35rem;
    font-size: 2.2rem;
    margin-bottom: .5rem;
    cursor: pointer;
}
.avis-stars span {
    color: rgba(255,255,255,.12);
    transition: color .12s, transform .12s;
    user-select: none;
}
.avis-stars span.active,
.avis-stars span.selected { color: #fbbf24; transform: scale(1.1); }
body.light .avis-box { background: #fff; border-color: #e2e8f0; }
body.light .avis-stars span { color: #e2e8f0; }

/* ===== Badge Toast ===== */
.badge-toast {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.10);
    border-left: 4px solid var(--bc, #fbbf24);
    border-radius: 14px;
    padding: 0.9rem 1.2rem;
    min-width: 230px;
    max-width: 310px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    z-index: 9000;
    animation: toast-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    transition: opacity 0.4s ease;
}
@keyframes toast-in {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}
.badge-toast-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}
.badge-toast-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.badge-toast-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}
.badge-toast-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.badge-toast-rarity {
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== Badge Page — categories ===== */
.badge-category {
    margin-bottom: 2rem;
}
.badge-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.badge-cat-title {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}
.badge-cat-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
}

/* ===== Badge Grid ===== */
.badge-grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.badge-card2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.1rem 0.75rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.badge-card2.earned {
    border-color: var(--bc, var(--primary));
    box-shadow: 0 0 18px rgba(var(--bc-rgb, 249,115,22), 0.18);
}
.badge-card2.earned:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.badge-card2.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}
.badge-card2-icon {
    font-size: 2rem;
    line-height: 1;
}
.badge-card2-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}
.badge-card2-desc {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.4;
}
.badge-card2-rarity {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.1rem;
}

/* ===== Badge Legend ===== */
.badge-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    margin-top: 1.5rem;
    padding: 0.9rem 1.1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.badge-legend-item {
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== Light mode overrides ===== */
body.light .badge-toast {
    background: #fff;
    border-color: #e2e8f0;
    border-left-color: var(--bc, #fbbf24);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
body.light .badge-card2 {
    background: #fff;
    border-color: #e2e8f0;
}
body.light .badge-legend {
    background: #f8fafc;
    border-color: #e2e8f0;
}

@media (max-width: 480px) {
    .badge-grid2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .badge-toast {
        left: 1rem;
        right: 1rem;
        min-width: unset;
        max-width: unset;
        bottom: 5rem;
    }
}

/* ===== App layout (sidebar + main + right panel) ===== */
.app-layout {
    margin-left: var(--sidebar-width);
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

/* ===== Right panel profil widget ===== */
.right-profil-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.rpw-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.rpw-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--accent);
}
.rpw-info {}
.rpw-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.2;
}
.rpw-concours {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rpw-xp-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}
.rpw-xp-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}
.rpw-xp-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.4s ease;
}
body.light .right-profil-widget { background: #fff; }
body.light .rpw-xp-bar { background: #e2e8f0; }

/* ===== Right panel ===== */
.right-panel {
    width: 264px;
    flex-shrink: 0;
    padding: 1.25rem 0.75rem;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
}

/* ===== Calendar widget ===== */
.cal-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}
.cal-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin: 0 0 0.85rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cal-group {
    margin-bottom: 0.85rem;
}
.cal-group:last-child { margin-bottom: 0; }
.cal-group-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--cc, var(--accent));
    margin-bottom: 0.4rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid color-mix(in srgb, var(--cc, var(--accent)) 25%, transparent);
}
.cal-event {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 7px;
    margin-bottom: 0.3rem;
    background: rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.cal-event:hover { background: rgba(255,255,255,0.06); }
.cal-event-left {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 0;
}
.cal-event-icon { font-size: 0.85rem; flex-shrink: 0; margin-top: 1px; }
.cal-event-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cal-event-name {
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}
.cal-event-date {
    font-size: 0.67rem;
    color: var(--text-dim);
    margin-top: 1px;
}
.cal-countdown {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    background: rgba(255,255,255,0.07);
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}
.cal-countdown.soon {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}
.cal-countdown.urgent {
    background: rgba(239,68,68,0.18);
    color: #f87171;
}
.cal-empty {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-align: center;
    padding: 0.75rem 0;
    margin: 0;
}

/* ===== Sidebar quick-access links ===== */
.sidebar-quick-links {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem;
}
.sidebar-quick-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}
.sidebar-quick-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* Light mode overrides */
body.light .cal-widget {
    background: #fff;
    border-color: #e2e8f0;
}
body.light .cal-event { background: rgba(0,0,0,0.025); }
body.light .cal-event:hover { background: rgba(0,0,0,0.06); }
body.light .cal-countdown { background: rgba(0,0,0,0.07); color: #64748b; }
body.light .sidebar-quick-btn {
    background: rgba(0,0,0,0.04);
    border-color: #e2e8f0;
    color: #64748b;
}
body.light .sidebar-quick-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #0f172a;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .right-panel { display: none; }
}
@media (max-width: 768px) {
    .app-layout { margin-left: 0; }
}

/* ===== GDO/GTO Sidebar — Section opérationnelle ===== */
.sidebar-section-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    padding: 0.6rem 0.85rem 0.15rem;
    user-select: none;
}

.sidebar-parent {
    justify-content: flex-start;
}
.sidebar-chevron {
    margin-left: auto;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.35;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
.sidebar-parent[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(90deg);
    opacity: 0.7;
}
.sidebar-parent[aria-expanded="true"] {
    color: var(--primary, #f97316);
}
.sidebar-parent[aria-expanded="true"] .sidebar-icon {
    stroke: var(--primary, #f97316);
}

.sidebar-subgroup {
    display: none;
    overflow: hidden;
}
.sidebar-subgroup.open {
    display: block;
}

.sidebar-sub {
    padding-left: 2.2rem;
    font-size: 0.83rem;
    margin-bottom: 1px;
}
.sidebar-sub-pip {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.sidebar-sub.active .sidebar-sub-pip {
    opacity: 1;
    background: var(--primary, #f97316);
}

/* ===== Doctrine PDF Page ===== */
.doctrine-page { max-width: 900px; margin: 0 auto; }
.doctrine-section-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 2rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.doctrine-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.doctrine-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.18s, transform 0.18s;
}
.doctrine-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.doctrine-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.doctrine-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}
.doctrine-badge.gdo { background: rgba(239,68,68,0.18); color: #f87171; }
.doctrine-badge.gto { background: rgba(59,130,246,0.18); color: #60a5fa; }
.doctrine-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}
.doctrine-card-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.doctrine-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.doctrine-tag {
    font-size: 0.68rem;
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.doctrine-card-actions {
    margin-top: auto;
    padding-top: 0.6rem;
}
.doctrine-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(249,115,22,0.1);
    border: 1px solid rgba(249,115,22,0.25);
    border-radius: 7px;
    padding: 0.38rem 0.75rem;
    text-decoration: none;
    transition: background 0.15s;
}
.doctrine-btn:hover { background: rgba(249,115,22,0.2); }

.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    text-align: center;
    color: var(--text-dim);
    gap: 0.75rem;
}
.placeholder-page h2 { color: var(--text); }

/* Light mode overrides */
body.light .sidebar-section-label { color: rgba(0,0,0,0.3); }
body.light .doctrine-tag { background: rgba(0,0,0,0.04); }
body.light .doctrine-card { background: #fff; }

/* ===== Fiches Synthèse ===== */
.synth-bref {
    font-size: 0.95rem;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(249,115,22,0.06);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
}
.synth-section {
    margin-bottom: 1.5rem;
}
.synth-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.65rem;
}
.synth-cles {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.synth-cles li { font-size: 0.88rem; color: var(--text); }
.synth-chiffres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.synth-chiffre {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.synth-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Rajdhani', sans-serif;
}
.synth-label { font-size: 0.76rem; color: var(--text-dim); }
.synth-securite {
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.synth-securite li {
    font-size: 0.88rem;
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.15);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    color: var(--text);
}

/* ===== Parcours — grade badges & pages ===== */
.sidebar-grade-badge {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.12rem 0.38rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.45);
    margin-left: 0.3rem;
    flex-shrink: 0;
}
body.light .sidebar-grade-badge {
    background: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.35);
}

.parcours-hero {
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.parcours-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ph-color, #f97316);
    opacity: 0.08;
    border-radius: inherit;
}
.parcours-hero-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.parcours-hero-icon { font-size: 2rem; }
.parcours-hero-grade {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: var(--ph-color, #f97316);
    color: #fff;
}
.parcours-hero h2 { margin: 0; font-size: 1.3rem; }
.parcours-hero p { margin: 0.35rem 0 0; color: var(--text-dim); font-size: 0.85rem; }
.parcours-hero-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
}
.ph-global-bar { margin-top: 1rem; }
.ph-global-stats { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-dim); }
.ph-global-pct { font-weight: 700; }

.ph-programme-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}
.ph-programme-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.6rem; }
.ph-note-el { display: block; font-size: 0.75rem; color: #ef4444; margin-bottom: 0.6rem; font-weight: 600; }
.ph-epreuve-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}
.ph-epreuve-row:last-of-type { border-bottom: none; }
.ph-epreuve-nom { flex: 1; }
.ph-epreuve-nature {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    text-transform: uppercase;
}
.ph-epreuve-nature.prog-nature-ecrit { background: rgba(99,102,241,0.15); color: #818cf8; }
.ph-epreuve-nature.prog-nature-oral { background: rgba(249,115,22,0.15); color: #fb923c; }
.ph-epreuve-nature.prog-nature-sport { background: rgba(34,197,94,0.15); color: #4ade80; }
.ph-epreuve-coeff { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.ph-programme-ref { font-size: 0.68rem; color: var(--text-dim); margin-top: 0.5rem; }

.parcours-themes-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.parcours-theme-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s;
}
.parcours-theme-row:hover { border-color: var(--primary); }
.parcours-theme-icon { font-size: 1.1rem; flex-shrink: 0; }
.parcours-theme-info { flex: 1; min-width: 0; }
.parcours-theme-titre { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.parcours-theme-count { font-size: 0.72rem; color: var(--text-dim); }
.parcours-theme-bar { width: 80px; flex-shrink: 0; }
.parcours-theme-pct { font-size: 0.72rem; color: var(--text-dim); text-align: right; }
.parcours-new-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,0.25);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ===== Audio ===== */
.cours-audio-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
    flex-wrap: wrap;
}
.btn-audio {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: rgba(249,115,22,0.1);
    color: #f97316;
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    min-height: 36px;
}
.btn-audio:hover { background: rgba(249,115,22,0.18); border-color: rgba(249,115,22,0.5); }
.btn-audio.btn-audio-playing {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}
.audio-progress-bar {
    height: 4px;
    width: 120px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}
.audio-progress-fill { height: 100%; background: #f97316; width: 30%; border-radius: 4px; }
@keyframes audioSweep {
    0%   { width: 0%; opacity: 1; }
    80%  { width: 100%; opacity: 1; }
    100% { width: 100%; opacity: 0.4; }
}
.audio-progress-anim { animation: audioSweep 8s linear infinite; }

/* ===== Mission du Jour ===== */
.mission-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f97316;
}

/* Teaser accueil — compact, cliquable */
.mission-teaser {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(249,115,22,0.07);
    border: 1px solid rgba(249,115,22,0.18);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background 0.15s;
}
.mission-teaser:hover { background: rgba(249,115,22,0.12); }
.mission-teaser-theme {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mission-teaser-status {
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
}

/* Page mission dédiée */
.mission-page { padding-bottom: 2rem; }
.mission-page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.mission-page-header { margin-bottom: 1.25rem; }
.mission-theme {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.3rem 0 0.2rem;
}
.mission-score {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0;
}
.mission-done {
    font-size: 0.85rem;
    color: #22c55e;
    font-weight: 600;
    padding: 0.6rem 0.9rem;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.mission-checklist { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }
.mission-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s;
}
.mission-check-item.done { border-color: rgba(34,197,94,0.25); background: rgba(34,197,94,0.04); }
.mission-check-status { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.mission-check-body { flex: 1; min-width: 0; }
.mission-check-title { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.mission-check-sub { display: block; font-size: 0.72rem; color: var(--text-dim); margin-top: 0.1rem; }
.mission-check-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    background: rgba(249,115,22,0.1);
    color: #f97316;
    border: 1px solid rgba(249,115,22,0.25);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 36px;
    white-space: nowrap;
}
.mission-check-btn:hover { background: rgba(249,115,22,0.18); }
.mission-check-item.done .mission-check-btn {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
    border-color: rgba(34,197,94,0.25);
}
.mission-progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mission-bar-outer {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 6px;
    overflow: hidden;
}
.mission-bar-inner { height: 100%; background: #f97316; border-radius: 6px; transition: width 0.4s ease; }
.mission-progress-label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }

.mission-duree-btn {
    font-size: 0.72rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: color 0.15s;
    min-height: 30px;
}
.mission-duree-btn:hover { color: var(--text); }

/* ===== Durée mission (Paramètres) ===== */
.mission-duree-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.mission-duree-option {
    padding: 0.55rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
}
.mission-duree-option:hover { border-color: rgba(249,115,22,0.35); color: var(--text); }
.mission-duree-option.active {
    background: rgba(249,115,22,0.12);
    border-color: rgba(249,115,22,0.4);
    color: #f97316;
}

/* ===== Programme Concours ===== */
.prog-page { padding-bottom: 2rem; }
.prog-reference { font-size: 0.74rem; color: var(--text-dim); margin: -0.5rem 0 0.5rem; }
.prog-description { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; line-height: 1.5; }
.prog-rules-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prog-rule {
    font-size: 0.74rem; font-weight: 600;
    background: rgba(239,68,68,0.08); color: #ef4444;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px; padding: 0.2rem 0.6rem;
}
.prog-disclaimer {
    font-size: 0.72rem; color: #f97316;
    background: rgba(249,115,22,0.07);
    border: 1px solid rgba(249,115,22,0.2);
    border-radius: 8px; padding: 0.5rem 0.75rem;
    margin-bottom: 1.25rem;
}
.prog-section-title {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-dim);
    margin: 1.5rem 0 0.75rem;
}
.prog-epreuves { display: flex; flex-direction: column; gap: 0.75rem; }
.prog-epreuve-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem;
}
.prog-epreuve-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.prog-epreuve-nature {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; border-radius: 5px;
    padding: 0.15rem 0.5rem;
}
.prog-nature-écrite { background: rgba(59,130,246,0.12); color: #3b82f6; border: 1px solid rgba(59,130,246,0.25); }
.prog-nature-orale { background: rgba(139,92,246,0.12); color: #8b5cf6; border: 1px solid rgba(139,92,246,0.25); }
.prog-nature-physique { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }
.prog-nature-formation { background: rgba(249,115,22,0.12); color: #f97316; border: 1px solid rgba(249,115,22,0.25); }
.prog-nature-dossier { background: rgba(156,163,175,0.12); color: #9ca3af; border: 1px solid rgba(156,163,175,0.25); }
.prog-duree, .prog-coeff {
    font-size: 0.74rem; color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border); border-radius: 5px;
    padding: 0.1rem 0.4rem;
}
.prog-coeff { color: #f97316; border-color: rgba(249,115,22,0.2); background: rgba(249,115,22,0.07); font-weight: 700; }
.prog-epreuve-titre { font-size: 0.9rem; font-weight: 700; margin: 0 0 0.4rem; color: var(--text); }
.prog-epreuve-prog { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.5rem; line-height: 1.5; }
.prog-conseil-box {
    font-size: 0.76rem; color: var(--text-secondary); line-height: 1.5;
    background: rgba(255,255,255,0.03); border-left: 3px solid #f97316;
    padding: 0.45rem 0.65rem; border-radius: 0 6px 6px 0;
}
.prog-themes { display: flex; flex-direction: column; gap: 0.4rem; }
.prog-theme-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: 8px;
}
.prog-theme-name { flex: 1; font-size: 0.82rem; font-weight: 500; color: var(--text); }
.prog-poids { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 4px; }
.poids-fort { background: rgba(249,115,22,0.12); color: #f97316; border: 1px solid rgba(249,115,22,0.2); }
.poids-moyen { background: rgba(156,163,175,0.1); color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }
.prog-theme-btn {
    font-size: 0.74rem; font-weight: 600; color: #f97316;
    background: rgba(249,115,22,0.08); border: 1px solid rgba(249,115,22,0.2);
    border-radius: 6px; padding: 0.2rem 0.6rem; cursor: pointer;
    transition: background 0.15s; white-space: nowrap; min-height: 28px;
}
.prog-theme-btn:hover { background: rgba(249,115,22,0.16); }
.prog-theme-na { font-size: 0.72rem; color: var(--text-dim); }
.prog-conseils { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.prog-conseils li {
    font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5;
    padding: 0.55rem 0.75rem 0.55rem 1rem;
    border-left: 3px solid rgba(249,115,22,0.35);
    background: rgba(255,255,255,0.02); border-radius: 0 8px 8px 0;
}

/* ===== Streak pulse (≥7 jours) ===== */
@keyframes streakPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(249,115,22,0.5)); }
    50%       { filter: drop-shadow(0 0 10px rgba(249,115,22,0.9)); }
}
.streak-fire-icon.streak-active svg { animation: streakPulse 1.8s ease-in-out infinite; }

/* ===== Auth modal ===== */
.auth-modal { display:none; position:fixed; inset:0; z-index:1000; align-items:center; justify-content:center; }
.auth-modal.visible { display:flex; }
.auth-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.6); backdrop-filter:blur(4px); }
.auth-box {
    position:relative; z-index:1;
    background:var(--card-bg); border:1px solid var(--border); border-radius:20px;
    padding:2rem 1.75rem; width:min(90vw,400px);
    box-shadow:0 20px 60px rgba(0,0,0,0.4);
    display:flex; flex-direction:column; align-items:center; text-align:center; gap:.6rem;
}
.auth-close { position:absolute; top:1rem; right:1rem; background:none; border:none; color:var(--text-dim); font-size:1.1rem; cursor:pointer; padding:.25rem .5rem; border-radius:6px; }
.auth-close:hover { background:var(--border); }
.auth-icon { font-size:2.5rem; margin-bottom:.25rem; }
.auth-title { margin:0; font-size:1.2rem; font-weight:800; }
.auth-sub { margin:0; color:var(--text-dim); font-size:.85rem; line-height:1.5; }
.auth-form { width:100%; display:flex; flex-direction:column; gap:.6rem; margin-top:.5rem; }
.auth-input {
    width:100%; box-sizing:border-box;
    background:var(--bg); border:1px solid var(--border); border-radius:10px;
    padding:.7rem 1rem; color:var(--text); font-size:.9rem;
}
.auth-input:focus { outline:none; border-color:var(--primary); }
.auth-btn { width:100%; padding:.75rem; font-size:.95rem; font-weight:700; }
.auth-legal { margin:0; font-size:.72rem; color:var(--text-dim); }

/* ===== Freemium gate ===== */
.freemium-gate {
    max-width:440px; margin:0 auto;
    background:var(--card-bg); border:1px solid var(--border); border-radius:20px;
    padding:2rem 1.75rem;
    display:flex; flex-direction:column; align-items:center; text-align:center; gap:.75rem;
}
.fg-icon { font-size:3rem; }
.freemium-gate h3 { margin:0; font-size:1.25rem; font-weight:800; }
.freemium-gate p { margin:0; color:var(--text-dim); font-size:.88rem; }
.fg-sub { font-size:.82rem !important; }
.fg-cta { width:100%; padding:.75rem; font-size:.95rem; font-weight:700; margin-top:.25rem; }

/* QCM locked card */
.qcm-locked { opacity:.65; }
.qcm-lock-badge { margin-top:.4rem; font-size:.72rem; color:var(--text-dim); }

/* Auth tabs */
.auth-tabs { display:flex; gap:.4rem; width:100%; margin:.25rem 0; }
.auth-tab {
    flex:1; padding:.45rem; border:1px solid var(--border); border-radius:8px;
    background:none; color:var(--text-dim); font-size:.8rem; cursor:pointer; transition:all .15s;
}
.auth-tab.active { background:var(--primary); border-color:var(--primary); color:#fff; font-weight:700; }
