/* ============================================
   Strava Dashboard - Stylesheet
   Modern, responsive design
   ============================================ */

:root {
    --color-bg: #0f1117;
    --color-surface: #1a1d27;
    --color-surface-hover: #22263a;
    --color-card: #1e2130;
    --color-border: #2a2e3f;
    --color-text: #e4e6f0;
    --color-text-secondary: #8b8fa3;
    --color-text-muted: #5d6178;
    --color-primary: #fc4c02;
    --color-primary-light: #ff6b2b;
    --color-primary-dark: #d94000;
    --color-accent: #4c9aff;
    --color-success: #36b37e;
    --color-warning: #ffab00;
    --color-danger: #ff5630;
    --color-ride: #fc4c02;
    --color-run: #00c853;
    --color-swim: #2196f3;
    --color-walk: #9c27b0;
    --color-hike: #795548;
    --color-other: #607d8b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --color-badge-bg: rgba(255,255,255,0.04);
    --color-badge-bg-hover: rgba(255,255,255,0.08);
    --color-overlay: rgba(0, 0, 0, 0.3);
    --color-input-bg: #1a1d27;
    --login-gradient: radial-gradient(ellipse at top, #1a1d2e 0%, #0f1117 70%);
    --strava-logo-filter: none;
    --kpi-positive-bg: #1a3a2a;
    --kpi-negative-bg: #3a1a1a;
    --strava-orange: #fc4c02;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-surface-hover: #f5f5f7;
    --color-card: #ffffff;
    --color-border: #e0e2e8;
    --color-text: #1a1d27;
    --color-text-secondary: #5d6178;
    --color-text-muted: #8b8fa3;
    --color-accent: #2563eb;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --color-badge-bg: rgba(0, 0, 0, 0.04);
    --color-badge-bg-hover: rgba(0, 0, 0, 0.08);
    --color-overlay: rgba(0, 0, 0, 0.08);
    --color-input-bg: #f5f6f8;
    --login-gradient: radial-gradient(ellipse at top, #e8eaf0 0%, #f0f2f5 70%);
    --strava-logo-filter: brightness(0) saturate(100%) invert(30%) sepia(5%) saturate(500%) hue-rotate(200deg);
    --kpi-positive-bg: #dcfce7;
    --kpi-negative-bg: #fee2e2;
}

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* ============ LOGIN PAGINA ============ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--login-gradient);
    padding: 20px;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #fff;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
}

/* ============ LANDING PAGE ============ */
.landing-page {
    min-height: 100vh;
    background: var(--color-bg);
}

.landing-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Hero --- */
.landing-hero {
    padding: 80px 0 60px;
    background: var(--login-gradient);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-demo-landing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    background: transparent;
}

.btn-demo-landing:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.06);
}

.btn-demo-landing i {
    font-size: 18px;
}

/* --- Hero Screenshot --- */
.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-screenshot {
    width: 100%;
    max-width: 540px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

/* --- Section headers --- */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 16px;
    color: var(--color-text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* --- Features --- */
.landing-features {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card.feature-highlight {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(252, 76, 2, 0.06), rgba(252, 76, 2, 0.02));
    position: relative;
}

.feature-card.feature-highlight .feature-icon {
    background: var(--color-primary);
    color: #fff;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(252, 76, 2, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* --- Steps --- */
.landing-steps {
    padding: 80px 0;
    background: var(--color-surface);
}

.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}

.step-card {
    text-align: center;
    padding: 24px;
    flex: 1;
    max-width: 280px;
    position: relative;
}

.step-number {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 48px;
    font-weight: 800;
    color: var(--color-border);
    line-height: 1;
}

.step-icon {
    width: 64px;
    height: 64px;
    background: rgba(252, 76, 2, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--color-primary);
    margin: 0 auto 20px;
}

.step-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.step-connector {
    display: flex;
    align-items: center;
    padding-top: 52px;
    color: var(--color-border);
    font-size: 20px;
}

/* --- Pricing --- */
.landing-pricing {
    padding: 80px 0;
    background: var(--color-surface);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 760px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pricing-card-pro {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.pricing-card-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 40px;
    font-weight: 800;
    color: var(--color-text);
}

.pricing-price span {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text-muted);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    flex: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    padding: 8px 0;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.pricing-features li i {
    color: var(--color-success);
    margin-top: 3px;
    flex-shrink: 0;
}

.pricing-card-pro .pricing-features li i {
    color: var(--color-primary);
}

.btn-pricing {
    display: block;
    text-align: center;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition);
    background: transparent;
}

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

.btn-pricing-pro {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.btn-pricing-pro:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: #fff;
}

.pricing-note {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 24px;
}

/* --- CTA --- */
.landing-cta {
    padding: 80px 0;
}

.cta-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.cta-card h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-card > p {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.landing-footer-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

.landing-footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.landing-footer-links a:hover {
    color: var(--color-primary);
}

/* --- Landing responsive --- */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .step-connector {
        transform: rotate(90deg);
        padding-top: 0;
        padding: 8px 0;
    }
}

@media (max-width: 600px) {
    .landing-hero {
        padding: 48px 0 36px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 15px;
    }
    
    .landing-features,
    .landing-steps,
    .landing-cta {
        padding: 48px 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .cta-card {
        padding: 36px 20px;
    }
    
    .cta-card h2 {
        font-size: 24px;
    }
    
    .hero-mockup {
        max-width: 340px;
    }
    
    .mockup-kpis {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .mockup-kpi {
        padding: 8px 4px;
    }
    
    .mockup-kpi-value {
        font-size: 13px;
    }
}

.btn-strava {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--color-primary);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-strava:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 76, 2, 0.4);
}

.btn-strava-official {
    display: inline-block;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-strava-official:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.btn-strava-official img {
    display: block;
}

/* ============ DEMO MODUS ============ */
.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0 16px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.btn-demo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    background: transparent;
}

.btn-demo:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.06);
}

.btn-demo i {
    font-size: 18px;
}

.demo-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.demo-banner {
    background: linear-gradient(90deg, rgba(252, 76, 2, 0.12), rgba(255, 107, 43, 0.08));
    border-bottom: 1px solid rgba(252, 76, 2, 0.25);
    padding: 10px 24px;
}

.demo-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.demo-banner-inner i {
    color: var(--color-primary);
    font-size: 16px;
}

.demo-banner-cta {
    margin-left: auto;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: color var(--transition);
}

.demo-banner-cta:hover {
    color: var(--color-primary-light);
}

/* ============ PIN FORM (Privé Demo) ============ */
.pin-form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.pin-input-group {
    width: 100%;
    max-width: 220px;
}

.pin-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Inter', monospace;
    text-align: center;
    letter-spacing: 4px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition);
}

.pin-input:focus {
    border-color: var(--color-primary);
}

.pin-input::placeholder {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--color-text-muted);
}

.btn-pin-submit {
    padding: 12px 32px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-pin-submit:hover {
    background: var(--color-primary-light);
}

.pin-error {
    margin-top: 16px;
    padding: 10px 16px;
    background: rgba(255, 86, 48, 0.12);
    border: 1px solid rgba(255, 86, 48, 0.3);
    border-radius: var(--radius-sm);
    color: var(--color-danger);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pin-hint {
    margin-top: 20px;
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.pin-hint i {
    color: var(--color-accent);
}

.login-footer-links {
    margin-top: 24px;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

.login-footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer-links a:hover {
    color: var(--color-primary);
}

.login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 32px;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.feature i {
    color: var(--color-primary);
    width: 16px;
}

/* ============ NAVIGATIE ============ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Hamburger — hidden on desktop */
.hamburger {
    display: none;
}

.mobile-nav-backdrop {
    display: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.nav-tab:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.nav-tab.active {
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.nav-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.nav-username {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* ===== User Menu Dropdown ===== */
.user-menu-wrapper {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 8px);
    padding: 4px 8px 4px 4px;
    cursor: pointer;
    color: var(--color-text);
    font-family: var(--font);
    transition: all 0.2s ease;
}

.user-menu-trigger:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border);
}

.user-menu-chevron {
    font-size: 10px;
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
}

.user-menu-wrapper.open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-backdrop {
    display: none;
}

.user-menu-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1099;
}

.user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 1100;
    overflow: hidden;
    animation: userMenuIn 0.15s ease-out;
}

@keyframes userMenuIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-menu.open {
    display: block;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}

.user-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-menu-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-menu-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pro-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
}

.user-menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.user-menu-item:hover {
    background: var(--color-surface-hover);
}

.user-menu-icon {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.user-menu-value {
    margin-left: auto;
    font-size: 12px;
    color: var(--color-text-muted);
}

.user-menu-item-warning:hover {
    color: var(--color-warning, #f0ad4e);
}

.user-menu-item-warning:hover .user-menu-icon {
    color: var(--color-warning, #f0ad4e);
}

.user-menu-item-danger:hover {
    color: var(--color-danger, #ef4444);
}

.user-menu-item-danger:hover .user-menu-icon {
    color: var(--color-danger, #ef4444);
}

/* Theme switch inside menu */
.user-menu-theme-switch {
    margin-left: auto;
    cursor: pointer;
}

.theme-switch-track {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--color-border);
    position: relative;
    transition: background 0.2s ease;
}

.theme-switch-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Dark mode active state */
[data-theme="dark"] .theme-switch-track {
    background: var(--color-primary);
}

[data-theme="dark"] .theme-switch-thumb {
    transform: translateX(16px);
}

/* Light mode: show sun icon in menu */
[data-theme="light"] .user-menu-item #userMenuThemeSwitch ~ span,
[data-theme="light"] #userMenuTheme .fa-moon { display: none; }
[data-theme="light"] #userMenuTheme::after { content: ''; }

/* ===== Theme Toggle (standalone, hidden now — kept for backward compat) ===== */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.08);
}

.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: inline; }

[data-theme="light"] .theme-toggle .fa-sun { display: inline; }
[data-theme="light"] .theme-toggle .fa-moon { display: none; }

/* ===== Strava logo in light mode ===== */
[data-theme="light"] .footer-powered img {
    filter: var(--strava-logo-filter);
}

/* ============ KNOPPEN ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-text-muted);
}

.btn-sync {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-sync:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.btn-sync.syncing {
    opacity: 0.7;
    pointer-events: none;
}

.btn-sync.syncing i {
    animation: spin 1s linear infinite;
}

/* ============ SYNC CENTER ============ */
.sync-center-wrapper {
    position: relative;
}

.btn-sync-center {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-sync-center:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.btn-sync-center.syncing i {
    animation: spin 1s linear infinite;
}

.sync-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    position: absolute;
    top: 4px;
    right: 4px;
    border: 2px solid var(--color-primary);
    transition: background 0.3s;
}

.sync-status-dot.status-ok {
    background: #4caf50;
}

.sync-status-dot.status-warning {
    background: #ff9800;
    animation: garmin-pulse 2s ease-in-out infinite;
}

.sync-status-dot.status-stale {
    background: #9e9e9e;
}

.sync-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    overflow: hidden;
}

.sync-panel.open {
    display: block;
}

.sync-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border);
}

