:root {
    /* Rangi Kuu (Primary) */
    --bg-main: #F8FAFC; 
    --card-bg: #FFFFFF; 
    --text-dark: #0F172A; 
    --text-light: #64748B;
    --border-light: #E2E8F0; /* Fedha nyeupe */
    
    /* Rangi za Mchanganyiko (Gradients) */
    --primary: #10B981; /* Kijani */
    --primary-dark: #059669;
    --secondary-blue: #2563EB; /* Bluu */
    --gold: #D4AF37; /* Dhahabu ya kifahari */
    --gold-light: #F59E0B; /* Dhahabu nyepesi */
    --danger: #EF4444;
    
    /* Shadow za Kisanaa */
    --shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
}

/* 1. Ondoa delay na box la bluu la kukCLICK kwenye simu */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; /* Ondoa box la bluu */
    margin: 0; padding: 0; 
}
body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: var(--bg-main); 
    color: var(--text-dark); 
    padding-bottom: 80px;
    touch-action: manipulation; /* Fanya Click iwe haraka bila 300ms delay */
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    padding: 20px; 
    border-bottom: 1px solid var(--border-light); 
    display: flex; justify-content: space-between; align-items: center; 
    position: sticky; top: 0; z-index: 100; 
}
.brand-area { display: flex; align-items: center; gap: 10px; }
.brand-logo { 
    width: 36px; height: 36px; 
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%); /* Kijani na Dhahabu */
    border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.brand-text { font-size: 1.2rem; font-weight: 800; background: linear-gradient(90deg, var(--text-dark) 0%, var(--secondary-blue) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }

/* Container & Cards */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.card { background: var(--card-bg); padding: 20px; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border-light); }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }

/* Premium Balance Card (Sasa ni ya Kifahari sana) */
.balance-card { 
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #059669 100%); 
    color: white; padding: 30px; border-radius: 24px; box-shadow: 0 20px 40px rgba(30, 58, 138, 0.2); margin-bottom: 30px; position: relative; overflow: hidden; 
}
.balance-card::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 200px; height: 200px; 
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%); /* Mviringo wa Dhahabu */
    opacity: 0.3; border-radius: 50%;
}
.balance-amount { 
    font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; margin-top: 10px;
    background: linear-gradient(90deg, #FFFFFF 0%, var(--gold) 100%); /* Maandishi ya Dhahabu na White */
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.balance-label { font-size: 0.9rem; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 8px; }

/* 2. Vitufe viwe na hisia ya mguso (active states) */
.btn-submit { 
    width: 100%; padding: 16px; 
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary-blue) 100%); /* Kijani kwenda Bluu */
    color: white; border: none; border-radius: 12px; font-size: 1.1rem; font-weight: 700; cursor: pointer; margin-top: 15px; 
    transition: all 0.2s ease; box-shadow: 0 10px 20px rgba(16, 185, 129, 0.25); 
    touch-action: manipulation; /* Kwa haraka */
}
.btn-submit:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 25px rgba(37, 99, 235, 0.3); 
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary) 100%); 
}
/* Hisia ya kubonyezwa (inajikaza kidogo na kugeukaizito) */
.btn-submit:active { 
    transform: scale(0.97); 
    box-shadow: 0 5px 10px rgba(16, 185, 129, 0.3); 
    filter: brightness(0.9);
}

input, select, textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 12px; font-size: 1rem; outline: none; box-sizing: border-box; font-family: inherit; margin-bottom: 10px; background: #F8FAFC; transition: 0.2s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); }

/* Modals (Popups) - Zimeunganishwa na Mobile Fix */
.modal-overlay { 
    display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); z-index: 2000; 
    align-items: center; justify-content: center; padding: 20px; overflow-y: auto; 
}
.modal-overlay.active { display: flex; }
.modal-box { 
    background: white; border-radius: 24px; width: 100%; max-width: 450px; padding: 25px; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.25); animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); position: relative; 
    margin: auto; max-height: 95vh; overflow-y: auto; border: 1px solid var(--border-light); 
}
@keyframes slideUp { from { transform: translateY(40px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; color: #94A3B8; cursor: pointer; background: none; border: none; transition: 0.2s; touch-action: manipulation; }
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }
.modal-close:active { color: var(--danger); transform: rotate(90deg) scale(0.9); }
@media (max-width: 480px) {
    .modal-box { width: 95%; padding: 20px; margin: 10px auto; }
} 

/* 3. Vitufe vya Chini (Bottom Nav) viwe na mguso wa haraka */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border-light); display: flex; justify-content: space-around; padding: 10px 0 20px 0; z-index: 1000; }
.nav-item { 
    display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-light); 
    text-decoration: none; font-size: 0.65rem; font-weight: 600; transition: 0.2s; 
    touch-action: manipulation; 
}
.nav-item i { font-size: 1.2rem; }
.nav-item.active { color: var(--secondary-blue); } /* Ili ielingane na gradient bluu */
.nav-item.active i { color: var(--primary); } /* Alama iwe kijani */
.nav-item:active {
    transform: scale(0.90); /* Ikipenywa inajikaza */
}

/* 4. FAB (Kitufe cha +) kiwe na mguso mkubwa */
.fab { 
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); width: 60px; height: 60px; 
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary-blue) 100%); 
    color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; 
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4); border: 4px solid var(--card-bg); z-index: 1001; text-decoration: none;
    transition: all 0.2s ease;
    touch-action: manipulation;
}
.fab:hover { transform: translateX(-50%) scale(1.05); box-shadow: 0 20px 35px rgba(16, 185, 129, 0.5); }
.fab:active { 
    transform: translateX(-50%) scale(0.90); 
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.5); 
    filter: brightness(1.1);
}

/* 5. Cart na Orodha (Expenses/Bills items) ziwe na mguso */
.exp-item, .expense-item { 
    display: flex; align-items: flex-start; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border-light);
    touch-action: manipulation;
    transition: background 0.1s;
}
.exp-item:last-child, .expense-item:last-child { border: none; }
.exp-item:active, .expense-item:active {
    background: #F8FAFC; /* Inawaka kidogo unapoibonyeza */
}
.exp-icon { width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: white; flex-shrink: 0; }

/* Alerts */
.alert-success { background: #ECFDF5; color: #047857; padding: 12px; border-radius: 10px; margin-bottom: 15px; text-align: center; font-weight: 600; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; padding: 12px; border-radius: 10px; margin-bottom: 15px; text-align: center; border: 1px solid #FECACA; }