/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --income: #10b981;
    --expense: #ef4444;
    --balance: #3b82f6;
    
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Summary Cards */
.summary-section {
    background: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-sm);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card .amount {
    font-size: 2rem;
    font-weight: 700;
}

.amount.income {
    color: var(--income);
}

.amount.expense {
    color: var(--expense);
}

.amount.balance {
    color: var(--balance);
}

.card .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Panel */
.panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.panel h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Category Bars */
.category-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-name {
    font-weight: 600;
}

.category-amount {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease-out;
}

/* Transactions Grid */
.transactions-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.transaction-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    transition: transform 0.2s;
}

.transaction-card:hover {
    transform: translateX(4px);
}

.transaction-icon {
    font-size: 2rem;
}

.transaction-details h4 {
    margin-bottom: 0.25rem;
}

.transaction-category {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.transaction-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.transaction-amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.transaction-amount.income {
    color: var(--income);
}

.transaction-amount.expense {
    color: var(--expense);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .transaction-card {
        grid-template-columns: auto 1fr;
    }
    
    .transaction-amount {
        grid-column: 1 / -1;
        text-align: center;
        margin-top: 0.5rem;
    }
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.charts-grid canvas {
    max-height: 300px;
}

/* Make charts responsive */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}