/* ============ Reset & Variables ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Colors */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Backgrounds */
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-hover: #475569;
    
    /* Text */
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Layout */
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    
    /* Transitions */
    --t-fast: 0.15s ease;
    --t: 0.3s ease;
    --t-slow: 0.5s ease;
}

html, body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ Animations ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============ Header ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(236, 72, 153, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 8px rgba(255,255,255,0.3));
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.logo-text p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: var(--t);
}

.icon-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

/* ============ Main ============ */
.main {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
    animation: fadeIn var(--t);
}

/* ============ Hero / Greeting ============ */
.hero {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(124, 58, 237, 0.2);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent 60%);
    pointer-events: none;
}

.hero-greeting {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    position: relative;
}

.hero-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    position: relative;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--t);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-unit {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 4px;
}

/* ============ Section ============ */
.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ Menu Grid ============ */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--t);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-color, var(--primary));
    opacity: 0.15;
    filter: blur(20px);
    transition: var(--t);
}

.menu-card:active {
    transform: scale(0.96);
    background: var(--bg-elevated);
}

.menu-card-icon {
    font-size: 28px;
    position: relative;
}

.menu-card-title {
    font-size: 14px;
    font-weight: 600;
    position: relative;
}

.menu-card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    position: relative;
}

/* ============ Bottom Nav ============ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--t);
    position: relative;
    flex: 1;
}

.nav-item.active {
    color: var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.nav-icon {
    font-size: 22px;
    transition: var(--t);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ============ Loading ============ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    opacity: 0;
    transition: var(--t);
    z-index: 998;
    max-width: 90%;
    text-align: center;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 13px;
}

/* ============ Responsive ============ */
@media (max-width: 380px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
    .hero-stats {
        grid-template-columns: 1fr;
    }
}
/* ============ Profile Setup ============ */
.profile-setup {
    padding: 20px 0;
    animation: fadeIn var(--t);
}

.setup-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
    border-radius: 3px;
}

.setup-header {
    text-align: center;
    margin-bottom: 24px;
}

.step-counter {
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(124, 58, 237, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
}

.setup-content {
    margin-bottom: 32px;
}

.setup-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

.form-input {
    width: 100%;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 2px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 18px;
    text-align: center;
    transition: var(--t);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
    background: var(--bg-elevated);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 15px;
}

.choice-grid {
    display: grid;
    gap: 12px;
}

.choice-btn {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: right;
    position: relative;
}

.choice-btn:active {
    transform: scale(0.98);
}

.choice-btn.selected {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.15);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.choice-emoji {
    font-size: 26px;
    flex-shrink: 0;
}

.choice-label {
    font-weight: 600;
    font-size: 15px;
}

.choice-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    font-weight: 400;
}

.setup-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 16px 24px;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:active {
    transform: scale(0.97);
    background: var(--bg-elevated);
}
/* ============ Report Page ============ */
.report-page {
    animation: fadeIn var(--t);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.report-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.icon-btn-small {
    background: rgba(124, 58, 237, 0.15);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--primary-light);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.user-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.summary-item {
    background: var(--bg-card);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 13px;
    font-weight: 600;
}

.bmi-card {
    padding: 16px;
    border-radius: var(--radius);
    border: 2px solid;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bmi-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.bmi-header span:last-child {
    font-weight: 600;
}

.bmi-value {
    font-size: 32px;
    font-weight: 800;
}

.energy-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.15));
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(124, 58, 237, 0.3);
    margin-bottom: 20px;
}

.energy-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.energy-value {
    font-size: 44px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.energy-unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.energy-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.macro-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.macro-emoji {
    font-size: 24px;
    margin-bottom: 6px;
}

.macro-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-light);
}

.macro-value span {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 2px;
}

.macro-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.macro-pct {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.nutrients-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nutrient-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nutrient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.nutrient-name {
    font-weight: 600;
    font-size: 14px;
}

.nutrient-required {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-light);
}

.nutrient-ul {
    font-size: 11px;
    color: var(--warning);
    margin-bottom: 6px;
}

.nutrient-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.sources-label {
    font-size: 11px;
    color: var(--text-muted);
}

.source-chip {
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-light);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

.report-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 20px 10px 10px;
    line-height: 1.6;
}
/* ============ Food Diary ============ */
.food-diary { animation: fadeIn var(--t); }

.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.diary-header h2 {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
    text-align: center;
}

.diary-date {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 10px;
}

.back-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.back-btn:active { transform: scale(0.9); }

.totals-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.15));
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.totals-main {
    text-align: center;
    margin-bottom: 16px;
}

.totals-value {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.totals-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.totals-grid > div {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.totals-grid > div span {
    font-size: 20px;
}

.diary-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}

.diary-section-header {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    gap: 10px;
}

.food-item-info { flex: 1; }

.food-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.food-item-amount {
    font-size: 12px;
    color: var(--text-muted);
}

.food-item-remove {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: var(--danger);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.food-item-remove:active { transform: scale(0.9); }

.search-box {
    margin-bottom: 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--t);
}

.category-card:active {
    transform: scale(0.97);
    background: var(--bg-elevated);
}

.category-emoji { font-size: 28px; }

.category-name {
    font-size: 13px;
    font-weight: 600;
}

.foods-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.food-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: var(--t);
}

