﻿/* === VARIABLES === */
        :root {
            --bg-primary: #0a0e1a;
            --bg-secondary: #111827;
            --bg-tertiary: #1a1f35;
            --bg-card: linear-gradient(135deg, #1a1f35 0%, #151a2e 100%);
            --bg-card-hover: linear-gradient(135deg, #1f2540 0%, #1a1f35 100%);
            --primary: #00d9ff;
            --primary-glow: rgba(0, 217, 255, 0.3);
            --secondary: #7c3aed;
            --accent-gradient: linear-gradient(135deg, #00d9ff 0%, #7c3aed 100%);
            --accent-gradient-subtle: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
            --text-primary: #f0f4ff;
            --text-secondary: #9ca3af;
            --text-muted: #6b7280;
            --success: #10b981;
            --success-glow: rgba(16, 185, 129, 0.2);
            --warning: #f59e0b;
            --danger: #ef4444;
            --danger-glow: rgba(239, 68, 68, 0.2);
            --border: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(0, 217, 255, 0.3);
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
            --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
            --shadow-glow: 0 0 40px var(--primary-glow);
            --glass: rgba(26, 31, 53, 0.6);
            --glass-border: rgba(255, 255, 255, 0.1);
            --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        body.light-mode {
            --bg-primary: #f0f4ff;
            --bg-secondary: #f9fafb;
            --bg-tertiary: #f3f4f6;
            --bg-card: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
            --bg-card-hover: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border: rgba(0, 0, 0, 0.08);
            --border-hover: rgba(0, 100, 200, 0.3);
            --glass: rgba(255, 255, 255, 0.7);
            --glass-border: rgba(0, 0, 0, 0.1);
            --bg-tertiary: #e8edf5;
        }

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

        body {
            font-family: 'Outfit', -apple-system, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            overflow-x: hidden;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background:
                radial-gradient(circle at 20% 30%, rgba(0, 217, 255, 0.07) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.07) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33% { transform: translate(30px, -30px) scale(1.1); }
            66% { transform: translate(-20px, 20px) scale(0.9); }
        }

        .orb {
            position: fixed;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.35;
            pointer-events: none;
            z-index: 0;
            animation: float 20s infinite ease-in-out;
        }
        .orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(0, 217, 255, 0.4) 0%, transparent 70%); top: -100px; left: -100px; }
        .orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, transparent 70%); bottom: -150px; right: -150px; animation-delay: -10s; }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
            position: relative;
            z-index: 1;
        }

        .hidden { display: none !important; }

        /* === NAVIGATION === */
        .navbar {
            padding: 20px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0;
            position: relative;
            z-index: 10;
        }

        .logo {
            font-weight: 800;
            font-size: 1.7rem;
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -0.02em;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .logo-icon {
            width: 40px; height: 40px;
            background: var(--accent-gradient);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: var(--shadow-glow);
        }

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

        /* === TAB NAV === */
        .tab-nav {
            display: flex;
            gap: 4px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            padding: 6px;
            border-radius: 16px;
            margin: 20px 0 32px;
            position: relative;
            z-index: 5;
        }

        .tab-btn {
            flex: 1;
            padding: 12px 20px;
            border: none;
            border-radius: 12px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-base);
            background: transparent;
            color: var(--text-secondary);
        }

        .tab-btn.active {
            background: var(--accent-gradient);
            color: white;
            box-shadow: var(--shadow-md), var(--shadow-glow);
        }

        .tab-btn:not(.active):hover {
            background: var(--glass);
            color: var(--text-primary);
        }

        .tab-content { display: none; }
        .tab-content.active { display: block; animation: fadeInUp 0.4s ease-out; }

        /* === BUTTONS === */
        .btn {
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
            font-size: 0.95rem;
            border: none;
            cursor: pointer;
            transition: all var(--transition-base);
            position: relative;
            overflow: hidden;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-primary {
            background: var(--accent-gradient);
            color: white;
            padding: 14px 32px;
            border-radius: 12px;
            box-shadow: var(--shadow-md), var(--shadow-glow);
        }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg), 0 0 60px var(--primary-glow); }
        .btn-primary:active { transform: translateY(0); }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--border);
            color: var(--text-primary);
            padding: 10px 20px;
            border-radius: 10px;
        }
        .btn-outline:hover { border-color: var(--border-hover); background: var(--glass); transform: translateY(-1px); }

        .btn-icon {
            width: 44px; height: 44px;
            border-radius: 10px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            cursor: pointer;
        }
        .btn-icon:hover { background: var(--accent-gradient); border-color: transparent; box-shadow: var(--shadow-glow); }

        /* === HERO === */
        .hero-section {
            text-align: center;
            padding: 80px 0 100px;
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--accent-gradient-subtle);
            border: 1px solid var(--border);
            padding: 8px 20px;
            border-radius: 30px;
            font-size: 0.9rem;
            color: var(--primary);
            margin-bottom: 24px;
            animation: fadeInUp 0.6s ease-out;
        }

        .hero-title {
            font-size: 4rem;
            font-weight: 800;
            line-height: 1.1;
            margin-bottom: 24px;
            letter-spacing: -0.03em;
            animation: fadeInUp 0.6s ease-out 0.1s backwards;
        }

        .gradient-text {
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .hero-subtitle {
            font-size: 1.2rem;
            color: var(--text-secondary);
            max-width: 580px;
            margin: 0 auto 40px;
            line-height: 1.8;
            animation: fadeInUp 0.6s ease-out 0.2s backwards;
        }

        .hero-cta { animation: fadeInUp 0.6s ease-out 0.3s backwards; }

        /* === CARDS === */
        .card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 28px;
            position: relative;
            overflow: hidden;
            transition: all var(--transition-base);
            backdrop-filter: blur(10px);
            margin-bottom: 24px;
        }

        .card::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 2px;
            background: var(--accent-gradient);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform var(--transition-base);
        }
        .card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
        .card:hover::before { transform: scaleX(1); }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 12px;
        }

        .card-icon {
            width: 44px; height: 44px;
            background: var(--accent-gradient-subtle);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
        }

        .card-title {
            font-size: 1.35rem;
            font-weight: 700;
            letter-spacing: -0.01em;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* === FORM === */
        .form-card { max-width: 500px; margin: 0 auto; animation: fadeInUp 0.5s ease-out; }
        .form-group { margin-bottom: 22px; }

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--text-primary);
        }

        input[type=number], select {
            width: 100%;
            padding: 14px 18px;
            background: var(--bg-secondary);
            border: 2px solid var(--border);
            border-radius: 12px;
            color: var(--text-primary);
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            transition: all var(--transition-base);
        }
        input[type=number]:focus, select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--primary-glow);
            background: var(--bg-tertiary);
        }
        input::placeholder { color: var(--text-muted); }

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

        .dashboard-title {
            font-size: 2.2rem;
            font-weight: 800;
            letter-spacing: -0.02em;
        }

        .grid-layout {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 24px;
        }

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

        .full-span { grid-column: 1 / -1; }

        /* === BMI === */
        .bmi-display { text-align: center; margin-bottom: 20px; }
        .bmi-number {
            font-size: 2.6rem;
            font-weight: 800;
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1;
            margin-bottom: 6px;
        }
        .bmi-status { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
        .gauge-container {
            height: 10px;
            background: linear-gradient(90deg, #3b82f6 0%, #10b981 35%, #f59e0b 70%, #ef4444 100%);
            border-radius: 12px;
            position: relative;
            margin: 20px 0;
            box-shadow: 0 4px 16px rgba(0,0,0,0.3);
        }
        .gauge-marker {
            width: 6px; height: 22px;
            background: white;
            border: 3px solid var(--bg-secondary);
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
            position: absolute;
            top: -6px;
            border-radius: 4px;
            transition: left var(--transition-slow);
        }

        /* === MEAL LIST === */
        .meal-list { list-style: none; padding: 0; }
        .meal-list li {
            padding: 14px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            transition: all var(--transition-base);
            border-radius: 8px;
            margin-bottom: 4px;
        }
        .meal-list li:hover { background: var(--accent-gradient-subtle); border-color: transparent; }
        .meal-list li::before { content: '>'; color: var(--success); font-weight: bold; margin-right: 8px; }

        /* === WORKOUT TABLE === */
        .workout-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 16px; }
        .workout-table thead { background: var(--accent-gradient-subtle); }
        .workout-table th {
            padding: 14px 16px;
            text-align: left;
            font-weight: 700;
            border-bottom: 2px solid var(--border);
        }
        .workout-table th:first-child { border-radius: 12px 0 0 0; }
        .workout-table th:last-child { border-radius: 0 12px 0 0; }
        .workout-table td {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
            transition: all var(--transition-base);
        }
        .workout-table tbody tr:hover { background: var(--accent-gradient-subtle); }
        .workout-table tbody tr:hover td { border-color: transparent; }
        .exercise-name { font-weight: 600; display: block; margin-bottom: 3px; }
        .exercise-note { font-size: 0.83rem; color: var(--text-secondary); }

        /* === REMOVE BTN === */
        .remove-btn {
            background: var(--danger);
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.82rem;
            font-weight: 600;
            font-family: 'Outfit', sans-serif;
            transition: all var(--transition-fast);
        }
        .remove-btn:hover { background: #dc2626; box-shadow: 0 0 20px var(--danger-glow); transform: scale(1.05); }

        /* === ALERTS === */
        .alert-box, .success-box {
            padding: 14px 18px;
            border-radius: 12px;
            margin-top: 14px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 10px;
            animation: slideIn 0.3s ease-out;
        }
        .alert-box { background: rgba(251, 146, 60, 0.1); border: 1px solid rgba(251, 146, 60, 0.3); color: #fb923c; }
        .success-box { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--success); }

        /* === CHATBOT === */
        .chat-toggle-btn {
            position: fixed;
            bottom: 32px; right: 32px;
            width: 60px; height: 60px;
            background: var(--accent-gradient);
            border-radius: 50%;
            border: none;
            color: white;
            font-size: 26px;
            cursor: pointer;
            box-shadow: var(--shadow-lg), var(--shadow-glow);
            z-index: 1000;
            transition: all var(--transition-base);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .chat-toggle-btn:hover { transform: scale(1.1) rotate(5deg); box-shadow: var(--shadow-lg), 0 0 70px var(--primary-glow); }

        .chat-window {
            position: fixed;
            bottom: 110px; right: 32px;
            width: 400px; height: 550px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 20px;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            backdrop-filter: blur(20px);
            animation: slideInUp 0.3s ease-out;
        }

        .chat-header {
            background: var(--accent-gradient);
            padding: 18px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: white;
            font-weight: 700;
            font-size: 1rem;
        }

        .chat-close {
            background: rgba(255,255,255,0.2);
            width: 30px; height: 30px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border: none;
            color: white;
            font-size: 16px;
            transition: all var(--transition-fast);
        }
        .chat-close:hover { background: rgba(255,255,255,0.35); }

        .chat-messages {
            flex: 1;
            padding: 16px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .chat-messages::-webkit-scrollbar { width: 5px; }
        .chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

        .msg {
            padding: 10px 14px;
            border-radius: 14px;
            max-width: 85%;
            word-wrap: break-word;
            line-height: 1.5;
            font-size: 0.9rem;
            animation: messageIn 0.2s ease-out;
        }
        .msg.bot { background: var(--bg-tertiary); border: 1px solid var(--border); align-self: flex-start; }
        .msg.user { background: var(--accent-gradient); color: white; align-self: flex-end; }
        .msg.system { background: rgba(251,146,60,0.1); border: 1px solid rgba(251,146,60,0.3); color: #fb923c; align-self: center; font-size: 0.82rem; text-align: center; }

        .typing-indicator {
            display: flex;
            gap: 5px;
            padding: 10px 14px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 14px;
            align-self: flex-start;
        }
        .typing-indicator span {
            width: 7px; height: 7px;
            background: var(--primary);
            border-radius: 50%;
            animation: typing 1.4s infinite;
        }
        .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
        .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

        .quick-actions {
            display: flex;
            gap: 8px;
            padding: 12px 16px;
            border-top: 1px solid var(--border);
            overflow-x: auto;
        }

        .quick-btn {
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            color: var(--text-primary);
            padding: 7px 14px;
            border-radius: 20px;
            font-size: 0.82rem;
            cursor: pointer;
            white-space: nowrap;
            font-family: 'Outfit', sans-serif;
            font-weight: 500;
            transition: all var(--transition-fast);
        }
        .quick-btn:hover { background: var(--accent-gradient); border-color: transparent; color: white; }

        .chat-input-area {
            padding: 14px 16px;
            border-top: 1px solid var(--border);
            display: flex;
            gap: 10px;
        }

        .chat-input-area input {
            flex: 1;
            padding: 10px 14px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 10px;
            color: var(--text-primary);
            font-size: 0.9rem;
            font-family: 'Outfit', sans-serif;
            width: auto;
        }
        .chat-input-area input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

        .chat-send-btn {
            background: var(--accent-gradient);
            border: none;
            color: white;
            padding: 10px 18px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-family: 'Outfit', sans-serif;
            transition: all var(--transition-fast);
            font-size: 0.9rem;
        }
        .chat-send-btn:hover { box-shadow: 0 0 20px var(--primary-glow); transform: translateY(-1px); }

        /* === TRACKER STATS === */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .stat-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 20px;
            text-align: center;
            transition: all var(--transition-base);
        }
        .stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

        .stat-value {
            font-size: 2.4rem;
            font-weight: 800;
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin: 6px 0;
            line-height: 1;
        }

        .stat-label { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }

        /* === HABITS TABLE === */
        .habits-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.83rem;
            overflow-x: auto;
            display: block;
        }

        .habits-table thead { background: var(--accent-gradient-subtle); position: sticky; top: 0; z-index: 5; }
        .habits-table th {
            padding: 11px 6px;
            text-align: center;
            font-weight: 600;
            border: 1px solid var(--border);
            min-width: 33px;
        }
        .habits-table th:first-child {
            text-align: left;
            min-width: 130px;
            position: sticky;
            left: 0;
            background: var(--bg-tertiary);
            z-index: 6;
        }

        .habits-table td {
            padding: 9px 6px;
            text-align: center;
            border: 1px solid var(--border);
            transition: background 0.15s;
        }
        .habits-table td:first-child {
            text-align: left;
            font-weight: 600;
            position: sticky;
            left: 0;
            background: var(--bg-tertiary);
            z-index: 4;
            padding-left: 12px;
        }
        .habits-table tbody tr:hover { background: var(--accent-gradient-subtle); }

        .habit-checkbox {
            width: 18px; height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .total-row { background: var(--accent-gradient-subtle); font-weight: 700; color: var(--primary); }
        .total-row td { font-size: 0.95rem; }

        /* === SLEEP CHART === */
        .sleep-chart {
            position: relative;
            height: 200px;
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 20px;
            margin-top: 16px;
        }

        .sleep-grid {
            position: absolute;
            top: 0; left: 50px; right: 20px; height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 20px 0;
        }

        .sleep-grid-line { border-top: 1px dashed var(--border); position: relative; }
        .sleep-grid-label { position: absolute; left: -45px; top: -8px; font-size: 0.72rem; color: var(--text-muted); }

        .sleep-plot { position: absolute; top: 20px; left: 50px; right: 20px; bottom: 20px; }

        .sleep-point {
            position: absolute;
            width: 8px; height: 8px;
            background: var(--primary);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--primary-glow);
            cursor: pointer;
            transition: all 0.2s;
            transform: translate(-4px, -4px);
        }
        .sleep-point:hover { width: 12px; height: 12px; transform: translate(-6px, -6px); }

        .sleep-line {
            position: absolute;
            height: 2px;
            background: var(--primary);
            opacity: 0.6;
            transform-origin: left center;
        }

        /* === MOOD === */
        .mood-selector {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }

        .mood-option {
            padding: 8px 14px;
            background: var(--bg-secondary);
            border: 2px solid var(--border);
            border-radius: 20px;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .mood-option:hover { border-color: var(--primary); background: var(--accent-gradient-subtle); }
        .mood-option.active { border-color: var(--primary); background: var(--accent-gradient-subtle); box-shadow: 0 0 12px var(--primary-glow); }

        .mood-tracker {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
            gap: 6px;
            margin-top: 10px;
        }

        .mood-day {
            aspect-ratio: 1;
            background: var(--bg-secondary);
            border: 2px solid var(--border);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            cursor: default;
            transition: all 0.2s;
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.78rem;
        }
        .mood-day.has-mood { font-size: 1.3rem; border-color: var(--primary); background: var(--accent-gradient-subtle); }
        .mood-day.today { box-shadow: 0 0 15px var(--primary-glow); border-color: var(--primary); }
        .mood-day.future { opacity: 0.3; }

        /* === SECTION HEADER (Tracker) === */
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
        }

        /* === ANIMATIONS === */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes slideInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes messageIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes typing {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
            30% { transform: translateY(-8px); opacity: 1; }
        }

        /* === SCROLLBAR === */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: var(--bg-secondary); }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--primary); }

        /* === RESPONSIVE === */
     /* === RESPONSIVE IMPROVEMENTS === */