.sync-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.sync-panel-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.sync-panel-close:hover {
    color: var(--color-text);
}

.sync-panel-source {
    padding: 14px 16px;
}

.sync-panel-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0;
}

.sync-source-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.sync-source-logo {
    height: 18px;
    opacity: 0.9;
}

.sync-source-icon-garmin {
    color: #007cc3;
    font-size: 16px;
}

.sync-source-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.sync-source-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.sync-source-status.status-ok {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.sync-source-status.status-warning {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.sync-source-status.status-error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.sync-source-status.status-none {
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
}

.sync-source-details {
    margin-bottom: 12px;
}

.sync-detail-row {
    font-size: 12px;
    color: var(--color-text-muted);
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-detail-row i {
    width: 14px;
    text-align: center;
    font-size: 11px;
    opacity: 0.7;
}

.sync-detail-backfill {
    color: var(--color-primary);
}

.btn-sync-action {
    width: 100%;
    background: var(--color-primary);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm, 8px);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-sync-action:hover {
    background: var(--color-primary-light);
}

.btn-sync-action.syncing {
    opacity: 0.7;
    pointer-events: none;
}

.btn-sync-action.syncing i {
    animation: spin 1s linear infinite;
}

.btn-sync-secondary {
    width: 100%;
    background: rgba(252, 76, 2, 0.1);
    border: 1px solid rgba(252, 76, 2, 0.3);
    color: var(--strava-orange, #fc4c02);
    padding: 7px 16px;
    border-radius: var(--radius-sm, 8px);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    transition: var(--transition);
}

.btn-sync-secondary:hover {
    background: rgba(252, 76, 2, 0.2);
}

.btn-sync-secondary.syncing {
    color: var(--strava-orange, #fc4c02);
}

.btn-sync-secondary.syncing i {
    animation: spin 1s linear infinite;
}

.btn-garmin-link {
    width: 100%;
    background: rgba(0, 124, 195, 0.1);
    border: 1px solid rgba(0, 124, 195, 0.3);
    color: #007cc3;
    padding: 8px 16px;
    border-radius: var(--radius-sm, 8px);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-garmin-link:hover {
    background: rgba(0, 124, 195, 0.2);
}

.btn-disconnect {
    border: none;
    color: var(--color-text-muted);
    padding: 8px;
    font-size: 0.85em;
}

.btn-disconnect:hover {
    color: var(--color-warning, #f0ad4e);
    background: transparent;
}

@keyframes garmin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-lang {
    border: none;
    background: none;
    padding: 4px 8px;
    font-size: 1.2em;
    cursor: pointer;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1;
}
.btn-lang:hover {
    background: var(--color-surface-hover);
}

.btn-logout {
    border: none;
    color: var(--color-text-muted);
    padding: 8px;
}

.btn-logout:hover {
    color: var(--color-danger);
    background: transparent;
}

.btn-admin {
    border: none;
    color: var(--color-text-muted);
    padding: 8px;
    font-size: 0.85em;
}
.btn-admin:hover {
    color: var(--color-primary);
    background: transparent;
}

/* ============ SYNC BAR ============ */
.sync-bar {
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary));
    padding: 8px 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.sync-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ============ FLASH BERICHTEN ============ */
.flash {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.flash-success {
    background: var(--kpi-positive-bg);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.flash-error {
    background: var(--kpi-negative-bg);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
    padding: 0 4px;
}

/* ============ PERIODE SELECTOR ============ */
.period-selector {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
    background: var(--color-surface);
    padding: 3px;
    border-radius: var(--radius-sm);
    width: fit-content;
    border: 1px solid var(--color-border);
}

.period-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

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

.period-btn.active {
    background: var(--color-primary);
    color: white;
}

/* ============ TRENDS PERIODE NAVIGATOR ============ */
.trends-period-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.trends-scope-group {
    display: inline-flex;
    background: var(--color-surface);
    padding: 3px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.trends-scope {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.trends-scope i {
    font-size: 12px;
}

.trends-scope:hover {
    color: var(--color-text);
}

.trends-scope.active {
    background: var(--color-primary);
    color: white;
}

.trends-nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trends-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 13px;
}

.trends-nav-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: var(--color-primary);
}

.trends-nav-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.trends-nav-label {
    min-width: 180px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text);
    letter-spacing: -0.3px;
}

.trends-nav-today {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.trends-nav-today:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ============ METRIC KAARTEN (unified KPI + sparkline) ============ */
.metric-section {
    margin-top: 28px;
    margin-bottom: 16px;
}
.tab-pane.active > .metric-section:first-child,
.tab-pane.active > .actueel-coach-card + .metric-section {
    margin-top: 28px;
}
/* Actueel-tab: meer adem tussen Coach, KPI, Heatmap */
#tab-actueel > .actueel-coach-card { margin-bottom: 8px; }
#tab-actueel > #heatmapCard { margin-top: 28px; }
.metric-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.metric-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.metric-period-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.metric-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px 8px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.metric-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(252, 76, 2, 0.1);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.metric-icon {
    color: var(--color-primary);
    font-size: 14px;
}

.metric-trend {
    font-size: 11px;
    font-weight: 700;
}
.metric-trend .trend-positive { color: var(--color-success, #22c55e); }
.metric-trend .trend-negative { color: var(--color-danger, #ef4444); }
.metric-trend .trend-stable { color: var(--color-text-muted); }

.metric-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.metric-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 2px;
    margin-bottom: 6px;
}

.metric-spark {
    height: 40px;
    margin: 0 -4px -2px;
    opacity: 0.9;
    pointer-events: none;
}
.metric-spark canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============ GRAFIEK KAARTEN ============ */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.chart-grid .chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.chart-card.full-width {
    margin-bottom: 16px;
}

.chart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.chart-header h3 i {
    color: var(--color-primary);
    font-size: 14px;
}

.chart-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.trends-filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 6px;
}

.chart-toggle-group {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.chart-toggle {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    border-right: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chart-toggle:last-child {
    border-right: none;
}

.chart-toggle:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.chart-toggle.active {
    background: var(--color-primary);
    color: white;
}

.chart-subtitle {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 400;
}

.chart-body {
    padding: 20px;
    position: relative;
    min-height: 200px;
}

.chart-body.chart-tall {
    min-height: 300px;
}

.chart-body canvas {
    width: 100% !important;
    max-height: 320px;
}

/* ============ ACTIVITEITSTYPEN STAT BARS ============ */
.types-bar-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-bar-overview {
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-bar-ov-label {
    flex: 0 0 100px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stat-bar-ov-wrap {
    flex: 1;
    height: 20px;
    background: var(--color-badge-bg);
    border-radius: 4px;
    overflow: hidden;
}
.stat-bar-ov-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.stat-bar-ov-value {
    flex: 0 0 36px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: right;
}
.stat-bar-ov-detail {
    flex: 0 0 130px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ============ TABEL ============ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.data-table thead th.sortable:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.data-table thead th.sortable.active {
    color: var(--color-primary);
}

.data-table thead th.sortable i:last-child {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.4;
    transition: var(--transition);
}

.data-table thead th.sortable:hover i:last-child {
    opacity: 0.7;
}

.data-table thead th.sortable.active i:last-child {
    opacity: 1;
    color: var(--color-primary);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--color-surface-hover);
}

.data-table tbody td {
    padding: 10px 12px;
    white-space: nowrap;
}

.data-table tbody td:nth-child(2) {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table .activity-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.data-table .activity-link:hover {
    text-decoration: underline;
    color: var(--color-primary-light);
}

/* Record links */
.record-name a,
.record-item a {
    color: var(--color-primary);
    text-decoration: none;
}

.record-name a:hover,
.record-item a:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

/* Activiteitstype badge */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-badge.ride { background: rgba(252, 76, 2, 0.15); color: var(--color-ride); }
.type-badge.virtualride { background: rgba(252, 76, 2, 0.1); color: #e06800; }
.type-badge.cycling { background: rgba(252, 76, 2, 0.15); color: var(--color-ride); }
.type-badge.running { background: rgba(0, 200, 83, 0.15); color: var(--color-run); }
.type-badge.run { background: rgba(0, 200, 83, 0.15); color: var(--color-run); }
.type-badge.swim { background: rgba(33, 150, 243, 0.15); color: var(--color-swim); }
.type-badge.walk { background: rgba(156, 39, 176, 0.15); color: var(--color-walk); }
.type-badge.hike { background: rgba(121, 85, 72, 0.15); color: var(--color-hike); }
.type-badge.other { background: rgba(96, 125, 139, 0.15); color: var(--color-other); }

.type-badge i {
    font-size: 10px;
}

/* ============ EXPORT BAR ============ */
.export-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.btn-export {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-export:hover {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

/* ============ FILTERS ============ */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}

.filter-select:hover {
    border-color: var(--color-text-muted);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ============ PAGINERING ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination button {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    transition: var(--transition);
}

.pagination button:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.pagination button.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============ HEATMAP (KALENDER) ============ */
.heatmap-container {
    overflow-x: auto;
    padding: 16px 20px;
}

.heatmap {
    display: flex;
    gap: 3px;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.heatmap-day {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--color-surface);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.heatmap-day:hover {
    outline: 2px solid var(--color-text-muted);
}

.heatmap-day.level-0 { background: var(--color-surface); }
.heatmap-day.level-1 { background: rgba(252, 76, 2, 0.2); }
.heatmap-day.level-2 { background: rgba(252, 76, 2, 0.4); }
.heatmap-day.level-3 { background: rgba(252, 76, 2, 0.6); }
.heatmap-day.level-4 { background: var(--color-primary); }

.heatmap-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-right: 8px;
    font-size: 10px;
    color: var(--color-text-muted);
}

.heatmap-label {
    height: 14px;
    display: flex;
    align-items: center;
}

.heatmap-months {
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.heatmap-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: var(--shadow);
}

/* ============ RECORDS ============ */
.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.records-header h2 {
    margin: 0;
    font-size: 20px;
}

.records-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.records-filter label {
    font-size: 13px;
    font-weight: 500;
}

.records-filter select {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-input);
    color: var(--color-text);
    font-size: 13px;
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
}

.record-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.record-card h3 {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-card h3 i {
    color: var(--color-primary);
}

.record-list {
    padding: 8px 0;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: var(--transition);
}

.record-item:hover {
    background: var(--color-surface-hover);
}

.record-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.record-rank.gold { background: rgba(255, 215, 0, 0.15); color: #ffd700; }
.record-rank.silver { background: rgba(192, 192, 192, 0.15); color: #c0c0c0; }
.record-rank.bronze { background: rgba(205, 127, 50, 0.15); color: #cd7f32; }

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

.record-name {
    font-weight: 500;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

.record-value {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-primary);
    white-space: nowrap;
}

/* ============ GEAR LIJST ============ */
.gear-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.gear-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(252, 76, 2, 0.1);
    color: var(--color-primary);
    font-size: 16px;
    flex-shrink: 0;
}

.gear-info {
    flex: 1;
}

.gear-name {
    font-weight: 600;
    font-size: 14px;
}

.gear-meta {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.gear-distance {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-primary);
}

/* ============ TAB CONTENT ============ */
.tab-content {
    display: none;
}

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

/* ============ LOADING ============ */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
    font-size: 12px;
    border-top: 1px solid var(--color-border);
    margin-top: 40px;
}

.footer-powered {
    margin-bottom: 10px;
}

.footer-powered img {
    height: 22px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.footer-powered img:hover {
    opacity: 1;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-links span {
    color: var(--color-text-muted);
}

.footer-sync {
    margin-top: 4px;
}

/* ============ PRIVACY PAGE ============ */
.privacy-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 30px;
    min-height: 100vh;
}

.privacy-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.privacy-back-link:hover {
    color: var(--color-primary);
}

.privacy-page h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.privacy-updated {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.privacy-page h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.privacy-page p {
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.privacy-page ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.privacy-page li {
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 6px;
}

.privacy-page a {
    color: var(--color-primary);
    text-decoration: none;
}

.privacy-page a:hover {
    text-decoration: underline;
}

.privacy-strava-badge {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.privacy-strava-badge img {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.privacy-strava-badge img:hover {
    opacity: 1;
}

/* ============ ANIMATIES ============ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

.metric-card, .chart-card, .record-card {
    animation: fadeIn 0.4s ease forwards;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .records-grid {
        grid-template-columns: 1fr;
    }
    
    .records-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }
    
    .nav-brand i {
        display: none;
    }
    .nav-brand span {
        font-size: 15px;
    }

    /* === Hamburger button === */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 10px;
        background: none;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
        border-radius: var(--radius-sm, 8px);
        transition: background 0.15s;
    }
    .hamburger:hover,
    .hamburger:active {
        background: var(--color-surface-hover);
    }
    .hamburger span {
        display: block;
        height: 2px;
        width: 100%;
        background: var(--color-text);
        border-radius: 1px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }
    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* === Slide-out nav drawer === */
    .nav-tabs {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        width: 260px;
        background: var(--color-surface);
        border-right: 1px solid var(--color-border);
        flex-direction: column;
        padding: 8px 0;
        overflow-y: auto;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .nav-tabs.open {
        transform: translateX(0);
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        top: 56px;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1099;
    }
    .mobile-nav-backdrop.open {
        display: block;
    }

    /* Tabs in drawer: full labels, vertical list */
    .nav-tab {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
        border-radius: 0;
        width: 100%;
        justify-content: flex-start;
        border-left: 3px solid transparent;
    }
    .nav-tab i {
        font-size: 16px;
        width: 20px;
        text-align: center;
        margin-right: 10px;
    }
    .nav-tab.active {
        font-size: 14px;
        border-left-color: var(--color-primary);
    }
    
    .nav-right {
        gap: 8px;
        margin-left: auto;
    }
    
    .nav-username {
        display: none;
    }

    .user-menu-trigger {
        padding: 4px;
    }

    .user-menu-chevron {
        display: none;
    }

    .user-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
        z-index: 1200;
        animation: userMenuSheetUp 0.25s ease-out;
    }

    @keyframes userMenuSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .user-menu-backdrop.open {
        background: rgba(0, 0, 0, 0.5);
        z-index: 1199;
    }

    .user-menu-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--color-border);
        margin: 0 auto 8px;
    }
    
    .btn-sync, .btn-sync-center {
        font-size: 0;
        padding: 8px;
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
    }
    .btn-sync i, .btn-sync-center i {
        font-size: 16px;
        margin: 0;
    }

    .sync-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
        z-index: 1200;
        animation: syncSheetUp 0.25s ease-out;
    }
    @keyframes syncSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .sync-panel-backdrop {
        display: none;
    }
    .sync-panel-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1199;
    }
    .sync-panel-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--color-border);
        margin: 0 auto 8px;
    }
    .btn-sync-action {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .period-selector {
        width: 100%;
        overflow-x: auto;
    }
    
    .trends-period-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .trends-nav-label {
        min-width: 140px;
        font-size: 14px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .login-features {
        grid-template-columns: 1fr;
    }
}

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

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ============ ANALYSE TAB ============ */
.analyse-sport-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--color-card);
    border-radius: 12px;
    padding: 6px;
    width: fit-content;
}

.analyse-toggle {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.analyse-toggle:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.analyse-toggle.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(252, 76, 2, 0.3);
}

.analyse-toggle[data-sport="running"].active {
    background: #36b37e;
    box-shadow: 0 2px 8px rgba(54, 179, 126, 0.3);
}

.analyse-panel {
    display: none;
}

.analyse-panel.active {
    display: block;
}

/* Coach samenvatting */
.coach-summary {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, rgba(252, 76, 2, 0.08), rgba(252, 76, 2, 0.02));
    border: 1px solid rgba(252, 76, 2, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.coach-summary.coach-running {
    background: linear-gradient(135deg, rgba(54, 179, 126, 0.08), rgba(54, 179, 126, 0.02));
    border-color: rgba(54, 179, 126, 0.2);
}

.coach-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.coach-running .coach-avatar {
    background: #36b37e;
}

.coach-text h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.coach-text p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Analyse KPI strip */
.analyse-kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.analyse-kpi {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.analyse-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.analyse-kpi-label {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Race predictions */
.race-ref {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.race-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.race-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.race-card:hover {
    transform: translateY(-2px);
    border-color: #36b37e;
}

.race-icon {
    font-size: 24px;
    color: #36b37e;
    margin-bottom: 8px;
}

.race-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.race-time {
    font-size: 20px;
    font-weight: 700;
    color: #36b37e;
    margin-bottom: 4px;
}

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

/* Responsive analyse */
@media (max-width: 900px) {
    .analyse-kpi-strip {
        grid-template-columns: repeat(3, 1fr);
    }
    .race-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .analyse-kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }
    .analyse-sport-toggle {
        width: 100%;
    }
    .analyse-toggle {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }
    .coach-summary {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .race-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   AI Coach — Dagadvies / Weekplan
   ============================================ */

/* === Coach keuze-scherm === */
.coach-chooser {
    padding: 8px 0 4px;
}
.coach-inline {
    padding: 0 20px 16px;
}
.coach-chooser-header {
    text-align: center;
    margin-bottom: 20px;
}
.coach-chooser-header p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0;
}
.coach-chooser-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.coach-chooser-card {
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px 18px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.coach-chooser-card:hover {
    border-color: var(--color-primary);
    background: rgba(252, 82, 0, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
/* Voorkom iOS dubbel-tap door hover-transform uit te schakelen op touch devices */
@media (hover: none), (pointer: coarse) {
    .coach-chooser-card:hover {
        transform: none;
        box-shadow: none;
    }
}
.coach-chooser-card:active {
    transform: translateY(0);
    border-color: var(--color-primary);
    background: rgba(252, 82, 0, 0.08);
}
.coach-chooser-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(252, 82, 0, 0.12), rgba(252, 82, 0, 0.04));
    color: var(--color-primary);
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.coach-chooser-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}
.coach-chooser-card p {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}
@media (max-width: 640px) {
    .coach-chooser-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .coach-chooser-card {
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 14px;
        flex-wrap: wrap;
    }
    .coach-chooser-icon {
        flex-shrink: 0;
    }
    .coach-chooser-card h4 {
        font-size: 0.9rem;
        flex: 1;
        min-width: 0;
    }
    .coach-chooser-card p {
        flex-basis: 100%;
        padding-left: 62px;
        margin-top: -4px;
    }
    .coach-inline {
        padding: 0 12px 12px;
    }
}

/* === Mode knoppen === */
/* Segmented-control stijl: mode-knoppen in een compacte rij */
.coach-mode-buttons {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 16px;
    padding: 3px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    flex-wrap: wrap;
}
.coach-mode-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.coach-mode-btn:hover {
    color: var(--color-text);
}
.coach-mode-btn.active {
    background: var(--color-card);
    color: var(--color-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.coach-mode-btn i {
    font-size: 0.85rem;
}

/* === Goals sectie (compact inklapbaar) === */
.coach-goals-section {
    margin-bottom: 12px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.coach-goals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.coach-goals-header:hover {
    background: var(--color-bg);
}
.coach-goals-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    min-width: 0;
}
.coach-goals-summary i {
    color: var(--color-primary);
    flex-shrink: 0;
}
.coach-goals-summary .goals-summary-next {
    font-weight: 600;
    color: var(--color-text);
}
.coach-goals-expand {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}
.coach-goals-section:not(.coach-goals-collapsed) .coach-goals-expand {
    transform: rotate(180deg);
}
.coach-goals-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--color-border);
}
.coach-goals-collapsed .coach-goals-body {
    display: none;
}
.coach-goals-empty {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 8px 0;
}
.coach-goal-list {
    margin-bottom: 12px;
    margin-top: 12px;
}
.coach-goal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 12px;
}
.coach-goal-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.coach-goal-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.coach-goal-desc {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}
.coach-goal-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.coach-goal-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}
.btn-icon:hover {
    background: var(--color-primary);
    color: #fff;
}
.btn-icon-danger:hover {
    background: #e74c3c;
    color: #fff;
}

/* Goal form */
.coach-goal-form {
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}
.coach-goal-form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.coach-goal-select {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.85rem;
    min-width: 130px;
}
.coach-goal-input {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.85rem;
    transition: border-color 0.2s;
}
.coach-goal-input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.coach-goal-date {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.85rem;
}
.coach-goal-distance {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.85rem;
    width: 80px;
}

.coach-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.coach-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
}
.coach-page-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.coach-page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.coach-page-sub {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}
.coach-page-header .btn {
    margin-left: auto;
    white-space: nowrap;
}

/* Stats strip */
.coach-stats-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
}
.coach-stat {
    flex: 1;
    min-width: 80px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
}
.coach-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.1;
    margin-bottom: 2px;
}
.coach-stat-label {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Volume mini chart */
.coach-volume-chart {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.coach-volume-chart h3 {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.coach-volume-chart h3 i {
    color: var(--color-primary);
}
.coach-vol-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.coach-vol-label {
    flex: 0 0 90px;
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    text-align: right;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.coach-vol-label small {
    color: var(--color-text-muted);
    font-size: 0.65rem;
}
.coach-vol-track {
    flex: 1;
    height: 10px;
    background: var(--color-badge-bg);
    border-radius: 3px;
    overflow: hidden;
}
.coach-vol-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.coach-vol-value {
    flex: 0 0 80px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
}
.coach-vol-value small {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.68rem;
}

/* Plan container */
.coach-plan-container {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.coach-plan-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--color-text-muted);
}
.coach-plan-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.3;
}
.coach-plan-empty h3 {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}
.coach-plan-empty p {
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}
.coach-plan-loading {
    padding: 60px 30px;
    text-align: center;
    color: var(--color-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.coach-plan-error {
    padding: 20px;
    background: rgba(255, 86, 48, 0.1);
    border: 1px solid rgba(255, 86, 48, 0.3);
    border-radius: var(--radius-sm);
    color: var(--color-danger);
    margin: 20px;
}

/* Rendered plan */
.coach-plan-content {
    padding: 24px;
}
.coach-plan-rendered {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--color-text);
}
.coach-plan-rendered p {
    margin-bottom: 4px;
}
.coach-plan-rendered hr.coach-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 12px 0;
}
.coach-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}
.coach-section-title:first-child {
    margin-top: 0;
}
.coach-subsection-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 16px 0 8px;
}
.coach-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px;
}
.coach-list li {
    padding: 6px 0 6px 16px;
    position: relative;
    color: var(--color-text);
}
.coach-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

/* Day cards */
.coach-day {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin: 6px 0;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
    background: rgba(252, 76, 2, 0.04);
}
.coach-day.rest {
    border-left-color: var(--color-text-muted);
    background: rgba(93, 97, 120, 0.04);
    opacity: 0.7;
}
.coach-day-name {
    font-weight: 700;
    color: var(--color-text);
    flex: 0 0 85px;
    font-size: 0.85rem;
}
.coach-day-desc {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.coach-plan-meta {
    padding: 12px 24px;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== Chat hierover knop ===== */
.btn-chat-hierover {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 24px;
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.btn-chat-hierover:hover {
    background: var(--color-primary-hover, var(--color-primary));
    transform: translateY(-1px);
}
.btn-chat-hierover i {
    font-size: 1rem;
}

/* Container voor coach-actie knoppen onder dagadvies */
.coach-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 24px 0;
}
.coach-action-bar .btn-chat-hierover,
.coach-action-bar .btn-refresh-advice {
    margin: 0;
}
.btn-refresh-advice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--color-text-secondary, #aaa);
    border: 1px solid var(--color-border, #444);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-refresh-advice:hover:not(:disabled) {
    background: var(--color-surface-hover, rgba(255,255,255,0.05));
    color: var(--color-text, #fff);
    border-color: var(--color-text-secondary, #888);
    transform: translateY(-1px);
}
.btn-refresh-advice:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-refresh-advice i {
    font-size: 1rem;
}

/* ===== Garmin Promo Banner ===== */
.garmin-promo-banner {
    position: relative;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 14px;
    padding: 18px 48px 18px 20px;
    margin-bottom: 20px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(17, 153, 142, 0.25);
    animation: garminSlideIn 0.4s ease-out;
}
@keyframes garminSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
.garmin-promo-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.garmin-promo-icon {
    font-size: 2rem;
    opacity: 0.9;
    flex-shrink: 0;
}
.garmin-promo-text {
    flex: 1;
    min-width: 200px;
}
.garmin-promo-text strong {
    font-size: 1rem;
    display: block;
    margin-bottom: 2px;
}
.garmin-promo-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.4;
}
.btn-garmin-promo {
    background: rgba(255,255,255,0.2);
    color: #fff !important;
    border: 2px solid rgba(255,255,255,0.5);
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-garmin-promo:hover {
    background: rgba(255,255,255,0.35);
    border-color: #fff;
}
.garmin-promo-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.garmin-promo-close:hover {
    color: #fff;
}

/* ===== Coach History ===== */
.coach-history-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.coach-history-toggle {
    background: transparent;
    border: 1px solid var(--border-color, var(--border));
    color: var(--color-text-muted, var(--text-muted));
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.coach-history-toggle:hover {
    color: var(--strava-orange, #fc4c02);
    border-color: var(--strava-orange, #fc4c02);
}

.coach-history-toggle.active {
    background: rgba(252, 76, 2, 0.1);
    color: var(--strava-orange, #fc4c02);
    border-color: rgba(252, 76, 2, 0.3);
}

.coach-history-list {
    margin-bottom: 16px;
    border: 1px solid var(--border-color, var(--border));
    border-radius: 10px;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.coach-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color, var(--border));
}

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

.coach-history-item:hover {
    background: var(--color-bg-elevated, rgba(255,255,255,0.05));
}

.coach-history-item.active {
    background: rgba(252, 76, 2, 0.08);
}

.coach-history-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--color-bg-elevated, rgba(255,255,255,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--strava-orange, #fc4c02);
    flex-shrink: 0;
}

.coach-history-item-info {
    flex: 1;
    min-width: 0;
}

.coach-history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text, var(--text-primary));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coach-history-item-date {
    font-size: 11px;
    color: var(--color-text-muted, var(--text-muted));
    margin-top: 2px;
}

.coach-history-item-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    flex-shrink: 0;
}

.coach-history-item-badge.dagadvies {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.coach-history-item-badge.weekplan {
    background: rgba(168,85,247,0.15);
    color: #a855f7;
}

/* ===== Coach Chat (dagadvies follow-up) ===== */
/* ===== Coach Thread Header (dagadvies unified UI) ===== */
.coach-thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-card);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.coach-thread-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Klikbare titel-knop + chevron-dropdown (Claude.ai-stijl) */
.coach-thread-title-wrap {
    position: relative;
}
.coach-thread-title-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.coach-thread-title-btn:hover {
    background: var(--color-bg);
}
.coach-thread-title-btn[aria-expanded="true"] {
    background: var(--color-bg);
}
.coach-thread-title-chevron {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.2s;
}
.coach-thread-title-btn[aria-expanded="true"] .coach-thread-title-chevron {
    transform: rotate(180deg);
}

.coach-thread-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    max-width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 6px;
    z-index: 100;
}
.coach-thread-dropdown[hidden] { display: none; }
.coach-thread-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--color-text);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}
.coach-thread-dropdown-item:hover {
    background: var(--color-bg);
}
.coach-thread-dropdown-item.is-active {
    background: rgba(252, 82, 0, 0.08);
    color: var(--color-primary);
}
.coach-thread-dropdown-item > i:first-child {
    width: 14px;
    opacity: 0.6;
    font-size: 0.85rem;
}
.coach-thread-dropdown-item > span {
    flex: 1;
}
.coach-thread-dropdown-check {
    font-size: 0.75rem;
    color: var(--color-primary);
}
.coach-thread-dropdown-loading,
.coach-thread-dropdown-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.coach-thread-actions {
    display: flex;
    gap: 4px;
}
.coach-thread-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.coach-thread-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
}
.coach-thread-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.coach-thread-btn .fa-sync-alt.spinning {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Rich assistant message (dagadvies-bericht: hele rendering binnen bubble) */
.coach-chat-bubble.coach-chat-bubble-rich {
    background: var(--color-bg);
    border-bottom-left-radius: 4px;
    max-width: 100%;
    padding: 14px 18px;
}
.coach-chat-bubble-rich .coach-chat-text {
    white-space: normal;
    font-size: 0.9rem;
}
.coach-chat-bubble-rich .coach-plan-rendered {
    margin: 0;
}
.coach-chat-msg.coach-chat-msg-rich {
    max-width: 95%;
}

.coach-chat-section {
    background: var(--color-card);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    margin-top: 12px;
}
/* In thread-modus (dagadvies): plan-container fungeert als één doos met header bovenaan */
.coach-plan-container.thread-mode {
    background: var(--color-card);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.coach-plan-container.thread-mode .coach-chat-section {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 0;
}
.coach-plan-container.thread-mode .coach-chat-messages {
    max-height: 70vh;
}

.coach-chat-messages {
    min-height: 60px;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coach-chat-messages:empty {
    padding: 0;
}

.coach-chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 85%;
}

.coach-chat-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.coach-chat-msg-assistant,
.coach-chat-msg-error {
    align-self: flex-start;
}

.coach-chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

.coach-chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}

.coach-chat-bubble-user {
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.coach-chat-bubble-assistant {
    background: var(--color-bg);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.coach-chat-bubble-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error, #ef4444);
    border-bottom-left-radius: 4px;
}

.coach-chat-text {
    white-space: pre-wrap;
}

.coach-chat-text strong { font-weight: 600; }
.coach-chat-text em { font-style: italic; }
.coach-chat-text ul { margin: 4px 0; padding-left: 18px; }
.coach-chat-text li { margin-bottom: 2px; }

.coach-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.coach-chat-input {
    flex: 1;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s;
}

.coach-chat-input:focus {
    border-color: var(--color-primary);
}

.coach-chat-input::placeholder {
    color: var(--color-text-muted);
}

.coach-chat-input-row .btn-sm {
    padding: 8px 14px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ===== Coach Feedback ===== */
.coach-feedback {
    background: var(--color-card);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 24px;
    margin-top: 16px;
}

.coach-feedback h3 {
    font-size: 1rem;
    margin: 0 0 4px;
    color: var(--color-text);
}

.coach-feedback-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0 0 16px;
}

.coach-feedback-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.feedback-tag {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-tag:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(255, 107, 53, 0.08);
}

.feedback-tag.active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #fff;
}

.feedback-tag.active i {
    color: #fff;
}

.coach-feedback-text {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    padding: 10px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.coach-feedback-text:focus {
    outline: none;
    border-color: var(--color-accent);
}

.coach-feedback-text::placeholder {
    color: var(--color-text-muted);
}

.coach-feedback-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coach-feedback-saved {
    color: var(--color-success, #4ade80);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: fadeInUp 0.3s ease;
}

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

/* ===== COACH INLINE CHAT ===== */
.coach-inline-chat {
    display: flex;
    align-items: flex-start;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: visible;
    min-height: 400px;
    background: var(--color-surface);
}

.cic-sidebar {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    border-radius: var(--radius) 0 0 var(--radius);
}

.cic-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 2;
}

.cic-sidebar-new {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}
.cic-sidebar-new:hover { background: var(--color-overlay); }

.cic-sidebar-list {
    padding: 4px;
}

.cic-sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.cic-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
    position: relative;
}
.cic-sidebar-item:hover { background: var(--color-overlay); }
.cic-sidebar-item.active { background: rgba(252, 76, 2, 0.1); color: var(--color-primary); }

.cic-sidebar-item-icon { font-size: 0.7rem; color: var(--color-text-muted); flex-shrink: 0; }
.cic-sidebar-item-info { flex: 1; min-width: 0; }
.cic-sidebar-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cic-sidebar-item-date { font-size: 0.7rem; color: var(--color-text-muted); }

.cic-sidebar-item-delete {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
}
.cic-sidebar-item:hover .cic-sidebar-item-delete { opacity: 1; }
.cic-sidebar-item-delete:hover { color: var(--color-danger); }

.cic-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cic-messages {
    padding: 16px;
    min-height: 300px;
}

.cic-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    text-align: center;
    gap: 8px;
}
.cic-welcome h3 { font-size: 1.1rem; font-weight: 600; }
.cic-welcome p { color: var(--color-text-muted); font-size: 0.85rem; max-width: 400px; }
.cic-welcome .chat-examples { margin-top: 8px; }

.cic-input-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    bottom: 0;
    border-radius: 0 0 var(--radius) 0;
}
.cic-input-bar .chat-input { flex: 1; }

.cic-sidebar-toggle {
    display: none;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--color-text);
    font-size: 14px;
}

@media (max-width: 768px) {
    .coach-inline-chat { position: relative; }
    .cic-sidebar {
        position: absolute;
        top: 0; left: 0; bottom: 0;
        z-index: 10;
        width: 240px;
        max-height: none;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }
    .cic-sidebar.open { transform: translateX(0); }
    .cic-sidebar-toggle { display: block; }
}

/* Responsive */
@media (max-width: 768px) {
    .coach-page-header {
        flex-wrap: wrap;
    }
    .coach-page-header .btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
    .coach-stats-strip {
        flex-wrap: wrap;
    }
    .coach-stat {
        min-width: calc(33% - 8px);
    }
    .coach-day {
        flex-direction: column;
        gap: 4px;
    }
    .coach-day-name {
        flex: none;
    }
}

/* ============================================
   Chat Tab - SportCoach AI
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--color-badge-bg);
}

.chat-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Welkom-scherm */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    flex: 1;
}

.chat-welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin-bottom: 20px;
}

.chat-welcome h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.chat-welcome p {
    color: var(--text-secondary);
    margin: 0 0 28px;
    font-size: 15px;
}

.chat-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 560px;
    width: 100%;
}

.chat-example-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--color-badge-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.chat-example-btn:hover {
    background: var(--color-badge-bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.chat-example-btn i {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

/* Chat berichten */
.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: chatFadeIn 0.3s ease;
}

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

.chat-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-assistant,
.chat-msg-error {
    align-self: flex-start;
}

.chat-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg-user .chat-msg-avatar {
    background: rgba(99,102,241,0.15);
    color: var(--accent);
}

.chat-msg-assistant .chat-msg-avatar {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
}

.chat-msg-error .chat-msg-avatar {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.55;
    font-size: 14px;
}

.chat-bubble-user {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
    background: var(--color-badge-bg-hover);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.chat-bubble-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    border-bottom-left-radius: 4px;
}

.chat-msg-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-msg-text ul {
    margin: 6px 0;
    padding-left: 20px;
}

.chat-msg-text li {
    margin: 3px 0;
}

.chat-msg-text strong {
    color: inherit;
    font-weight: 600;
}

/* Typing indicator */
.chat-typing-dots {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.chat-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: chatTyping 1.4s infinite;
}

.chat-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTyping {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Input bar */
.chat-input-bar {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--color-badge-bg);
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--accent);
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.chat-send-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #818cf8;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat responsive */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 200px);
        height: calc(100dvh - 200px);
        border-radius: 12px;
    }
    .chat-msg {
        max-width: 92%;
    }
    .chat-examples {
        grid-template-columns: 1fr;
    }
    .chat-welcome {
        padding: 24px 16px;
    }
    .chat-input-bar {
        padding: 12px 14px;
    }
    .chat-send-btn {
        width: 44px;
        height: 44px;
    }
}

/* ===== Light theme specific overrides ===== */
[data-theme="light"] .login-card,
[data-theme="light"] .chart-card,
[data-theme="light"] .coach-feedback,
[data-theme="light"] .coach-plan-container,
[data-theme="light"] .coach-page-header,
[data-theme="light"] .coach-chat-section {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

[data-theme="light"] .heatmap-day-card.rest {
    background: rgba(0,0,0,0.02);
}

[data-theme="light"] .heatmap-day-card.active {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .heatmap-day-rest {
    color: rgba(0,0,0,0.2);
}

[data-theme="light"] .navbar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Sync Center light mode */
[data-theme="light"] .sync-panel {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .sync-source-logo {
    filter: brightness(0) saturate(100%);
}
[data-theme="light"] .sync-status-dot {
    border-color: var(--color-primary);
}

[data-theme="light"] .kpi-change.positive {
    background: var(--kpi-positive-bg);
    color: #16a34a;
}

[data-theme="light"] .kpi-change.negative {
    background: var(--kpi-negative-bg);
    color: #dc2626;
}

[data-theme="light"] .nav-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

[data-theme="light"] .btn:hover {
    border-color: var(--color-border);
    background: var(--color-surface-hover);
}

[data-theme="light"] .btn-sync-center:hover {
    background: #e04400;
    border-color: #e04400;
    color: #fff;
}

[data-theme="light"] .btn-sync-action:hover {
    background: #e04400;
}

[data-theme="light"] .period-btn.active {
    background: var(--color-primary);
    color: #fff;
}

/* Light mode: chat leesbaarheid */
[data-theme="light"] .chat-bubble-assistant {
    background: #f0f2f5;
    border-color: #e0e2e8;
    color: #1a1d27;
}

[data-theme="light"] .chat-msg-text,
[data-theme="light"] .chat-msg-text p,
[data-theme="light"] .chat-msg-text li,
[data-theme="light"] .chat-msg-text td,
[data-theme="light"] .chat-msg-text th,
[data-theme="light"] .chat-msg-text h1,
[data-theme="light"] .chat-msg-text h2,
[data-theme="light"] .chat-msg-text h3,
[data-theme="light"] .chat-msg-text h4,
[data-theme="light"] .chat-msg-text strong,
[data-theme="light"] .chat-msg-text em,
[data-theme="light"] .chat-msg-text span {
    color: #1a1d27;
}

[data-theme="light"] .chat-msg-text code {
    background: #e0e2e8;
    color: #333;
}

[data-theme="light"] .chat-msg-text a {
    color: var(--color-primary);
}

[data-theme="light"] .chat-bubble-error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

[data-theme="light"] .chat-welcome h3,
[data-theme="light"] .chat-welcome p {
    color: #1a1d27;
}

[data-theme="light"] .chat-header-info h3 {
    color: #1a1d27;
}

[data-theme="light"] .chat-input {
    background: #fff;
    color: #1a1d27;
    border-color: #e0e2e8;
}

[data-theme="light"] .chat-input::placeholder {
    color: #8b8fa3;
}

/* ============================================
   ACTUEEL TAB - Week heatmap & vergelijkingen
   ============================================ */

.actueel-header {
    margin-bottom: 12px;
}

.actueel-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* KPI config button */
.btn-kpi-config {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}
.btn-kpi-config:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* KPI config overlay */
.kpi-config-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.kpi-config-dialog {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 380px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.kpi-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border);
}
.kpi-config-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kpi-config-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}
.kpi-config-close:hover { color: var(--color-text); }
.kpi-config-body {
    padding: 16px 20px;
}
.kpi-config-subtitle {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}
.kpi-config-group {
    margin-bottom: 16px;
}
.kpi-config-group h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kpi-config-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
}
.kpi-config-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Metric detail modal */
.metric-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.metric-detail-modal {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 560px;
    max-width: 94vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.metric-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border);
}
.metric-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.metric-detail-title h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.metric-detail-icon {
    font-size: 18px;
}
.metric-detail-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.metric-detail-close:hover {
    color: var(--color-text);
    background: var(--color-surface);
}
.metric-detail-body {
    padding: 20px;
}
.metric-detail-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.metric-detail-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.metric-detail-value {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}
.metric-detail-trend {
    font-size: 14px;
    font-weight: 700;
}
.metric-detail-trend .trend-positive { color: var(--color-success, #22c55e); }
.metric-detail-trend .trend-negative { color: var(--color-danger, #ef4444); }
.metric-detail-trend .trend-stable { color: var(--color-text-muted); }
.metric-detail-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.detail-stat {
    text-align: center;
    min-width: 60px;
}
.detail-stat-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}
.detail-stat-label {
    font-size: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}
.metric-detail-chart {
    height: 220px;
    margin: 0 -4px;
}
.metric-detail-chart canvas {
    width: 100% !important;
    height: 100% !important;
}
.metric-detail-footer {
    margin-top: 14px;
    font-size: 11px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}
@media (max-width: 560px) {
    .metric-detail-summary {
        flex-direction: column;
    }
    .metric-detail-value {
        font-size: 28px;
    }
}

/* Week heatmap — 4 weken overzicht (inklapbaar) */
.heatmap-collapsible .heatmap-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    max-height: 500px;
    opacity: 1;
}
.heatmap-collapsible.collapsed .heatmap-body {
    max-height: 0;
    opacity: 0;
    padding: 0;
}
.heatmap-toggle-header {
    cursor: pointer;
    user-select: none;
}
.heatmap-collapse-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: transform 0.3s ease, color 0.2s;
}
.heatmap-collapse-btn:hover { color: var(--color-text); }
.heatmap-collapsible.collapsed .heatmap-collapse-btn i {
    transform: rotate(-90deg);
}
.heatmap-collapsible.collapsed .heatmap-legend {
    display: none;
}

.week-heatmap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.heatmap-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted, #888);
    font-weight: 500;
}

.heatmap-legend-sep {
    color: var(--text-muted, #555);
    font-size: 10px;
    opacity: 0.4;
}

.heatmap-header {
    display: grid;
    grid-template-columns: 110px repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.heatmap-header-spacer {
    /* Empty cell aligning with week labels */
}

.heatmap-header-day {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-align: center;
    padding: 2px 0;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: 110px repeat(7, 1fr);
    gap: 4px;
}

.heatmap-week-label {
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 4px 0 2px;
    white-space: nowrap;
}

.heatmap-week-label.current {
    color: var(--color-primary);
    font-weight: 700;
}

.heatmap-day-card {
    background: var(--bg-card-alt, rgba(255,255,255,0.03));
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 5px 3px 4px;
    text-align: center;
    transition: all 0.2s;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.heatmap-day-card.rest {
    background: rgba(255,255,255,0.015);
}

.heatmap-day-card.active {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}

.heatmap-day-card.active[data-activity-ids]:hover {
    border-color: var(--strava-orange, #FC4C02);
    background: rgba(252, 76, 2, 0.08);
    transform: scale(1.04);
}

/* Heatmap activity picker (meerdere activiteiten per dag) */
.heatmap-picker {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    min-width: 240px;
    max-width: 320px;
    overflow: hidden;
    animation: fadeIn 0.15s ease;
}
.heatmap-picker-loading {
    padding: 16px;
    text-align: center;
    color: var(--color-text-secondary);
}
.heatmap-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--color-border);
}
.heatmap-picker-item:last-child {
    border-bottom: none;
}
.heatmap-picker-item:hover {
    background: rgba(252, 76, 2, 0.08);
}
.heatmap-picker-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.heatmap-picker-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.heatmap-picker-meta {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.heatmap-day-card.today {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.heatmap-day-card.future {
    opacity: 0.3;
    background: transparent;
}

.heatmap-day-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.heatmap-day-card.active .heatmap-day-date {
    color: var(--color-primary);
}

.heatmap-day-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 2px 0 1px;
}

/* Activity dots — Strava-style colored circles */
.activity-dot {
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.activity-dot.dot-run  { background: #fc4c02; } /* Strava oranje */
.activity-dot.dot-ride { background: #3b82f6; } /* blauw */
.activity-dot.dot-other { background: #22c55e; } /* groen */

.activity-dot.dot-sm { width: 7px;  height: 7px; }
.activity-dot.dot-md { width: 10px; height: 10px; }
.activity-dot.dot-lg { width: 13px; height: 13px; }
.activity-dot.dot-xl { width: 16px; height: 16px; }

.heatmap-day-value {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
}

.heatmap-day-rest {
    font-size: 9px;
    color: var(--text-muted, rgba(255,255,255,0.2));
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

/* Comparison rows */
.comparison-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 8px;
}

.comparison-row.comparison-header {
    padding: 4px 0 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.comparison-row.comparison-header span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #555);
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-label {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.comparison-avg {
    font-size: 12px;
    color: var(--text-muted, #555);
    min-width: 80px;
    text-align: right;
}

.comparison-current {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 80px;
    text-align: right;
}

.comparison-change {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 55px;
    text-align: center;
}

.comparison-change.positive {
    background: rgba(0, 200, 83, 0.12);
    color: #00c853;
}

.comparison-change.negative {
    background: rgba(255, 82, 82, 0.12);
    color: #ff5252;
}

.comparison-change.neutral {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

/* AI Coach embedded in Actueel */
.actueel-coach-card {
    min-height: auto;
}

.actueel-coach-card .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.actueel-coach-card .chart-header h3 {
    margin: 0;
}

.coach-inline .coach-stats-strip {
    margin-top: 0;
}

.coach-inline .coach-plan-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.coach-inline .coach-plan-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.coach-inline .coach-plan-empty h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.coach-inline .coach-plan-empty p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
}

/* Coach demo overlay */
.coach-demo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 24px;
}

.coach-demo-example {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.demo-advice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 14px;
}

.demo-advice-header i {
    color: var(--color-primary);
    font-size: 18px;
}

.demo-advice-body {
    padding: 20px;
}

.demo-advice-body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text);
}

.demo-advice-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.demo-advice-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.demo-advice-footer .btn {
    font-size: 13px;
    padding: 10px 24px;
}

/* Chat full page (eigen tab) */
.chat-page {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    height: calc(100vh - 160px);
}

.chat-page .chat-container {
    max-width: none;
    height: auto;
    flex: 1;
    min-width: 0;
    margin: 0;
}

/* Chat sidebar */
.chat-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-card, var(--card-bg));
    border: 1px solid var(--border-color, var(--border));
    border-radius: 12px;
    overflow: hidden;
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, var(--border));
}

.chat-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text, var(--text-primary));
}

.chat-sidebar-new {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color, var(--border));
    background: transparent;
    color: var(--color-text-muted, var(--text-muted));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}

.chat-sidebar-new:hover {
    background: var(--strava-orange, #fc4c02);
    color: #fff;
    border-color: var(--strava-orange, #fc4c02);
}

.chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--color-text-muted, var(--text-muted));
    font-size: 13px;
    text-align: center;
}

.chat-sidebar-empty p {
    margin: 0;
}

.chat-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.chat-sidebar-item:hover {
    background: var(--color-bg-elevated, rgba(255,255,255,0.05));
}

.chat-sidebar-item.active {
    background: rgba(252, 76, 2, 0.1);
    border: 1px solid rgba(252, 76, 2, 0.2);
}

.chat-sidebar-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-bg-elevated, rgba(255,255,255,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.chat-sidebar-item.active .chat-sidebar-item-icon {
    background: rgba(252, 76, 2, 0.15);
    color: var(--strava-orange, #fc4c02);
}

.chat-sidebar-item-info {
    flex: 1;
    min-width: 0;
}

.chat-sidebar-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, var(--text-primary));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-sidebar-item-date {
    font-size: 11px;
    color: var(--color-text-muted, var(--text-muted));
    margin-top: 2px;
}

.chat-sidebar-item-delete {
    opacity: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.chat-sidebar-item:hover .chat-sidebar-item-delete {
    opacity: 1;
}

.chat-sidebar-item-delete:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

/* Mobile: sidebar toggle */
.chat-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 16px;
    z-index: 50;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--strava-orange, #fc4c02);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .chat-page {
        flex-direction: column;
        height: auto;
    }
    .chat-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        z-index: 1000;
        border-radius: 0;
        border-right: 1px solid var(--border-color, var(--border));
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }
    .chat-sidebar.open {
        display: flex;
    }
    .chat-sidebar-toggle {
        display: flex;
    }
    .chat-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        display: none;
    }
    .chat-sidebar-backdrop.open {
        display: block;
    }
}

.chat-fullpage {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.chat-fullpage .chat-messages {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
}

.chat-fullpage .chat-welcome {
    padding: 40px 20px;
}

.chat-fullpage .chat-examples {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Light theme overrides for new components */
[data-theme="light"] .heatmap-day-card {
    background: #f5f6f8;
    border-color: #e0e2e8;
}

[data-theme="light"] .heatmap-day-card.active {
    background: rgba(252, 76, 2, 0.06);
    border-color: rgba(252, 76, 2, 0.2);
}
[data-theme="light"] .heatmap-day-card.active[data-activity-ids]:hover {
    background: rgba(252, 76, 2, 0.12);
    border-color: var(--strava-orange, #FC4C02);
}
[data-theme="light"] .heatmap-picker {
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

[data-theme="light"] .comparison-row {
    border-bottom-color: #e0e2e8;
}

[data-theme="light"] .comparison-change.neutral {
    background: #f0f1f3;
}

/* ===== Light theme: Map page fixes ===== */
[data-theme="light"] .map-toolbar {
    background: #f5f6f8;
    border-bottom-color: #d8dae0;
}

[data-theme="light"] .map-timeline-btn {
    background: #e8eaef;
    color: #3a3d4a;
    border-color: #d0d2d8;
}

[data-theme="light"] .map-timeline-btn:hover {
    background: #ddd;
    border-color: var(--strava-orange);
    color: var(--strava-orange);
}

[data-theme="light"] .map-timeline-btn.active {
    background: var(--strava-orange);
    color: #fff;
    border-color: var(--strava-orange);
}

[data-theme="light"] .map-timeline {
    background: #f5f6f8;
    border-color: #d0d2d8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .map-timeline-play {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .map-timeline-date {
    color: #2a2d3a;
}

[data-theme="light"] .map-timeline-speed {
    background: #e8eaef;
    color: #3a3d4a;
    border-color: #d0d2d8;
}

[data-theme="light"] .map-filter-group select {
    background: #e8eaef;
    color: #2a2d3a;
    border-color: #d0d2d8;
}

[data-theme="light"] .map-filter-group label {
    color: #4a4d5a;
}

[data-theme="light"] .map-stats {
    color: #4a4d5a;
}

[data-theme="light"] .map-legend {
    background: rgba(255, 255, 255, 0.92);
    border-color: #d0d2d8;
    color: #3a3d4a;
}

[data-theme="light"] .map-photo-marker-icon {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .metric-top-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .coach-mode-buttons {
        gap: 6px;
    }
    .coach-mode-btn {
        min-width: 90px;
        padding: 12px 10px;
        font-size: 0.8rem;
        min-height: 44px;
    }
    .coach-goal-form-row {
        flex-direction: column;
    }
    .coach-goal-input {
        min-width: 100%;
    }
    .coach-goal-select,
    .coach-goal-date,
    .coach-goal-distance {
        width: 100%;
    }
    
    .week-heatmap {
        overflow-x: auto;
    }
    
    .heatmap-header {
        grid-template-columns: 80px repeat(7, minmax(40px, 1fr));
        gap: 3px;
    }
    
    .heatmap-grid {
        grid-template-columns: 80px repeat(7, minmax(40px, 1fr));
        gap: 3px;
    }
    
    .heatmap-week-label {
        font-size: 9px;
    }
    
    .heatmap-day-card {
        padding: 4px 2px;
        min-height: 44px;
    }
    
    .heatmap-day-date {
        font-size: 11px;
    }
    
    .heatmap-day-value {
        font-size: 8px;
    }
    
    .activity-dot.dot-sm { width: 6px;  height: 6px; }
    .activity-dot.dot-md { width: 8px;  height: 8px; }
    .activity-dot.dot-lg { width: 10px; height: 10px; }
    .activity-dot.dot-xl { width: 13px; height: 13px; }
}

/* ==========================================
   Activity Detail Modal
   ========================================== */
.activity-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.activity-detail-modal {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 720px;
    max-width: 96vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease;
}
.activity-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-card);
    z-index: 2;
}
.activity-detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}
.activity-type-icon {
    font-size: 22px;
    color: var(--strava-orange, #FC4C02);
    flex-shrink: 0;
}
.activity-detail-title > div {
    min-width: 0;
}
.activity-detail-title h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.activity-detail-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.activity-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-strava-link {
    color: var(--strava-orange, #FC4C02);
    font-size: 20px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}
.btn-strava-link:hover {
    background: rgba(252, 76, 2, 0.1);
}
.activity-detail-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.activity-detail-close:hover {
    color: var(--color-text);
    background: var(--color-surface);
}
.activity-detail-body {
    padding: 20px 24px 24px;
}

/* Stats grid */
.act-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.act-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}
.act-stat-icon {
    color: var(--strava-orange, #FC4C02);
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.act-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.act-stat-value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}
.act-stat-label {
    font-size: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Map */
.activity-detail-map-container {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}
.map-marker-start,
.map-marker-end {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 10px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.map-marker-start {
    background: #4CAF50;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.5);
}
.map-marker-end {
    background: #f44336;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.5);
}

/* Splits & Best efforts */
.activity-detail-splits,
.activity-detail-best-efforts {
    margin-bottom: 20px;
}
.activity-detail-splits h4,
.activity-detail-best-efforts h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
}
.activity-detail-splits h4 i,
.activity-detail-best-efforts h4 i {
    color: var(--strava-orange, #FC4C02);
    font-size: 13px;
}
.splits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.splits-table thead th {
    text-align: left;
    padding: 6px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
}
.splits-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s;
}
.splits-table tbody tr:hover {
    background: var(--color-surface);
}
.splits-table tbody td {
    padding: 8px 10px;
}
.split-km {
    font-weight: 700;
    color: var(--color-text);
    min-width: 36px;
}
.split-pace {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.split-time {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-secondary);
}
.split-hr {
    color: var(--color-text-secondary);
}
.split-elev {
    color: var(--color-text-secondary);
    font-size: 12px;
}
.split-bar {
    width: 80px;
    padding: 0 !important;
}
.pace-bar {
    height: 6px;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.split-partial td {
    color: var(--color-text-muted);
    font-style: italic;
}

/* Splits chart */
.splits-chart-container {
    height: 220px;
    position: relative;
    margin-bottom: 12px;
}
.splits-table-details {
    margin-top: 4px;
}
.splits-table-details summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary);
    padding: 6px 0;
    user-select: none;
}
.splits-table-details summary:hover {
    color: var(--strava-orange, #FC4C02);
}
.splits-table-details[open] .splits-table {
    margin-top: 6px;
}

/* Best efforts */
.best-efforts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.best-effort-item {
    padding: 10px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.best-effort-pr {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.06);
}
.best-effort-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}
.best-effort-name i {
    color: #FFD700;
    font-size: 11px;
}
.best-effort-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-secondary);
}
.best-effort-time {
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* Backfill button in sync area */
.backfill-status {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Mobile responsive for activity detail */
@media (max-width: 600px) {
    .activity-detail-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
    .activity-detail-header {
        padding: 14px 16px 10px;
    }
    .activity-detail-body {
        padding: 16px;
    }
    .act-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .act-stat-item {
        padding: 8px 10px;
    }
    .splits-table {
        font-size: 12px;
    }
    .splits-table thead th,
    .splits-table tbody td {
        padding: 6px 6px;
    }
    .split-bar {
        display: none;
    }
    .best-efforts-grid {
        grid-template-columns: 1fr;
    }
    #actDetailMap {
        height: 250px !important;
    }
}

/* ============================================
   ACTIVITEITENKAART PAGINA
   ============================================ */
body.map-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--color-bg);
}

.map-page .navbar {
    flex-shrink: 0;
    z-index: 600;
}

.map-page .nav-tab {
    text-decoration: none;
    color: inherit;
}

/* Toolbar met filters */
.map-toolbar {
    flex-shrink: 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px;
    z-index: 500;
}
.map-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    flex-wrap: wrap;
}
.map-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.map-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}
.map-filter-group select {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.map-filter-group select:focus {
    outline: none;
    border-color: var(--strava-orange);
}
.map-stats {
    margin-left: auto;
    display: flex;
    gap: 16px;
}
.map-stat {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.map-stat i {
    color: var(--strava-orange);
    margin-right: 4px;
}

/* De kaart zelf */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.activities-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Loading overlay */
.map-loading {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-loading-inner {
    background: var(--color-card);
    padding: 30px 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--color-text);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.map-loading-inner i {
    color: var(--strava-orange);
    margin-bottom: 12px;
}
.map-loading-inner p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Tooltip op polyline */
.map-polyline-tooltip {
    background: var(--color-card) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    max-width: 280px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}
.map-polyline-tooltip::before {
    display: none !important;
}
.map-tooltip strong {
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}
.map-tooltip-type {
    font-weight: 600;
}

/* Legenda */
.map-legend {
    background: var(--color-card);
    color: var(--color-text);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-height: 300px;
    overflow-y: auto;
}
.map-legend strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}
.map-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
}
.map-legend-color {
    display: inline-block;
    width: 14px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .map-toolbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .map-stats {
        margin-left: 0;
    }
    .map-legend {
        max-width: 140px;
        font-size: 11px;
    }
    .map-filter-group select {
        padding: 8px 12px;
        font-size: 14px;
        min-height: 44px;
    }
    .map-timeline-btn {
        min-height: 44px;
        padding: 8px 14px;
    }
}

/* ============================================
   Map: Timeline bar
   ============================================ */
.map-timeline {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    max-width: calc(100% - 40px);
    min-width: 320px;
}
.map-timeline-play {
    background: var(--strava-orange);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}
.map-timeline-play:hover {
    background: var(--strava-orange-hover, #e04000);
    transform: scale(1.08);
}
.map-timeline-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    min-width: 100px;
}
.map-timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--strava-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.map-timeline-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--strava-orange);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.map-timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    min-width: 90px;
    text-align: center;
}
.map-timeline-speed {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}
.map-timeline-speed:hover {
    border-color: var(--strava-orange);
}
.map-timeline-btn {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    font-family: inherit;
}
.map-timeline-btn:hover {
    border-color: var(--strava-orange);
    color: var(--strava-orange);
}
.map-timeline-btn.active {
    background: var(--strava-orange);
    color: #fff;
    border-color: var(--strava-orange);
}

/* ============================================
   Map: Photo markers (thumbnail + cluster)
   ============================================ */

/* Individual photo thumbnail marker */
.map-photo-marker-img {
    border: 2px solid #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--color-card);
}
.map-photo-marker-img:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 10000 !important;
}
.map-photo-marker-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lichtgewicht foto-marker (camera icoon i.p.v. thumbnail voor performance) */
.map-photo-marker-icon {
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 2px solid #fff;
    cursor: pointer;
    transition: transform 0.2s;
}
.map-photo-marker-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* Photo cluster markers */
.photo-cluster {
    background: none !important;
    border: none !important;
}
.photo-cluster-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    color: #fff;
    padding: 0 10px;
    height: 34px;
    min-width: 34px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s;
    white-space: nowrap;
}
.photo-cluster:hover .photo-cluster-inner {
    transform: scale(1.1);
}
.photo-cluster-inner i {
    font-size: 12px;
}
.photo-cluster-small .photo-cluster-inner {
    background: var(--strava-orange);
}
.photo-cluster-medium .photo-cluster-inner {
    background: #e65100;
}
.photo-cluster-large .photo-cluster-inner {
    background: #bf360c;
}

/* Override MarkerCluster default styles for dark/light themes */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: none !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: none !important;
}

/* Legacy camera marker (fallback) */
.map-photo-marker {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--strava-orange);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}
.map-photo-marker:hover {
    transform: scale(1.2);
}
.map-photo-marker i {
    color: var(--strava-orange);
    font-size: 14px;
}

/* Photo popup */
.map-photo-popup {
    text-align: center;
}
.map-photo-popup-container .leaflet-popup-content-wrapper {
    background: var(--color-card);
    color: var(--color-text);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border: 1px solid var(--color-border);
}
.map-photo-popup-container .leaflet-popup-tip {
    background: var(--color-card);
}
.map-photo-thumb {
    width: 100%;
    max-width: 240px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: block;
    cursor: pointer;
}
.map-photo-caption-text {
    font-size: 11px;
    color: var(--color-text-secondary);
    font-style: italic;
    margin-bottom: 4px;
}
.map-photo-info {
    font-size: 12px;
    line-height: 1.5;
}
.map-photo-info strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

/* ============================================
   Map: Gradient legend for speed/HR/heatmap
   ============================================ */
.map-legend-gradient-wrap {
    margin-top: 6px;
}
.map-legend-gradient {
    height: 10px;
    border-radius: 5px;
    width: 100%;
    min-width: 100px;
}
.map-legend-gradient-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--color-text-secondary);
    margin-top: 3px;
}

