/* PROGYNIST MEAL Dashboard - Modern & Modern User-Friendly Design System */

:root {
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --primary-soft: rgba(13, 110, 253, 0.1);
    --secondary: #6c757d;
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --info: #06b6d4;
    --info-soft: rgba(6, 182, 212, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    --dark: #0f172a;
    --sidebar: #1e293b;
    --light: #f4f6fb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #0d6efd 100%);
    --grad-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --grad-info: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    --grad-warning: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --grad-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --grad-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
    --shadow-hover: 0 15px 30px -5px rgba(13, 110, 253, 0.18);
    --sidebar-width: 270px;
}

/* Global Reset & Base Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background-color: var(--light);
    overflow-x: hidden;
    min-height: 100vh;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* System Logo Styling */
.system-logo {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: inline-block;
}

.system-logo:hover {
    transform: scale(0.95);
    filter: brightness(1.15) drop-shadow(0 0 12px rgba(13, 110, 253, 0.3));
}

.logo-dashboard {
    height: 110px !important;
    width: auto !important;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.25));
}

.logo-auth {
    height: 120px !important;
    width: auto !important;
    max-width: 220px;
    object-fit: contain;
    margin-bottom: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.15));
}

.logo-home {
    max-height: 130px !important;
    width: auto !important;
}

/* Dark Theme Overrides */
html.dark-theme {
    --light: #0b0f19;
    --card-bg: #151c2c;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar: #070a12;
    --border-color: #1e293b;
}

html.dark-theme body {
    background-color: var(--light);
    color: var(--text);
}

html.dark-theme .navbar {
    background: rgba(21, 28, 44, 0.9) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .card:not(.dashboard-tile):not(.dashboard-hero) {
    background-color: var(--card-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text);
}

html.dark-theme .bg-white {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
}

html.dark-theme .bg-light {
    background-color: #0f172a !important;
    color: var(--text) !important;
}

html.dark-theme .text-dark {
    color: #f8fafc !important;
}

html.dark-theme .table {
    color: #f8fafc;
}

html.dark-theme .table thead.bg-light,
html.dark-theme .table thead.table-light {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sidebar & Layout Structure */
#sidebar-wrapper {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1060;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.08);
}

#page-content-wrapper {
    flex: 1;
    width: calc(100% - var(--sidebar-width)) !important;
    margin-left: var(--sidebar-width) !important;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--light);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Link Styling */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.15rem;
    color: #ffffff !important;
    text-decoration: none;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    border-radius: 12px !important;
    transition: all 0.25s ease;
    position: relative;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.sidebar-link i {
    font-size: 1.2rem;
    width: 26px;
    color: #ffffff;
    opacity: 0.9;
    transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.sidebar-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16);
    transform: translateX(4px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.sidebar-link:hover i {
    color: #60a5fa;
    opacity: 1;
    transform: scale(1.15);
}

.sidebar-link.active {
    color: #ffffff !important;
    background: linear-gradient(90deg, #0d6efd 0%, #1e3c72 100%) !important;
    font-weight: 700;
    border-left: 5px solid #60a5fa;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sidebar-link.active i {
    color: #ffffff !important;
    opacity: 1;
}

/* Sidebar Toggling */
#wrapper.toggled #sidebar-wrapper {
    left: calc(-1 * var(--sidebar-width));
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Modern Card Styling */
.card {
    border-radius: 18px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--card-bg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.shadow-sm {
    box-shadow: var(--shadow-md) !important;
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.hover-lift:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-hover) !important;
}

/* Dashboard Tiles & Hero */
.dashboard-tile {
    border: none !important;
    border-radius: 18px !important;
    color: white !important;
    padding: 1.5rem !important;
    height: 100%;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.dashboard-hero {
    border-radius: 22px !important;
    background: var(--grad-primary);
    color: white;
    padding: 2.5rem !important;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.dashboard-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.18);
}

.dashboard-tile i {
    font-size: 2.75rem;
    opacity: 0.25;
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
}

.tile-primary { background: var(--grad-primary); }
.tile-success { background: var(--grad-success); }
.tile-info { background: var(--grad-info); }
.tile-warning { background: var(--grad-warning); }
.tile-danger { background: var(--grad-danger); }

/* Glassmorphism Classes */
.glass-ai {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* Modern Top Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 72px;
    border-bottom: 1px solid var(--border-color) !important;
    z-index: 1050;
}

.topbar-icon-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.topbar-icon-btn:hover {
    background: #eff6ff;
    color: var(--primary);
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.2);
}

#menu-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #475569;
    cursor: pointer;
}

#menu-toggle:hover {
    background: var(--primary);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(13, 110, 253, 0.25);
    border-color: var(--primary);
}

.topbar-search {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding-left: 2.75rem;
    width: 260px;
    font-size: 0.88rem;
    height: 42px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-search:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
    width: 320px;
    outline: none;
}

/* User Avatar & Profile */
.user-avatar-circle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1e3c72 0%, #0d6efd 100%);
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
    color: #ffffff;
}

/* Modern Tables */
.table {
    border-color: var(--border-color);
}

.table thead.table-light,
.table thead.bg-light {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.025);
}

/* Modern Pill Badges */
.badge {
    font-weight: 600;
    padding: 0.45em 0.85em;
    border-radius: 50rem;
    letter-spacing: 0.02em;
}

.badge.bg-primary-subtle {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
}

.badge.bg-success-subtle {
    background-color: var(--success-soft) !important;
    color: var(--success) !important;
}

.badge.bg-warning-subtle {
    background-color: var(--warning-soft) !important;
    color: #b45309 !important;
}

.badge.bg-danger-subtle {
    background-color: var(--danger-soft) !important;
    color: var(--danger) !important;
}

/* Form Inputs & Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-pill, .btn-rounded-pill {
    border-radius: 50rem !important;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #0d6efd 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #152c56 0%, #0b5ed7 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.35);
}

/* Auth Pages Styling */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)),
        url('../img/home_hero_bg.png') no-repeat center center;
    background-size: cover;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1001;
}

.auth-card {
    border-radius: 24px !important;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.4);
    background: white;
    max-width: 1050px;
    width: 100%;
    display: flex !important;
    flex-direction: row;
    min-height: 580px;
}

.login-left-green {
    background: var(--grad-primary);
    color: white;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 42%;
}

.auth-right {
    padding: 3rem 2.5rem;
    background: white;
    width: 58%;
}

/* Footer Styling */
footer.fixed-footer {
    position: relative;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    margin-top: auto;
}

/* Utilities */
.x-small { font-size: 0.78rem; }
.smaller { font-size: 0.72rem; }

/* Responsive adjustments */
@media (max-width: 991px) {
    #sidebar-wrapper {
        left: calc(-1 * var(--sidebar-width));
    }
    #page-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    #wrapper.toggled #sidebar-wrapper {
        left: 0;
    }
}