* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f1f5f9;
}

.finance-tracker {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.header p {
    color: #64748b;
    font-size: 1.1rem;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.stats-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

.stats-card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 16px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.stats-change {
    font-size: 0.9rem;
    opacity: 0.8;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.control-section {
    background: #f8fafc;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.control-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.transactions {
    background: #f8fafc;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.transactions h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.transaction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-description {
    font-weight: 600;
    color: #1e293b;
}

.transaction-category {
    font-size: 0.85rem;
}

.transaction-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.income { color: #059669; }
.expense { color: #dc2626; }

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 12px;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

#clearAllBtn:hover {
    background: #64748b;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.progress-container { margin-top: 16px; }
.progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}
.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}
.goal-status {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 8px;
}

/* --- CHART STYLES --- */
.visualizations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.chart-container {
    background: #f8fafc;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}

/* --- CATEGORY BADGES --- */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.category-food { background: rgba(234, 179, 8, 0.2); color: #ca8a04; }
.category-transport { background: rgba(59, 130, 246, 0.2); color: #2563eb; }
.category-entertainment { background: rgba(219, 39, 119, 0.2); color: #be185d; }
.category-utilities { background: rgba(34, 197, 94, 0.2); color: #16a34a; }
.category-salary { background: rgba(139, 92, 246, 0.2); color: #7c3aed; }
.category-freelance { background: rgba(168, 85, 247, 0.2); color: #9333ea; }
.category-other { background: rgba(100, 116, 139, 0.2); color: #475569; }

/* --- RESPONSIVE STYLES --- */
@media (max-width: 992px) {
    .controls, .visualizations {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .header h1 { font-size: 2rem; }
    .container { padding: 20px; }
}