@media (max-width: 768px) {
    /* 1. Typography & Container */
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    .dashboard-title { font-size: 1.6rem; text-align: center; }
    .container { padding: 0 16px; }

    /* 2. Fix Tab Buttons: Equal width and readable */
    .tab-nav {
        display: flex;
        width: 100%;
        gap: 8px;
        padding: 5px;
        background: var(--bg-tertiary);
    }
    .tab-btn {
        flex: 1; /* Makes both buttons exactly the same size */
        padding: 14px 5px;
        font-size: 0.85rem;
        white-space: nowrap; /* Prevents text from wrapping to 2 lines */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* 3. Fix Workout Table: Prevent squishing */
    .card {
        padding: 20px 15px;
        overflow-x: hidden; /* Keep the card itself contained */
    }

    /* Wrap your table in a div with this class if it overflows, 
       or use this direct table fix: */
    .tab-content {
        overflow-x: auto; /* Allows swiping left/right on the whole section if needed */
    }

    .workout-table {
        display: block; /* Allows horizontal scrolling */
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
        min-width: 550px; /* Forces enough width so columns don't crush text */
    }

    /* 4. Action Buttons (Generate/Reset) */
    .btn-primary, .btn-outline {
        width: 100%; /* Full width buttons are better for mobile thumbs */
        margin-bottom: 10px;
        padding: 16px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    /* 5. Grid Layouts */
    .grid-layout, .stats-grid {
        grid-template-columns: 1fr !important; /* Force everything to stack */
        gap: 16px;
    }

    /* 6. Fix Chatbot Proportions */
    .chat-window {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 90px;
        height: 60vh;
    }

    /* Ensure the user can scroll to the bottom past the floating button */
    body {
        padding-bottom: 100px;
    }
}
        /* Sleep select styling */
        .sleep-select {
            background: var(--bg-secondary);
            color: var(--text-primary);
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
        }
        .table-wrapper {
            width: 100%;
            overflow-x: auto;
        }

        .workout-table {
            min-width: 600px; /* important for mobile */
        }
