/* FitPavlik — Dark Fitness Theme */

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

:root {
    --bg: #0a0e1a;
    --bg-1: #0f1524;
    --bg-2: #151b2e;
    --bg-3: #1b2238;
    --card: #131a2c;
    --card-2: #1a2236;
    --border: #252e47;
    --border-light: #303a56;
    --text: #e9edf7;
    --text-2: #aab1c8;
    --text-3: #6f7894;
    --muted: #7b829a;

    --primary: #22c55e;
    --primary-hover: #16a34a;
    --primary-glow: rgba(34, 197, 94, 0.3);
    --accent: #06b6d4;
    --warn: #f59e0b;
    --danger: #ef4444;
    --purple: #a78bfa;

    --radius: 14px;
    --radius-lg: 20px;
    --radius-sm: 8px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);

    --sidebar-w: 260px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 15px;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* =========== AUTH / LOGIN =========== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse at top left, rgba(34, 197, 94, 0.15), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(6, 182, 212, 0.15), transparent 50%),
        var(--bg);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1050px;
    width: 100%;
}

.auth-card {
    background: linear-gradient(150deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-brand { text-align: center; margin-bottom: 2rem; }
.brand-logo {
    display: inline-flex;
    width: 80px; height: 80px;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px var(--primary-glow);
}
.auth-brand h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-tagline { color: var(--text-2); margin-top: 0.3rem; font-size: 0.95rem; }

.auth-form label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-2); font-size: 0.9rem; }

.password-field { position: relative; margin-bottom: 1.5rem; }
.password-field input { padding-right: 3rem; }
.toggle-pw {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
}
.toggle-pw:hover { color: var(--text); background: var(--bg-3); }

.auth-footnote {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-3);
    font-size: 0.85rem;
}

.auth-hero {
    background: linear-gradient(145deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}
.hero-stats .stat {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: transform 0.2s;
}
.hero-stats .stat:hover { transform: translateY(-4px); border-color: var(--primary); }
.stat-value { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.stat-label { color: var(--text-2); font-size: 0.9rem; }

/* =========== INPUTS / BUTTONS =========== */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    color-scheme: dark;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.field { margin-bottom: 1.25rem; }
.field label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.15s;
    text-decoration: none;
}
.btn:hover { background: var(--border); border-color: var(--border-light); transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border: none;
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 6px 20px var(--primary-glow); color: white; }
.btn-secondary { background: var(--bg-3); }
.btn-outline { background: transparent; border: 1px solid var(--border-light); }
.btn-outline:hover { background: var(--bg-3); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-danger { background: var(--danger); border: none; color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    border: 1px solid;
}
.alert-error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.alert-ok { background: rgba(34, 197, 94, 0.1); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }

/* =========== SETUP WIZARD =========== */
.setup-body {
    min-height: 100vh;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse at top, rgba(34, 197, 94, 0.1), transparent 60%),
        var(--bg);
}
.setup-wrap { max-width: 760px; margin: 0 auto; }
.setup-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}
.setup-header { text-align: center; margin-bottom: 2rem; }
.setup-header h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.setup-header p { color: var(--text-2); }
.form-section {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.form-section h3 { margin-bottom: 1rem; font-size: 1.05rem; color: var(--text); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.radio-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pill { flex: 1; min-width: 120px; }
.pill input { display: none; }
.pill span {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
    font-size: 0.9rem;
}
.pill input:checked + span {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.setup-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* =========== LAYOUT =========== */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.75rem 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.brand-icon { font-size: 1.8rem; }
.brand-name { font-weight: 800; font-size: 1.15rem; }
.sidebar-close {
    display: none;
    background: none; border: none;
    color: var(--text-2); cursor: pointer;
    margin-left: auto;
    font-size: 1.2rem;
    padding: 0.3rem 0.5rem;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    color: var(--text-2);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.15s;
    font-size: 0.95rem;
}
.sidebar-nav a:hover {
    background: var(--bg-3);
    color: var(--text);
}
.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: calc(0.9rem - 3px);
}
.nav-icon { font-size: 1.2rem; width: 22px; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}
.user-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center; justify-content: center;
    font-weight: 800;
    color: white;
}
.user-name { font-weight: 600; font-size: 0.92rem; }
.user-meta { font-size: 0.8rem; color: var(--text-3); }
.btn-logout {
    display: block;
    padding: 0.65rem 0.9rem;
    text-align: center;
    color: var(--text-2);
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}
.btn-logout:hover { color: var(--danger); background: var(--bg-3); }

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.menu-toggle {
    display: none;
    background: none; border: none;
    color: var(--text); cursor: pointer;
    padding: 0.5rem;
}
.page-title { font-size: 1.25rem; font-weight: 800; flex: 1; }
.topbar-actions { display: flex; gap: 0.5rem; }

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* =========== CARDS =========== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.card-head h3 { font-size: 1.1rem; font-weight: 700; }
.link-small { font-size: 0.9rem; color: var(--primary); font-weight: 600; }
.muted { color: var(--text-3); font-size: 0.9rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }

/* =========== DASHBOARD HERO =========== */
.hero-card {
    background:
        radial-gradient(ellipse at top right, rgba(34, 197, 94, 0.15), transparent 70%),
        linear-gradient(135deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}
.greeting { color: var(--text-2); font-size: 1rem; margin-bottom: 0.5rem; }
.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.hero-accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-2);
    font-size: 0.95rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.progress-bar-wrap { display: flex; align-items: center; gap: 1rem; }
.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--bg-2);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 0.8s ease;
}
.progress-label { font-size: 0.9rem; color: var(--text-2); font-weight: 600; }

