/* ==========================================
   EndoLeve — Desktop Web Layout with Sidebar
   ========================================== */

:root {
    --purple-100: #f0ebf8;
    --purple-200: #e0d4f0;
    --purple-300: #c7b3e3;
    --purple-400: #a78bda;
    --purple-500: #7c5cbf;
    --purple-600: #6a4dab;
    --purple-700: #553d8a;
    --pink-100: #f8edf2;
    --pink-200: #f0d4e3;
    --pink-300: #e0a8c4;
    --pink-400: #c97da5;
    --pink-500: #b5648e;
    --coral-400: #e88a95;
    --coral-500: #d4616e;
    --mint-100: #eef7f3;
    --mint-200: #d5ede3;
    --mint-300: #7dcbaa;
    --mint-400: #4db89a;
    --mint-500: #2d9e7e;
    --sky-400: #5ba8d4;
    --sky-500: #3d8fc0;
    --warm-50: #faf8f0;
    --warm-100: #f5f0de;
    --warm-400: #e8d48b;

    --bg: #f5f3f8;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1233;
    --bg-sidebar-hover: #2a1b45;
    --bg-sidebar-active: rgba(124, 92, 191, 0.2);
    --text-primary: #2d2341;
    --text-secondary: #5e5272;
    --text-muted: #9a8dad;
    --text-sidebar: #c4b5d9;
    --text-sidebar-active: #ffffff;
    --border: #e8e2f0;
    --border-light: #f2eef7;

    --gradient-primary: linear-gradient(135deg, #7c5cbf 0%, #a87bc5 50%, #c97da5 100%);
    --gradient-warm: linear-gradient(135deg, #c97da5 0%, #e8d48b 100%);
    --gradient-cool: linear-gradient(135deg, #5ba8d4 0%, #4db89a 100%);
    --gradient-sunset: linear-gradient(135deg, #b98fc2 0%, #d4616e 100%);
    --gradient-hero: linear-gradient(135deg, #5a6abd 0%, #6b4a8f 50%, #a87bc5 100%);

    --shadow-sm: 0 1px 3px rgba(45, 35, 65, 0.06);
    --shadow-md: 0 4px 14px rgba(45, 35, 65, 0.08);
    --shadow-lg: 0 10px 30px rgba(45, 35, 65, 0.1);
    --shadow-xl: 0 20px 50px rgba(45, 35, 65, 0.14);

    --sidebar-width: 270px;
    --sidebar-collapsed: 0px;
    --top-bar-height: 68px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
textarea {
    font-family: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============ SPLASH SCREEN ============ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-icon {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: splashBounce 1.5s ease infinite;
}

.splash-icon .material-icons-round {
    font-size: 48px;
    color: white;
}

@keyframes splashBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.splash-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.splash-subtitle {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 300;
}

.splash-loader {
    width: 180px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    margin: 40px auto 0;
    overflow: hidden;
}

.splash-loader-bar {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: var(--radius-full);
    animation: splashLoad 2.5s ease forwards;
}

@keyframes splashLoad {
    to {
        width: 100%;
    }
}

/* ============ LOGIN SCREEN ============ */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%), radial-gradient(circle at 70% 80%, rgba(241, 91, 181, 0.2) 0%, transparent 50%);
}

.login-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 50px 40px;
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.login-icon-wrap {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-icon-wrap .material-icons-round {
    font-size: 42px;
}

.login-logo {
    margin-bottom: 36px;
}

.login-logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-logo p {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 300;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s var(--ease);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group input:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    background: white;
    color: var(--purple-600);
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-login {
    margin-top: 10px;
}

.login-note {
    margin-top: 20px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ============ APP LAYOUT ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 500;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 28px;
    color: var(--purple-400);
    background: rgba(155, 93, 229, 0.15);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.sidebar-close-btn {
    display: none;
    color: var(--text-sidebar);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-avatar .material-icons-round {
    font-size: 22px;
    color: white;
}

.sidebar-user-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
}

.sidebar-user-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--text-sidebar);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav-section {
    margin-bottom: 20px;
}

.sidebar-section-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-sidebar);
    opacity: 0.5;
    padding: 0 12px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s var(--ease);
    position: relative;
}

.sidebar-item:hover {
    background: var(--bg-sidebar-hover);
    color: #e0d4f0;
}

.sidebar-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--purple-400);
    border-radius: 0 4px 4px 0;
}

.sidebar-item .material-icons-round {
    font-size: 22px;
}

.sidebar-item-text {
    white-space: nowrap;
}

.sidebar-item.crisis-item {
    color: #fca5a5;
}

.sidebar-item.crisis-item:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.crisis-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: auto;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-footer-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: rgba(155, 93, 229, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-sidebar);
    line-height: 1.4;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 499;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* ============ MAIN WRAP ============ */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.35s var(--ease);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed~.main-wrap {
    margin-left: 0;
}

/* ============ TOP BAR ============ */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: var(--top-bar-height);
    background: rgba(244, 240, 250, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--purple-100);
    color: var(--purple-600);
}

.menu-toggle .material-icons-round {
    font-size: 26px;
}

.top-bar-title h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.top-bar-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crisis-top-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
    transition: all 0.3s var(--ease);
    animation: crisisGlow 2.5s ease-in-out infinite;
}

.crisis-top-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

@keyframes crisisGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
    }

    50% {
        box-shadow: 0 4px 25px rgba(238, 90, 36, 0.5);
    }
}

