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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: #1e3a8a;
    color: white;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 20px;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
}

.navbar-nav a:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background-color: #1f2937;
    color: white;
    position: fixed;
    height: 100vh;
    padding: 20px 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar li a {
    display: block;
    color: #d1d5db;
    padding: 12px 25px;
    text-decoration: none;
}

.sidebar li a:hover {
    background-color: #374151;
    color: white;
}

/* Main Content */
.main-content {
    margin-left: 220px;
    padding: 30px;
}

/* Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card h3 {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.card p {
    font-size: 1.6rem;
    font-weight: bold;
}

.income { color: #10b981; }
.expense { color: #ef4444; }
.balance { color: #3b82f6; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Badges */
.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Login Form */
.login-form {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.login-form h2 {
    margin-bottom: 24px;
    text-align: center;
}

.footer {
    background-color: #1e3a8a;
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: auto;
    width: 100%;
}

/* Adjust footer when sidebar is present on the page */
body:has(.sidebar) .footer {
    margin-left: 220px;
    width: calc(100% - 220px);
}

/* Chart */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 600px;
}