* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f4f6f9;
    color: #2c3345;
}

/* ---------- Login Page ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 340px;
}
.login-box h2 { margin-bottom: 20px; text-align: center; color: #1b3a6b; }
.login-box label { display: block; margin: 12px 0 4px; font-size: 14px; }
.login-box input {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.login-box button {
    width: 100%; margin-top: 20px; padding: 10px; background: #1b3a6b;
    color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer;
}
.login-box button:hover { background: #14294d; }
.alert-error {
    background: #fdecea; color: #b71c1c; padding: 10px; border-radius: 6px; margin-bottom: 10px; font-size: 14px;
}

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

.sidebar {
    width: 240px;
    background: #1b3a6b;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 10px; }
.sidebar-header h3 { font-size: 18px; }
.user-badge { display: block; font-size: 12px; opacity: 0.8; margin-top: 6px; }

.sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: #dbe4f5;
    text-decoration: none;
    font-size: 14px;
    border-right: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.08); }
.sidebar nav a.active { background: rgba(255,255,255,0.12); border-right-color: #4f8ff7; color: #fff; }
.sidebar nav a.logout { margin-top: 20px; color: #ff9b9b; }

.content { flex: 1; padding: 30px; }
.content h1 { margin-bottom: 20px; color: #1b3a6b; }

/* ---------- Stats Grid ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-label { display: block; font-size: 13px; color: #7a8296; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; color: #1b3a6b; }
.stat-card.income .stat-value { color: #1b9c5c; }
.stat-card.expense .stat-value { color: #d64545; }
.stat-card.net .stat-value { color: #4f8ff7; }

/* ---------- Panels & Tables ---------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.panel h2 { font-size: 16px; margin-bottom: 14px; color: #1b3a6b; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid #eee; }
th { color: #7a8296; font-weight: 600; font-size: 12px; }
.empty-note { color: #9aa1b3; font-size: 14px; }

@media (max-width: 900px) {
    .panels { grid-template-columns: 1fr; }
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
}