.crisis-top-label {
    display: inline;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1200px;
    width: 100%;
}

/* ============ PAGES ============ */
.page {
    display: none;
    animation: pageIn 0.4s var(--ease);
}

.page.active {
    display: block;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ PAGE GRID (Home 2-column layout) ============ */
.page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ============ PAGE BANNERS ============ */
.page-header-banner {
    padding: 32px;
    border-radius: var(--radius-lg);
    color: white;
    text-align: center;
    margin-bottom: 24px;
}

.page-header-banner h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-header-banner p {
    font-size: 0.9rem;
    opacity: 0.85;
}

.food-banner {
    background: var(--gradient-cool);
}

.tracker-banner {
    background: var(--gradient-primary);
}

.plan-banner {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #064e3b;
}

.exercise-banner {
    background: linear-gradient(135deg, #FEE440 0%, #F15BB5 100%);
}

.edu-banner {
    background: var(--gradient-hero);
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-title .material-icons-round {
    font-size: 22px;
    color: var(--purple-500);
}

/* Mood card */
.mood-card {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
}

.mood-card .card-title {
    color: white;
}

.mood-card .card-title .material-icons-round {
    color: white;
}

.pain-scale {
    text-align: center;
}

.pain-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    outline: none;
}

.pain-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.pain-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.pain-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 6px;
}

.pain-emoji {
    font-size: 1.8rem;
    margin-top: 10px;
    transition: all 0.3s;
}

.card .pain-slider {
    background: var(--border);
}

.card .pain-slider::-webkit-slider-thumb {
    background: var(--gradient-primary);
}

.card .pain-labels {
    color: var(--text-muted);
}

/* Crisis banner */
.crisis-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 18px 22px;
    background: linear-gradient(135deg, #c0544f, #d4716b);
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(192, 84, 79, 0.2);
    transition: all 0.3s var(--ease);
}

.crisis-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(238, 90, 36, 0.4);
}

.crisis-banner:active {
    transform: scale(0.98);
}

.crisis-banner>.material-icons-round:first-child {
    font-size: 28px;
}

.crisis-banner div {
    flex: 1;
    text-align: left;
}

.crisis-banner strong {
    display: block;
    font-size: 0.95rem;
}

.crisis-banner span:not(.material-icons-round) {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.quick-action-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--qa-color) 15%, white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-icon .material-icons-round {
    font-size: 26px;
    color: var(--qa-color);
}