/* ============================================
   Map: Mobile responsive for new controls
   ============================================ */
@media (max-width: 768px) {
    .map-timeline {
        bottom: 12px;
        padding: 6px 10px;
        gap: 6px;
        min-width: 280px;
        flex-wrap: wrap;
    }
    .map-timeline-slider {
        min-width: 60px;
    }
    .map-timeline-date {
        font-size: 11px;
        min-width: 70px;
    }
    .map-timeline-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ============================================
   Activity Detail: Photo gallery
   ============================================ */
.activity-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.activity-photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--color-surface);
    transition: transform 0.2s, box-shadow 0.2s;
}
.activity-photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.activity-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.activity-photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Map popup: clickable thumbnail styling */
.map-photo-clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}
.map-photo-clickable:hover {
    opacity: 0.85;
}
.map-photo-open-detail {
    color: var(--strava-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}
.map-photo-open-detail:hover {
    text-decoration: underline;
}

/* ============================================
   Photo Lightbox
   ============================================ */
.photo-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.photo-lightbox {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.photo-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.photo-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10001;
}
.photo-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}
.photo-lightbox-prev,
.photo-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10001;
}
.photo-lightbox-prev { left: 16px; }
.photo-lightbox-next { right: 16px; }
.photo-lightbox-prev:hover,
.photo-lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}
.photo-lightbox-caption {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    text-align: center;
    max-width: 80vw;
    z-index: 10001;
}
.photo-lightbox-counter {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 600;
    z-index: 10001;
}