.food-card:active {
    transform: scale(0.98);
    background: var(--bg-elevated);
}

.food-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.food-card-kcal {
    font-size: 12px;
    color: var(--text-muted);
}

.selected-food-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.15));
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(124, 58, 237, 0.3);
    margin-bottom: 16px;
}

.selected-food-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.selected-food-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.unit-selector {
    display: flex;
    gap: 10px;
}

.unit-btn {
    flex: 1;
    background: var(--bg-card);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 14px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
}

.unit-btn.selected {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.15);
}

.unit-btn:active { transform: scale(0.97); }

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius);
    padding: 14px;
    font-size: 13px;
    color: var(--info);
    text-align: center;
}
/* ============ Water ============ */
.water-page { animation: fadeIn var(--t); }

.water-visual {
    text-align: center;
    padding: 30px 0;
}

.water-drop { font-size: 64px; margin-bottom: 10px; }

.water-amount {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.water-unit {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.water-progress {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.progress-bar-bg {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.water-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.water-btn {
    background: var(--bg-card);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 20px 10px;
    cursor: pointer;
    transition: var(--t);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.water-btn:active {
    transform: scale(0.95);
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--info);
}

.water-btn-icon { font-size: 28px; }

.water-btn-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--info);
}

/* ============ Sleep ============ */
.sleep-page { animation: fadeIn var(--t); }

.sleep-visual {
    text-align: center;
    padding: 30px 0;
}

.sleep-icon { font-size: 64px; margin-bottom: 10px; }

.sleep-total {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.sleep-unit {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.sleep-status {
    font-size: 15px;
    font-weight: 600;
    margin-top: 10px;
}

.sleep-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.sleep-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.sleep-card-icon { font-size: 28px; margin-bottom: 6px; }

.sleep-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sleep-card-value {
    font-size: 16px;
    font-weight: 700;
}

/* ============ Weight ============ */
.weight-page { animation: fadeIn var(--t); }

.weight-current {
    text-align: center;
    padding: 30px 0;
}

.weight-value {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: inline-block;
}

.weight-unit {
    font-size: 18px;
    color: var(--text-secondary);
    display: inline-block;
    margin-right: 6px;
}

.weight-diff {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.weight-bmi {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.05);
}

.weight-history {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.weight-history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.weight-history-item:last-child { border-bottom: none; }

.weight-history-item span:first-child { color: var(--text-muted); }

.weight-history-item span:last-child { font-weight: 600; }
/* ============ Progress Chart ============ */
.progress-chart {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
}

.progress-row:last-child {
    border-bottom: none;
}

.progress-day {
    width: 50px;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-size: 11px;
}

.progress-bar {
    flex: 1;
    color: var(--primary-light);
    font-family: monospace;
    letter-spacing: 1px;
    font-size: 13px;
    overflow: hidden;
}

.progress-kcal {
    width: 50px;
    text-align: left;
    font-weight: 600;
    flex-shrink: 0;
}

.progress-status {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.progress-stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}

.stat-line:last-child {
    border-bottom: none;
}

.stat-line span {
    color: var(--text-secondary);
}

.stat-line strong {
    color: var(--text);
    font-weight: 700;
}
/* استایل پاپ‌آپ سفارشی */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); /* پس‌زمینه تاریک */
    display: flex; justify-content: center; align-items: center; z-index: 9999;
    backdrop-filter: blur(4px); /* افکت شیشه‌ای */
}

.modal-content {
    background: #1e1e2f; padding: 25px; border-radius: 15px; 
    width: 85%; max-width: 350px; text-align: center; color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid rgba(168, 85, 247, 0.3); /* حاشیه بنفش ملایم */
}

.modal-content h3 { margin-top: 0; font-size: 1.2rem; }
.modal-content p { font-size: 0.95rem; color: #ccc; margin-bottom: 20px; }

.modal-content input {
    width: 90%; padding: 12px; margin-bottom: 20px; 
    border-radius: 10px; border: 1px solid #444; 
    background: #2a2a3e; color: white; 
    text-align: center; font-size: 1.1rem; font-family: inherit;
}
.modal-content input:focus { outline: none; border-color: #a855f7; }

.modal-buttons { display: flex; justify-content: space-around; gap: 10px; }
.modal-buttons button {
    flex: 1; padding: 12px; border: none; border-radius: 10px; 
    cursor: pointer; font-weight: bold; font-size: 1rem; font-family: inherit;
    transition: all 0.2s;
}
.btn-confirm { background: #a855f7; color: white; }
.btn-confirm:hover { background: #9333ea; }
.btn-cancel { background: #444; color: white; }
.btn-cancel:hover { background: #555; }
/* ============ History & Monthly ============ */
.history-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-day {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: var(--t);
}

.history-day:active {
    transform: scale(0.98);
    background: var(--bg-elevated);
}

.history-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-date {
    font-size: 14px;
    font-weight: 600;
}

.history-count {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(124, 58, 237, 0.15);
    padding: 3px 10px;
    border-radius: 8px;
}

.history-day-total {
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 600;
}

.month-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: var(--radius);
    border: 1px solid rgba(124, 58, 237, 0.2);
}