.quick-action-item>span:last-child {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

/* Summary stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    text-align: center;
    padding: 14px;
    background: var(--purple-100);
    border-radius: var(--radius-sm);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--purple-600);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* Tip card */
.tip-card {
    background: linear-gradient(135deg, #fff7ed, #fffbeb);
    border-color: #fed7aa;
}

.tip-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #fff;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: #ea580c;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.tip-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #78350f;
}

/* ============ TAB BAR ============ */
.tab-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.tab:hover {
    background: var(--purple-100);
}

.tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s var(--ease);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============ FOOD GRID ============ */
.food-category {
    margin-bottom: 24px;
}

.food-cat-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.food-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.food-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.food-item-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.food-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.food-item-benefit {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.food-item.avoid-item {
    border-color: #fecaca;
    background: #fff5f5;
}

.food-item.caution-item {
    border-color: #fed7aa;
    background: #fffbeb;
}

/* ============ RECIPES (GirlsFIT Style) ============ */
.rc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 18px;
    transition: all 0.2s var(--ease);
}

.rc-back-btn:hover {
    background: var(--purple-100);
    border-color: var(--purple-300);
    color: var(--purple-600);
}

.rc-back-btn .material-icons-round {
    font-size: 18px;
}

.rc-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.rc-section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ---- Category Cards ---- */
.rc-cat-card {
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s var(--ease);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.rc-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.rc-cat-img-wrap {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.rc-cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.rc-cat-card:hover .rc-cat-img {
    transform: scale(1.06);
}

.rc-cat-label {
    padding: 14px 16px;
}

.rc-cat-title {
    font-size: 1rem;
    font-weight: 800;
}

.rc-cat-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Recipe Cards inside category ---- */
.rc-recipe-card {
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.25s var(--ease);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
}

.rc-recipe-card:hover {
    background: var(--purple-100);
    border-color: var(--purple-300);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.rc-recipe-info {
    flex: 1;
}

.rc-recipe-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.rc-recipe-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

/* ---- Recipe Detail Page ---- */
.rc-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}


.rc-detail-body {
    padding: 28px 32px 32px;
}

.rc-detail-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.rc-detail-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.rc-detail-section {
    margin-bottom: 22px;
}

.rc-detail-section h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.rc-detail-section ul,
.rc-detail-section ol {
    padding-left: 20px;
}

.rc-detail-section li {
    padding: 5px 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.rc-detail-benefit {
    background: linear-gradient(135deg, #f3e8ff, #fce7f3);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border-left: 4px solid var(--purple-500);
}

.rc-detail-benefit strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: var(--purple-600);
}

.rc-detail-benefit p {
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .rc-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .rc-cat-img-wrap {
        height: 130px;
    }

    .rc-recipe-img-wrap {
        height: 120px;
    }

    .rc-detail-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .rc-grid {
        grid-template-columns: 1fr;
    }
}


/* ============ MENU ============ */
.menu-week {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.menu-day {
    margin-bottom: 0;
}

.menu-day-title {
    font-size: 1rem;
    font-weight: 800;
    padding: 10px 16px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.menu-meal {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 6px;
}

.menu-meal-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--purple-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 70px;
    flex-shrink: 0;
}

.menu-meal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============ SHOPPING ============ */
.shopping-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.shopping-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all 0.3s var(--ease);
}

.btn-icon:hover {
    transform: translateY(-2px);
}

.shopping-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.shopping-cat-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.shopping-item.checked {
    opacity: 0.5;
    text-decoration: line-through;
}

.shopping-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--purple-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.shopping-item.checked .shopping-check {
    background: var(--purple-500);
    border-color: var(--purple-500);
}

.shopping-check .material-icons-round {
    font-size: 16px;
    color: white;
    opacity: 0;
}

.shopping-item.checked .shopping-check .material-icons-round {
    opacity: 1;
}

.shopping-item-name {
    font-size: 0.88rem;
    font-weight: 500;
}

/* ============ SYMPTOM FORM ============ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.form-grid .full-span {
    grid-column: 1 / -1;
}

.form-grid .card {
    margin-bottom: 0;
}

.input-date {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    transition: border-color 0.3s;
}

.input-date:focus {
    border-color: var(--purple-400);
}

.level-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.level-btn {
    padding: 10px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.level-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.mood-selector {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    transition: all 0.3s;
    flex: 1;
    font-size: 1.5rem;
}

.mood-btn span {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
}

.mood-btn.active {
    border-color: var(--purple-400);
    background: var(--purple-100);
    transform: scale(1.05);
}

.text-area {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg);
    resize: vertical;
    outline: none;
}

.text-area:focus {
    border-color: var(--purple-400);
}

.btn-save-symptom {
    width: 100%;
    margin-top: 14px;
    background: var(--gradient-primary);
    color: white;
}

/* ============ HISTORY ============ */
.history-chart-wrap {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
}

.history-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.history-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--purple-500);
    min-width: 55px;
    text-align: center;
}

.history-details {
    flex: 1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

.history-badge.pain {
    background: #fee2e2;
    color: #b91c1c;
}

.history-badge.mood {
    background: var(--purple-100);
    color: var(--purple-600);
}

.history-badge.energy {
    background: var(--mint-100);
    color: #047857;
}

/* ============ PLAN ============ */
.plan-progress-wrap {
    margin-bottom: 20px;
}

.plan-progress-bar {
    height: 10px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.plan-progress-fill {
    height: 100%;
    background: var(--gradient-cool);
    border-radius: var(--radius-full);
    transition: width 0.5s var(--ease);
}

.plan-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.plan-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-cool);
    color: #064e3b;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.plan-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.plan-day-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.plan-day-card:hover {
    box-shadow: var(--shadow-md);
}

.plan-day-card.completed {
    border-color: var(--mint-300);
    background: var(--mint-100);
}

.plan-day-card.current {
    border-color: var(--purple-400);
    box-shadow: 0 0 25px rgba(155, 93, 229, 0.2);
}

.plan-day-card.locked {
    opacity: 0.5;
}

.plan-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.plan-day-num {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--purple-600);
}

.plan-day-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.plan-day-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.plan-day-checklist {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.plan-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.plan-check-item.done {
    text-decoration: line-through;
    opacity: 0.6;
}

.plan-check-item .check-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--purple-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plan-check-item.done .check-box {
    background: var(--mint-500);
    border-color: var(--mint-500);
}

.plan-check-item .check-box .material-icons-round {
    font-size: 14px;
    color: white;
    opacity: 0;
}

.plan-check-item.done .check-box .material-icons-round {
    opacity: 1;
}

/* ============ EXERCISES ============ */
.exercise-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.exercise-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 14px;
}

.exercise-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.exercise-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.8rem;
}

.exercise-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.exercise-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.exercise-meta {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.exercise-meta span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--purple-500);
    display: flex;
    align-items: center;
    gap: 3px;
}

.exercise-meta .material-icons-round {
    font-size: 14px;
}

/* ============ EDUCATION ============ */
.edu-topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.edu-topic-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 22px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.edu-topic-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.edu-topic-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.8rem;
}

.edu-topic-title {
    font-size: 1rem;
    font-weight: 700;
}

.edu-topic-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.edu-topic-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 6px;
}

/* ============ MODALS ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(26, 16, 37, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.3s;
}

@keyframes overlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    animation: modalScale 0.35s var(--ease);
    position: relative;
}

@keyframes modalScale {
    from {
        transform: scale(0.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--purple-100);
}

.modal-close .material-icons-round {
    font-size: 20px;
    color: var(--text-secondary);
}

/* Crisis modal */
.crisis-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.crisis-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.crisis-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.crisis-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.crisis-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.crisis-option:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.crisis-option-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crisis-option-icon .material-icons-round {
    font-size: 26px;
    color: white;
}

.crisis-option h4 {
    font-size: 0.92rem;
    font-weight: 700;
}

.crisis-option p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-back-crisis {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--purple-500);
    margin-bottom: 16px;
    padding: 8px 0;
}

.crisis-detail-content {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 22px;
    border: 1px solid var(--border);
}

.crisis-detail-content h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
}

