/* ==========================================================================
   🐉 Hendy & Putri Planning — Nailong Theme
   Warm Yellow Dark Mode with Cute Nailong Vibes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    --bg-primary: #0d0d12;
    --bg-secondary: #14141f;
    --bg-card: rgba(255, 220, 80, 0.03);
    --bg-card-hover: rgba(255, 220, 80, 0.06);
    --bg-glass: rgba(255, 220, 80, 0.04);
    --border-glass: rgba(255, 220, 80, 0.10);
    --border-glass-hover: rgba(255, 220, 80, 0.20);

    --yellow-300: #fde047;
    --yellow-400: #facc15;
    --yellow-500: #eab308;
    --yellow-600: #ca8a04;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --warm-pink: #f9a8d4;

    --gradient-primary: linear-gradient(135deg, #fde047, #f59e0b, #fb923c);
    --gradient-warm: linear-gradient(135deg, #fde047, #facc15);
    --gradient-cool: linear-gradient(135deg, #f59e0b, #fb923c);
    --gradient-bg: linear-gradient(160deg, #0d0d12 0%, #1a1408 40%, #12100a 100%);

    --text-primary: #fef9e7;
    --text-secondary: #c9b88a;
    --text-muted: #8a7c5a;
    --text-accent: #fde047;

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-glow: 0 0 30px rgba(253, 224, 71, 0.12);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--yellow-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--yellow-300); }

/* ---- Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(13, 13, 18, 0.9);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-brand {
    text-align: center;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 24px;
}

.sidebar-brand .brand-mascot {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--yellow-400);
    margin-bottom: 8px;
    animation: mascotBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(253, 224, 71, 0.3));
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand .brand-heart {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(253, 224, 71, 0.10);
    color: var(--yellow-400);
    border: 1px solid rgba(253, 224, 71, 0.18);
}

.nav-item .nav-emoji {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

.sidebar-user .user-avatar {
    font-size: 1.8rem;
}

.sidebar-user .user-info {
    flex: 1;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-user .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

/* ---- Cards ---- */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Dashboard Grid ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-grid .full-width {
    grid-column: 1 / -1;
}

/* ---- Mood Hero ---- */
.mood-hero {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(253, 224, 71, 0.06), rgba(249, 115, 22, 0.06));
    border: 1px solid rgba(253, 224, 71, 0.12);
    position: relative;
    overflow: hidden;
}

.mood-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.04) 0%, transparent 60%);
    animation: rotateGlow 15s linear infinite;
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mood-nailong {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--yellow-400);
    box-shadow: 0 8px 24px rgba(253, 224, 71, 0.3);
    display: block;
    margin: 0 auto 16px;
    position: relative;
    animation: nailongBounce 2.5s ease-in-out infinite;
}

@keyframes nailongBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.05); }
}

.mood-emoji {
    font-size: 5rem;
    display: none; /* hidden — replaced by nailong images */
}

.mood-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
}

.mood-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    position: relative;
}

/* ---- Limit Meter ---- */
.limit-meter {
    margin: 24px 0;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.meter-spent {
    font-size: 1.8rem;
    font-weight: 800;
}

.meter-limit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.meter-bar {
    height: 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.meter-fill.safe { background: linear-gradient(90deg, #34d399, #10b981); }
.meter-fill.warning { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.meter-fill.danger { background: linear-gradient(90deg, #fb923c, #f97316); }
.meter-fill.over { background: linear-gradient(90deg, #f87171, #ef4444); }

.meter-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Quick Add Expense ---- */
.quick-add-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    background: rgba(255, 220, 80, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--yellow-500);
    box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.12);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c9b88a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.form-input option {
    background: #1a1a20;
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #1a1408;
    box-shadow: 0 4px 15px rgba(253, 224, 71, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 224, 71, 0.35);
    color: #1a1408;
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

/* ---- Expense List ---- */
.expense-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.expense-list::-webkit-scrollbar {
    width: 4px;
}

.expense-list::-webkit-scrollbar-thumb {
    background: rgba(253, 224, 71, 0.15);
    border-radius: var(--radius-full);
}

.expense-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.expense-item:hover {
    background: rgba(253, 224, 71, 0.03);
    border-color: var(--border-glass);
}

.expense-category-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(253, 224, 71, 0.06);
    border-radius: var(--radius-sm);
}

.expense-details {
    flex: 1;
}

.expense-desc {
    font-weight: 500;
    font-size: 0.9rem;
}

.expense-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.expense-amount {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--orange-400);
    white-space: nowrap;
}

.expense-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.expense-item:hover .expense-actions {
    opacity: 1;
}

/* ---- Stats Row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-normal);
}

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

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
}

.stat-emoji {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

/* ---- Charts ---- */
.chart-container {
    position: relative;
    height: 280px;
    margin-top: 12px;
}

/* ---- Savings Page ---- */
.savings-hero {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.06), rgba(253, 224, 71, 0.06));
    border: 1px solid rgba(52, 211, 153, 0.12);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
}

.savings-hero-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--yellow-400);
    box-shadow: 0 8px 24px rgba(253, 224, 71, 0.3);
    display: block;
    margin: 0 auto 16px;
    animation: nailongBounce 2.5s ease-in-out infinite;
}

.savings-amount {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #34d399, #fde047);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.savings-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.savings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.savings-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.savings-item:hover {
    background: rgba(253, 224, 71, 0.03);
    border-color: var(--border-glass);
}

.savings-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 211, 153, 0.08);
    border-radius: var(--radius-sm);
}

.savings-info {
    flex: 1;
}

.savings-desc {
    font-weight: 500;
    font-size: 0.9rem;
}

.savings-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.savings-amount-item {
    font-weight: 700;
    color: var(--success);
    font-size: 0.95rem;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-bg);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.08), transparent 70%);
    top: -200px;
    right: -200px;
    animation: floatBlob 8s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.06), transparent 70%);
    bottom: -200px;
    left: -200px;
    animation: floatBlob 10s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-card {
    background: rgba(253, 224, 71, 0.03);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(253, 224, 71, 0.10);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.login-mascot {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--yellow-400);
    box-shadow: 0 8px 20px rgba(253, 224, 71, 0.3);
    display: block;
    margin: 0 auto 16px;
    animation: nailongBounce 2.5s ease-in-out infinite;
}