@media (max-width: 768px) {
    .activity-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }
    .photo-lightbox-prev,
    .photo-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ============================================
   HEALTH DASHBOARD
   ============================================ */

/* Period & metric toggles */
.health-period-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.health-scope {
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.health-scope:hover {
    border-color: var(--color-primary);
    color: var(--text-primary);
}
.health-scope.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.trends-scope-group {
    display: flex;
    gap: 4px;
}

.health-metric-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.health-metric-toggle {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.health-metric-toggle:hover {
    border-color: var(--toggle-color, var(--color-primary));
}
.health-metric-toggle.active {
    background: var(--toggle-color, var(--color-primary));
    color: #fff;
    border-color: var(--toggle-color, var(--color-primary));
}
.health-metric-toggle i {
    font-size: 10px;
}

/* Main chart card */
.health-main-chart-card .chart-body {
    position: relative;
}
.health-chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    gap: 8px;
    background: var(--card-bg);
    border-radius: 8px;
    z-index: 2;
}

/* Day cards section */
.health-day-cards-section {
    margin-bottom: 16px;
}
.health-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.health-section-title i {
    color: var(--color-primary);
}

.health-day-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.health-day-cards::-webkit-scrollbar {
    height: 4px;
}
.health-day-cards::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}
.health-day-cards::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.health-day-card {
    min-width: 140px;
    max-width: 160px;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s, transform 0.2s;
}
.health-day-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}
.health-day-today {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.health-day-header {
    text-align: center;
    line-height: 1.2;
}
.health-day-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}
.health-day-date {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
}