.crisis-detail-content .step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.crisis-detail-content .step:last-child {
    border-bottom: none;
}

.step-num {
    width: 30px;
    height: 30px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.step-text strong {
    color: var(--text-primary);
}

.breathing-circle-wrap {
    text-align: center;
    padding: 30px 0;
}

.breathing-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    animation: breathe 11s ease-in-out infinite;
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.7;
    }

    36% {
        transform: scale(1.3);
        opacity: 1;
    }

    64% {
        transform: scale(1.3);
        opacity: 1;
    }

    82% {
        transform: scale(0.8);
        opacity: 0.7;
    }
}

.breathing-instruction {
    margin-top: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--purple-600);
}

/* Recipe / Exercise / Edu modals */
.recipe-detail-header,
.exercise-detail-header,
.edu-article-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.recipe-detail-emoji,
.exercise-detail-emoji,
.edu-article-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.recipe-detail-title,
.exercise-detail-title,
.edu-article-title {
    font-size: 1.3rem;
    font-weight: 800;
}

.recipe-detail-meta,
.exercise-detail-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.recipe-section {
    margin-bottom: 20px;
}

.recipe-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.recipe-section ul {
    list-style: none;
}

.recipe-section li {
    padding: 6px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    padding-left: 16px;
    position: relative;
}

.recipe-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--purple-400);
    font-weight: bold;
}

.recipe-section ol {
    padding-left: 20px;
}

.recipe-section ol li {
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.recipe-benefit-box {
    background: var(--mint-100);
    border: 1px solid var(--mint-200);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 0.85rem;
    color: #065f46;
    line-height: 1.5;
}

.exercise-steps {
    margin-top: 16px;
}

.exercise-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.exercise-step:last-child {
    border-bottom: none;
}

.exercise-step-num {
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.exercise-step-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.exercise-benefit-box {
    background: var(--purple-100);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--purple-700);
    line-height: 1.5;
}

.edu-article-body {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.edu-article-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.edu-article-body p {
    margin-bottom: 12px;
}

.edu-article-body ul {
    margin-bottom: 12px;
    padding-left: 20px;
}

.edu-article-body li {
    margin-bottom: 6px;
}

.edu-article-body .highlight-box {
    background: var(--purple-100);
    border-left: 4px solid var(--purple-500);
    padding: 14px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    font-size: 0.88rem;
    color: var(--purple-700);
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--bg-dark, #1a1025);
    color: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    z-index: 9000;
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s var(--ease);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 20px;
    color: var(--mint-400);
}

/* ============ INSIGHTS ============ */
.insight-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.insight-placeholder {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.insight-item {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-item .insight-emoji {
    font-size: 1.2rem;
    margin-right: 8px;
}

/* Plan preview */
.plan-preview-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plan-preview-item .material-icons-round {
    font-size: 18px;
    color: var(--mint-500);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--purple-200);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* ============ HISTORY CARDS ============ */
.history-chart-wrap {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    max-height: 220px;
    overflow: hidden;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
}

.history-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.history-empty h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 12px 0 6px;
}

.history-empty p {
    font-size: 0.88rem;
}

.hcard {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s var(--ease);
    animation: fadeIn 0.35s var(--ease);
}

.hcard:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.hcard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--gradient-primary);
    color: white;
}

.hcard-day-name {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    opacity: 0.85;
}

.hcard-date {
    font-size: 0.95rem;
    font-weight: 800;
}

.hcard-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hcard-delete:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: scale(1.1);
}

.hcard-delete .material-icons-round {
    font-size: 18px;
}

.hcard-pain-bar {
    position: relative;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.hcard-pain-level {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    opacity: 0.12;
    transition: width 0.5s var(--ease);
}

.hcard-pain-info {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hcard-pain-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.hcard-pain-value {
    font-size: 1.3rem;
    font-weight: 800;
}

.hcard-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.hcard-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 14px 6px;
    background: var(--bg-card);
    text-align: center;
}

.hcard-metric-emoji {
    font-size: 1.3rem;
}

.hcard-metric-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.hcard-metric-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hcard-notes-section {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
}

.hcard-notes-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--purple-500);
    margin-bottom: 6px;
}

.hcard-notes-title .material-icons-round {
    font-size: 16px;
}

.hcard-notes-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-line;
}

