:root {
    --green: #2ecc71;
    --red: #e74c3c;
    --blue: #3498db;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --white: #ffffff;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: auto;
}

header {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    text-align: center;
}

.budget-setup {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 6px solid #ccc;
}

.card.budget { border-color: var(--green); }
.card.expense { border-color: var(--red); }
.card.remaining { border-color: var(--blue); }

.card h3 { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.6; }
.card p { font-size: 2rem; font-weight: bold; margin: 10px 0 0; }

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .main-content { grid-template-columns: 1fr; }
}

form {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 2; }
.input-row select { flex: 1; }

input, select, button {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

button {
    background: var(--dark);
    color: white;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

button:hover { background: #34495e; }

.tracker-section {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.search-bar {
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
    border: 2px solid #eee;
}

.chart-container {
    height: 350px;
    margin-bottom: 25px;
}

#history {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.history-item.inflow {
    border-left: 5px solid var(--green);
    background-color: #f0fff4;
}

.history-item.outflow {
    border-left: 5px solid var(--red);
}