:root {
    /* --- Primary: Emerald Green (Nutrisi) --- */
    --color-primary: #10B981;
    --color-primary-hover: #059669;
    --color-primary-light: #D1FAE5;

    /* --- Secondary: Royal Navy (Payment) --- */
    --color-secondary: #1E3A8A;
    --color-secondary-hover: #172554;
    --color-secondary-light: #DBEAFE;

    /* --- Accent: Amber (Highlight) --- */
    --color-accent: #F59E0B;

    /* --- Neutral Colors --- */
    --color-bg-app: #F9FAFB;
    --color-bg-container: #FFFFFF;
    --color-text-main: #111827;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;

    /* --- Functional Status --- */
    --color-error: #EF4444;
    --color-success: #10B981;
    --color-warning: #F59E0B;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-secondary-light) 100%);
    color: var(--color-text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    background: var(--color-bg-container);
    backdrop-filter: blur(12px);
    padding: 1rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

/* LOGO */
.logo {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

/* BUTTONS */
.btn-food {
    background: var(--color-primary);
    color: white;
    padding: 1rem 1.2rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 700;
    width: 100%;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    font-size: 1rem;
    font-family: inherit;
}

.btn {
    background: var(--color-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 700;
    width: 100%;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    font-size: 1rem;
    font-family: inherit;
}

.btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--color-primary-light);
}

.btn-danger {
    background: var(--color-error);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #DC2626;
}

/* GOOGLE BUTTON */
.google-btn {
    background: white;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.google-btn:hover {
    background: var(--color-bg-app);
    border-color: var(--color-primary);
}

.google-btn img {
    width: 24px;
    height: 24px;
}

/* TABS */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--color-bg-app);
    border-radius: 1rem;
    display: inline-flex;
    border: 1px solid var(--color-border);
}

.tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-radius: 0.75rem;
}

.tab-btn.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* UPLOAD BOX */
.upload-box {
    border: 2px dashed var(--color-border);
    border-radius: 1rem;
    padding: 2rem;
    cursor: pointer;
    background: var(--color-bg-app);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.upload-box:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-box img {
    max-width: 100%;
    border-radius: 1rem;
    display: none;
    margin-top: 1rem;
}

/* FORM ELEMENTS */
.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-border);
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* RESULT CARDS */
.result-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border);
}

/* DIET: DAY SELECTOR */
.day-selector {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    scrollbar-width: none;
}

.day-btn {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: white;
    color: var(--color-text-muted);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.day-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
}

.menu-item {
    border-left: 4px solid var(--color-primary);
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--color-bg-app);
    border-radius: 0 0.5rem 0.5rem 0;
    border-right: 1px solid var(--color-border);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

/* FINANCE HISTORY */
.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.month-nav {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.history-item:last-child {
    border-bottom: none;
}

.h-info h4 {
    text-align: left;
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.h-info p {
    text-align: left;
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.h-amount {
    font-weight: 700;
    color: var(--color-text-main);
}

/* LOADING */
.loading {
    display: none;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 1rem;
}

.loading.active {
    display: block;
}

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 320px;
    margin: auto;
    padding: 2rem;
    border-radius: 1.5rem;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}

.modal-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* SCAN ANIMATION - Enhanced */
.scan-container {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 1rem;
    overflow: hidden;
    display: none;
    margin-bottom: 1.5rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scan-container.active {
    display: flex;
}

.scan-receipt-icon {
    font-size: 4rem;
    animation: receiptPulse 1.5s ease-in-out infinite;
    z-index: 10;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    box-shadow: 0 0 20px var(--color-primary);
    top: 0;
    left: 0;
    animation: scanMove 2s linear infinite;
}

.scan-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.scan-steps {
    margin-top: 1rem;
    z-index: 10;
}

.scan-step {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    opacity: 0;
    animation: stepFade 4s infinite;
}

.scan-step:nth-child(1) {
    animation-delay: 0s;
}

.scan-step:nth-child(2) {
    animation-delay: 1.5s;
}

.scan-step:nth-child(3) {
    animation-delay: 3s;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes scanMove {
    0% {
        top: 0;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes receiptPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes stepFade {

    0%,
    20% {
        opacity: 1;
    }

    25%,
    100% {
        opacity: 0;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* LANDING PAGE */
.landing-hero {
    padding: 1rem 0;
}

.hero-desc {
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: var(--color-bg-app);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: left;
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.feature-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--color-text-main);
}

.feature-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* PROFILE */
.profile-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--color-primary-light);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-avatar {
    width: 32px;
    height: 32px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid var(--color-primary);
}

.header-avatar img {
    width: 100%;
    height: 100%;
}