:root {
    --primary-color: #0D47A1; 
    --primary-light: #1976D2;
    --primary-dark: #002171;
    --secondary-color: #4CAF50; 
    --accent-color: #F44336;
    --background-color: #F5F7FA;
    --surface-color: #FFFFFF;
    --text-color: #212121;
    --text-light-color: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Auth Page Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--primary-dark);
}

.auth-box {
    background: var(--surface-color);
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h1 {
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light-color);
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.toggle-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.toggle-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.hidden {
    display: none;
}

.error-message {
    color: var(--accent-color);
    margin-top: 1rem;
    font-size: 0.9em;
    min-height: 1.2em;
}


/* Main App Layout */
.app-container {
    display: flex;
}

.sidebar {
    width: 250px;
    background: var(--primary-dark);
    color: var(--text-light-color);
    position: fixed;
    height: 100%;
    padding-top: 1rem;
    transition: width 0.3s ease;
}

.sidebar-header {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
}
.sidebar-header .logo i {
    margin-right: 0.5rem;
}

.main-nav ul {
    list-style: none;
}

.main-nav ul li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-light-color);
    text-decoration: none;
    transition: background-color 0.3s;
    border-left: 3px solid transparent;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    background-color: var(--primary-light);
    border-left-color: var(--secondary-color);
}

.main-nav ul li a i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.logout-link {
    position: absolute;
    bottom: 0;
    width: 100%;
}

.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 2rem;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.card-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Grid Layout */
.grid-container {
    display: grid;
    gap: 1.5rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table thead th {
    background: #f9f9f9;
    font-weight: 600;
}

.text-income {
    color: var(--secondary-color);
    font-weight: bold;
}
.text-expense {
    color: var(--accent-color);
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    .sidebar.open {
        width: 250px;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .grid-container-2, .grid-container-3 {
        grid-template-columns: 1fr;
    }
}