/* Base Variables & Settings */
:root {
    --brand-primary: #3B82F6;
    /* Modern Blue */
    --brand-secondary: #0ea5e9;
    --brand-success: #10b981;
    --brand-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--brand-dark);
    background-color: #f8fafc;
    /* Cool gray background */
}

/* Glassmorphism Utilities */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border) !important;
}

.glass-navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Prevent backdrop-filter from creating a stacking context that traps modals */
    isolation: auto;
}

/* ===== Modal Stacking Fix =====
   Ensures modals render above sticky navbar (z-index: 1020).
   No !important here — JS inline styles must be able to override for stacking. */
.modal-backdrop {
    z-index: 1055;
}
.modal {
    z-index: 1060;
}

/* Auth Page specific */
.auth-body {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
}

.brand-logo {
    max-height: 180px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.brand-title {
    color: var(--brand-dark);
    letter-spacing: -0.5px;
}

.btn-brand {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border: none;
    transition: all 0.3s ease;
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.bg-rose {
    background-color: #F43F5E !important;
}

.text-indigo {
    color: #6366F1 !important;
}

/* --- Visual Metaphors --- */

/* Salt Shaker */
.salt-shaker-container {
    height: 80px;
    width: 60px;
    background: #e5e7eb;
    border: 2px solid #374151;
    border-radius: 8px 8px 12px 12px;
    position: relative;
    overflow: hidden;
    margin: 10px auto;
}

.salt-shaker-cap {
    height: 12px;
    background: #4b5563;
    border-bottom: 2px solid #374151;
    position: relative;
}

.salt-shaker-cap::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px rgba(255, 255, 255, 0.2);
}

.salt-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, #fff, #f3f4f6);
    transition: height 1s ease-out;
}

.salt-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
}

/* Balance Scale */
.scale-container {
    width: 120px;
    height: 60px;
    position: relative;
    margin: 10px auto;
}

.scale-beam {
    width: 100%;
    height: 4px;
    background: #4b5563;
    border-radius: 2px;
    position: absolute;
    top: 20px;
    transform-origin: center center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-pivot {
    width: 12px;
    height: 12px;
    background: #1f2937;
    border-radius: 50%;
    position: absolute;
    top: 16px;
    left: 54px;
    z-index: 2;
}

.scale-pan {
    width: 30px;
    height: 4px;
    background: #4b5563;
    position: absolute;
    bottom: -15px;
}

.scale-pan-left {
    left: 0;
}

.scale-pan-right {
    right: 0;
}

.scale-cord {
    width: 1px;
    height: 15px;
    background: #9ca3af;
    position: absolute;
    top: 4px;
}

.scale-cord-left {
    left: 15px;
}

.scale-cord-right {
    right: 15px;
}

/* Gluten Shield */
.shield-container {
    font-size: 3rem;
    position: relative;
    display: inline-block;
}

.shield-fracture {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s;
}

.shield-cracked .shield-fracture {
    opacity: 1;
}

.shield-cracked i.bi-shield-fill {
    color: #fca5a5 !important;
}

/* Radar Scan */
.radar-container {
    width: 80px;
    height: 80px;
    border: 2px solid #10b981;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: rgba(16, 185, 129, 0.05);
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(16, 185, 129, 0.4) 100%);
    transform-origin: 0 0;
    animation: radar-spin 2s linear infinite;
}

@keyframes radar-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.radar-blip {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* Vitality Nexus (Growth Rings) */
.ring-container {
    width: 80px;
    height: 80px;
    position: relative;
}

.nexus-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid;
    border-radius: 50%;
}

.ring-inner {
    width: 30px;
    height: 30px;
    border-color: #fb7185;
}

.ring-mid {
    width: 55px;
    height: 55px;
    border-color: #f43f5e;
    opacity: 0.6;
}

.ring-outer {
    width: 80px;
    height: 80px;
    border-color: #be123c;
    opacity: 0.3;
}

/* Lipid Labyrinth */
.labyrinth-container {
    width: 100px;
    height: 80px;
    position: relative;
    padding: 5px;
}

.labyrinth-path {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0px, rgba(0, 0, 0, 0.05) 10px, transparent 10px, transparent 20px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.labyrinth-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(239, 68, 68, 0.4), rgba(245, 158, 11, 0.2));
    transition: height 1s ease-in-out;
}

/* Warning Beacon */
.beacon-container {
    width: 60px;
    height: 80px;
    position: relative;
    margin: 5px auto;
}

.beacon-tower {
    width: 30px;
    height: 60px;
    background: #4b5563;
    margin: 0 auto;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.beacon-light {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 12px;
    background: #10b981;
    border-radius: 2px;
    box-shadow: 0 0 15px #10b981;
}

.beacon-alert .beacon-light {
    background: #ef4444;
    box-shadow: 0 0 20px #ef4444;
    animation: beacon-blink 1s infinite;
}

@keyframes beacon-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Nutritional Compass */
.compass-container {
    width: 80px;
    height: 80px;
    border: 3px solid #6366f1;
    border-radius: 50%;
    position: relative;
    margin: 10px auto;
    background: white;
}

.compass-needle {
    position: absolute;
    top: 10px;
    left: 38px;
    width: 4px;
    height: 30px;
    background: #6366f1;
    transform-origin: bottom center;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.compass-needle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -3px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #6366f1;
}

.compass-mark {
    position: absolute;
    font-size: 0.5rem;
    font-weight: bold;
    color: #94a3b8;
}

.mark-n {
    top: 2px;
    left: 36px;
}

.mark-e {
    top: 35px;
    right: 2px;
}

.mark-s {
    bottom: 2px;
    left: 36px;
}

.mark-w {
    top: 35px;
    left: 2px;
}

/* Form inputs styling */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.form-floating label {
    color: #64748b;
}

/* Dashboard specific */
.brand-text {
    background: -webkit-linear-gradient(45deg, var(--brand-primary), var(--brand-success));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.25rem;
}

/* Alert text wrapping */
.alert {
    word-break: break-all;
}

/* Custom Table Design */
.custom-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.custom-table td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    vertical-align: middle;
    color: #475569;
}

