/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ===== */
:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #1a1c22;
    --bg-card: #1e1f25;
    --border-color: #2f3138;
    --accent-primary: #bb86fc;
    --accent-secondary: #03dac6;
    --accent-warning: #f54242;
    --text-primary: #e8eaed;
    --text-secondary: #9ba1b0;
    --gradient: linear-gradient(135deg, #bb86fc, #3700b3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* ===== ШАПКА ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title h1 {
    font-size: 1.8rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo {
    height: auto;
    width: 100%;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 40px;
}

.username {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: all 0.2s;
    text-decoration: none;
}

.settings-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* ===== НАВИГАЦИЯ ===== */
.nav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.nav-btn {
    padding: 14px 20px;
    border-radius: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* ===== КАРТОЧКИ СТАТИСТИКИ ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.stat-value small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--accent-primary);
    margin-left: 8px;
}

/* ===== ГРАФИКИ ===== */
.graph-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.chart-container {
    height: 200px;
    width: 100%;
}

/* ===== МЕТОДИКИ ===== */
.program-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.program-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Метрики */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.metric-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 20px;
    text-align: center;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

/* Подходы - блочное отображение */
.approaches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.approach-block {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.approach-number {
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(187, 134, 252, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.approach-info {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    flex: 1;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item i {
    color: var(--accent-primary);
    width: 18px;
}

.approach-type {
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.type-warmup { background: #2a2c35; color: var(--text-secondary); }
.type-work { background: #03dac633; color: #03dac6; }
.type-heavy { background: #f5424233; color: #f54242; }
.type-max { background: #bb86fc33; color: #bb86fc; }
.type-cooldown { background: #2a2c35; color: var(--text-secondary); }

/* Графики в методиках */
.charts-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.chart-block {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 15px;
}

.chart-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-small {
    height: 120px;
}

/* ===== ТАБЛИЦА ЛИДЕРОВ ===== */
.leaderboard-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.leaderboard-table th {
    text-align: left;
    padding: 15px 10px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
}

.rank-cell {
    font-weight: 700;
    width: 50px;
}

.rank-1 .rank-cell { color: gold; }
.rank-2 .rank-cell { color: silver; }
.rank-3 .rank-cell { color: #cd7f32; }

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.rating-cell {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== ЗДОРОВЬЕ ===== */
.health-page {
    max-width: 800px;
    margin: 0 auto;
}

.metrics-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.progress-item {
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 10px;
    transition: width 0.5s;
}

/* Достижения - сетка */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.achievement-item {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 15px 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.achievement-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Проблемные зоны */
.problem-zones {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
}

.zone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.zone-item:last-child {
    border-bottom: none;
}

.zone-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f54242;
}

.zone-name {
    flex: 1;
}

.zone-severity {
    color: #f54242;
    font-size: 0.9rem;
}

/* ===== НАСТРОЙКИ ===== */
.settings-page {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.settings-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-label i {
    width: 24px;
    color: var(--accent-primary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--accent-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.danger-zone {
    border-color: var(--accent-warning);
}

.danger-zone h2 {
    color: var(--accent-warning);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger {
    background: var(--accent-warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .user-actions {
        justify-content: space-between;
    }
    
    .nav-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .approach-block {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .approach-info {
        width: 100%;
        gap: 15px;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-title h1 {
        font-size: 1.4rem;
    }
    
    .logo {
        width: 100%;
    }
    
    .nav-buttons {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .approach-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}



* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: linear-gradient(135deg, #0a0c10 0%, #1a1c22 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #e8eaed;
        }

        .auth-container {
            width: 100%;
            max-width: 440px;
            padding: 20px;
        }

        .auth-card {
            background: #1e1f25;
            border-radius: 32px;
            padding: 40px;
            border: 1px solid #2f3138;
            box-shadow: 0 20px 40px rgba(0,0,0,0.4);
        }

        .auth-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .auth-header h1 {
            font-size: 2.5rem;
            font-weight: 600;
            background: linear-gradient(135deg, #bb86fc, #3700b3);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
        }

        .auth-header p {
            color: #9ba1b0;
        }

        .form-group {
            margin-bottom: 24px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #9ba1b0;
            font-size: 0.9rem;
        }

        .input-wrapper {
            position: relative;
        }

        .input-wrapper i {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ba1b0;
        }

        .input-wrapper input {
            width: 100%;
            padding: 16px 16px 16px 48px;
            background: #2a2c35;
            border: 1px solid #2f3138;
            border-radius: 16px;
            color: #e8eaed;
            font-size: 1rem;
            transition: all 0.2s;
        }

        .input-wrapper input:focus {
            outline: none;
            border-color: #bb86fc;
            box-shadow: 0 0 0 3px rgba(187,134,252,0.2);
        }

        .btn-auth {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, #bb86fc, #3700b3);
            border: none;
            border-radius: 16px;
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.2s;
            margin-bottom: 20px;
        }

        .btn-auth:hover {
            opacity: 0.9;
        }

        .error-message {
            background: #f5424233;
            color: #f54242;
            padding: 12px;
            border-radius: 12px;
            margin-bottom: 20px;
            text-align: center;
            border: 1px solid #f54242;
        }

        .auth-footer {
            text-align: center;
            color: #9ba1b0;
        }

        .auth-footer a {
            color: #bb86fc;
            text-decoration: none;
            font-weight: 600;
        }

        .auth-footer a:hover {
            text-decoration: underline;
        }

        .demo-credentials {
            margin-top: 30px;
            padding: 20px;
            background: #2a2c35;
            border-radius: 16px;
            text-align: center;
        }

        .demo-credentials p {
            color: #9ba1b0;
            margin-bottom: 10px;
        }

        .demo-credentials code {
            color: #bb86fc;
            background: #1e1f25;
            padding: 4px 8px;
            border-radius: 8px;
        }











        body {
            font-family: 'Inter', sans-serif;
            background: linear-gradient(135deg, #0a0c10 0%, #1a1c22 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #e8eaed;
        }

        .auth-container {
            width: 100%;
            max-width: 480px;
            padding: 20px;
        }

        .auth-card {
            background: #1e1f25;
            border-radius: 32px;
            padding: 40px;
            border: 1px solid #2f3138;
            box-shadow: 0 20px 40px rgba(0,0,0,0.4);
        }

        .auth-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .auth-header h1 {
            font-size: 2.5rem;
            font-weight: 600;
            background: linear-gradient(135deg, #bb86fc, #3700b3);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
        }

        .auth-header p {
            color: #9ba1b0;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 6px;
            color: #9ba1b0;
            font-size: 0.9rem;
        }

        .form-group label .required {
            color: #f54242;
            margin-left: 4px;
        }

        .input-wrapper {
            position: relative;
        }

        .input-wrapper i {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ba1b0;
        }

        .input-wrapper input {
            width: 100%;
            padding: 14px 16px 14px 48px;
            background: #2a2c35;
            border: 1px solid #2f3138;
            border-radius: 16px;
            color: #e8eaed;
            font-size: 1rem;
            transition: all 0.2s;
        }

        .input-wrapper input:focus {
            outline: none;
            border-color: #bb86fc;
            box-shadow: 0 0 0 3px rgba(187,134,252,0.2);
        }

        .btn-auth {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, #bb86fc, #3700b3);
            border: none;
            border-radius: 16px;
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.2s;
            margin: 20px 0;
        }

        .btn-auth:hover {
            opacity: 0.9;
        }

        .error-message {
            background: #f5424233;
            color: #f54242;
            padding: 12px;
            border-radius: 12px;
            margin-bottom: 20px;
            text-align: center;
            border: 1px solid #f54242;
        }

        .auth-footer {
            text-align: center;
            color: #9ba1b0;
        }

        .auth-footer a {
            color: #bb86fc;
            text-decoration: none;
            font-weight: 600;
        }

        .auth-footer a:hover {
            text-decoration: underline;
        }

        .password-hint {
            font-size: 0.85rem;
            color: #9ba1b0;
            margin-top: 4px;
        }