:root {
    /* Цветовая палитра: темная тема с неоновыми-акцентами */
    --bg-color: #0f1115;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-glow: #00f0ff;
    --accent-glow-secondary: #39ff14;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.1);
    --danger-color: #ff3366;
    --danger-color-hover: #ff1a53;
}

body.light-mode {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-glow: #0284c7;
    --accent-glow-secondary: #16a34a;
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-hover: rgba(0, 0, 0, 0.08);
    --border-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 240, 255, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(57, 255, 20, 0.05), transparent 25%);
}

/* Glassmorphism утилиты */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

/* Навигация */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--accent-glow);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-links a.active {
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.1);
}

/* Контейнер приложения */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 5%;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.view-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Дашборд */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.05);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-glow);
}

.stat-value .unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Градиентный баннер */
.gradient-border {
    position: relative;
    padding: 2rem;
    background: var(--bg-glass);
    border-radius: 16px;
    text-align: center;
    overflow: hidden;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-glow), var(--accent-glow-secondary));
}

.dashboard-banner h2 {
    margin-bottom: 0.5rem;
}

.dashboard-banner p {
    color: var(--text-secondary);
}

/* Layout Grid для Тренировок и Питания */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

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

/* Формы */
.form-container {
    padding: 2rem;
    height: fit-content;
}

.form-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.row {
    display: flex;
    gap: 1rem;
}

.row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-glow) 0%, #0088ff 100%);
    color: #000;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

/* Карточки Списка */
.list-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.data-card:hover {
    background: var(--bg-glass-hover);
}

.card-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.card-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.badge {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-glow);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.green {
    background: rgba(57, 255, 20, 0.1);
    color: var(--accent-glow-secondary);
}

.btn-delete {
    background: rgba(255, 51, 102, 0.1);
    color: var(--danger-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: var(--danger-color);
    color: #fff;
    transform: scale(1.1);
}

/* Иконка крестика для кнопки delete */
.btn-delete::before, .btn-delete::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background-color: currentColor;
}

.btn-delete::before { transform: rotate(45deg); }
.btn-delete::after { transform: rotate(-45deg); }

/* Состояние загрузки или пустых данных */
.loading, .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* 404 Страница Специфичное */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    text-align: center;
}

.not-found h1 {
    font-size: 8rem;
    line-height: 1;
    font-weight: 800;
    color: var(--accent-glow);
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
    margin-bottom: 1rem;
}

.not-found h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.not-found p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.not-found .btn-primary {
    width: auto;
    padding: 1rem 2rem;
    text-decoration: none;
    display: inline-block;
}

/* Бургер-меню */
.burger-menu {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .burger-menu {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links.show {
        display: flex;
    }
}

/* Лейаут с сайдбаром */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Реклама */
.ad-banner {
    padding: 1.5rem;
    position: relative;
    border-radius: 12px;
}
.ad-label {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--text-secondary);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Форум кнопки */
.btn-like, .btn-reply {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.btn-like:hover { color: #ff3366; }
.btn-reply:hover { color: var(--accent-glow); }

/* Water Tracker */
.water-container {
    width: 60px;
    height: 120px;
    border: 3px solid var(--border-color);
    border-radius: 0 0 10px 10px;
    position: relative;
    overflow: hidden;
    margin: 1rem auto;
    background: rgba(255,255,255,0.05);
}
.water-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: rgba(0, 240, 255, 0.5);
    transition: height 0.5s ease;
}

/* Админ Таблица */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.admin-table th, .admin-table td {
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    text-align: left;
}
.admin-table th {
    background: var(--bg-glass);
    color: var(--text-secondary);
}

/* Умный Поиск */
.search-bar {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 2rem auto;
    display: flex;
}
.search-bar input {
    border-radius: 8px 0 0 8px;
    flex-grow: 1;
}
.search-bar button {
    border-radius: 0 8px 8px 0;
    width: auto;
}

