:root {
    --bg: #081c15;
    --bg-soft: #0f2e25;
    --panel: rgba(17, 40, 33, 0.82);
    --panel-border: rgba(197, 241, 220, 0.08);
    --text: #f3fff8;
    --muted: #b7d5c6;
    --accent: #52b788;
    --accent-2: #95d5b2;
    --warning: #f4a261;
    --danger: #e76f51;
}

body.app-shell {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(82, 183, 136, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(244, 162, 97, 0.15), transparent 28%),
        linear-gradient(145deg, #04110d 0%, #0a2018 45%, #081c15 100%);
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.topbar {
    background: rgba(5, 19, 14, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--panel-border);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: block;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

.auth-brand-mark {
    width: 58px;
    height: 58px;
    display: block;
}

.hero-panel,
.panel-card,
.glass-panel,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.hero-panel,
.panel-card,
.glass-panel {
    border-radius: 24px;
}

.hero-panel {
    padding: 2rem;
}

.stat-card {
    padding: 1.2rem;
    border-radius: 20px;
    height: 100%;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-card strong {
    font-size: 1.35rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent-2);
    font-size: 0.72rem;
}

.pill,
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(149, 213, 178, 0.14);
    color: var(--accent-2);
}

.form-control,
.form-select,
.btn,
.card {
    border-radius: 16px;
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.25rem rgba(82, 183, 136, 0.18);
}

.form-label,
.table,
.nav-link,
.navbar-brand,
.lead,
h1, h2, h3, h4, h5,
p,
span,
strong,
label {
    color: var(--text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #ffffff !important;
}

.text-secondary {
    color: var(--muted) !important;
}

.btn-success {
    background: linear-gradient(135deg, #40916c, #2d6a4f);
    border: none;
}

.table-darkish {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}

.silhouette-wrap {
    background:
        radial-gradient(circle at 50% 18%, rgba(149, 213, 178, 0.2), transparent 28%),
        linear-gradient(180deg, rgba(149, 213, 178, 0.08), rgba(0, 0, 0, 0));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 0.5rem 0.75rem 0.25rem;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-shell {
    position: relative;
    min-height: 280px;
    height: 42vh;
    max-height: 420px;
}

.chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.body-svg {
    width: 100%;
    max-height: 330px;
}

.body-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.body-metric {
    min-width: 76px;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(82, 183, 136, 0.14);
    border: 1px solid rgba(149, 213, 178, 0.18);
    color: #ffffff;
    font-weight: 700;
    text-align: center;
}

.body-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.85rem;
}

.body-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.legend-start {
    color: rgba(244, 162, 97, 0.95);
}

.legend-current {
    color: rgba(123, 211, 168, 0.95);
}

.body-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.body-summary > div {
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-label {
    display: block;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.silhouette-outline {
    fill: none;
    stroke: rgba(244, 162, 97, 0.8);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.silhouette-fill {
    fill: url(#bodyFillGradient);
    stroke: rgba(197, 241, 220, 0.8);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.silhouette-floor {
    fill: rgba(0, 0, 0, 0.18);
}

.meal-card,
.achievement-item {
    padding: 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.achievement-item,
.achievement-full .card-body {
    text-align: center;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.achievement-full .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

.meal-card,
.meal-card *,
.panel-card .card-body .meal-description,
.panel-card .card-body .meal-description + .d-flex,
.panel-card .card-body .meal-description + .small,
.panel-card .card-body strong,
.panel-card .card-body .fw-semibold {
    color: #ffffff !important;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

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

.achievement-item.locked,
.achievement-full.locked {
    filter: grayscale(1);
    opacity: 0.55;
}

.achievement-icon,
.achievement-icon-lg {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 222, 128, 0.34), rgba(196, 144, 35, 0.08));
    color: #f4c95d;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.achievement-icon-lg {
    font-size: 2.5rem;
    width: 88px;
    height: 88px;
}

.achievement-icon i,
.achievement-icon-lg i {
    color: #f4c95d;
    filter: drop-shadow(0 4px 10px rgba(244, 201, 93, 0.2));
}

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
}

@media (max-width: 991px) {
    .hero-panel {
        padding: 1.5rem;
    }

    .chart-shell {
        height: 320px;
        max-height: 320px;
    }

    .silhouette-wrap {
        min-height: 320px;
    }

    .achievement-grid.compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .chart-shell {
        min-height: 240px;
        height: 240px;
        max-height: 240px;
    }

    .body-summary {
        grid-template-columns: 1fr;
    }

    .silhouette-wrap {
        min-height: 280px;
        padding-top: 0.5rem;
    }

    .achievement-grid.compact,
    .achievement-grid {
        grid-template-columns: 1fr;
    }
}
