/* =========================================
   Modern Health & Fitness Tracker v3.0
   Clean, Mobile-First Design
   ========================================= */

/* Import Modern Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

/* CSS Variables - Light Theme */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.2);
    
    /* Accent Colors */
    --accent-green: #10b981;
    --accent-green-light: #34d399;
    --accent-blue: #0ea5e9;
    --accent-orange: #f97316;
    --accent-pink: #ec4899;
    --accent-purple: #a855f7;
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    
    /* Surfaces */
    --bg-base: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-input: #f1f5f9;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Borders */
    --border: rgba(148, 163, 184, 0.2);
    --border-strong: rgba(148, 163, 184, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-blue: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(99, 102, 241, 0.08) 0px, transparent 50%), 
                     radial-gradient(at 80% 0%, rgba(236, 72, 153, 0.06) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    
    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --nav-height: 70px;
    --bottom-nav-height: 72px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --primary-glow: rgba(129, 140, 248, 0.25);
    
    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(30, 41, 59, 0.6);
    --bg-input: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border: rgba(71, 85, 105, 0.3);
    --border-strong: rgba(71, 85, 105, 0.5);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.2);
    
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(129, 140, 248, 0.1) 0px, transparent 50%), 
                     radial-gradient(at 80% 0%, rgba(236, 72, 153, 0.08) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    transition: background var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =========================================
   Header / Top Navigation
   ========================================= */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.top-bar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.top-bar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform var(--transition-fast);
    text-decoration: none;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* =========================================
   Date Picker Section
   ========================================= */
.date-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.date-nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.date-display {
    text-align: center;
    flex: 1;
}

.date-display .day-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.date-display .date-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.date-picker-wrap {
    position: relative;
}

.date-picker-wrap input[type="date"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.today-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.today-badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* =========================================
   Bottom Navigation (Mobile)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 2px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bottom-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 44px;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-glow);
}

