* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2d3748;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    min-height: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

.form-buttons .btn-primary {
    flex: 1;
}

.summary-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.summary-card.budget::before {
    background: linear-gradient(90deg, #3182ce, #2b6cb0);
}

.summary-card.expenses::before {
    background: linear-gradient(90deg, #e53e3e, #c53030);
}

.summary-card.balance.positive::before {
    background: linear-gradient(90deg, #38a169, #2f855a);
}

.summary-card.balance.negative::before {
    background: linear-gradient(90deg, #e53e3e, #c53030);
}

.summary-card h3 {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 600;
}

.summary-card .amount {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}

.summary-card.budget .amount {
    color: #3182ce;
}

.summary-card.expenses .amount {
    color: #e53e3e;
}

.summary-card.balance.positive .amount {
    color: #38a169;
}

.summary-card.balance.negative .amount {
    color: #e53e3e;
}

.expenses-container {
    max-height: 400px;
    overflow-y: auto;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
}

.expense-item:hover {
    background: #edf2f7;
    border-left-color: #667eea;
    transform: translateX(5px);
}

.expense-info h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 4px;
}

.expense-date {
    font-size: 0.9rem;
    color: #718096;
}

.expense-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.expense-amount {
    font-weight: 700;
    color: #e53e3e;
    font-size: 1.1rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
}

.no-expenses {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
    
    .summary-card {
        padding: 20px;
    }
    
    .summary-card .amount {
        font-size: 2rem;
    }
    
    .expense-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .expense-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .form-buttons .btn-primary {
        width: 100%;
    }
    
    .btn-secondary {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    .summary-card .amount {
        font-size: 1.8rem;
    }
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .summary-card {
    animation: fadeIn 0.6s ease-out;
}

/* Custom scrollbar */
.expenses-container::-webkit-scrollbar {
    width: 6px;
}

.expenses-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.expenses-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.expenses-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}