.weight-display {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    min-width: 200px;
}
.weight-now { font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: 0.3rem; }
.weight-now small { font-size: 1rem; color: var(--text-3); margin-left: 0.3rem; font-weight: 600; }
.weight-label { color: var(--text-2); margin-bottom: 1rem; font-size: 0.9rem; }

/* =========== STATS GRID =========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.15s, border-color 0.15s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.stat-icon {
    width: 50px; height: 50px;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon.kcal { background: rgba(239, 68, 68, 0.15); }
.stat-icon.burn { background: rgba(34, 197, 94, 0.15); }
.stat-icon.deficit { background: rgba(6, 182, 212, 0.15); }
.stat-icon.projection { background: rgba(167, 139, 250, 0.15); }

.stat-big { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.stat-sub { font-size: 0.8rem; color: var(--text-3); margin-top: 0.2rem; }

/* =========== TODAY / WORKOUT =========== */
.today-workout .wo-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.wo-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-2);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    align-items: center;
}
.wo-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.wo-strength { background: rgba(34, 197, 94, 0.15); color: var(--primary); }
.wo-cardio { background: rgba(6, 182, 212, 0.15); color: var(--accent); }
.wo-rest { background: rgba(167, 139, 250, 0.15); color: var(--purple); }

.exercise-list {
    list-style: none;
    margin-bottom: 1rem;
}
.exercise-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.92rem;
    position: relative;
    padding-left: 1.5rem;
}
.exercise-list li:last-child { border-bottom: none; }
.exercise-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* =========== MACROS =========== */
.macro-ring-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.macro-item { text-align: center; }
.macro-ring {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: conic-gradient(var(--c) 0deg 360deg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    margin: 0 auto 0.5rem;
    position: relative;
    color: white;
    font-weight: 800;
}
.macro-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: var(--card);
    border-radius: 50%;
}
.macro-ring span, .macro-ring small {
    position: relative;
    z-index: 1;
    color: var(--text);
}
.macro-ring span { font-size: 1.3rem; }
.macro-ring small { font-size: 0.75rem; color: var(--text-3); }
.macro-name { font-size: 0.85rem; color: var(--text-2); font-weight: 600; }