.nav-item .nav-icon {
    font-size: 20px;
    transition: transform var(--transition-bounce);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item .nav-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Desktop Tab Navigation */
.tabs {
    display: none;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 14px 22px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.tab-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.tab-btn:active {
    transform: scale(0.97);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeSlideIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* =========================================
   Cards Grid
   ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.metric-card:active {
    transform: scale(0.98);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent, var(--gradient-primary));
}

.metric-card.calories { --card-accent: var(--accent-orange); }
.metric-card.calories::before { background: var(--gradient-warning); }
.metric-card.water { --card-accent: var(--accent-blue); }
.metric-card.water::before { background: var(--gradient-blue); }
.metric-card.protein { --card-accent: var(--accent-green); }
.metric-card.protein::before { background: var(--gradient-success); }
.metric-card.exercise { --card-accent: var(--accent-red); }
.metric-card.exercise::before { background: var(--gradient-danger); }
.metric-card.supplement { --card-accent: var(--accent-purple); }
.metric-card.supplement::before { background: linear-gradient(135deg, #a855f7 0%, #d946ef 100%); }
.metric-card.weight { --card-accent: var(--accent-pink); }
.metric-card.weight::before { background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%); }

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.metric-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-input);
}

.metric-card.calories .metric-icon { background: rgba(249, 115, 22, 0.1); }
.metric-card.water .metric-icon { background: rgba(14, 165, 233, 0.1); }
.metric-card.protein .metric-icon { background: rgba(16, 185, 129, 0.1); }
.metric-card.exercise .metric-icon { background: rgba(239, 68, 68, 0.1); }
.metric-card.supplement .metric-icon { background: rgba(168, 85, 247, 0.1); }
.metric-card.weight .metric-icon { background: rgba(236, 72, 153, 0.1); }

.metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.metric-value .unit {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-target {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-remaining {
    font-size: 0.75rem;
    font-weight: 600;
}

.metric-remaining.ok { color: var(--accent-green); }
.metric-remaining.over { color: var(--accent-red); }

/* Progress Ring */
.progress-ring-wrap {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-strong);
    stroke-width: 4;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--card-accent, var(--primary));
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset var(--transition-slow);
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Progress Bar (Linear) */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width var(--transition-slow);
}

.progress-fill.over {
    background: var(--gradient-danger);
}

.progress-fill.success {
    background: var(--gradient-success);
}

.metric-card.calories .progress-fill { background: var(--gradient-warning); }
.metric-card.water .progress-fill { background: var(--gradient-blue); }
.metric-card.protein .progress-fill { background: var(--gradient-success); }
.metric-card.exercise .progress-fill { background: var(--gradient-danger); }
.metric-card.supplement .progress-fill { background: linear-gradient(135deg, #a855f7 0%, #d946ef 100%); }

/* =========================================
   Stats Row
   ========================================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-pill {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 12px 8px;
    text-align: center;
}

.stat-pill .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-pill .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* =========================================
   Form Cards
   ========================================= */
.form-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.form-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-card h3 .form-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Form Elements */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    min-height: 50px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Quick Add Buttons */
.quick-add-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.quick-btn {
    padding: 12px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 80px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.quick-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.quick-btn:active {
    transform: scale(0.97);
}

.quick-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    -webkit-tap-highlight-color: transparent;
    min-height: 56px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-submit:active {
    transform: translateY(0) scale(0.98);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* =========================================
   Entry Lists
   ========================================= */
.list-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.list-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.list-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
}

.list-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-count {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-weight: 600;
}

.list-body {
    max-height: 350px;
    overflow-y: auto;
}

.entry-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background var(--transition-fast);
}

.entry-item:last-child {
    border-bottom: none;
}

.entry-item:hover {
    background: var(--bg-input);
}

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.entry-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.entry-delete {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.entry-delete:hover {
    background: var(--accent-red);
    color: white;
    transform: scale(1.1);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* =========================================
   Tables (for detailed views)
   ========================================= */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

thead {
    background: var(--bg-input);
}

th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tbody tr:hover {
    background: var(--bg-input);
}

/* =========================================
   Badges
   ========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-warning { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-info { background: rgba(14, 165, 233, 0.15); color: var(--accent-blue); }
.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

/* =========================================
   Supplement Checklist
   ========================================= */
.supplement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.supplement-item {
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    position: relative;
}

.supplement-item:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.supplement-item.taken {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-green);
}

.supplement-item .supp-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.supplement-item .supp-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.supplement-item .supp-dose {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.supplement-item .supp-check {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 14px;
    color: var(--accent-green);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.supplement-item.taken .supp-check {
    opacity: 1;
}

/* =========================================
   Charts & Analytics
   ========================================= */
.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-container {
    height: 220px;
    position: relative;
}

/* =========================================
   Alerts & Messages
   ========================================= */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--accent-orange);
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--accent-blue);
}

/* =========================================
   Search
   ========================================= */
.search-wrap {
    position: relative;
    margin-bottom: 16px;
    z-index: 10;
}

.search-input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--primary-glow);
}

/* =========================================
   Footer
   ========================================= */
footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

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

/* =========================================
   Login Page
   ========================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: 20px;
}

.login-page body,
body.login-body {
    padding-bottom: 20px;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 40px 28px;
    box-shadow: var(--shadow-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* =========================================
   Utilities
   ========================================= */
.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-warning { color: var(--accent-orange) !important; }
.text-info { color: var(--accent-blue) !important; }
.text-muted { color: var(--text-muted) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }

.text-center { text-align: center !important; }

.hidden { display: none !important; }

/* =========================================
   Loading & Animations
   ========================================= */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =========================================
   Responsive Design
   ========================================= */

/* Tablet and up */
@media (min-width: 768px) {
    body {
        padding-bottom: 20px;
    }
    
    .container {
        padding: 0 24px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .tabs {
        display: flex;
    }
    
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
    
    .stats-row {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .form-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .list-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container {
        height: 280px;
    }
    
    .supplement-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .form-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .list-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Extra large screens */
@media (min-width: 1280px) {
    .container {
        padding: 0 32px;
    }
    
    .cards-grid {
        gap: 20px;
    }
    
    .cards-grid.six-cols {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Small mobile */
@media (max-width: 374px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .nav-item {
        min-width: 40px;
        padding: 6px 2px;
    }
    
    .nav-item .nav-icon {
        font-size: 18px;
    }
    
    .nav-item .nav-label {
        font-size: 0.5rem;
    }
}

/* Very small screens - hide labels */
@media (max-width: 380px) {
    .nav-item .nav-label {
        display: none;
    }
    
    .nav-item {
        min-width: 36px;
        padding: 8px 4px;
    }
    
    .nav-item .nav-icon {
        font-size: 20px;
    }
}

/* AI Calculator Button */
.btn-ai {
    width: 100%;
    padding: 20px 28px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.btn-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-ai:hover::before {
    left: 100%;
}

.btn-ai:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.6), 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.btn-ai:active {
    transform: translateY(-2px) scale(0.98);
}

/* GPS Activity Tracker */
.tracker-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
    padding: 0 10px;
}

.tracker-btn {
    flex: 1;
    max-width: 180px;
    min-width: 140px;
    padding: 45px 25px;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}

.tracker-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tracker-btn:hover::before {
    opacity: 1;
}

.tracker-btn.walk {
    background: linear-gradient(145deg, #10b981 0%, #059669 50%, #047857 100%);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.tracker-btn.run {
    background: linear-gradient(145deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.tracker-btn:hover {
    transform: translateY(-8px) scale(1.03);
}

.tracker-btn.walk:hover {
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

.tracker-btn.run:hover {
    box-shadow: 0 20px 50px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

.tracker-btn:active {
    transform: translateY(-4px) scale(0.98);
}

.tracker-btn-icon {
    font-size: 5rem;
    line-height: 1;
}

.tracker-btn-label {
    font-size: 1.5rem;
    font-weight: 700;
}

.tracker-btn-cal {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 5px;
}

.tracker-type {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Timer Display */
.tracker-timer-display {
    text-align: center;
    margin: 25px 0;
    padding: 25px;
    background: linear-gradient(135deg, var(--primary-glow), transparent);
    border-radius: 20px;
    border: 2px solid var(--primary);
}

.tracker-time-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: 2px;
}

.tracker-time-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Stats Grid */
.tracker-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.tracker-stat-box {
    background: var(--bg-input);
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    border: 1px solid var(--border);
}

.tracker-stat-box.calories {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.1));
    border-color: rgba(239, 68, 68, 0.3);
}

.tracker-stat-box.minutes {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(99, 102, 241, 0.3);
}

.tracker-stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.tracker-stat-box .tracker-stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.tracker-stat-box .tracker-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Old stats styles (kept for compatibility) */
.tracker-stats {
    text-align: center;
    margin: 20px 0;
}

.tracker-stat.main .tracker-stat-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.tracker-stat.main .tracker-stat-label {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.tracker-stats-row {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    padding: 15px;
    background: var(--bg-input);
    border-radius: 15px;
}

.tracker-stat {
    text-align: center;
}

.tracker-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tracker-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.tracker-status {
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: #10b981;
}

.status-dot.warning {
    background: #f59e0b;
}

.status-dot.error {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stop Button */
.tracker-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.tracker-stop-btn {
    width: 100%;
    max-width: 280px;
    padding: 18px 30px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.2s ease;
    color: white;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.tracker-stop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
}

.tracker-stop-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.tracker-stop-btn .stop-icon {
    font-size: 1.5rem;
}

.tracker-control-btn {
    flex: 1;
    max-width: 140px;
    padding: 15px 20px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    color: white;
}

.tracker-control-btn.pause {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.tracker-control-btn.stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tracker-control-btn:hover {
    transform: translateY(-2px);
}

.tracker-summary {
    text-align: center;
    padding: 20px;
}

.tracker-summary h4 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.tracker-summary-stats {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-input);
    border-radius: 15px;
}

.summary-stat {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.tracker-summary-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.tracker-summary-actions button {
    flex: 1;
    max-width: 160px;
}

/* Background Activity Tracker */
.background-tracker-controls {
    padding: 10px 0;
}

.tracker-toggle-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-input);
    transition: 0.3s;
    border-radius: 32px;
    border: 2px solid var(--border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.toggle-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.bg-tracking-status {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.bg-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}

.bg-tracking-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.bg-stat {
    display: flex;
    flex-direction: column;
}

.bg-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.bg-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.bg-tracking-info {
    margin-top: 10px;
}

.bg-tracking-info ul {
    padding-left: 20px;
}

.bg-tracking-info li {
    margin-bottom: 3px;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-ai:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ai #ai-btn-icon {
    font-size: 2.2rem;
}

.ai-status {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.ai-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.ai-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Time display in entries */
.entry-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Supplement time display */
.supp-time {
    font-size: 0.7rem;
    color: var(--primary);
    margin-top: 2px;
    font-weight: 500;
}

.supplement-item.taken .supp-time {
    color: var(--accent-green);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.modal-content .text-muted {
    margin-bottom: 20px;
}

.modal-content input[type="time"] {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

/* User Management Styles */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border);
    gap: 15px;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
}

.user-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-edit, .btn-delete {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-edit {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-edit:hover {
    background: var(--primary);
    color: white;
}

.btn-delete {
    background: var(--bg-card);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.btn-delete:hover {
    background: var(--accent-red);
    color: white;
}

.badge-admin {
    background: var(--gradient-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-you {
    background: var(--accent-green);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Goal Preset Buttons */
.btn-preset {
    flex: 1;
    min-width: 100px;
    padding: 15px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-preset:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-preset small {
    display: block;
    opacity: 0.7;
    margin-top: 4px;
}

.btn-preset:hover small {
    opacity: 1;
}

@media (max-width: 500px) {
    .user-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* =========================================
   Mobile Button Enhancements
   ========================================= */

/* Large mobile screens (phones in landscape, small tablets) */
@media (max-width: 768px) {
    .btn-ai {
        padding: 18px 24px;
        font-size: 1.4rem;
        min-height: 75px;
        border-radius: 18px;
    }
    
    .btn-ai #ai-btn-icon {
        font-size: 2rem;
    }
    
    .tracker-buttons {
        gap: 16px;
        padding: 0 5px;
    }
    
    .tracker-btn {
        min-height: 155px;
        padding: 40px 20px;
        border-radius: 26px;
    }
    
    .tracker-btn-icon {
        font-size: 4.5rem;
    }
    
    .tracker-btn-label {
        font-size: 1.4rem;
    }
}

/* Standard mobile screens */
@media (max-width: 480px) {
    .btn-ai {
        padding: 16px 20px;
        font-size: 1.3rem;
        min-height: 70px;
        border-radius: 16px;
    }
    
    .btn-ai #ai-btn-icon {
        font-size: 1.8rem;
    }
    
    .tracker-buttons {
        gap: 14px;
        margin: 25px 0;
    }
    
    .tracker-btn {
        min-height: 150px;
        max-width: 48%;
        padding: 35px 15px;
        border-radius: 24px;
    }
    
    .tracker-btn-icon {
        font-size: 4rem;
    }
    
    .tracker-btn-label {
        font-size: 1.3rem;
    }
}

/* Small mobile screens */
@media (max-width: 380px) {
    .btn-ai {
        padding: 14px 18px;
        font-size: 1.2rem;
        min-height: 65px;
        gap: 10px;
    }
    
    .btn-ai #ai-btn-icon {
        font-size: 1.6rem;
    }
    
    .tracker-buttons {
        gap: 12px;
    }
    
    .tracker-btn {
        min-height: 140px;
        padding: 30px 12px;
        border-radius: 22px;
    }
    
    .tracker-btn-icon {
        font-size: 3.5rem;
    }
    
    .tracker-btn-label {
        font-size: 1.2rem;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .btn-ai {
        padding: 12px 16px;
        font-size: 1.1rem;
        min-height: 60px;
    }
    
    .btn-ai #ai-btn-icon {
        font-size: 1.5rem;
    }
    
    .tracker-btn {
        min-height: 130px;
        padding: 25px 10px;
    }
    
    .tracker-btn-icon {
        font-size: 3rem;
    }
    
    .tracker-btn-label {
        font-size: 1.1rem;
    }
}

/* Touch-friendly improvements for all mobile */
@media (hover: none) and (pointer: coarse) {
    .btn-ai,
    .tracker-btn,
    .btn-submit,
    .water-btn,
    .tab-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .btn-ai:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
    
    .tracker-btn:active {
        transform: scale(0.96);
        transition: transform 0.1s ease;
    }
}

/* Print styles */
@media print {
    .top-bar,
    .bottom-nav,
    .tabs,
    .btn-submit,
    .entry-delete {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        padding-bottom: 0;
    }
    
    .metric-card,
    .form-card,
    .list-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Tag checkbox styles for GKI tracking */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tag-checkbox input[type="checkbox"] {
    display: none;
}

.tag-checkbox .tag-label {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tag-checkbox input[type="checkbox"]:checked + .tag-label {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.tag-checkbox:hover .tag-label {
    border-color: var(--primary);
}

/* GKI Preview styles */
.gki-preview {
    animation: fadeIn 0.3s ease;
}

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

/* GKI Guide styles */
.gki-guide {
    display: grid;
    gap: 10px;
}

.gki-guide > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
}

