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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #244954 0%, #1a353d 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

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

.nav-brand h1 {
    font-size: 24px;
    color: #00bf63;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #00bf63;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 0;
}

/* Messages/Alerts */
.messages {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #244954;
    margin-bottom: 10px;
    text-align: center;
}

.login-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #00bf63;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #00bf63;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #00a555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 191, 99, 0.4);
}

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

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-active {
    background: #00bf63;
    color: white;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-header h2 {
    color: #244954;
}

.filters {
    display: flex;
    gap: 10px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
}

.stat-content h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 400px;
}

.chart-container h3 {
    color: #244954;
    margin-bottom: 20px;
    font-size: 18px;
}

.chart-container canvas {
    max-height: 320px;
}

/* Recent Expenses */
.recent-expenses {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    color: #244954;
    font-size: 20px;
}

/* Tables */
.expense-table {
    width: 100%;
    border-collapse: collapse;
}

.expense-table thead {
    background: #f8f9fa;
}

.expense-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.expense-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.expense-table tbody tr:hover {
    background: #f8f9fa;
}

.category-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.category-food { background: #ffeaa7; color: #d63031; }
.category-shopping { background: #dfe6e9; color: #2d3436; }
.category-transport { background: #74b9ff; color: #0984e3; }
.category-subscriptions { background: #fd79a8; color: #d63031; }
.category-entertainment { background: #fdcb6e; color: #e17055; }
.category-utilities { background: #55efc4; color: #00b894; }
.category-health { background: #a29bfe; color: #6c5ce7; }
.category-other { background: #b2bec3; color: #2d3436; }

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Expense List */
.expense-list-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.expense-list-container h2 {
    color: #244954;
    margin-bottom: 20px;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Forms */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-container h2 {
    color: #244954;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

select.form-control {
    cursor: pointer;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.1);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

.footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .filters {
        width: 100%;
        justify-content: center;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .expense-table {
        font-size: 14px;
    }

    .expense-table th,
    .expense-table td {
        padding: 8px;
    }
}

/* Alerts Section */
.alerts-section {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-left: 4px solid #f39c12;
}

.alerts-section h3 {
    color: #244954;
    margin-bottom: 15px;
    font-size: 16px;
}

.alert-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.alert-card {
    background: #fff9e6;
    padding: 12px 18px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #f39c12;
}

.alert-amount {
    font-weight: 700;
    font-size: 18px;
    color: #e74c3c;
}

.alert-merchant {
    font-size: 14px;
    color: #333;
}

.alert-date {
    font-size: 12px;
    color: #999;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.insight-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.insight-card h3 {
    color: #244954;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Trend List */
.trend-list {
    list-style: none;
}

.trend-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.trend-list li:last-child {
    border-bottom: none;
}

.trend-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.trend-amount {
    font-weight: 600;
    color: #244954;
    margin-right: 15px;
}

.trend-change {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 70px;
    text-align: center;
}

.trend-change.up {
    background: #ffeaea;
    color: #e74c3c;
}

.trend-change.down {
    background: #eafff0;
    color: #27ae60;
}

/* Merchant List */
.merchant-list {
    list-style: none;
}

.merchant-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.merchant-list li:last-child {
    border-bottom: none;
}

.merchant-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.merchant-amount {
    font-weight: 600;
    color: #244954;
    margin-right: 15px;
}

.merchant-count {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Trend Card Indicator */
.stat-card.trend-up .stat-icon {
    color: #e74c3c;
}

.stat-card.trend-down .stat-icon {
    color: #27ae60;
}
