:root {
    --primary-bg: #0a0e27;
    --secondary-bg: #141b3a;
    --card-bg: #1a2342;
    --accent-primary: #8b5cf6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-title: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
    --input-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.app-container {
    display: flex;
    width: 100%;
    flex: 1;
}

.sidebar {
    width: 270px;
    background: var(--secondary-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: 25px;
    padding-bottom: 80px;
    z-index: 1001;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 0 30px 0 30px;
    width: calc(100% - 270px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 10px;
}

.page-title-display {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    margin-right: 15px;
    cursor: pointer;
    padding: 5px;
}

.nav-menu {
    list-style: none;
    margin-top: 30px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    font-weight: 600;
}

.glass-card,
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.glass-card {
    background: rgba(26, 35, 66, 0.6);
    backdrop-filter: blur(12px);
}

.card:hover,
.glass-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.input-group {
    margin-bottom: 20px;
}



.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.input-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    line-height: 1.5;
    margin-bottom: 0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    cursor: pointer;
}

.form-select option {
    background: #141b3a;
    color: white;
}

.btn-block {
    width: 100%;
    padding: 16px;
    background: var(--gradient-title);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-block:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    border: none;
}

.category-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px;
    margin-bottom: 25px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: 0.2s;
    cursor: pointer;
    min-width: 70px;
}

.cat-item.active {
    opacity: 1;
    transform: translateY(-5px);
}

.cat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 2px solid transparent;
}