/* ============ RESPONSIVE — TABLET ============ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(calc(var(--sidebar-width) * -1));
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-wrap {
        margin-left: 0 !important;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .crisis-options {
        grid-template-columns: 1fr;
    }
}

/* ============ RESPONSIVE — MOBILE ============ */
@media (max-width: 640px) {
    .main-content {
        padding: 12px;
    }

    .top-bar {
        padding: 0 12px;
    }

    .top-bar h1 {
        font-size: 1.2rem;
    }

    /* Page header banners */
    .page-header-banner {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    .page-header-banner h2 {
        font-size: 1.15rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .page-header-banner p {
        font-size: 0.8rem;
    }

    /* Tab bar - scrollable */
    .tab-bar {
        gap: 6px;
        margin-bottom: 16px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    /* Food grid - single column */
    .food-grid {
        grid-template-columns: 1fr;
    }

    .food-item {
        padding: 12px;
    }

    .food-item-benefit {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }

    .food-cat-title {
        font-size: 0.9rem;
    }

    /* Recipe grid */
    .rc-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Summary stats */
    .summary-stats {
        gap: 8px;
    }

    .stat-item {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    /* Quick actions */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-action-item {
        padding: 14px 8px;
    }

    .quick-action-item span:last-child {
        font-size: 0.72rem;
    }

    /* Cards */
    .card {
        padding: 16px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    /* Crisis banner */
    .crisis-banner {
        padding: 14px 16px;
    }

    .crisis-banner strong {
        font-size: 0.88rem;
    }

    /* SOS button in top bar */
    .crisis-top {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    /* Menu week */
    .menu-week {
        grid-template-columns: 1fr;
    }

    .menu-meal {
        flex-wrap: wrap;
        gap: 4px 10px;
        padding: 8px 10px;
    }

    .menu-meal-label {
        font-size: 0.7rem;
        min-width: 60px;
    }

    .menu-meal-desc {
        font-size: 0.8rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .menu-day-title {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    /* Prevent horizontal overflow */
    .main-wrap {
        overflow-x: hidden;
    }

    .page {
        overflow-x: hidden;
        word-break: break-word;
    }

    .tab-content {
        overflow-x: hidden;
    }

    /* Recipes list */
    .recipes-list,
    .exercise-list,
    .edu-topics,
    .plan-timeline,
    .history-list,
    .shopping-list {
        grid-template-columns: 1fr;
    }

    /* Modal */
    .modal {
        max-width: 100%;
        margin: 12px;
        border-radius: var(--radius-md);
        max-height: 90vh;
    }

    .crisis-top-label {
        display: none;
    }

    /* Mood card emoji */
    .pain-emoji {
        font-size: 1.5rem;
    }

    /* Community */
    .community-post {
        padding: 16px;
    }

    /* Bonus pages */
    .bonus-content {
        padding: 0 4px;
    }
}

/* ============ BONUS PAGES ============ */
.bonus-banner-social {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bonus-banner-fertility {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bonus-banner-mental {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bonus-content {
    padding: 0 8px;
}

.bonus-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.bonus-section-header {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .2s;
}

.bonus-section-header:hover {
    background: var(--purple-100);
}

.bonus-section-icon {
    font-size: 1.6rem;
}

.bonus-section-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
}

.bonus-section-toggle {
    color: var(--text-muted);
    transition: transform .3s;
}

.bonus-section.open .bonus-section-toggle {
    transform: rotate(180deg);
}

.bonus-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
}

.bonus-section.open .bonus-section-body {
    max-height: 5000px;
}

.bonus-subsection {
    padding: 0 24px 20px;
}

.bonus-subsection h4 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--purple-500);
    margin-bottom: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.bonus-subsection:first-child h4 {
    border-top: none;
    padding-top: 0;
}

.bonus-subsection ul {
    list-style: none;
    padding: 0;
}

.bonus-subsection li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.bonus-subsection li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--purple-400);
}


/* ============ COMMUNITY ============ */
.community-banner {
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
}

.community-new-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.community-new-post-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: .92rem;
    transition: background .2s;
}

.community-new-post-header:hover {
    background: var(--purple-100);
}

.community-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-400), var(--purple-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .9rem;
    flex-shrink: 0;
}

.community-new-post-form {
    padding: 0 20px 20px;
}

.community-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .88rem;
    margin-bottom: 12px;
    outline: none;
}

.community-select:focus {
    border-color: var(--purple-400);
}

.community-textarea {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .9rem;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    outline: none;
    line-height: 1.6;
}

.community-textarea:focus {
    border-color: var(--purple-400);
}

.community-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.community-filter-btn {
    padding: 8px 16px;
    border-radius: 60px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.community-filter-btn:hover,
.community-filter-btn.active {
    background: var(--purple-500);
    color: #fff;
    border-color: var(--purple-500);
}

/* ---- Post Card ---- */
.community-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all .2s;
}

.community-post-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-400), var(--pink-500, #ec4899));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.community-post-author {
    font-weight: 700;
    font-size: .92rem;
}

.community-post-time {
    font-size: .75rem;
    color: var(--text-muted);
}

.community-post-badge {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 60px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.community-post-badge[data-cat="vitoria"] {
    background: rgba(16, 185, 129, .12);
    color: #10b981;
}

.community-post-badge[data-cat="dica"] {
    background: rgba(245, 158, 11, .12);
    color: #f59e0b;
}

.community-post-badge[data-cat="desabafo"] {
    background: rgba(147, 51, 234, .12);
    color: #9333ea;
}

.community-post-badge[data-cat="dor"] {
    background: rgba(239, 68, 68, .12);
    color: #ef4444;
}

.community-post-badge[data-cat="alimentacao"] {
    background: rgba(20, 184, 166, .12);
    color: #14b8a6;
}

.community-post-body {
    padding: 0 20px 16px;
    font-size: .9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
}

.community-post-actions {
    padding: 0 20px 12px;
    display: flex;
    gap: 16px;
}

.community-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.community-action-btn:hover {
    background: var(--purple-100);
    color: var(--purple-500);
}

.community-action-btn.liked {
    color: var(--pink-500, #ec4899);
}

.community-action-btn .material-icons-round {
    font-size: 1.1rem;
}

/* ---- Comments ---- */
.community-comments {
    background: var(--bg-main);
    border-top: 1px solid var(--border);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease, padding .3s;
}

.community-post.show-comments .community-comments {
    max-height: 2000px;
    padding: 16px 20px;
}

.community-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.community-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--purple-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-700);
    font-weight: 700;
    font-size: .65rem;
    flex-shrink: 0;
}

.community-comment-body {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.community-comment-author {
    font-weight: 700;
    font-size: .82rem;
    margin-bottom: 2px;
}

.community-comment-text {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.community-comment-time {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.community-comment-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.community-comment-input input {
    flex: 1;
    padding: 8px 14px;
    border-radius: 60px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .82rem;
    outline: none;
}

.community-comment-input input:focus {
    border-color: var(--purple-400);
}

.community-comment-input button {
    padding: 8px 14px;
    border-radius: 60px;
    border: none;
    background: var(--purple-500);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    transition: background .2s;
}

.community-comment-input button:hover {
    background: var(--purple-600);
}


/* ============ NUTRI IA CHAT ============ */
.nutri-banner {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
}

.nutri-chat-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 240px);
    min-height: 400px;
}

.nutri-chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nutri-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: msgIn .3s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nutri-msg-bot {
    align-self: flex-start;
}

.nutri-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.nutri-msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 2px solid var(--border);
}

.nutri-msg-user .nutri-msg-avatar {
    background: linear-gradient(135deg, var(--purple-400), var(--purple-600));
    border-color: var(--purple-400);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
}

.nutri-msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    position: relative;
}

.nutri-msg-user .nutri-msg-bubble {
    background: linear-gradient(135deg, var(--purple-500), var(--purple-600));
    border-color: var(--purple-500);
    color: #fff;
}

.nutri-msg-name {
    font-size: .75rem;
    font-weight: 700;
    color: var(--purple-500);
    margin-bottom: 4px;
}

.nutri-msg-user .nutri-msg-name {
    color: rgba(255, 255, 255, .7);
}

.nutri-msg-text {
    font-size: .9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.nutri-msg-user .nutri-msg-text {
    color: #fff;
}

.nutri-msg-text strong {
    color: var(--text-primary);
}

.nutri-msg-user .nutri-msg-text strong {
    color: #fff;
}

/* Suggestions */
.nutri-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0 16px;
}

.nutri-suggestion {
    padding: 8px 16px;
    border-radius: 60px;
    border: 1px solid var(--purple-300);
    background: var(--purple-100);
    color: var(--purple-600);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.nutri-suggestion:hover {
    background: var(--purple-500);
    color: #fff;
    border-color: var(--purple-500);
}

/* Input */
.nutri-input-wrap {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.nutri-input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 60px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .92rem;
    outline: none;
    transition: border-color .2s;
}

.nutri-input:focus {
    border-color: var(--purple-400);
}

.nutri-send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--purple-500), #ec4899);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.nutri-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(147, 51, 234, .3);
}

