:root {
    --primary: #4361ee;
    --success: #2ec4b6;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #212529;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--dark);
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.container {
    background: white;
    width: 100%;
    max-width: 500px;
    height: fit-content;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: var(--primary);
    color: white;
    padding: 20px;
    text-align: center;
}

.balance-board {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.balance-title { font-size: 0.9rem; color: #666; margin-bottom: 5px; }
.balance-amount { font-size: 2rem; font-weight: bold; color: var(--dark); }

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 20px 20px;
}

.summary-card {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.income-text { color: var(--success); font-weight: bold; }
.expense-text { color: var(--danger); font-weight: bold; }

/* Form Input */
.form-container {
    padding: 20px;
    background: #fff;
    border-top: 5px solid var(--light);
}

.form-group { margin-bottom: 15px; }

label { display: block; margin-bottom: 5px; font-size: 0.9rem; }

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

input:focus, select:focus { border-color: var(--primary); }

button.btn-add {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

button.btn-add:hover { background-color: #3046b5; }

/* Transaction List */
.history-container {
    padding: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#clear-btn {
    font-size: 0.8rem;
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.list-group {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.list-item {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.list-item.plus { border-right: 5px solid var(--success); padding-right: 10px; }
.list-item.minus { border-right: 5px solid var(--danger); padding-right: 10px; }

.delete-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.7;
    transition: 0.2s;
}

.delete-btn:hover { opacity: 1; }