/* Score ring */
.health-day-score {
    position: relative;
    width: 52px;
    height: 52px;
}
.health-score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.health-score-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--score-color, var(--text-primary));
}

/* Day metrics */
.health-day-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}
.health-day-metric {
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px;
    background: var(--bg-secondary);
    border-radius: 4px;
}
.health-day-metric i {
    font-size: 8px;
}

/* Activity badges in day card */
.health-day-activity {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}
.health-act-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: var(--color-primary-alpha, rgba(99,102,241,0.15));
    color: var(--color-primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.health-rest-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Week averages table */
.health-week-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.health-week-table th {
    text-align: center;
    padding: 8px 6px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.health-week-table th i {
    margin-right: 2px;
}
.health-week-table td {
    text-align: center;
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.health-week-table td:first-child {
    text-align: left;
    white-space: nowrap;
}
.health-week-table td small {
    color: var(--text-secondary);
    font-size: 11px;
}
.health-week-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Cell coloring */
.health-cell-good {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e !important;
    font-weight: 600;
}
.health-cell-bad {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444 !important;
    font-weight: 600;
}
.health-cell-neutral {
    color: var(--text-primary);
}

/* Insights */
.health-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.health-insight-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    transition: transform 0.2s;
}
.health-insight-card:hover {
    transform: translateY(-1px);
}
.health-insight-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.health-insight-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}
.health-insight-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.insight-positive .health-insight-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.insight-positive {
    border-color: rgba(34, 197, 94, 0.25);
}
.insight-warning .health-insight-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.insight-warning {
    border-color: rgba(245, 158, 11, 0.25);
}
.insight-info .health-insight-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}
.insight-info {
    border-color: rgba(99, 102, 241, 0.25);
}

