:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --accent: #4f46e5; /* Indigo */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-color: #111827;
    --card-bg: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border: #374151;
    --accent: #818cf8;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.controls, .data-controls {
    display: flex;
    gap: 10px;
}

/* Buttons */
button { cursor: pointer; border: none; border-radius: 6px; font-weight: 500; transition: 0.2s; }
.btn-icon { background: none; color: var(--text-primary); font-size: 1.2rem; }
.btn-sm { background: var(--card-bg); border: 1px solid var(--border); color: var(--text-primary); padding: 5px 10px; }
.btn-primary { background: var(--accent); color: white; padding: 10px 20px; width: 100%; }
.btn-secondary { background: var(--text-secondary); color: white; padding: 10px 20px; }
.btn-primary:hover { opacity: 0.9; }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
@media (max-width: 600px) { .dashboard-grid { grid-template-columns: 1fr; } }

.card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

/* Specific Cards */
.total-card h3 { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.total-card p { font-size: 1.8rem; font-weight: 700; color: var(--accent); margin: 5px 0 0 0; }

.budget-card input { width: 100%; padding: 5px; margin: 5px 0; border: 1px solid var(--border); background: transparent; color: var(--text-primary); }
.progress-bg { background: var(--border); height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; width: 0%; background: var(--success); transition: width 0.5s, background 0.3s; }

.chart-card { display: flex; align-items: center; justify-content: center; height: 220px; }

/* Form */
.form-container { background: var(--card-bg); padding: 20px; border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 20px; }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; }
input, select { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-color); color: var(--text-primary); outline: none; }

/* List */
ul { list-style: none; padding: 0; }
.expense-item {
    background: var(--card-bg);
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.expense-info h4 { margin: 0; font-size: 1rem; }
.expense-info small { color: var(--text-secondary); font-size: 0.8rem; }
.amount { font-weight: bold; margin-right: 15px; }

.actions button { background: none; margin-left: 5px; opacity: 0.7; }
.actions button:hover { opacity: 1; }
.text-edit { color: #3b82f6; }
.text-delete { color: #ef4444; }

.hidden { display: none; }

/* Toast */
.toast {
    position: fixed; top: 20px; right: 20px;
    background: #333; color: white;
    padding: 12px 25px; border-radius: 6px;
    transform: translateY(-50px); opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }