:root {
    --primary: #4CAF50;
    --primary-rgb: 76, 175, 80;
    --primary-container: #2e7d32;
    --secondary: #2196F3;
    --surface: #ffffff;
    --surface-low: #f8f9fa;
    --surface-high: #f0f2f5;
    --surface-highest: #e9ecef;
    --on-surface: #1a1c1e;
    --on-surface-variant: #44474e;
    --outline: #dbe0e5;
    --error: #ba1a1a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--surface-low);
    color: var(--on-surface);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--outline);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--on-surface);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--on-surface-variant);
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.nav-item.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.nav-divider {
    height: 1px;
    background: var(--outline);
    margin: 1rem 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--outline);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--surface-highest);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--on-surface-variant);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    background-image: radial-gradient(at 0% 0%, rgba(var(--primary-rgb), 0.05) 0%, transparent 50%);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--on-surface);
}

/* Glass Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:hover {
    background: var(--primary-container);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--surface-highest);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
.animate-in {
    animation: slideUp 0.6s cubic-bezier(0.2, 0, 0, 1) forwards;
}

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

/* Form Styling */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--on-surface-variant);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--outline);
    border-radius: 12px;
    background: var(--surface);
    color: var(--on-surface);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 600px;
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
}

/* Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--outline);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: #323232;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    animation: toastIn 0.3s ease forwards;
}

@keyframes toastIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Nutrition Specific */
.metrics-display p {
    color: var(--on-surface);
}

.status-pill {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-msg {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}
