/**
 * ══════════════════════════════════════════════════
 *  NUTRÊ , Layout
 *  Sidebar, topbar, grids, dashboard structure,
 *  tables, responsive breakpoints.
 * ══════════════════════════════════════════════════
 */

/* ── Auth Pages (Login/Register) ─────────── */
.page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

.panel-left {
    background: var(--green-900); display: flex; flex-direction: column;
    justify-content: space-between; padding: 4rem 3rem; position: relative;
    overflow: hidden; animation: fadeSlideLeft 0.8s ease both;
}
.panel-left::before {
    content: ''; position: absolute; inset: 0;
    background-image: url('../assets/nutrielo-login.webp'); background-size: cover;
    background-position: center; opacity: 0.1; z-index: 0;
}
.panel-left > * { position: relative; z-index: 2; }
.panel-left::after {
    content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.04); bottom: 40px; left: -100px;
}
.login-brand-panel {
    padding: 0;
    background: #FAF8F5;
    align-items: center;
    justify-content: center;
}
.login-brand-panel::before,
.login-brand-panel::after { display: none; }
.login-brand-art {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    object-fit: contain;
    object-position: center;
}
.login-brand-video {
    width: min(100%, 1080px);
    height: auto;
    min-height: 0;
    max-height: min(100vh, 1080px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #FAF8F5 url('../assets/nutrielo-login.webp') center / cover no-repeat;
    pointer-events: none;
}
.login-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: block;
    overflow: hidden;
    background: #0c3027;
    animation: loginLoadingFadeIn 180ms ease-out both;
}
.login-loading-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(4, 30, 24, 0.04) 35%, rgba(4, 30, 24, 0.82) 100%);
}
.login-loading-overlay[hidden] {
    display: none;
}
.login-loading-overlay video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}
.login-loading-status {
    position: absolute;
    left: 50%;
    bottom: clamp(28px, 7vh, 76px);
    z-index: 2;
    width: min(560px, calc(100vw - 32px));
    padding: 20px 24px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(7, 43, 34, 0.74);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
    color: #fff;
    text-align: center;
}
.login-loading-kicker {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.login-loading-greeting {
    min-height: 34px;
    margin: 0;
    font-family: 'DM Serif Display', serif;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 400;
    line-height: 1.08;
}
.login-loading-greeting.is-pending {
    visibility: hidden;
}
.login-loading-message {
    margin: 6px 0 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
}
.login-loading-progress {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}
.login-loading-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #a8d391 0%, #e8f7df 55%, #fff 100%);
    box-shadow: 0 0 18px rgba(210, 246, 193, 0.65);
    transition: width 120ms linear;
}
@keyframes loginLoadingFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 640px) {
    /* No celular o painel visual de desktop virava uma faixa vazia e escondia
       a ação principal abaixo da dobra. A identidade continua no título e o
       acesso começa imediatamente pelo formulário. */
    .login-page .login-brand-panel { display: none; }

    .login-page .page {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        overflow-x: hidden;
    }
    .login-page .panel-right {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 32px 16px;
        overflow-x: hidden;
    }
    .login-page .form-card,
    .login-page form,
    .login-page .form-group,
    .login-page .google-signin-wrap {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .login-page .form-card {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }
    .login-page .google-signin-button,
    .login-page .google-signin-button > div,
    .login-page .google-signin-button iframe {
        width: 100% !important;
        max-width: 100% !important;
    }
    .login-page .google-signin-button { overflow: hidden; }
    .login-loading-status {
        bottom: 20px;
        padding: 17px 18px;
        border-radius: 16px;
    }
    .login-loading-message { margin-bottom: 12px; }
}
.left-circle-accent {
    position: absolute; width: 200px; height: 200px; border-radius: 50%;
    background: rgba(82,183,136,0.08); bottom: -50px; right: 40px; pointer-events: none;
}

/* Logo */
.logo { display: flex; align-items: center; text-decoration: none; transition: var(--transition); }
.logo img { height: 48px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.sidebar .logo img { height: auto; border-radius: 14px; }
.panel-left .logo img { height: 110px; }
.sidebar .logo { justify-content: center; width: 100%; }
.logo:hover { transform: translateY(-2px); opacity: 0.9; }

/* Left Panel Content */
.left-tagline { margin-top: 0.75rem; font-size: 14px; color: rgba(238,247,242,0.5); letter-spacing: 0.05em; font-weight: 300; }
.left-headline { font-family: 'DM Serif Display', serif; font-size: clamp(32px, 4vw, 48px); color: var(--green-100); line-height: 1.1; margin-bottom: 2rem; }
.left-headline em { font-style: italic; color: var(--coral); }

.feature-list { display: flex; flex-direction: column; gap: 1.25rem; }
.feature-item { display: flex; align-items: flex-start; gap: 14px; animation: fadeSlideLeft 0.7s ease both; }
.feature-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); margin-top: 8px; flex-shrink: 0; }
.feature-text { font-size: 15px; color: rgba(238,247,242,0.7); line-height: 1.5; font-weight: 300; }
.feature-text strong { color: #fff; font-weight: 500; }

.plan-highlights { display: flex; flex-direction: column; gap: 1.25rem; }
.plan-hl { display: flex; align-items: flex-start; gap: 14px; padding: 1.25rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 16px; backdrop-filter: blur(8px); transition: var(--transition); }
.plan-hl:hover { background: rgba(255,255,255,0.06); transform: translateX(10px); }
.plan-hl-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.plan-hl-name { font-size: 14px; font-weight: 500; color: #fff; margin-bottom: 4px; }
.plan-hl-desc { font-size: 13px; color: rgba(238,247,242,0.4); font-weight: 300; line-height: 1.4; }
.left-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(238,247,242,0.5); text-decoration: none; transition: var(--transition); }
.left-back:hover { color: #fff; transform: translateX(-4px); }

.testimonial { border-left: 2px solid var(--green-500); padding-left: 1.5rem; }
.testimonial-text { font-size: 16px; color: rgba(238,247,242,0.8); font-style: italic; line-height: 1.6; font-family: 'DM Serif Display', serif; }
.testimonial-author { margin-top: 0.75rem; font-size: 13px; color: rgba(238,247,242,0.4); font-weight: 300; }

/* Right Panel */
.panel-right { background: #fff; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; overflow-y: auto; }
.register-page .panel-right { align-items: flex-start; }
.form-card { width: 100%; max-width: 420px; animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.login-page .form-header { margin-bottom: 28px; }
.login-page .divider-row { margin: 24px 0; }
.login-page .divider-text { letter-spacing: 0; }
.login-page :is(input, select, textarea, .field-wrap input, .field-wrap select, .field-wrap textarea, .btn-submit) {
    box-sizing: border-box;
    max-width: 100%;
}
.login-page .field { margin-bottom: 14px !important; }
.login-page .field label { margin-bottom: 6px; }
.login-page .field-wrap input { min-height: 46px; }
.login-page .btn-submit {
    width: 100%;
    height: 52px !important;
    min-height: 52px;
}
.login-page form > div[style*="text-align: right"] {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 24px !important;
}
.login-page .forgot-link {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    text-align: right;
    white-space: nowrap;
}
.form-header { margin-bottom: 2.5rem; }
.form-title { font-family: 'DM Serif Display', serif; font-size: 32px; color: var(--green-900); margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.form-subtitle { font-size: 15px; color: var(--text-muted); font-weight: 300; }

/* Steps Indicator */
.steps { display: flex; align-items: center; margin-bottom: 3rem; position: relative; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; z-index: 2; }
.step-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 2px solid var(--border); color: var(--text-light); background: #fff; transition: var(--transition); }
.step-circle.active { background: var(--green-900); border-color: var(--green-900); color: #fff; box-shadow: 0 4px 12px rgba(28,61,46,0.2); }
.step-circle.done { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.step-label { font-size: 11px; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.step-item.active .step-label { color: var(--green-900); }
.step-item.done .step-label { color: var(--green-500); }
.step-line { position: absolute; top: 16px; height: 2px; background: var(--border); width: 100%; z-index: 1; }
.step-line-progress { position: absolute; top: 0; left: 0; height: 100%; background: var(--green-500); width: 0%; transition: var(--transition); }
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.5s ease both; }

/* Plans */
.plans-grid { display: grid; gap: 12px; margin-bottom: 2rem; }
.plan-card { border: 2px solid var(--border); border-radius: 16px; padding: 1.25rem; cursor: pointer; transition: var(--transition); position: relative; background: #fff; }
.plan-card:hover { border-color: var(--green-500); }
.plan-card.selected { border-color: var(--green-900); background: var(--green-100); }
.plan-card.popular { border-color: var(--coral-hover); }
.plan-badge { position: absolute; top: -12px; right: 16px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: 20px; text-transform: uppercase; }
.plan-price-value { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--green-900); }

/* ── Dashboard Layout ────────────────────── */
.dashboard-page {
    background-color: var(--bg-main);
    background-image: radial-gradient(at 0% 0%, rgba(82,183,136,0.05) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(232,97,74,0.03) 0px, transparent 50%);
    min-height: 100vh;
}
.dashboard-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
    width: 220px; background: var(--sidebar-bg); color: #fff;
    display: flex; flex-direction: column; padding: 2.5rem 0.6rem 2.5rem 1rem;
    position: fixed; height: 100vh; left: 0; top: 0; z-index: 1000;
    box-shadow: 10px 0 30px rgba(0,0,0,0.05);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #52b788 rgba(0, 0, 0, 0.35);
}
.sidebar.collapsed { width: 90px; padding: 2.5rem 0.8rem; overflow: hidden; }

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #52b788;
    border-radius: 999px;
    min-height: 40px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #74c69d;
}

@supports not selector(::-webkit-scrollbar) {
    .sidebar {
        scrollbar-width: thin;
        scrollbar-color: #52b788 rgba(0, 0, 0, 0.35);
    }
}

.sidebar-header {
    margin-bottom: 3.5rem; padding: 0; display: flex; justify-content: center;
    align-items: center; height: 90px; flex-shrink: 0;
}
.sidebar-header .logo img { width: 100%; height: auto; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: block; }
.sidebar:not(.collapsed) .sidebar-header .logo img { max-width: 130px; }
.sidebar.collapsed .sidebar-header .logo img { max-width: 45px; }

.sidebar-toggle {
    position: fixed; top: 22px; left: 178px; width: 32px; height: 32px;
    background: #fff; border: 1.5px solid var(--border); border-radius: 50%;
    color: var(--green-900); display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 1002;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.sidebar-toggle:hover { background: var(--green-500); color: #fff; border-color: var(--green-500); box-shadow: 0 4px 16px rgba(82,183,136,0.3); }
.sidebar-toggle.is-collapsed { left: 74px; }
.sidebar-toggle.is-collapsed svg { transform: rotate(180deg); }

.sidebar-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 14px; padding: 12px 20px;
    color: rgba(255,255,255,0.6); text-decoration: none; border-radius: 14px;
    font-weight: 500; font-size: 12.6px; transition: var(--transition);
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: var(--green-500); box-shadow: 0 4px 15px rgba(82,183,136,0.3); }
.nav-item span { transition: opacity 0.3s ease; white-space: nowrap; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; gap: 0; }
.sidebar.collapsed .nav-item span { display: none; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 3.5rem; margin-top: auto; }

/* Sidebar Credits */
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; margin-top: auto; }
.footer-credit { text-align: center; font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.4); line-height: 1.4; transition: var(--transition); }
.footer-credit .short-credit { display: none; color: var(--green-500); font-weight: 700; font-size: 16px; }
.sidebar.collapsed .full-credit { display: none !important; }
.sidebar.collapsed .short-credit { display: block !important; }

/* ── Main Content ────────────────────────── */
.main-content {
    flex: 1; margin-left: 220px; padding: 0; min-height: 100vh;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed ~ .main-content { margin-left: 90px; }

/* ── Topbar ──────────────────────────────── */
.topbar {
    height: 90px; background: var(--bg-surface); opacity: 0.98; backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: space-between; padding: 0 3rem;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 900;
}
.topbar-info { display: flex; align-items: center; gap: 10px; }
.topbar-user-menu { position:relative; }
.topbar-user-pill {
    display: flex; align-items: center; gap: 12px; padding: 4px 18px 4px 4px; border-radius: 14px;
    background: var(--green-100); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer; max-width: 300px; overflow: hidden; border: 1px solid rgba(28,61,46,0.1);
    box-shadow: var(--shadow-sm);
}
.topbar-user-pill:focus-visible { outline:2px solid var(--green-500); outline-offset:3px; }
.topbar-user-pill:hover {
    background: var(--green-200); box-shadow: 0 4px 16px rgba(82,183,136,0.15);
}
.topbar-user-details {
    display: flex; flex-direction: column; justify-content: center;
    white-space: nowrap; opacity: 1; transform: translateX(0); transition: all 0.3s ease;
}
.topbar-user-name { font-size: 14px; font-weight: 700; color: var(--green-900); line-height: 1.2; }
.topbar-user-role { font-size: 11.5px; font-weight: 500; color: var(--text-muted); line-height: 1.2; }
.topbar-user-pill:hover .topbar-user-details { opacity: 1; transform: translateX(0); }
.topbar-user-dropdown { position:absolute; top:calc(100% + 8px); right:0; z-index:1100; min-width:180px; padding:6px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:0 12px 30px rgba(17,54,41,.16); }
.topbar-user-dropdown a,.topbar-user-dropdown button { display:flex; width:100%; box-sizing:border-box; align-items:center; min-height:38px; padding:8px 10px; border:0; border-radius:8px; background:transparent; color:var(--text-main); font:inherit; font-size:13px; text-align:left; text-decoration:none; cursor:pointer; }
.topbar-user-dropdown a:hover,.topbar-user-dropdown button:hover,.topbar-user-dropdown a:focus-visible,.topbar-user-dropdown button:focus-visible { background:var(--green-100); outline:none; }
.topbar-user-dropdown button { color:#b64032; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.logout-link {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 14px;
    /* Sempre com a mesma cor (antes só aparecia no hover). */
    background: #FEF2F2 !important; color: var(--coral) !important;
    border: 1.5px solid rgba(232,97,74,0.1) !important;
    text-decoration: none; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.logout-link:hover, .logout-link:focus-visible { transform: scale(1.05); box-shadow: 0 4px 12px rgba(20,94,73,0.08); }
.logout-link:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* ── Dashboard Body ──────────────────────── */
.dashboard-body { padding: 3rem; max-width: 1400px; margin: 0 auto; }
.welcome-section { margin-bottom: 3.5rem; }
.welcome-title { font-family: 'DM Serif Display', serif; font-size: 40px; color: var(--green-900); margin-bottom: 8px; letter-spacing: -0.02em; }
.welcome-subtitle { color: var(--text-muted); font-size: 16px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 4rem; }
.stat-card {
    background: var(--bg-surface); padding: 2rem; border-radius: 28px; border: 1px solid var(--border);
    display: flex; align-items: center; gap: 1.5rem; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(28,61,46,0.08); border-color: var(--green-500); }
.stat-icon { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.icon-green { background: #E6F6EC; color: #16A34A; }
.icon-coral { background: #FEF2F2; color: var(--coral); }
.icon-cream { background: #FDFBFA; color: var(--green-900); }
.stat-value { display: block; font-family: 'DM Serif Display', serif; font-size: 32px; color: var(--green-900); line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* Tables */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.section-title { font-family: 'DM Serif Display', serif; font-size: 24px; color: var(--green-900); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 1.5rem; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); background: var(--bg-main); text-align: left; font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.data-table td { padding: 1.5rem; border-bottom: 1px solid var(--border); font-size: 15px; color: var(--text-main); }
.data-table tr:hover { background: rgba(82,183,136,0.05); }

/* Welcome Overlay */
.welcome-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(28,61,46,0.95); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; animation: fadeInWelcome 0.5s ease;
}
@keyframes fadeInWelcome { from { opacity: 0; } to { opacity: 1; } }
.welcome-content { text-align: center; color: #fff; }
.welcome-avatar {
    width: 100px; height: 100px; border-radius: 30px; background: var(--green-500);
    margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
    font-size: 40px; font-family: 'DM Serif Display', serif; overflow: hidden;
    border: 3px solid rgba(255,255,255,0.2); animation: zoomIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.welcome-avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes zoomIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.welcome-text { font-family: 'DM Serif Display', serif; font-size: 32px; margin-bottom: 8px; }
.welcome-sub { opacity: 0.7; font-weight: 300; margin-bottom: 25px; }
.welcome-loader { width: 200px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 10px; margin: 0 auto; overflow: hidden; }
.loader-bar { width: 100%; height: 100%; background: var(--green-500); transform: translateX(-100%); animation: loadProgress 2s forwards; }
@keyframes loadProgress { to { transform: translateX(0); } }

/* ── History & Clinical Details ───────────── */
.history-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.data-stat-card { background: #fff; border: 1px solid var(--border); padding: 1.2rem; border-radius: 20px; display: flex; flex-direction: column; gap: 4px; transition: all 0.3s ease; }
.data-stat-card:hover { border-color: var(--green-300); box-shadow: 0 10px 20px rgba(82,183,136,0.08); transform: translateY(-2px); }
.data-stat-card span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); font-weight: 700; }
.data-stat-card b { font-size: 22px; color: var(--green-900); font-family: 'Outfit', sans-serif; }
.bmc-stage {
    position: relative; width: 100%; height: 380px;
    background: radial-gradient(circle at center, var(--green-50) 0%, #fff 70%);
    border-radius: 30px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; overflow: hidden; border: 1px solid var(--border); transition: background 0.5s ease;
}
.bmc-stage::before { content: ''; position: absolute; bottom: -50px; width: 200px; height: 100px; background: var(--green-100); filter: blur(40px); border-radius: 50%; opacity: 0.6; }

/* ── Responsive Layout ───────────────────── */
@media (max-width: 992px) {
    .page { grid-template-columns: 1fr; }
    .panel-left { padding: 3rem 2rem; }
    .panel-left::before, .panel-left::after { display: none; }
    .left-center, .left-bottom { display: none; }
    .panel-right { padding: 4rem 1.5rem; }
    .login-brand-panel { height: clamp(220px, 38vh, 360px); padding: 0; }
    .login-brand-art { min-height: 0; }
    .login-brand-video { width: auto; max-width: 100%; height: 100%; max-height: 100%; }
}

@media (max-width: 900px) {
    .sidebar { width: 90px; padding: 2.5rem 1rem; }
    .sidebar .nav-item span, .sidebar-header span { display: none; }
    .nav-item { justify-content: center; padding: 18px; }
    .main-content { margin-left: 90px; }
}

/* ── Print ───────────────────────────────── */
.print-header { display: none; }
@media print {
    body { background: #fff !important; color: #000 !important; font-size: 11pt; }
    .sidebar, .topbar, .tab-nav, .btn, .btn-icon, .btn-3d, .topbar-actions,
    #bmiIllustrationCard, .modal-overlay, .add-meal-btn, .topbar-user-pill { display: none !important; }
    .dashboard-layout { display: block !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .clinical-panel { display: none !important; }
    .clinical-panel.active { display: block !important; }
    #panel-dieta { display: block !important; grid-template-columns: 1fr !important; }
    .diet-summary-card { position: static !important; width: 100% !important; margin-top: 2rem; }
    .data-card, .card { box-shadow: none !important; border: 1px solid #eee !important; margin-bottom: 2rem !important; background: #fff !important; page-break-inside: avoid; }
    .print-header { display: block !important; text-align: center; margin-bottom: 3rem; border-bottom: 2px solid var(--green-200); padding-bottom: 1rem; }
}

/* Modern responsive layout layer */
.dashboard-page {
    background-color: var(--bg-main);
    background-image: none;
}

.sidebar {
    width: 220px;
    padding: 24px 13px;
    box-shadow: none;
}

.sidebar.collapsed {
    width: 64px;
    padding: 24px 10px;
}

.sidebar-toggle {
    left: 196px;
    border-radius: var(--radius-md);
}

.sidebar-toggle.is-collapsed {
    left: 50px;
}

.nav-item {
    border-radius: var(--radius-md);
    padding: 11px 10px;
}

.sidebar .nav-item > svg {
    flex: 0 0 20px;
    width: 20px;
    min-width: 20px;
}

.sidebar .nav-item > span {
    min-width: 0;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.main-content {
    margin-left: 220px;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 64px;
}

.topbar {
    height: 72px;
    padding: 0 28px;
    box-shadow: none;
}

.dashboard-body {
    padding: 28px;
    max-width: 1320px;
}

.welcome-section {
    margin-bottom: 24px;
}

.welcome-title {
    font-size: clamp(28px, 3vw, 38px);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 20px;
    gap: 14px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.stat-value {
    font-size: 28px;
}

.section-header,
.module-header {
    gap: 16px;
    flex-wrap: wrap;
}

.data-table {
    min-width: 720px;
}

.data-card {
    overflow-x: auto;
}

@media (max-width: 900px) {
    .dashboard-page::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(12, 48, 39, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .dashboard-page.sidebar-open::before {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 220px;
        z-index: 1200;
        box-sizing: border-box;
        visibility: hidden;
        pointer-events: none;
    }

    .sidebar.collapsed {
        width: 220px;
        padding: 24px 13px;
        overflow-y: auto;
    }

    .sidebar .nav-item,
    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        gap: 14px;
    }

    .sidebar .nav-item span,
    .sidebar.collapsed .nav-item span {
        display: inline;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-toggle {
        left: calc(100% + 16px);
        top: 18px;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-toggle.is-collapsed { left: calc(100% + 16px); }

    .main-content,
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .topbar {
        padding-left: 64px;
        padding-right: 16px;
    }

    .dashboard-body {
        padding: 18px;
    }
}

@media (max-width: 640px) {
    .topbar {
        height: 64px;
        padding-right: 10px;
    }

    .topbar-actions { gap: 8px; }
    .topbar-notifications { margin-right: 0 !important; }
    .topbar-user-pill { padding-right: 4px; gap: 0; }
    .topbar-user-details { display: none; }
    #notifDropdown { position: fixed !important; top: 70px !important; left: 12px !important; right: 12px !important; width: auto !important; max-height: calc(100vh - 84px); }
    .logout-link { width: 40px; height: 40px; }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        max-width: 100%;
    }

    .panel-right {
        padding: 28px 16px;
    }
}