.tdee-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.tdee-breakdown > div {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.tdee-breakdown span { color: var(--text-2); }
.tdee-breakdown strong { color: var(--text); font-weight: 700; }

/* =========== TIMELINE =========== */
.timeline { position: relative; padding-left: 2rem; }
.timeline:before {
    content: '';
    position: absolute;
    left: 0.9rem; top: 1.5rem; bottom: 1rem;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    display: grid;
    grid-template-columns: 70px auto 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    position: relative;
}
.timeline-time { font-weight: 700; font-size: 0.95rem; color: var(--accent); }
.timeline-dot {
    position: absolute;
    left: -0.3rem;
    width: 28px; height: 28px;
    background: var(--bg-2);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center; justify-content: center;
    font-size: 0.85rem;
    z-index: 1;
}
.timeline-body { padding-left: 1rem; }
.timeline-title { font-weight: 600; }
.timeline-msg { font-size: 0.85rem; color: var(--text-3); }

/* =========== WEEKLY PLAN =========== */
.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.day-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.15s;
}
.day-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.day-card.today {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), var(--bg-2));
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3), 0 8px 20px rgba(34, 197, 94, 0.1);
}
.day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.day-name { font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.today-dot {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}
.day-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.day-dur { color: var(--text-2); font-size: 0.9rem; margin-bottom: 0.75rem; }
.day-rest { opacity: 0.75; }

/* =========== TIPS =========== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.tip {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.tip-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.tip h4 { margin-bottom: 0.4rem; font-size: 1rem; }
.tip p { color: var(--text-2); font-size: 0.9rem; }

/* =========== LOG TABLE =========== */
.log-table { display: flex; flex-direction: column; gap: 0.3rem; }
.log-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    align-items: center;
    font-size: 0.92rem;
}
.log-head {
    background: transparent;
    font-weight: 700;
    color: var(--text-3);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
}
.intensity {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}
.intensity-light { background: rgba(6, 182, 212, 0.15); color: var(--accent); }
.intensity-moderate { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.intensity-hard { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.gain-neg { color: var(--primary); font-weight: 700; }
.gain-pos { color: var(--danger); font-weight: 700; }

/* =========== NUTRITION =========== */
.gradient-card {
    background:
        radial-gradient(ellipse at top right, rgba(34, 197, 94, 0.15), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(6, 182, 212, 0.1), transparent 50%),
        linear-gradient(135deg, var(--card), var(--card-2));
}
.nutrition-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
}
.ns-big { text-align: center; padding: 1rem 2rem; border-right: 1px solid var(--border); }
.big-val {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.big-label { color: var(--text-2); margin-top: 0.3rem; }
.ns-split {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.ns-item { text-align: center; background: var(--bg-2); border-radius: var(--radius); padding: 1rem; }
.ns-num { font-size: 2rem; font-weight: 800; }
.ns-unit { font-size: 0.9rem; color: var(--text-3); margin-left: 0.2rem; }
.ns-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-top: 0.4rem;
}

.meals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.meal-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.meal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.meal-name { font-weight: 700; }
.meal-time { font-size: 0.82rem; color: var(--text-3); margin-top: 0.2rem; }
.meal-kcal { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.meal-kcal small { font-size: 0.7rem; color: var(--text-3); margin-left: 0.2rem; display: block; }
.meal-macros {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
}
.meal-macros span {
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    font-weight: 700;
}
.mm-p { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.mm-c { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.mm-f { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.ms-label { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.4rem; }
.meal-suggestions ul { list-style: none; }
.meal-suggestions li {
    padding: 0.3rem 0;
    font-size: 0.88rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}
.meal-suggestions li:last-child { border-bottom: none; }

.rules-list { list-style: none; }
.rules-list li {
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.4rem;
    background: var(--bg-2);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
}
.rules-no li { border-left-color: var(--danger); }

/* =========== CHARTS =========== */
.chart-box {
    position: relative;
    width: 100%;
    height: 320px;
    min-height: 240px;
}
.chart-box-sm { height: 200px; min-height: 160px; }
.chart-box canvas {
    max-width: 100%;
    max-height: 100%;
}

/* =========== PROGRESS =========== */
.chart-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-2);
}
.lg-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
}
.lg-now { background: var(--primary); }
.lg-goal { background: var(--accent); }
.lg-start { background: var(--purple); }

.bmi-display { text-align: center; margin-bottom: 1.25rem; }
.bmi-val { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.bmi-cat {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.bmi-scale { position: relative; padding: 0 0 2rem; }
.bmi-bar { display: flex; height: 24px; border-radius: 6px; overflow: hidden; }
.bmi-seg { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; }
.bmi-low { background: #60a5fa; }
.bmi-ok { background: #22c55e; }
.bmi-over { background: #f59e0b; }
.bmi-obese { background: #ef4444; }
.bmi-marker {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    font-size: 1rem;
    color: var(--text);
    transition: left 0.5s;
}

/* =========== NOTIFICATIONS =========== */
.info-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), var(--card));
}
.ic-icon { font-size: 2.5rem; }
.ic-body { flex: 1; }
.ic-body h3 { margin-bottom: 0.4rem; }
.ic-body p { color: var(--text-2); margin-bottom: 1rem; }

.notif-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notif-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: center;
    transition: border-color 0.15s;
}
.notif-item:hover { border-color: var(--border-light); }
.notif-item.disabled { opacity: 0.5; }
.notif-time { text-align: center; }
.nt-icon { font-size: 1.5rem; }
.nt-clock { font-weight: 700; color: var(--accent); }
.notif-title { font-weight: 700; margin-bottom: 0.2rem; }
.notif-msg { color: var(--text-2); font-size: 0.88rem; margin-bottom: 0.5rem; }
.notif-days { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.day-chip {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    background: var(--bg-3);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-3);
}
.day-chip.active { background: rgba(34, 197, 94, 0.2); color: var(--primary); }
.cat-chip {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 0.5rem;
}
.notif-actions { display: flex; align-items: center; gap: 0.5rem; }
.btn-icon {
    background: none; border: none;
    padding: 0.5rem; cursor: pointer;
    font-size: 1rem; color: var(--text-3);
    border-radius: 6px;
}
.btn-icon:hover { background: var(--bg-3); color: var(--danger); }
.btn-icon-edit:hover { color: var(--accent); }
.btn-icon-play:hover { color: var(--primary); background: rgba(34, 197, 94, 0.1); }

.notif-help {
    margin-top: 0.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}
.notif-help summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-2);
    user-select: none;
}
.notif-help summary:hover { color: var(--text); }
.notif-help[open] summary { color: var(--primary); margin-bottom: 0.5rem; }
.notif-help ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}
.notif-help li {
    padding: 0.4rem 0;
    color: var(--text-2);
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border);
}
.notif-help li:last-child { border-bottom: none; }
.notif-help code {
    background: var(--bg-3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent);
}

.switch { position: relative; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-3);
    border-radius: 26px;
    transition: 0.2s;
}
.slider:before {
    content: '';
    position: absolute;
    height: 20px; width: 20px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.day-selector { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.day-pick { flex: 1; min-width: 52px; }
.day-pick input { display: none; }
.day-pick span {
    display: block;
    padding: 0.6rem 0.5rem;
    text-align: center;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.day-pick input:checked + span {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.template-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text);
    font-family: inherit;
}
.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), var(--bg-2));
}
.t-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.t-text { font-weight: 700; font-size: 0.92rem; }
.t-time { color: var(--text-3); font-size: 0.82rem; margin-top: 0.2rem; }

