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

* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f0f2f8;
    margin: 0;
    color: #1f2430;
}
h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 16px; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 14px; }

.navbar {
    display: flex;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, #1f2430, #2c3350);
    color: white;
    padding: 14px 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-brand { font-weight: 800; letter-spacing: 0.2px; }
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a, .nav-user a {
    color: #cfd6e6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover, .nav-user a:hover { color: white; border-color: #3d5afe; }
.nav-user { display: flex; gap: 14px; align-items: center; font-size: 0.9rem; }

.container { max-width: 1080px; margin: 32px auto; padding: 0 16px; }

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(20,20,40,0.06), 0 1px 2px rgba(20,20,40,0.08);
    margin-bottom: 24px;
    border: 1px solid #eceef4;
}
.auth-card { max-width: 380px; margin: 80px auto; }

form { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 0.85rem; font-weight: 600; margin-top: 8px; }
input, select {
    padding: 9px 11px;
    border: 1px solid #d3d7e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
input:focus, select:focus {
    outline: none;
    border-color: #3d5afe;
    box-shadow: 0 0 0 3px rgba(61,90,254,0.12);
}
.checkbox-label { display: flex; align-items: center; gap: 8px; flex-direction: row; font-weight: normal; }
button {
    margin-top: 12px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #3d5afe;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
button:hover { background: #2f47cc; }
button.danger { background: #d3455b; }
button.danger:hover { background: #b1364a; }
button.btn-debit { background: #e53935; }
button.btn-debit:hover { background: #c62828; }
button.btn-credit { background: #2e9e5b; }
button.btn-credit:hover { background: #23844a; }

.type-toggle { display: flex; gap: 10px; }
.type-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #d3d7e0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.type-option:has(input:checked).type-debit { border-color: #e53935; background: #fdecea; color: #c62828; }
.type-option:has(input:checked).type-credit { border-color: #2e9e5b; background: #e9f7ef; color: #23844a; }

.balance-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.balance-card {
    text-align: left;
    border-left: 4px solid #3d5afe;
}
.balance-bank { border-left-color: #3d5afe; }
.balance-cash { border-left-color: #ff7043; }
.balance-debit { border-left-color: #e53935; }
.balance-credit { border-left-color: #2e9e5b; }
.balance-label { font-size: 0.8rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.balance-amount { font-size: 1.5rem; font-weight: 800; margin-top: 6px; }

.amount-debit { color: #e53935; font-weight: 700; }
.amount-credit { color: #2e9e5b; font-weight: 700; }

@media (max-width: 900px) {
    .balance-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .balance-cards { grid-template-columns: 1fr; }
}

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
    padding: 8px 18px;
    border-radius: 999px;
    background: white;
    border: 1px solid #d3d7e0;
    color: #4b5163;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.15s;
}
.filter-btn:hover { border-color: #3d5afe; color: #3d5afe; }
.filter-btn.active { background: #3d5afe; border-color: #3d5afe; color: white; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.chart-card { min-height: 320px; }
@media (max-width: 720px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.empty-state { color: #8b93a7; font-size: 0.9rem; padding: 24px 0; text-align: center; }

.category-pill {
    background: #eef0fb;
    color: #3d5afe;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pay-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.pay-cash { background: #fff0e8; color: #c65a2e; }
.pay-bank { background: #e6f7f3; color: #0f8a6f; }

.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eceef2; font-size: 0.9rem; }
.data-table th { background: #f5f6fa; font-weight: 600; color: #4b5163; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.4px; }
.data-table tbody tr:hover { background: #fafbff; }

.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; flex-direction: row; gap: 4px; margin: 0; }
.inline-form input { padding: 4px 6px; font-size: 0.8rem; }
.inline-form button { margin-top: 0; padding: 4px 10px; font-size: 0.8rem; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.flash-error { background: #fde2e2; color: #a12525; }
.flash-success { background: #dcf5e3; color: #1c7a3b; }
.flash-warning { background: #fff4d6; color: #8a6100; }

.receipt-image { max-width: 100%; border-radius: 8px; margin-top: 8px; border: 1px solid #eceef2; }
.receipt-preview { max-width: 240px; display: block; margin-bottom: 10px; }

.row-actions { display: flex; gap: 10px; }