/* AI Health Chat */
.health-ai-section {
    margin-top: 8px;
}
.health-ai-chat {
    display: flex;
    flex-direction: column;
    height: 420px;
}
.health-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome screen */
.health-ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    flex: 1;
}
.health-ai-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--color-primary-alpha, rgba(99,102,241,0.12));
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}
.health-ai-welcome h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.health-ai-welcome p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    max-width: 400px;
}

.health-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.health-ai-suggestion {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.health-ai-suggestion:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-alpha, rgba(99,102,241,0.08));
}
.health-ai-suggestion i {
    font-size: 12px;
}

/* Chat messages */
.health-ai-msg {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: healthMsgIn 0.3s ease;
}
@keyframes healthMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.health-ai-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.health-ai-msg-ai {
    align-self: flex-start;
}
.health-ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.health-ai-msg-user .health-ai-msg-avatar {
    background: var(--color-primary-alpha, rgba(99,102,241,0.15));
    color: var(--color-primary);
}
.health-ai-msg-ai .health-ai-msg-avatar {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}
.health-ai-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
}
.health-ai-msg-user .health-ai-msg-content {
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.health-ai-msg-ai .health-ai-msg-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Input bar */
.health-ai-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-color);
}
.health-ai-input-bar .chat-input {
    flex: 1;
}
.health-ai-input-bar .chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.2s;
}
.health-ai-input-bar .chat-send-btn:hover {
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
    .health-period-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .health-metric-toggles {
        margin-left: 0;
    }
    .health-day-card {
        min-width: 120px;
    }
    .health-insights-grid {
        grid-template-columns: 1fr;
    }
    .health-ai-chat {
        height: 350px;
    }
    .health-ai-msg {
        max-width: 95%;
    }
    .health-week-table {
        font-size: 11px;
    }
    .health-week-table th,
    .health-week-table td {
        padding: 6px 3px;
    }
}