/* =========== ADMIN =========== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}
.admin-stat {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.as-val { font-size: 2rem; font-weight: 800; }
.as-label { color: var(--text-3); font-size: 0.82rem; margin-top: 0.25rem; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}
.pg-item {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.pg-item span { color: var(--text-3); }

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.export-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.15s;
    text-decoration: none;
}
.export-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), var(--bg-2));
    color: var(--text);
}
.ex-icon { font-size: 2rem; }
.export-btn strong { display: block; font-size: 0.95rem; }
.export-btn span { color: var(--text-3); font-size: 0.82rem; display: block; margin-top: 0.15rem; }

.danger-card { border-color: rgba(239, 68, 68, 0.3); }
.danger-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}
.about-grid > div {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.9rem;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}
.about-grid span { color: var(--text-3); }

/* =========== MODAL =========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.open { display: flex; animation: fadeIn 0.2s; }
.modal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s;
}
.modal-card h3 { margin-bottom: 1.25rem; }
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--bg-3);
    border: none;
    color: var(--text);
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
}
.modal-close:hover { background: var(--danger); }

/* =========== MEAL MODAL =========== */
.hidden { display: none !important; }
#tpl-select {
    font-weight: 600;
    background-image: linear-gradient(135deg, rgba(34, 197, 94, 0.05), transparent);
    border-color: var(--border-light);
}
#tpl-count { font-weight: 400; margin-left: 0.4rem; font-size: 0.82rem; }

/* =========== TOAST =========== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: var(--card);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideLeft 0.2s;
    max-width: 350px;
}
.toast-error { border-left-color: var(--danger); }
.toast-ok { border-left-color: var(--primary); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =========== RESPONSIVE =========== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .auth-container { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .hero-card { grid-template-columns: 1fr; }
    .nutrition-summary { grid-template-columns: 1fr; }
    .ns-big { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 85%;
        max-width: 320px;
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
    }
    .main { margin-left: 0; }
    .menu-toggle { display: block; }
    .sidebar-close { display: block; }
    .topbar { padding: 0.85rem 1rem; }
    .main-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .week-grid { grid-template-columns: 1fr; }
    .setup-card { padding: 1.5rem; }
    .hero-title { font-size: 1.5rem; }
    .weight-now { font-size: 2.25rem; }
    .notif-item { grid-template-columns: 60px 1fr auto; gap: 0.75rem; }
    .log-row { grid-template-columns: 1fr 1fr; font-size: 0.85rem; }
    .log-head { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-meta { flex-direction: column; gap: 0.5rem; }
    .main-content { padding: 0.75rem; }
    .card { padding: 1.1rem; }
    .timeline { padding-left: 1.5rem; }
    .timeline-item { grid-template-columns: 50px auto 1fr; gap: 0.5rem; }
}