.cat-item.active .cat-icon {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.type-switch {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 5px;
    margin: 0 auto 20px auto;
    width: fit-content;
}

.type-btn {
    padding: 10px 30px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.type-btn.active.expense {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

.type-btn.active.income {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 992px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sum-card {
        padding: 12px;
        min-width: unset;
    }

    .sum-card .value {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 350px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.sum-card {
    padding: 15px;
    border-radius: 16px;
    color: white;
    min-width: 140px;
}

.sum-card h4 {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.sum-card .value {
    font-size: 1.3rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th {
    text-align: left;
    padding: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 600;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center;
}

.app-footer {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 25px 20px;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 0.9rem;
}

.footer-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    overflow: hidden;
}

canvas {
    max-width: 100% !important;
}

.user-profile {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

/* --- LANGUAGE SWITCHER REFINEMENT --- */
.language-switcher-wrapper {
    display: flex;
    justify-content: flex-start;
    padding-left: 10px;
    margin-bottom: 25px;
}

.language-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.lang-btn {
    padding: 6px 16px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.lang-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.lang-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid var(--accent-primary);
    object-fit: cover;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: white;
    color: #333;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-login:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ef4444;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

.soul-wrapper {
    font-family: 'Nunito', sans-serif;
    color: #f1f1f1;
}

.brand-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    background: linear-gradient(to right, #d946ef, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(217, 70, 239, 0.5));
    text-align: center;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.status-badge {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 9999px;
    border-width: 1px;
    border-style: solid;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    -webkit-text-fill-color: initial;
    /* Reset gradient text if inherited */
    display: inline-flex;
    align-items: center;
    line-height: 1;
    height: fit-content;
}

.status-badge.live {
    background-color: #db2777;
    /* bg-pink-600 */
    color: #000000 !important;
    /* Force text color */
    border-color: #f472b6;
    /* border-pink-400 */
    box-shadow: 0 0 10px rgba(219, 39, 119, 0.8);
}

.status-badge.offline {
    background-color: #334155;
    /* bg-slate-700 */
    color: #94a3b8 !important;
    /* text-slate-400 */
    border-color: #475569;
    /* border-slate-600 */
    box-shadow: none;
}

.brand-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #e2e8f0;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
    opacity: 0.9;
}

.emoji-container {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    overflow-x: auto;
    padding: 5px;
    scrollbar-width: none;
}

.emoji-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.5;
    cursor: pointer;
    border-radius: 12px;
    padding: 6px;
    min-width: 48px;
    border: 1px solid transparent;
}

.emoji-btn:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
}

.emoji-btn.active {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(217, 70, 239, 0.15);
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.4);
    border-color: #d946ef;
}

.emoji-label {
    font-size: 9px;
    margin-top: 4px;
    color: #cbd5e1;
    white-space: nowrap;
    font-weight: 600;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fancy-greeting {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 14px 24px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.4;
    max-width: 100%;
    color: #f59e0b;
}

.fancy-greeting .text-gradient {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0 15px 0 15px;
    }

    .btn-sidebar-toggle {
        display: block;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .sum-card .value {
        font-size: 1.1rem;
    }

    .page-title-display {
        font-size: 1.3rem;
    }

    .big-amount-input {
        font-size: 2.5rem !important;
    }

    .type-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .card,
    .glass-card {
        padding: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .currency-selector {
        max-width: 100px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* --- HÔM NAY ĂN GÌ MODULE --- */
.wheel-outer-container {
    position: relative;
    width: 380px;
    height: 380px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(139, 92, 246, 0.2);
}

.wheel-canvas-box {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.1);
}

#foodWheel {
    border-radius: 50%;
    transition: transform 4s cubic-bezier(0.15, 0, 0.15, 1);
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ff6b6b;
    z-index: 100;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.food-result-card {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.food-result-card.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.food-result-card h2 {
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

@media (max-width: 480px) {
    .wheel-outer-container {
        width: 310px;
        height: 310px;
    }
}

:root {
    --primary-bg: #0a0e27;
    --secondary-bg: #141b3a;
    --card-bg: #1a2342;
    --accent-primary: #8b5cf6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-title: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
    --input-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.app-container {
    display: flex;
    width: 100%;
    flex: 1;
}

.sidebar {
    width: 270px;
    background: var(--secondary-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: 25px;
    padding-bottom: 80px;
    z-index: 1001;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 0 30px 0 30px;
    width: calc(100% - 270px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.page-title-display {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    margin-right: 15px;
    cursor: pointer;
    padding: 5px;
}

.nav-menu {
    list-style: none;
    margin-top: 30px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    font-weight: 600;
}

.glass-card,
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.glass-card {
    background: rgba(26, 35, 66, 0.6);
    backdrop-filter: blur(12px);
}

.card:hover,
.glass-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    line-height: 1.5;
    margin-bottom: 0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
    cursor: pointer;
}

.form-select option {
    background: #141b3a;
    color: white;
}

.btn-block {
    width: 100%;
    padding: 16px;
    background: var(--gradient-title);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    text-align: center;
}

.btn-block:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    border: none;
}

.category-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px;
    margin-bottom: 25px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: 0.2s;
    cursor: pointer;
    min-width: 70px;
}

.cat-item.active {
    opacity: 1;
    transform: translateY(-5px);
}

.cat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 2px solid transparent;
}

.cat-item.active .cat-icon {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.type-switch {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 5px;
    margin: 0 auto 20px auto;
    width: fit-content;
}

.type-btn {
    padding: 10px 30px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.type-btn.active.expense {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

.type-btn.active.income {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.sum-card {
    padding: 15px;
    border-radius: 16px;
    color: white;
}

.sum-card h4 {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.sum-card .value {
    font-size: 1.3rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th {
    text-align: left;
    padding: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 600;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center;
}

.app-footer {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 25px 20px;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 0.9rem;
}

.footer-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    overflow: hidden;
}

canvas {
    max-width: 100% !important;
}

.user-profile {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

/* --- LANGUAGE SWITCHER REFINEMENT --- */
.language-switcher-wrapper {
    display: flex;
    justify-content: flex-start;
    padding-left: 10px;
    margin-bottom: 25px;
}

.language-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.lang-btn {
    padding: 6px 16px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.lang-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.lang-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid var(--accent-primary);
    object-fit: cover;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: white;
    color: #333;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-login:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ef4444;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

.soul-wrapper {
    font-family: 'Nunito', sans-serif;
    color: #f1f1f1;
}

.brand-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    background: linear-gradient(to right, #d946ef, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(217, 70, 239, 0.5));
    text-align: center;
    margin-bottom: 5px;
}

.brand-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #e2e8f0;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
    opacity: 0.9;
}

.emoji-container {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    overflow-x: auto;
    padding: 5px;
    scrollbar-width: none;
}

.emoji-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.5;
    cursor: pointer;
    border-radius: 12px;
    padding: 6px;
    min-width: 48px;
    border: 1px solid transparent;
}

.emoji-btn:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
}

.emoji-btn.active {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(217, 70, 239, 0.15);
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.4);
    border-color: #d946ef;
}

.emoji-label {
    font-size: 9px;
    margin-top: 4px;
    color: #cbd5e1;
    white-space: nowrap;
    font-weight: 600;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fancy-greeting {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 14px 24px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.4;
    max-width: 100%;
    color: #f59e0b;
}

.fancy-greeting .text-gradient {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0 15px 0 15px;
    }

    .btn-sidebar-toggle {
        display: block;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .sum-card .value {
        font-size: 1.1rem;
    }

    .page-title-display {
        font-size: 1.3rem;
    }

    .big-amount-input {
        font-size: 2.5rem !important;
    }

    .type-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .card,
    .glass-card {
        padding: 10px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .food-modal-overlay {
        padding-left: 20px !important;
        /* Reset centering for mobile */
    }
}

/* --- HÔM NAY ĂN GÌ MODULE --- */
.wheel-outer-container {
    position: relative;
    width: 380px;
    height: 380px;
    margin: 40px auto;
    background: transparent;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(139, 92, 246, 0.2);
}

.wheel-canvas-box {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.1);
}

#foodWheel {
    border-radius: 50%;
    transition: transform 18s cubic-bezier(0.15, 0, 0.15, 1);
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ff6b6b;
    z-index: 100;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* --- USER AREA & LOGIN --- */
.user-profile {
    width: 100%;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-login i {
    font-size: 1.1rem;
}

/* --- OVERLAYS --- */
.universe-overlay,
.offline-overlay-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.98);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.food-result-card {
    max-width: 400px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 179, 71, 0.5);
    box-shadow: 0 0 50px rgba(255, 179, 71, 0.3);
    transform: scale(0);
}

.food-modal-overlay.active .food-result-card {
    animation: modalPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.food-result-card h2 {
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

/* --- Improved Food Modal V2 --- */
.food-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.food-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.food-modal-content {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    max-width: 450px;
    width: 100%;
    padding: 40px 30px 30px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.winner-icon {
    font-size: 3rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5));
}

.food-title-gradient {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
}

.food-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.food-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.food-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.food-info-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.food-combo-text {
    color: #10b981;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.food-note-text {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    font-style: italic;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-share {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    transition: all 0.3s;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(16, 185, 129, 0.4);
}

@media (max-width: 480px) {
    .wheel-outer-container {
        width: 310px;
        height: 310px;
    }
}

/* --- ENHANCEMENTS --- */
.starfield-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #05070a;
    overflow: hidden;
    z-index: 0;
}

.starfield-bg::before,
.starfield-bg::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-repeat: repeat;
    background-size: 250px 250px;
}

.starfield-bg::before {
    background-image:
        radial-gradient(1px 1px at 25px 25px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 150px 150px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 100px 250px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.2px 1.2px at 200px 50px, #fff, rgba(0, 0, 0, 0));
    animation: rotateStars 120s linear infinite, twinkle 4s ease-in-out infinite alternate;
    opacity: 0.4;
}

.starfield-bg::after {
    background-image:
        radial-gradient(2px 2px at 50px 80px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 180px 190px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 120px 40px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2.5px 2.5px at 240px 140px, #fff, rgba(0, 0, 0, 0));
    animation: rotateStars 90s linear infinite, twinkle 3s ease-in-out infinite alternate-reverse;
    opacity: 0.7;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

@keyframes rotateStars {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#spinFoodBtn {
    position: relative;
    overflow: hidden;
}

#spinFoodBtn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    30% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

/* === Login Button Neon Glow Effect === */
.btn-login {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%) !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    border: 2px solid #5eead4 !important;
    box-shadow:
        0 0 20px rgba(45, 212, 191, 0.5),
        0 0 40px rgba(45, 212, 191, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease !important;
    animation: neon-pulse 2s ease-in-out infinite !important;
}

.btn-login:hover {
    background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 100%) !important;
    box-shadow:
        0 0 30px rgba(45, 212, 191, 0.8),
        0 0 60px rgba(45, 212, 191, 0.5),
        0 0 80px rgba(45, 212, 191, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.btn-login:active {
    transform: translateY(0) scale(0.98) !important;
}

@keyframes neon-pulse {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(45, 212, 191, 0.5),
            0 0 40px rgba(45, 212, 191, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow:
            0 0 30px rgba(45, 212, 191, 0.7),
            0 0 50px rgba(45, 212, 191, 0.4),
            0 0 70px rgba(45, 212, 191, 0.2),
            inset 0 0 25px rgba(255, 255, 255, 0.15);
    }
}

/*  === GUIDE SECTION V1 STYLES === */
.guide-policy-box {
    border: 1px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.guide-policy-title {
    color: #10b981;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-warning {
    color: #ef4444;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 0;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    border-radius: 8px;
}

.guide-section-header {
    color: var(--accent-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    font-size: 1.3rem;
}

#tab-guide .card {
    margin-bottom: 15px;
}

#tab-guide ul {
    padding-left: 20px;
}

#tab-guide li {
    margin-bottom: 10px;
    line-height: 1.8;
}

#tab-guide b {
    color: var(--text-primary);
    font-weight: 700;
}

/* Currency Selector Enhancements */
.currency-selector {
    background-color: rgba(30, 41, 59, 0.8) !important;
    color: #f8fafc !important;
    /* Ensure bright text */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.currency-selector:hover {
    background-color: rgba(30, 41, 59, 1) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.currency-selector option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    padding: 12px;
}

/* === FOOD MODAL V2 (EXACT MATCH) === */
.food-modal-content.v2-style {
    padding: 0;
    overflow: hidden;
    background: #0f172a;
    /* Dark Blue Body Base */
    border: 2px solid #fbbf24;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.2);
}

.v2-modal-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    padding: 20px 10px;
    text-align: center;
    border-bottom: 2px solid #b45309;
}

.v2-modal-header h2 {
    color: #1e3a8a;
    /* Dark Text on Gold */
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.v2-modal-body {
    padding: 25px 20px 10px;
    text-align: center;
}

.v2-winner-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ef4444;
    /* Reddish text */
    margin-bottom: 20px;
    line-height: 1.4;
}

.v2-food-name {
    display: inline;
    /* Keep on same line flow if needed, or block */
    color: #f87171;
    text-transform: capitalize;
}

.v2-image-container {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.v2-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-enjoy-label {
    color: #34d399;
    /* Green text */
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.v2-note-box {
    background: rgba(255, 255, 255, 0.05);
    /* Very dark box */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.v2-modal-footer {
    padding: 0 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-action-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

@media (max-width: 480px) {
    .v2-action-row {
        flex-direction: column;
    }

    .btn-v2-share.main-share {
        order: 1;
    }

    .btn-v2-close {
        order: 2;
    }
}

.btn-v2-share {
    flex: 1;
    background: #10b981;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 #059669;
    transition: transform 0.1s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-v2-share:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #059669;
}

.btn-v2-share.zalo {
    background: #0068ff;
    box-shadow: 0 4px 0 #0055d4;
}

.btn-v2-share.zalo:active {
    box-shadow: 0 2px 0 #0055d4;
}

.btn-v2-share.fb {
    background: #1877f2;
    box-shadow: 0 4px 0 #145dbf;
}

.btn-v2-share.fb:active {
    box-shadow: 0 2px 0 #145dbf;
}

.btn-v2-share.main-share {
    flex: 2;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 0 #047857;
    min-height: 50px;
    position: relative;
    overflow: visible;
}

.btn-v2-share.main-share:active {
    box-shadow: 0 2px 0 #047857;
}

/* Custom Share Popover - Desktop Only */
.v2-share-popover {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 180px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

@media (max-width: 1024px) {
    .v2-share-popover {
        display: none !important;
    }

    .btn-v2-share.main-share {
        overflow: hidden !important;
    }
}

.v2-share-popover.active {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.v2-share-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(30, 41, 59, 0.95);
}

.popover-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    transition: background 0.2s;
    cursor: pointer;
    text-align: left;
}

.popover-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.popover-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.btn-v2-close {
    flex: 1;
    background: #475569;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 #334155;
    transition: transform 0.1s;
}

.btn-v2-close:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #334155;
}

/* === UNIVERSE LIMIT OVERLAY V2 === */
.universe-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.universe-content {
    background: transparent;
    padding: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.universe-content h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.universe-content p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-universe-login {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn-universe-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.btn-universe-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s;
}

.btn-universe-close:hover {
    color: #94a3b8;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* === UNIVERSE LIMIT OVERLAY V2 (MATCHED) === */
.universe-icon {
    font-size: 4rem;
    color: #a29bfe;
    margin-bottom: 20px;
}

.universe-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: none;
    /* V2 doesn't enforce uppercase here based on inline styles */
    letter-spacing: normal;
}

.universe-content p {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 30px;
    max-width: 400px;
    line-height: 1.5;
}

.btn-universe-actions {
    display: flex;
    gap: 15px;
}

.btn-universe-close {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    color: white;
    cursor: pointer;
    text-decoration: none;
    /* Reset underline */
    font-size: 1rem;
}

.btn-universe-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-universe-login {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    color: white;
    cursor: pointer;
    display: inline-block;
    font-size: 1rem;
    margin-right: 0;
    /* Reset */
}

.btn-universe-login:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(162, 155, 254, 0.4);
}

/* === V2 FOOD MODAL STYLES (MATCHED) === */
.food-modal-content.v2-style {
    background: #0f172a;
    /* Dark blue bg */
    border: 1px solid rgba(251, 191, 36, 0.5);
    /* Gold border to match header */
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
    /* Restored for perfect centering */
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
    /* Static aura */
    position: relative;
    text-align: center;
    animation: glow-pulse 2s infinite alternate;
    /* V2 Pulse Effect */
}

@keyframes glow-pulse {
    from {
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    }

    to {
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
    }
}

.food-modal-content.v2-style {
    transition: all 0.3s ease;
}

.food-modal-content.v2-style:hover {
    border-color: #d946ef;
    /* Purple-500 */
    box-shadow: 0 0 40px rgba(217, 70, 239, 0.7);
    /* Purple Glow */
}

.v2-modal-header {
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
    padding: 15px;
    text-align: center;
}

.v2-modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

.v2-modal-body {
    padding: 20px;
    background: #0f172a;
}

.v2-winner-label {
    font-size: 1rem;
    color: #fbbf24;
    margin-bottom: 15px;
    font-weight: 700;
}

.v2-food-name {
    display: block;
    font-size: 1.5rem;
    color: #fff;
    margin-top: 5px;
}

.v2-image-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.v2-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-combo-text {
    color: #4ade80 !important;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
    min-height: 20px;
    /* Ensure valid height even if empty initially */
}

.v2-note-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.v2-modal-footer {
    padding: 2px;
    /* Slight padding if needed */
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-v2-share {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
}

.btn-v2-close {
    background: #475569;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 0.5;
}

/* === V2 FOOD MODAL EXACT MATCH === */
.food-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.food-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.food-modal-content.v2-style {
    background: #0f172a;
    /* Dark blue bg */
    border: 2px solid #fbbf24;
    /* Golden Border */
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
    /* Perfect centering */
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.2);
    position: relative;
    text-align: center;
    /* Pop out from center */
    transform: scale(0);
    animation: popOutCenter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popOutCenter {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.v2-modal-header {
    background: #fbbf24;
    /* Solid Gold/Orange */
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid #d97706;
}

.v2-modal-header h2 {
    margin: 0;
    color: #1e293b;
    /* Dark text on gold */
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
}

.v2-modal-body {
    padding: 25px 20px;
}

.v2-winner-label {
    font-size: 1.1rem;
    color: #f87171;
    /* Reddish pink title */
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.v2-food-name {
    display: block;
    font-size: 1.4rem;
    color: #f87171;
    /* Match title color or slightly lighter? Screenshot shows consistent reddish/pink */
    margin-top: 5px;
    text-transform: capitalize;
}

.v2-image-container {
    width: 100%;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 15px;
    /* Rounded Rectangle, NOT circle */
    overflow: hidden;
    border: none;
    /* Screenshot doesn't show border on image */
}

.v2-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-enjoy-label {
    color: #4ade80;
    /* Green */
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 15px;
}

.v2-note-box {
    background: rgba(30, 41, 59, 1);
    /* Darker slate box */
    padding: 15px;
    border-radius: 10px;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.v2-modal-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-bottom: 10px;
}

.btn-v2-share {
    background: #10b981;
    /* Green */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    flex: 1.5;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-v2-close {
    background: #475569;
    /* Gray */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    flex: 0.8;
    font-size: 1rem;
}

/* === AGGRESSIVE MOBILE FIXES === */
@media (max-width: 768px) {
    #tab-invest .form-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    #tab-invest .summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    #tab-invest .sum-card {
        padding: 10px !important;
    }

    #tab-invest .sum-card .value {
        font-size: 1.1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 400px) {
    #tab-invest .sum-card .value {
        font-size: 1rem !important;
    }
}

/* --- HISTORY HEADER OPTIMIZATION --- */
.history-header-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 640px) {
    .history-header-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .history-header-grid h3 {
        text-align: center !important;
        width: 100%;
    }

    .history-header-grid .search-wrapper {
        order: 2;
        width: 100% !important;
    }

    .history-header-grid .filter-wrapper {
        order: 1;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .history-header-grid .form-select {
        flex: 1;
    }
}