/* ============ PRO SUBSCRIPTION ============ */
.pro-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pro-lock-content {
    text-align: center;
    max-width: 400px;
    padding: 40px 32px;
}
.pro-lock-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fc4c02, #ff8a50);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    padding: 5px 18px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 1.5px;
}
.pro-lock-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 12px 0;
    color: #fff;
}
.pro-lock-content p {
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
}
.pro-lock-content .btn-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fc4c02, #ff8a50);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.pro-lock-content .btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 76, 2, 0.35);
}
.pro-lock-price {
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* PRO badge in navbar */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fc4c02, #ff8a50);
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pro-badge-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    text-decoration: none;
    transition: all 0.2s;
}

a.pro-badge-nav:hover {
    background: rgba(245, 158, 11, 0.22);
    transform: translateY(-1px);
}

.nav-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 14px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border: none;
    border-radius: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.nav-upgrade:hover {
    background: linear-gradient(135deg, #f97316, #fc4c02);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.nav-upgrade i {
    font-size: 11px;
}

.free-badge-sm {
    font-size: 10px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.user-menu-item-upgrade {
    color: #f59e0b !important;
    font-weight: 600 !important;
}

.user-menu-item-upgrade .user-menu-icon {
    color: #f59e0b !important;
}

/* AI limiet indicator */
.ai-limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
    padding: 4px 10px;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}
.ai-limit-badge .limit-count {
    font-weight: 700;
    color: var(--strava-orange);
}
.ai-limit-badge.limit-warning .limit-count {
    color: #f59e0b;
}
.ai-limit-badge.limit-exceeded {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
.ai-limit-badge.limit-exceeded .limit-count {
    color: #ef4444;
}

/* PRO upsell modal */
.pro-upsell-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.pro-upsell-modal {
    background: var(--color-card);
    border: 2px solid var(--strava-orange);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 92vw;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease;
}
.pro-upsell-modal h3 {
    font-size: 20px;
    margin: 12px 0 8px;
}
.pro-upsell-modal p {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.6;
}
.pro-upsell-modal .btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fc4c02, #ff8a50);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.pro-upsell-modal .btn-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(252, 76, 2, 0.3);
}
.pro-upsell-modal .btn-close-upsell {
    display: block;
    margin: 12px auto 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.pro-upsell-modal .btn-close-upsell:hover {
    color: var(--color-text);
}

/* ============================================
   Welcome Banner (nieuwe gebruikers)
   ============================================ */
.welcome-banner {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    border-radius: 16px;
    padding: 24px 48px 24px 24px;
    margin: 0 0 24px 0;
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    animation: welcomeSlideIn 0.5s ease-out;
}
@keyframes welcomeSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.welcome-banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.welcome-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.welcome-banner-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.welcome-banner-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
}
.btn-welcome-sync {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.btn-welcome-sync:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: #fff;
}
.welcome-banner-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.welcome-banner-close:hover {
    color: #fff;
}
@media (max-width: 600px) {
    .welcome-banner { padding: 16px 36px 16px 16px; }
    .welcome-banner-content { flex-direction: column; text-align: center; }
    .welcome-banner-icon { font-size: 1.5rem; }
}

/* ============================================
   Training Alert Banner
   ============================================ */
.training-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid;
    animation: fadeIn 0.4s ease;
}
.training-alert[data-risk="overload"] {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}
.training-alert[data-risk="overload"] .training-alert-icon {
    color: #ef4444;
}
.training-alert[data-risk="high"] {
    background: rgba(249, 115, 22, 0.08);
    border-color: rgba(249, 115, 22, 0.3);
}
.training-alert[data-risk="high"] .training-alert-icon {
    color: #f97316;
}
.training-alert[data-risk="detraining"] {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}
.training-alert[data-risk="detraining"] .training-alert-icon {
    color: #3b82f6;
}
.training-alert-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.training-alert-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}
.training-alert-text {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.4;
}
.training-alert-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 14px;
}
.training-alert-close:hover {
    color: var(--color-text);
}