.login-heart {
    font-size: 3rem;
    display: none; /* replaced by nailong image */
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.avatar-select {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.avatar-option {
    cursor: pointer;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    text-align: center;
    flex: 1;
}

.avatar-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-hover);
}

.avatar-option.selected {
    border-color: var(--yellow-500);
    background: rgba(253, 224, 71, 0.06);
    box-shadow: 0 0 20px rgba(253, 224, 71, 0.15);
}

.avatar-option .avatar-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.avatar-option .avatar-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .form-input {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    padding: 14px;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.login-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--danger);
}

/* ---- Floating Stars (Login BG) ---- */
.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.floating-heart {
    position: absolute;
    bottom: -20px;
    font-size: 1.2rem;
    opacity: 0.20;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.20; }
    90% { opacity: 0.20; }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ---- Expenses Page ---- */
.expenses-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.day-group {
    margin-bottom: 24px;
}

.day-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-glass);
}

.day-date {
    font-weight: 600;
    font-size: 1rem;
}

.day-total {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: auto;
}

.day-mood {
    font-size: 1.2rem;
}

.day-mood-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 1.5px solid var(--yellow-400);
}

/* ---- Toast Notification ---- */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(253, 224, 71, 0.06);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(253, 224, 71, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    z-index: 1000;
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
    font-weight: 500;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-success {
    border-left: 3px solid var(--success);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state .empty-nailong {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--yellow-400);
    box-shadow: 0 4px 12px rgba(253, 224, 71, 0.15);
    display: block;
    margin: 0 auto 12px;
    opacity: 0.85;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ---- Page Title ---- */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Pagination ---- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-wrapper .page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.pagination-wrapper .page-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination-wrapper .page-link.active {
    background: rgba(253, 224, 71, 0.12);
    border-color: rgba(253, 224, 71, 0.25);
    color: var(--yellow-400);
}

/* ---- Mobile Toggle ---- */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: rgba(253, 224, 71, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(253, 224, 71, 0.18);
    border-radius: var(--radius-full);
    width: 42px;
    height: 42px;
    color: var(--yellow-400);
    font-size: 1.15rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-normal);
}
.mobile-toggle:hover {
    background: rgba(253, 224, 71, 0.15);
    border-color: var(--yellow-300);
    transform: scale(1.05);
}
.mobile-toggle.active {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.25);
    color: var(--danger);
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.15);
}

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Responsive (Tablets & Mobile) ---- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 72px;
    }

    .mobile-toggle {
        display: flex;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13.5px;
    }

    .main-content {
        padding: 16px 12px;
        padding-top: 64px;
    }

    .glass-card {
        padding: 16px;
    }

    .mood-hero {
        padding: 20px 16px;
    }

    .savings-hero {
        padding: 24px 16px;
        margin-bottom: 16px;
    }

    /* Compact Row Stats on Mobile Phones */
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 10px 6px;
    }

    .stat-emoji {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .stat-value {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0;
    }

    .quick-add-form {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .quick-add-form .form-group {
        width: 100%;
        min-width: unset !important;
    }

    .quick-add-form .form-input {
        width: 100%;
    }

    .quick-add-form .btn {
        width: 100%;
        padding: 12px;
    }

    /* Horizontal Avatar Select on Login */
    .avatar-select {
        flex-direction: row;
        gap: 12px;
    }

    .avatar-option {
        padding: 12px 8px;
        flex: 1;
    }

    .avatar-option .avatar-emoji {
        font-size: 2rem;
    }

    .avatar-option .avatar-name {
        font-size: 0.8rem;
    }

    .login-card {
        margin: 16px;
        padding: 32px 20px;
    }

    .mood-nailong {
        width: 80px;
        height: 80px;
        margin-bottom: 8px;
    }

    .savings-hero-img {
        width: 80px;
        height: 80px;
        margin-bottom: 8px;
    }

    .savings-amount {
        font-size: 1.8rem;
    }

    .expenses-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-row {
        width: 100%;
    }
    
    .filter-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .filter-form .form-input {
        width: 100%;
    }

    /* Clean spacing for items in list on mobile */
    .expense-item {
        padding: 6px 10px;
        gap: 8px;
    }
    
    .expense-category-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .expense-amount {
        font-size: 0.85rem;
    }

    .expense-actions {
        opacity: 1; /* Always show action buttons on touch/mobile screens! */
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12.5px;
    }

    .main-content {
        padding: 12px 10px;
        padding-top: 60px;
    }

    .glass-card {
        padding: 12px;
    }

    .stats-row {
        gap: 6px;
    }
    
    .stat-card {
        padding: 10px 4px;
    }
    
    .stat-emoji {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }
    
    .savings-amount {
        font-size: 1.5rem;
    }
    
    .mood-message {
        font-size: 1.05rem;
    }
}

/* ---- Utility ---- */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-yellow { color: var(--yellow-400); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none; }