.nutri-send-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.nutri-disclaimer {
    font-size: .72rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0 8px;
}

/* Typing indicator */
.nutri-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.nutri-typing span {
    width: 8px;
    height: 8px;
    background: var(--purple-400);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.nutri-typing span:nth-child(2) {
    animation-delay: .2s;
}

.nutri-typing span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ============ SETTINGS PAGE ============ */
.settings-banner {
    background: linear-gradient(135deg, #5e5272, #7c5cbf);
}

.settings-section {
    margin-bottom: 16px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg);
    transition: all 0.3s var(--ease);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.settings-input:focus {
    outline: none;
    border-color: var(--purple-400);
    box-shadow: 0 0 0 3px rgba(124, 92, 191, 0.1);
}

.settings-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-pass-wrap .settings-input {
    padding-right: 48px;
}

.settings-pass-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.settings-pass-toggle:hover {
    color: var(--purple-500);
}

.settings-pass-strength {
    font-size: 0.75rem;
    font-weight: 600;
    min-height: 18px;
}

.settings-pass-strength.weak {
    color: #d4616e;
}

.settings-pass-strength.medium {
    color: #e8a030;
}

.settings-pass-strength.strong {
    color: #2d9e7e;
}

.settings-pass-match {
    font-size: 0.75rem;
    font-weight: 600;
    min-height: 18px;
}

.settings-pass-match.match {
    color: #2d9e7e;
}

.settings-pass-match.no-match {
    color: #d4616e;
}

.settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    font-family: inherit;
}

.settings-btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.settings-btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.settings-btn-danger {
    background: transparent;
    color: #d4616e;
    border: 1px solid #d4616e;
}

.settings-btn-danger:hover {
    background: #d4616e;
    color: white;
}

/* Toggle switches */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.settings-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-toggle-item:last-child {
    border-bottom: none;
}

.settings-toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-toggle-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.settings-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.settings-slider {
    background: var(--purple-500);
}

input:checked+.settings-slider:before {
    transform: translateX(22px);
}

/* About */
.settings-about {
    padding: 12px 0;
}

.settings-about p {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-about-desc {
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    margin-top: 4px;
}

/* ============ MENSTRUAL CALENDAR ============ */
.cycle-banner {
    background: linear-gradient(135deg, #c97da5, #7c5cbf);
}

.cycle-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cycle-info-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.cycle-info-item .material-icons-round {
    font-size: 1.4rem;
}

.cycle-info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 2px;
}

.cycle-info-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cycle-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cycle-month-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cycle-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.cycle-nav-btn:hover {
    background: var(--purple-100);
    color: var(--purple-500);
}

.cycle-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cycle-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cycle-day {
    text-align: center;
    padding: 8px 4px;
    font-size: 0.82rem;
    border-radius: 50%;
    cursor: default;
    transition: 0.2s;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.cycle-day.empty {
    visibility: hidden;
}

.cycle-day.today {
    font-weight: 700;
    box-shadow: inset 0 0 0 2px var(--purple-400);
}

.cycle-day.period {
    background: rgba(201, 125, 165, 0.25);
    color: #a0456e;
    font-weight: 600;
}

.cycle-day.fertile {
    background: rgba(45, 158, 126, 0.15);
    color: #2d9e7e;
}

.cycle-day.ovulation {
    background: #e8a030;
    color: white;
    font-weight: 700;
}

.cycle-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cycle-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.cycle-dot-period {
    background: rgba(201, 125, 165, 0.5);
}

.cycle-dot-fertile {
    background: rgba(45, 158, 126, 0.3);
}

.cycle-dot-ovulation {
    background: #e8a030;
}

.cycle-phase-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.cycle-phase-card ul {
    margin-top: 8px;
    padding-left: 0;
    list-style: none;
}

.cycle-phase-card li {
    padding: 4px 0;
    font-size: 0.85rem;
}

/* ============ EMOTIONAL DIARY ============ */
.diary-banner {
    background: linear-gradient(135deg, #a78bda, #c97da5);
}

.diary-moods {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.diary-mood-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    min-width: 60px;
}

.diary-mood-btn span {
    font-size: 1.5rem;
    display: block;
}

.diary-mood-btn small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.diary-mood-btn:hover {
    border-color: var(--purple-300);
    transform: translateY(-2px);
}

.diary-mood-btn.active {
    border-color: var(--purple-500);
    background: var(--purple-50);
    box-shadow: 0 0 0 3px rgba(124, 92, 191, 0.15);
}

.diary-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    color: var(--text-primary);
    background: var(--bg);
    box-sizing: border-box;
    transition: 0.3s;
}

.diary-textarea:focus {
    outline: none;
    border-color: var(--purple-400);
    box-shadow: 0 0 0 3px rgba(124, 92, 191, 0.1);
}

.diary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.diary-tag {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-secondary);
    user-select: none;
}

.diary-tag:hover {
    border-color: var(--purple-300);
}

.diary-tag.active {
    background: var(--purple-100);
    border-color: var(--purple-400);
    color: var(--purple-600);
    font-weight: 600;
}

.diary-entry {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: 0.2s;
}

.diary-entry:hover {
    box-shadow: var(--shadow-sm);
}

.diary-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.diary-entry-emoji {
    font-size: 1.4rem;
}

.diary-entry-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.diary-entry-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 8px;
    line-height: 1.5;
}

.diary-entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.diary-entry-tag {
    padding: 2px 10px;
    background: var(--purple-50);
    color: var(--purple-500);
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
}

/* ============ MEDITATIONS ============ */
.meditation-banner {
    background: linear-gradient(135deg, #5b5ea6, #7c5cbf);
}

.meditation-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.meditation-tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
    color: var(--text-secondary);
    font-family: inherit;
}

.meditation-tab.active {
    background: var(--purple-500);
    color: white;
    border-color: var(--purple-500);
}

.meditation-card {
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-bottom: 10px;
}

.meditation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.meditation-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.meditation-emoji {
    font-size: 2rem;
}

.meditation-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.meditation-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meditation-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ============ GUT HEALTH ============ */
.gut-banner {
    background: linear-gradient(135deg, #2d9e7e, #3d8fc0);
}

.gut-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.gut-tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
    color: var(--text-secondary);
    font-family: inherit;
}

.gut-tab.active {
    background: #2d9e7e;
    color: white;
    border-color: #2d9e7e;
}

.gut-panel {
    display: none;
}

.gut-panel.active {
    display: block;
}

/* Quiz */
.gut-quiz-question {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.gut-quiz-q {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gut-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gut-quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.82rem;
}

.gut-quiz-option:hover {
    border-color: #2d9e7e;
    background: rgba(45, 158, 126, 0.05);
}

.gut-quiz-option input[type="radio"] {
    accent-color: #2d9e7e;
}

.gut-quiz-result-card {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.gut-quiz-result-card h4 {
    margin-bottom: 8px;
}

.gut-quiz-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.gut-quiz-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s;
}

/* Foods */
.gut-foods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.gut-food-card {
    text-align: center;
    padding: 14px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: 0.2s;
}

.gut-food-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.gut-food-emoji {
    font-size: 2rem;
    margin-bottom: 4px;
}

.gut-food-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gut-food-benefit {
    font-size: 0.7rem;
    color: #2d9e7e;
    font-weight: 600;
    margin: 2px 0;
}

.gut-food-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Protocol */
.gut-protocol-week {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.gut-protocol-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gut-protocol-emoji {
    font-size: 1.6rem;
}

.gut-protocol-header strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.gut-protocol-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 6px;
}

.gut-protocol-tasks {
    padding-left: 18px;
}

.gut-protocol-tasks li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

/* Tips */
.gut-tip-card {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.gut-tip-card:last-child {
    border-bottom: none;
}

.gut-tip-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.gut-tip-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.gut-tip-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============ MEDITATION AUDIO PLAYER ============ */
.med-player {
    background: linear-gradient(135deg, #5b5ea6, #7c5cbf);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 12px 0;
}

.med-player-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.med-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #7c5cbf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: 0.2s;
}

.med-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.med-play-btn .material-icons-round {
    font-size: 1.6rem;
}

.med-player-info {
    flex: 1;
    min-width: 0;
}

.med-player-times {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.med-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.med-progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s;
}

/* ============ MOBILE COMPACT ============ */
@media (max-width: 640px) {

    /* Page header banners */
    .page-header-banner {
        padding: 16px 14px !important;
        margin-bottom: 10px !important;
        border-radius: 12px !important;
    }

    .page-header-banner h2 {
        font-size: 1.1rem !important;
    }

    .page-header-banner p {
        font-size: 0.78rem !important;
    }

    /* All tab bars */
    .tab-bar,
    .meditation-tabs,
    .gut-tabs {
        gap: 4px !important;
        padding: 3px !important;
        margin-bottom: 10px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .tab,
    .meditation-tab,
    .gut-tab {
        padding: 6px 10px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Main content area */
    .main-content {
        padding: 8px !important;
    }

    .page {
        padding: 0 !important;
    }

    /* Food page */
    .food-cat-title {
        font-size: 0.85rem !important;
        margin: 8px 0 4px !important;
    }

    .food-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }

    .food-item {
        padding: 8px !important;
        gap: 6px !important;
        border-radius: 8px !important;
    }

    .food-item-emoji {
        font-size: 1.2rem !important;
    }

    .food-item-name {
        font-size: 0.72rem !important;
    }

    .food-item-benefit {
        font-size: 0.62rem !important;
        display: none !important;
    }

    .food-category {
        margin-bottom: 8px !important;
    }

    /* Recipes */
    .recipes-list .recipe-card,
    .recipe-item {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    /* Meditation items */
    .meditation-list .meditation-item {
        padding: 12px !important;
        margin-bottom: 6px !important;
    }

    .meditation-item h4 {
        font-size: 0.88rem !important;
    }

    .meditation-item p {
        font-size: 0.73rem !important;
    }

    .med-info span {
        font-size: 0.7rem !important;
    }

    /* Gut health panels */
    .gut-panel .card {
        padding: 12px !important;
    }

    .gut-panel .card-title {
        font-size: 0.95rem !important;
    }

    .gut-quiz-question {
        margin-bottom: 10px !important;
    }

    .gut-quiz-question p {
        font-size: 0.82rem !important;
    }

    .gut-quiz-option {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
        margin-bottom: 4px !important;
    }

    .gut-food-card,
    .gut-protocol-step,
    .gut-tip-card {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    /* Cards gerais */
    .card {
        padding: 12px !important;
        margin-bottom: 8px !important;
        border-radius: 12px !important;
    }

    .card-title {
        font-size: 0.92rem !important;
    }

    /* Header */
    .header {
        padding: 8px 12px !important;
    }

    .header-greeting h1 {
        font-size: 1rem !important;
    }

    .header-greeting p {
        font-size: 0.73rem !important;
    }

    /* Settings */
    .settings-card {
        padding: 14px !important;
        margin-bottom: 10px !important;
    }

    .settings-card h3 {
        font-size: 0.95rem !important;
    }

    .settings-card label {
        font-size: 0.76rem !important;
    }

    .settings-card input {
        padding: 9px !important;
        font-size: 0.82rem !important;
    }

    /* Exercise page */
    .exercise-card {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    .exercise-card h4 {
        font-size: 0.82rem !important;
    }

    /* Bonus / Guide pages */
    .bonus-accordion {
        margin-bottom: 6px !important;
    }

    .bonus-accordion-header {
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
    }

    .bonus-accordion-body {
        padding: 8px 12px !important;
    }

    .bonus-accordion-body h4 {
        font-size: 0.82rem !important;
    }

    .bonus-accordion-body li,
    .bonus-accordion-body p {
        font-size: 0.76rem !important;
        line-height: 1.4 !important;
    }

    /* Community */
    .community-post {
        padding: 12px !important;
        margin-bottom: 8px !important;
    }

    .community-post-text {
        font-size: 0.8rem !important;
    }

    .community-filter-btn {
        padding: 5px 8px !important;
        font-size: 0.7rem !important;
    }

    /* Symptom tracker */
    .hcard {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    .hcard-header {
        margin-bottom: 8px !important;
    }

    .hcard-day-name {
        font-size: 0.75rem !important;
    }

    .hcard-date {
        font-size: 0.7rem !important;
    }

    .hcard-metrics {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }

    .hcard-metric {
        padding: 4px !important;
    }

    .hcard-metric-emoji {
        font-size: 1rem !important;
    }

    .hcard-metric-label {
        font-size: 0.6rem !important;
    }

    .hcard-metric-value {
        font-size: 0.68rem !important;
    }

    /* Diary */
    .diary-entry-card {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    /* Cycle calendar */
    .cycle-calendar .cal-day {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.72rem !important;
    }

    /* Quick actions on home */
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .quick-action-item {
        padding: 10px 8px !important;
    }

    .quick-action-item span.material-icons-round {
        font-size: 22px !important;
    }

    .quick-action-item p {
        font-size: 0.7rem !important;
    }

    /* SOS button */
    .sos-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 0.65rem !important;
    }
}