/* ============================================
   Training Stress Chart
   ============================================ */
.training-stress-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 0 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.ts-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ts-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.training-stress-scope {
    font-size: 12px !important;
    padding: 4px 10px !important;
}

/* ============================================
   Recovery Score Ring (KPI Card)
   ============================================ */
.recovery-score-ring {
    position: relative;
    width: 48px;
    height: 48px;
    margin: 0 auto 4px;
}
.recovery-score-ring svg {
    transform: rotate(-90deg);
}
.recovery-score-ring .ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    font-weight: 700;
}

/* ============================================
   Feedback FAB + Modal
   ============================================ */
.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--strava-orange);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(252, 76, 2, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(252, 76, 2, 0.5);
}
.feedback-overlay {
    position: fixed;
    inset: 0;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.feedback-modal {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 480px;
    max-width: 94vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.25s ease;
}
.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border);
}
.feedback-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.feedback-modal-header h3 i {
    color: var(--strava-orange);
}
.feedback-modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.feedback-modal-close:hover {
    background: var(--color-overlay);
}
.feedback-modal-body {
    padding: 20px;
}
.feedback-field {
    margin-bottom: 16px;
}
.feedback-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}
.feedback-field select,
.feedback-field input,
.feedback-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.feedback-field select:focus,
.feedback-field input:focus,
.feedback-field textarea:focus {
    outline: none;
    border-color: var(--strava-orange);
}
.feedback-field textarea {
    resize: vertical;
    min-height: 100px;
}
.feedback-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.feedback-submit-btn {
    background: var(--strava-orange);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.15s;
}
.feedback-submit-btn:hover {
    opacity: 0.9;
}
.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.feedback-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}
.feedback-msg-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.feedback-msg-error {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

@media (max-width: 600px) {
    .feedback-fab {
        bottom: 16px;
        right: 16px;
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    .feedback-modal {
        width: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
        align-self: flex-end;
    }
}