.custom-table tbody tr {
    transition: all 0.2s ease;
}

.custom-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Action Buttons in Table */
.btn-action {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: scale(1.1);
}

.badge-role {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

.badge-Admin {
    background-color: #fee2e2;
    color: #ef4444;
}

.badge-Pro {
    background-color: #dbeafe;
    color: #3b82f6;
}

.badge-Basic {
    background-color: #e0e7ff;
    color: #6366f1;
}

.badge-Yearly {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-Family {
    background-color: #fce7f3;
    color: #db2777;
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] body {
    color: #f8fafc;
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-bs-theme="dark"] .glassmorphism,
[data-bs-theme="dark"] .glass-navbar {
    background: rgba(30, 41, 59, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .navbar-brand .brand-title {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .navbar-brand img {
    filter: invert(1) hue-rotate(180deg) brightness(1.2);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .custom-table th {
    border-bottom-color: #334155;
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .custom-table td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .custom-table tbody tr {
    background-color: #1e293b;
}

[data-bs-theme="dark"] .custom-table tbody tr:hover {
    background-color: #334155;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-floating label,
[data-bs-theme="dark"] .form-label {
    color: #94a3b8;
}

/* Ensure inputs use Bootstrap's dark theme variables properly or override */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f172a;
    color: #f8fafc;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #334155;
    color: #f8fafc;
}

/* Theme Dropdown Styles */
.theme-dropdown {
    position: relative;
}

.theme-dropdown-btn {
    background: transparent;
    border: none;
    color: #64748b; /* --gray equivalent in styles.css */
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.theme-dropdown-btn:hover {
    color: var(--brand-dark);
}

[data-bs-theme="dark"] .theme-dropdown-btn {
    color: #94a3b8;
}

[data-bs-theme="dark"] .theme-dropdown-btn:hover {
    color: #f8fafc;
}

.theme-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 8px 0;
    margin-top: 8px;
    list-style: none;
    display: none;
    z-index: 1050; /* Above navbar */
    border: 1px solid #e2e8f0; /* --border equivalent */
}

.theme-dropdown .dropdown-menu.show {
    display: block;
}

.theme-dropdown .dropdown-item {
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--brand-dark);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s, color 0.2s;
}

.theme-dropdown .dropdown-item svg {
    margin-right: 12px;
}

.theme-dropdown .dropdown-item:hover,
.theme-dropdown .dropdown-item.active {
    background: #f1f5f9; /* --light-bg equivalent */
    color: var(--brand-primary);
}

[data-bs-theme="dark"] .theme-dropdown .dropdown-item {
    color: #f8fafc;
}

[data-bs-theme="dark"] .theme-dropdown .dropdown-item:hover,
[data-bs-theme="dark"] .theme-dropdown .dropdown-item.active {
    background: #334155;
    color: #f8fafc;
}

/* ── Weekly Evaluation: Colored Card Headers ─────────────────────────── */
.wr-card-header {
    padding: 0.55rem 1rem;
    border-radius: 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    flex-shrink: 0;
}

/* Safety Score — Blue */
.wr-header-blue {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* Search Activity — Indigo */
.wr-header-indigo {
    background-color: #e0e7ff;
    color: #4338ca;
}

/* Dynamic: Danger variants (diabetes, heart, kidney, weight, allergen) — Red */
.wr-header-red {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Dynamic: Warning variants (gluten, pregnancy) — Amber */
.wr-header-amber {
    background-color: #fef3c7;
    color: #b45309;
}

/* Top Categories — Teal */
.wr-header-teal {
    background-color: #ccfbf1;
    color: #0f766e;
}

/* Avg. Nutrition — Green */
.wr-header-green {
    background-color: #dcfce7;
    color: #15803d;
}

/* Recent Avoids — Rose */
.wr-header-rose {
    background-color: #ffe4e6;
    color: #be123c;
}

/* Meal Prep (Athlete) — Orange */
.wr-header-orange {
    background-color: #ffedd5;
    color: #c2410c;
}

/* Dark-mode overrides */
[data-bs-theme="dark"] .wr-header-blue {
    background-color: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-indigo {
    background-color: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-red {
    background-color: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-amber {
    background-color: rgba(217, 119, 6, 0.18);
    color: #fcd34d;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-teal {
    background-color: rgba(20, 184, 166, 0.18);
    color: #5eead4;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-green {
    background-color: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-rose {
    background-color: rgba(244, 63, 94, 0.18);
    color: #fda4af;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .wr-header-orange {
    background-color: rgba(249, 115, 22, 0.18);
    color: #fdba74;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ── Weekly Evaluation: Matching Card Borders ────────────────────────── */
.wr-card-blue {
    border-color: #93c5fd !important;
}

.wr-card-indigo {
    border-color: #e0e7ff !important;
}

.wr-card-red {
    border-color: #fca5a5 !important;
}

.wr-card-amber {
    border-color: #fcd34d !important;
}

.wr-card-teal {
    border-color: #5eead4 !important;
}

.wr-card-green {
    border-color: #86efac !important;
}

.wr-card-rose {
    border-color: #fda4af !important;
}

.wr-card-orange {
    border-color: #fdba74 !important;
}

/* Dark mode — slightly more opaque so borders remain visible */
[data-bs-theme="dark"] .wr-card-blue {
    border-color: rgba(59, 130, 246, 0.45) !important;
}

[data-bs-theme="dark"] .wr-card-indigo {
    border-color: rgba(99, 102, 241, 0.18) !important;
}

[data-bs-theme="dark"] .wr-card-red {
    border-color: rgba(239, 68, 68, 0.45) !important;
}

[data-bs-theme="dark"] .wr-card-amber {
    border-color: rgba(217, 119, 6, 0.45) !important;
}

[data-bs-theme="dark"] .wr-card-teal {
    border-color: rgba(20, 184, 166, 0.45) !important;
}

[data-bs-theme="dark"] .wr-card-green {
    border-color: rgba(34, 197, 94, 0.45) !important;
}

[data-bs-theme="dark"] .wr-card-rose {
    border-color: rgba(244, 63, 94, 0.45) !important;
}

[data-bs-theme="dark"] .wr-card-orange {
    border-color: rgba(249, 115, 22, 0.45) !important;
}

/* ── Weekly Evaluation: Avg. Nutrition Tiles ────────────────────────── */
.wr-nutri-tiles {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.letter-spacing-lg {
    letter-spacing: 0.12em;
}

[data-bs-theme="dark"] .progress {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.wr-left-column-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    height: 100%;
}

.wr-nutri-tile {
    flex: 1;
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.wr-nutri-tile .nt-icon {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.wr-nutri-tile .nt-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.wr-nutri-tile .nt-value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--brand-dark);
}

.wr-nutri-tile .nt-unit {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Tile colour palettes */
.nt-red {
    background-color: #fee2e2;
}

.nt-red .nt-label,
.nt-red .nt-icon {
    color: #ef4444;
}

.nt-yellow {
    background-color: #fef9c3;
}

.nt-yellow .nt-label,
.nt-yellow .nt-icon {
    color: #ca8a04;
}

.nt-blue {
    background-color: #dbeafe;
}

.nt-blue .nt-label,
.nt-blue .nt-icon {
    color: #3b82f6;
}

.nt-green {
    background-color: #dcfce7;
}

.nt-green .nt-label,
.nt-green .nt-icon {
    color: #22c55e;
}

.nt-purple {
    background-color: #ede9fe;
}

.nt-purple .nt-label,
.nt-purple .nt-icon {
    color: #7c3aed;
}

.nt-orange {
    background-color: #ffedd5;
}

.nt-orange .nt-label,
.nt-orange .nt-icon {
    color: #f97316;
}

.nt-teal {
    background-color: #ccfbf1;
}

.nt-teal .nt-label,
.nt-teal .nt-icon {
    color: #0d9488;
}

/* Dark mode tile overrides for a premium, high-contrast look */
[data-bs-theme="dark"] .wr-nutri-tile {
    background-color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .nt-red {
    border-top: 3px solid #ef4444 !important;
}

[data-bs-theme="dark"] .nt-red .nt-value {
    color: #f87171;
}

[data-bs-theme="dark"] .nt-red .nt-icon {
    color: #f87171;
}

[data-bs-theme="dark"] .nt-yellow {
    border-top: 3px solid #f59e0b !important;
}

[data-bs-theme="dark"] .nt-yellow .nt-value {
    color: #fbbf24;
}

[data-bs-theme="dark"] .nt-yellow .nt-icon {
    color: #fbbf24;
}

[data-bs-theme="dark"] .nt-blue {
    border-top: 3px solid #3b82f6 !important;
}

[data-bs-theme="dark"] .nt-blue .nt-value {
    color: #60a5fa;
}

[data-bs-theme="dark"] .nt-blue .nt-icon {
    color: #60a5fa;
}

[data-bs-theme="dark"] .nt-green {
    border-top: 3px solid #10b981 !important;
}

[data-bs-theme="dark"] .nt-green .nt-value {
    color: #34d399;
}

[data-bs-theme="dark"] .nt-green .nt-icon {
    color: #34d399;
}

[data-bs-theme="dark"] .nt-purple {
    border-top: 3px solid #8b5cf6 !important;
}

[data-bs-theme="dark"] .nt-purple .nt-value {
    color: #a78bfa;
}

[data-bs-theme="dark"] .nt-purple .nt-icon {
    color: #a78bfa;
}

[data-bs-theme="dark"] .nt-orange {
    border-top: 3px solid #f97316 !important;
}

[data-bs-theme="dark"] .nt-orange .nt-value {
    color: #fb923c;
}

[data-bs-theme="dark"] .nt-orange .nt-icon {
    color: #fb923c;
}

[data-bs-theme="dark"] .nt-teal {
    border-top: 3px solid #14b8a6 !important;
}

[data-bs-theme="dark"] .nt-teal .nt-value {
    color: #2dd4bf;
}

[data-bs-theme="dark"] .nt-teal .nt-icon {
    color: #2dd4bf;
}

[data-bs-theme="dark"] .wr-nutri-tile .nt-label {
    opacity: 0.85;
}

[data-bs-theme="dark"] .wr-nutri-tile .nt-unit {
    color: #94a3b8;
}

[data-bs-theme="dark"] .nt-teal .nt-value {
    color: #5eead4;
}

[data-bs-theme="dark"] .text-secondary {
    color: #cbd5e1 !important;
}

/* ── Print Styles ──────────────────────────────────────────────────────── */
@media print {

    /* Reset height and overflow for printing */
    html,
    body {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide everything except the Weekly Evaluation Modal */
    body>*:not(#weeklyReportModal) {
        display: none !important;
    }

    /* Hide redundant elements within the modal */
    .modal-backdrop,
    .modal-header .btn,
    .modal-header .btn-close,
    .modal-footer,
    script,
    nav {
        display: none !important;
    }

    /* Target the Weekly Report Modal exclusively */
    #weeklyReportModal,
    #weeklyReportModal * {
        visibility: visible !important;
    }

    /* Positioning and sizing */
    #weeklyReportModal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 1 !important;
    }

    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .modal-content {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        background: white !important;
        color: black !important;
    }

    /* Ensure backgrounds and colors print correctly */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .wr-card-header,
    .wr-nutri-tile,
    .progress-bar,
    .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Layout tweaks for paper */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    .col-md-6,
    .col-lg-6 {
        width: 50% !important;
        flex: 0 0 50% !important;
    }

    .col-md-4,
    .col-lg-4 {
        width: 33.33% !important;
        flex: 0 0 33.33% !important;
    }

    .col-md-8,
    .col-lg-8 {
        width: 66.66% !important;
        flex: 0 0 66.66% !important;
    }

    .col-sm-4 {
        width: 33.33% !important;
        flex: 0 0 33.33% !important;
    }

    .card {
        page-break-inside: avoid !important;
        margin-bottom: 20px !important;
        border: 1px solid #ddd !important;
    }

    /* Force Light Mode Aesthetics for printing */
    [data-bs-theme="dark"] .modal-content {
        background-color: #ffffff !important;
        color: #0f172a !important;
    }

    [data-bs-theme="dark"] .text-muted {
        color: #64748b !important;
    }
}

/* ── Mobile Responsiveness ─────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .glass-navbar .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .brand-text {
        font-size: 1.16rem;
    }

    .navbar-brand img {
        width: 120px !important;
    }

    .card-body {
        padding: 1.25rem !important;
    }

    h2, .fs-2 { font-size: 1.5rem !important; }
    h4, .fs-4 { font-size: 1.25rem !important; }

    /* Fix for oversized navbar toggler */
    .navbar-toggler {
        padding: 0.5rem 0.6rem !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
        background-color: var(--light-bg) !important;
        border: 2px solid var(--border) !important;
        box-shadow: none !important;
    }

    [data-bs-theme="dark"] .navbar-toggler {
        background-color: #1e293b !important;
        border-color: #334155 !important;
    }

    /* Fix for cramped search tabs */
    .nav-pills {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
    }

    .nav-pills .nav-link {
        white-space: nowrap;
        padding: 0.6rem 1.25rem !important;
        font-size: 0.88rem !important;
    }

    /* Fix for cut-off input placeholders */
    #barcodeSearchForm .position-relative,
    #nameSearchForm .position-relative {
        margin-bottom: 0.5rem;
    }

    .form-control-lg.rounded-pill.ps-5 {
        padding-left: 2.75rem !important;
        padding-right: 1.25rem !important;
        font-size: 0.95rem !important;
    }

    /* Adjust barcode/search icon position on mobile */
    .bi-upc-scan.position-absolute,
    .bi-search.position-absolute {
        left: 0.75rem !important;
        width: 18px !important;
        height: 18px !important;
    }

    /* Stacking search form buttons on small screens */
    #barcodeSearchForm, #nameSearchForm {
        flex-direction: column !important;
    }

    #barcodeSearchForm button, #nameSearchForm button {
        width: 100%;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        font-size: 1rem !important;
    }

    /* Fix for profile card icon overflow */
    .profile-item {
        flex-wrap: wrap !important;
        gap: 1rem !important;
        padding: 1.25rem !important;
    }

    .profile-info-wrapper {
        width: 100% !important;
        flex-grow: 1;
    }

    .profile-actions-wrapper {
        width: 100% !important;
        justify-content: flex-end !important;
        padding-top: 0.75rem;
        border-top: 1px dashed rgba(0,0,0,0.05);
    }

    [data-bs-theme="dark"] .profile-actions-wrapper {
        border-top-color: rgba(255,255,255,0.05);
    }

    /* Admin Search Bar stacking */
    .admin-filter-row > div {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .nav-pills .nav-link {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        font-size: 0.85rem;
    }
}

/* ── Dashboard Mobile Navbar Fixes ────────────────────────────────── */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: 85vh;
        overflow-y: auto;
        padding-bottom: 1rem;
    }

    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        background-color: rgba(0, 0, 0, 0.03) !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        box-shadow: none !important;
        padding-left: 0.5rem;
        transform: none !important;
    }

    [data-bs-theme="dark"] .navbar-nav .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .navbar-nav .dropdown-item {
        padding: 0.75rem 1rem;
    }
}
/* Auth Card Top Actions */
.auth-card {
    position: relative;
    overflow: visible !important;
}

.auth-actions-top {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.auth-icon-link {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-icon-link i {
    font-size: 1.1rem;
}

.auth-icon-link:hover {
    transform: translateY(-3px);
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.2);
}

[data-bs-theme="dark"] .auth-icon-link {
    background: rgba(30, 41, 59, 0.5);
    color: #3ab0ec;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .auth-icon-link:hover {
    background: #3ab0ec;
    color: #1e293b;
}

/* ── Collapsible Icon & Label Rotation ────────────────────────── */
[data-bs-toggle="collapse"] .collapse-icon {
    transition: transform 0.3s ease;
}

[data-bs-toggle="collapse"].collapsed .collapse-icon {
    transform: rotate(-180deg);
}

[data-bs-toggle="collapse"] .show-label {
    display: none;
}

[data-bs-toggle="collapse"].collapsed .show-label {
    display: inline;
}

[data-bs-toggle="collapse"] .hide-label {
    display: inline;
}

[data-bs-toggle="collapse"].collapsed .hide-label {
    display: none;
}
/* ── Product Detail Scroll Containers ────────────────────────── */
.product-detail-scroll-container {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    position: relative;
}

/* Custom Scrollbar for a premium look */
.product-detail-scroll-container::-webkit-scrollbar {
    width: 5px;
}

.product-detail-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.product-detail-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.product-detail-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-bs-theme="dark"] .product-detail-scroll-container::-webkit-scrollbar-thumb {
    background: #334155;
}

[data-bs-theme="dark"] .product-detail-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Nutrition Facts Table ────────────────────────── */
.nutrition-facts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem;
}

.nutrition-facts-table tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
}

.nutrition-facts-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.nutrition-facts-table td {
    padding: 10px 12px;
}

.nutrition-facts-table td:last-child {
    text-align: right;
    font-weight: 700;
}

.nutrition-facts-label {
    color: #475569;
    font-weight: 500;
}

.nutrition-facts-sublabel {
    padding-left: 20px;
    font-size: 0.85rem;
    color: #64748b;
}

body.dark-theme .nutrition-facts-table tr {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .nutrition-facts-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

body.dark-theme .nutrition-facts-label {
    color: #cbd5e1;
}

body.dark-theme .nutrition-facts-sublabel {
    color: #94a3b8;
}

.nutrition-facts-footer {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    padding: 10px;
    font-style: italic;
}

/* ── Custom Serving Card Styles (Light/Dark responsive) ── */
.manufacturer-label-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #0d6efd !important;
    color: #212529;
}
.manufacturer-label-card .card-text {
    color: #212529;
}
body.dark-theme .manufacturer-label-card,
[data-bs-theme="dark"] .manufacturer-label-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9;
}
body.dark-theme .manufacturer-label-card .card-text,
[data-bs-theme="dark"] .manufacturer-label-card .card-text {
    color: #f1f5f9;
}

.suggested-serving-card {
    background-color: #f0fdf4;
    border: 1px solid #d1fae5;
    border-left: 4px solid #198754 !important;
    color: #198754;
}
.suggested-serving-card .serving-title {
    color: #198754;
}
.suggested-serving-card .serving-value {
    color: #198754;
}
.suggested-serving-card .serving-subtext {
    color: #6c757d;
}
body.dark-theme .suggested-serving-card,
[data-bs-theme="dark"] .suggested-serving-card {
    background-color: #064e3b !important;
    border-color: #1b4d3e !important;
    color: #4ade80;
}
body.dark-theme .suggested-serving-card .serving-title,
[data-bs-theme="dark"] .suggested-serving-card .serving-title {
    color: #4ade80;
}
body.dark-theme .suggested-serving-card .serving-value,
[data-bs-theme="dark"] .suggested-serving-card .serving-value {
    color: #4ade80;
}
body.dark-theme .suggested-serving-card .serving-subtext,
[data-bs-theme="dark"] .suggested-serving-card .serving-subtext {
    color: #a7f3d0;
}

/* --- Theme-responsive Nutrition Highlight Cards --- */
.nutri-card {
    min-width: 85px;
    max-width: 110px;
    min-height: 100px;
}
.nutri-card .nutri-card-value {
    color: #1e293b;
}

/* Light Mode Card Colors */
.nutri-card-danger { background-color: #FEE2E2; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-danger i { color: #EF4444; }
.nutri-card-danger .nutri-card-title,
.nutri-card-danger .nutri-card-unit { color: #991B1B; }

.nutri-card-warning { background-color: #FEF3C7; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-warning i { color: #F59E0B; }
.nutri-card-warning .nutri-card-title,
.nutri-card-warning .nutri-card-unit { color: #92400E; }

.nutri-card-primary { background-color: #E0E7FF; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-primary i { color: #4F46E5; }
.nutri-card-primary .nutri-card-title,
.nutri-card-primary .nutri-card-unit { color: #3730A3; }

.nutri-card-info { background-color: #E0F2FE; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-info i { color: #0284C7; }
.nutri-card-info .nutri-card-title,
.nutri-card-info .nutri-card-unit { color: #075985; }

.nutri-card-success { background-color: #DCFCE7; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-success i { color: #16A34A; }
.nutri-card-success .nutri-card-title,
.nutri-card-success .nutri-card-unit { color: #166534; }

.nutri-card-secondary { background-color: #F1F5F9; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-secondary i { color: #475569; }
.nutri-card-secondary .nutri-card-title,
.nutri-card-secondary .nutri-card-unit { color: #1E293B; }

.nutri-card-dark { background-color: #F1F5F9; border-color: rgba(0,0,0,0.05) !important; }
.nutri-card-dark i { color: #1E293B; }
.nutri-card-dark .nutri-card-title,
.nutri-card-dark .nutri-card-unit { color: #1E293B; }

/* Dark Mode Card Colors Override */
body.dark-theme .nutri-card .nutri-card-value,
[data-bs-theme="dark"] .nutri-card .nutri-card-value {
    color: #F1F5F9 !important;
}

body.dark-theme .nutri-card-danger,
[data-bs-theme="dark"] .nutri-card-danger { background-color: #2D1F21 !important; border-color: #4C1D24 !important; }
body.dark-theme .nutri-card-danger i,
[data-bs-theme="dark"] .nutri-card-danger i { color: #EF4444 !important; }
body.dark-theme .nutri-card-danger .nutri-card-title,
body.dark-theme .nutri-card-danger .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-danger .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-danger .nutri-card-unit { color: #FCA5A5 !important; }

body.dark-theme .nutri-card-warning,
[data-bs-theme="dark"] .nutri-card-warning { background-color: #2D271E !important; border-color: #4E3A1A !important; }
body.dark-theme .nutri-card-warning i,
[data-bs-theme="dark"] .nutri-card-warning i { color: #F59E0B !important; }
body.dark-theme .nutri-card-warning .nutri-card-title,
body.dark-theme .nutri-card-warning .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-warning .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-warning .nutri-card-unit { color: #FCD34D !important; }

body.dark-theme .nutri-card-primary,
[data-bs-theme="dark"] .nutri-card-primary { background-color: #1E2235 !important; border-color: #2B3252 !important; }
body.dark-theme .nutri-card-primary i,
[data-bs-theme="dark"] .nutri-card-primary i { color: #6366F1 !important; }
body.dark-theme .nutri-card-primary .nutri-card-title,
body.dark-theme .nutri-card-primary .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-primary .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-primary .nutri-card-unit { color: #A5B4FC !important; }

body.dark-theme .nutri-card-info,
[data-bs-theme="dark"] .nutri-card-info { background-color: #1E293B !important; border-color: #1E3A8A !important; }
body.dark-theme .nutri-card-info i,
[data-bs-theme="dark"] .nutri-card-info i { color: #3B82F6 !important; }
body.dark-theme .nutri-card-info .nutri-card-title,
body.dark-theme .nutri-card-info .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-info .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-info .nutri-card-unit { color: #93C5FD !important; }

body.dark-theme .nutri-card-success,
[data-bs-theme="dark"] .nutri-card-success { background-color: #1E332A !important; border-color: #1A4D35 !important; }
body.dark-theme .nutri-card-success i,
[data-bs-theme="dark"] .nutri-card-success i { color: #10B981 !important; }
body.dark-theme .nutri-card-success .nutri-card-title,
body.dark-theme .nutri-card-success .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-success .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-success .nutri-card-unit { color: #86EFAC !important; }

body.dark-theme .nutri-card-secondary,
[data-bs-theme="dark"] .nutri-card-secondary { background-color: #1E293B !important; border-color: #334155 !important; }
body.dark-theme .nutri-card-secondary i,
[data-bs-theme="dark"] .nutri-card-secondary i { color: #94A3B8 !important; }
body.dark-theme .nutri-card-secondary .nutri-card-title,
body.dark-theme .nutri-card-secondary .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-secondary .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-secondary .nutri-card-unit { color: #CBD5E1 !important; }

body.dark-theme .nutri-card-dark,
[data-bs-theme="dark"] .nutri-card-dark { background-color: #1E293B !important; border-color: #334155 !important; }
body.dark-theme .nutri-card-dark i,
[data-bs-theme="dark"] .nutri-card-dark i { color: #CBD5E1 !important; }
body.dark-theme .nutri-card-dark .nutri-card-title,
body.dark-theme .nutri-card-dark .nutri-card-unit,
[data-bs-theme="dark"] .nutri-card-dark .nutri-card-title,
[data-bs-theme="dark"] .nutri-card-dark .nutri-card-unit { color: #CBD5E1 !important; }

/* Multi-Step Profile Wizard Styles */
.wizard-steps-indicator {
    position: relative;
    padding-bottom: 10px;
}
.step-line-bg {
    position: absolute;
    top: 18px;
    left: 20px;
    right: 20px;
    height: 3px;
    background-color: #e2e8f0;
    z-index: 1;
}
.step-line-fill {
    position: absolute;
    top: 18px;
    left: 20px;
    height: 3px;
    background-color: var(--brand-success);
    width: 0%;
    z-index: 2;
    transition: width 0.3s ease;
}
.wizard-step-dot {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.wizard-step-dot .step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #64748b;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.wizard-step-dot.active .step-num {
    background-color: var(--brand-success);
    color: #fff;
    border-color: #fff;
}
.wizard-step-dot.completed .step-num {
    background-color: var(--brand-success);
    color: #fff;
}
.wizard-step-dot .step-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-top: 6px;
    transition: color 0.3s ease;
}
.wizard-step-dot.active .step-label {
    color: var(--brand-success);
    font-weight: 700;
}
.wizard-step-content {
    display: none;
}
.wizard-step-content.active {
    display: block;
}

/* Selectable Category Card */
.category-check-card {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}
.category-check-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.category-check-card.selected {
    border-color: var(--brand-success);
    background-color: rgba(16, 185, 129, 0.04);
}
.category-check-card .category-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}
.category-check-card .category-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.category-check-card.selected .category-checkbox {
    border-color: var(--brand-success);
    background-color: var(--brand-success);
    color: #fff;
}

/* Allergen Chip Tags */
.allergen-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.allergen-chip {
    background-color: #f1f5f9;
    color: var(--brand-dark);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
}
.allergen-chip .btn-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 14px;
    margin-left: 6px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Custom Form Switch Styling matching SmartBiteApp */
.form-check.form-switch .form-check-input {
    background-color: #334155;
    border-color: #334155;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2364748b'/%3e%3c/svg%3e");
}
.form-check.form-switch .form-check-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2364748b'/%3e%3c/svg%3e");
}
.form-check.form-switch .form-check-input:checked {
    background-color: #10b981;
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* --- Scan Result UI Styles --- */
.overall-result-box {
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.overall-result-box-yellow {
    background-color: #FFFBEB;
    border-color: #FDE68A;
    color: #B45309;
}
.overall-result-box-red {
    background-color: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}
.overall-result-box-green {
    background-color: #F0FDF4;
    border-color: #BBF7D0;
    color: #15803D;
}
.overall-result-icon {
    font-size: 3rem;
    flex-shrink: 0;
}
.overall-result-content {
    flex-grow: 1;
}
.overall-result-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    opacity: 0.85;
}
.overall-result-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.overall-result-desc {
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 500;
}

/* Reference Legend Bar */
.reference-legend-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 8px;
    margin-bottom: 24px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.legend-text-title {
    font-weight: 700;
    color: #1E293B;
}
.legend-text-sub {
    font-size: 0.75rem;
    color: #64748B;
}

/* Selected Profiles List */
.selected-profiles-container {
    margin-bottom: 24px;
}
.selected-profiles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.selected-profiles-header h5 {
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}
.selected-profiles-count {
    color: #10B981;
    font-weight: 700;
    font-size: 0.9rem;
}
.profile-result-card {
    background-color: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.profile-result-card:hover {
    border-color: #E2E8F0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.profile-result-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}
.profile-result-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #F1F5F9;
    color: #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.profile-result-texts {
    display: flex;
    flex-direction: column;
}
.profile-result-name {
    font-weight: 700;
    color: #1E293B;
    font-size: 0.95rem;
}
.profile-result-sub {
    font-size: 0.8rem;
    color: #64748B;
}

/* Action Buttons Grid */
.actions-grid-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.action-btn-custom {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.btn-action-detail {
    background-color: #10B981;
    border: 1px solid #10B981;
    color: #FFFFFF;
}
.btn-action-detail:hover {
    background-color: #059669;
    border-color: #059669;
    color: #FFFFFF;
}
.btn-action-guideline {
    background-color: #FFFFFF;
    border: 1px solid #059669;
    color: #059669;
}
.btn-action-guideline:hover {
    background-color: rgba(5, 150, 105, 0.04);
}

/* Why This Result Tags */
.why-result-section {
    margin-bottom: 24px;
}
.why-result-section h5 {
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 12px;
}
.why-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.why-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
}
.why-pill-orange {
    background-color: #FFFBEB;
    border-color: #FEF3C7;
    color: #D97706;
}
.why-pill-green {
    background-color: #F0FDF4;
    border-color: #DCFCE7;
    color: #16A34A;
}
.why-pill-red {
    background-color: #FEF2F2;
    border-color: #FEE2E2;
    color: #DC2626;
}

/* Disclaimer Block */
.disclaimer-card-custom {
    background-color: #EFF6FF;
    border: 1px solid #DBEAFE;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.disclaimer-icon-blue {
    font-size: 1.8rem;
    color: #3B82F6;
    line-height: 1;
}
.disclaimer-text-custom {
    font-size: 0.82rem;
    color: #1E40AF;
    line-height: 1.4;
    font-weight: 500;
}

/* Dark Mode Overrides */
body.dark-theme .overall-result-box-yellow,
[data-bs-theme="dark"] .overall-result-box-yellow {
    background-color: #2D251A;
    border-color: #4B3A1C;
    color: #FBBF24;
}
body.dark-theme .overall-result-box-red,
[data-bs-theme="dark"] .overall-result-box-red {
    background-color: #2D1B1E;
    border-color: #511A24;
    color: #F87171;
}
body.dark-theme .overall-result-box-green,
[data-bs-theme="dark"] .overall-result-box-green {
    background-color: #142E1F;
    border-color: #1B4D32;
    color: #34D399;
}
body.dark-theme .reference-legend-bar,
[data-bs-theme="dark"] .reference-legend-bar {
    background-color: #1E293B;
    border-color: #334155;
}
body.dark-theme .legend-text-title,
[data-bs-theme="dark"] .legend-text-title {
    color: #F1F5F9;
}
body.dark-theme .profile-result-card,
[data-bs-theme="dark"] .profile-result-card {
    background-color: #1E293B;
    border-color: #334155;
}
body.dark-theme .profile-result-name,
[data-bs-theme="dark"] .profile-result-name {
    color: #F1F5F9;
}
body.dark-theme .profile-result-icon-circle,
[data-bs-theme="dark"] .profile-result-icon-circle {
    background-color: #334155;
}
body.dark-theme .btn-action-detail,
[data-bs-theme="dark"] .btn-action-detail {
    background-color: #10B981;
    border-color: #10B981;
    color: #FFFFFF;
}
body.dark-theme .btn-action-guideline,
[data-bs-theme="dark"] .btn-action-guideline {
    background-color: #1E293B;
    border-color: #059669;
    color: #059669;
}
body.dark-theme .selected-profiles-header h5,
body.dark-theme .why-result-section h5,
[data-bs-theme="dark"] .selected-profiles-header h5,
[data-bs-theme="dark"] .why-result-section h5 {
    color: #F1F5F9;
}
body.dark-theme .why-pill-orange,
[data-bs-theme="dark"] .why-pill-orange {
    background-color: #2D251A;
    border-color: #4B3A1C;
    color: #FBBF24;
}
body.dark-theme .why-pill-green,
[data-bs-theme="dark"] .why-pill-green {
    background-color: #142E1F;
    border-color: #1B4D32;
    color: #34D399;
}
body.dark-theme .why-pill-red,
[data-bs-theme="dark"] .why-pill-red {
    background-color: #2D1B1E;
    border-color: #511A24;
    color: #F87171;
}
body.dark-theme .disclaimer-card-custom,
[data-bs-theme="dark"] .disclaimer-card-custom {
    background-color: #1E293B;
    border-color: #1D3A6F;
}
body.dark-theme .disclaimer-text-custom,
[data-bs-theme="dark"] .disclaimer-text-custom {
    color: #93C5FD;
}

.profile-result-row {
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.profile-result-row:hover {
    background-color: #F8FAFC;
}
body.dark-theme .profile-result-row,
[data-bs-theme="dark"] .profile-result-row {
    background-color: #1E293B;
    border-color: #334155 !important;
}
body.dark-theme .profile-result-row:hover,
[data-bs-theme="dark"] .profile-result-row:hover {
    background-color: #334155;
}
.profile-result-row:nth-child(even) {
    background-color: #F8FAFC;
}
.profile-result-row:nth-child(even):hover {
    background-color: #F1F5F9;
}
body.dark-theme .profile-result-row:nth-child(even),
[data-bs-theme="dark"] .profile-result-row:nth-child(even) {
    background-color: #111827;
}
body.dark-theme .profile-result-row:nth-child(even):hover,
[data-bs-theme="dark"] .profile-result-row:nth-child(even):hover {
    background-color: #1E293B;
}

/* Scan Result Category Badges */
.status-badge-green {
    background-color: #10B981 !important;
    border: 1px solid #10B981 !important;
    color: #FFFFFF !important;
}
.status-badge-yellow {
    background-color: #FFB000 !important;
    border: 1px solid #FFB000 !important;
    color: #1E293B !important;
}
.status-badge-red {
    background-color: #EF4444 !important;
    border: 1px solid #EF4444 !important;
    color: #FFFFFF !important;
}

body.dark-theme .status-badge-green,
[data-bs-theme="dark"] .status-badge-green {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: #FFFFFF !important;
}
body.dark-theme .status-badge-yellow,
[data-bs-theme="dark"] .status-badge-yellow {
    background-color: #FFB000 !important;
    border-color: #FFB000 !important;
    color: #1E293B !important;
}
body.dark-theme .status-badge-red,
[data-bs-theme="dark"] .status-badge-red {
    background-color: #EF4444 !important;
    border-color: #EF4444 !important;
    color: #FFFFFF !important;
}

/* Selected Profile Card Micro-Interactions */
.selected-profile-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.selected-profile-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
    border-color: #10B981 !important;
}

/* Dark mode adjustment */
}

/* ── Trends New UI (Weekly Report) ─────────────────────────── */
.trends-top-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.period-card {
    flex: 1;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
[data-bs-theme="dark"] .period-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.08);
}

.period-card-header {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.period-card.this-period .period-card-header {
    background: #DCFCE7;
    color: #16A34A;
}
.period-card.previous-period .period-card-header {
    background: #DBEAFE;
    color: #2563EB;
}
[data-bs-theme="dark"] .period-card.this-period .period-card-header { background: rgba(22,163,74,0.2); }
[data-bs-theme="dark"] .period-card.previous-period .period-card-header { background: rgba(37,99,235,0.2); }

.period-card-date {
    font-size: 0.8rem;
    color: #64748B;
    margin-bottom: 1rem;
}

.period-card-score {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.period-card.this-period .period-card-score { color: #16A34A; }
.period-card.previous-period .period-card-score { color: #2563EB; }
[data-bs-theme="dark"] .period-card.this-period .period-card-score { color: #4ADE80; }
[data-bs-theme="dark"] .period-card.previous-period .period-card-score { color: #60A5FA; }

.period-card-status {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.period-card.this-period .period-card-status { color: #16A34A; }
.period-card.previous-period .period-card-status { color: #2563EB; }
[data-bs-theme="dark"] .period-card.this-period .period-card-status { color: #4ADE80; }
[data-bs-theme="dark"] .period-card.previous-period .period-card-status { color: #60A5FA; }

.sparkline-container {
    height: 60px;
    margin: 0 -1.5rem -1rem;
    position: relative;
}
.sparkline-container svg {
    width: 100%;
    height: 100%;
}
.sparkline-label {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.5rem;
}

.trend-difference-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FEF2F2;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    min-width: 140px;
}
[data-bs-theme="dark"] .trend-difference-badge {
    background: rgba(239,68,68,0.1);
}
.trend-difference-badge.positive {
    background: #F0FDF4;
}
[data-bs-theme="dark"] .trend-difference-badge.positive {
    background: rgba(34,197,94,0.1);
}

.diff-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #EF4444;
}
.diff-percent {
    font-size: 0.9rem;
    font-weight: 600;
    color: #EF4444;
    margin-bottom: 0.5rem;
}
.diff-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #EF4444;
}
.trend-difference-badge.positive .diff-value,
.trend-difference-badge.positive .diff-percent,
.trend-difference-badge.positive .diff-status {
    color: #22C55E;
}

/* Nutrition Trends Card */
.nutrition-trends-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
[data-bs-theme="dark"] .nutrition-trends-card {
    background: #1E293B;
    border-color: rgba(255,255,255,0.08);
}

.nutrition-trends-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.nutrition-trends-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.nutrition-trends-subtitle {
    color: #64748B;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.nutrition-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
}
[data-bs-theme="dark"] .legend-item { color: #CBD5E1; }
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.nutrition-chart-container {
    height: 250px;
    margin-bottom: 1.5rem;
    position: relative;
}

.nutrition-summary-row {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}
.nutrition-summary-badge {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
}
.summary-improving {
    background: #F0FDF4;
    color: #16A34A;
}
.summary-increasing {
    background: #FEF2F2;
    color: #EF4444;
}
.summary-stable {
    background: #F0F9FF;
    color: #0284C7;
}
[data-bs-theme="dark"] .summary-improving { background: rgba(34,197,94,0.1); }
[data-bs-theme="dark"] .summary-increasing { background: rgba(239,68,68,0.1); }
[data-bs-theme="dark"] .summary-stable { background: rgba(14,165,233,0.1); }

.summary-count {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.summary-label {
    font-size: 0.75rem;
}
