/* ── Budget Header ── */

.budget-header {
    text-align: center;
    padding: 60px 20px 30px;
}

.budget-header h1 {
    font-size: 42px;
    color: #2E8B57;
    margin-bottom: 10px;
}

.budget-header p {
    color: #6b7280;
    font-size: 18px;
}

/* ── Overview Cards ── */

.budget-overview {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 20px 10px;
    flex-wrap: wrap;
}

.overview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 220px;
    padding: 28px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    background: white;
}

.overview-card.total {
    border-top: 4px solid #2E8B57;
}

.overview-card.spent {
    border-top: 4px solid #EF4444;
}

.overview-card.remaining {
    border-top: 4px solid #3B82F6;
}

.overview-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-amount {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.overview-card.total .overview-amount  { color: #2E8B57; }
.overview-card.spent .overview-amount  { color: #EF4444; }
.overview-card.remaining .overview-amount { color: #3B82F6; }

/* ── Add Expense ── */

.add-expense-section {
    display: flex;
    justify-content: center;
    padding: 20px 20px 10px;
}

.add-expense-card {
    width: 100%;
    max-width: 950px;
    background: white;
    padding: 35px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #2E8B57;
}

.add-expense-card h2 {
    font-size: 22px;
    color: #2E8B57;
    margin-bottom: 24px;
}

.expense-form {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.input-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-box label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.input-box input,
.input-box select {
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: 0.3s;
    background: white;
    color: #1f2937;
}

.input-box input:focus,
.input-box select:focus {
    border-color: #2E8B57;
    box-shadow: 0 0 8px rgba(46, 139, 87, 0.2);
}

.input-box input::placeholder {
    color: #9ca3af;
}

.btn-add-expense {
    padding: 13px 24px;
    background: #2E8B57;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    height: fit-content;
}

.btn-add-expense:hover {
    background: #236b45;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 139, 87, 0.3);
}

/* ── Expenses List ── */

.expenses-section {
    display: flex;
    justify-content: center;
    padding: 20px 20px 10px;
}

.expenses-card {
    width: 100%;
    max-width: 950px;
    background: white;
    padding: 35px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
}

.expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.expenses-header h2 {
    font-size: 22px;
    color: #2E8B57;
}

.expenses-header select {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    cursor: pointer;
    transition: 0.3s;
    background: white;
    color: #374151;
}

.expenses-header select:focus {
    border-color: #2E8B57;
}

#expenseList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#expenseList li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    transition: 0.3s;
}

#expenseList li:hover {
    border-color: #2E8B57;
    background: #E8F7EF;
}

.expense-icon {
    font-size: 22px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.expense-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

.expense-desc {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.expense-cat {
    font-size: 13px;
    color: #6b7280;
}

.expense-amount {
    font-size: 17px;
    font-weight: 700;
    color: #EF4444;
    white-space: nowrap;
}

.expense-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: 0.2s;
    flex-shrink: 0;
}

.expense-delete:hover {
    color: #EF4444;
    background: #fef2f2;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    font-size: 15px;
    padding: 40px 0;
    border: none !important;
    background: transparent !important;
}

.empty-state:hover {
    border-color: transparent !important;
    background: transparent !important;
}

/* ── Over budget warning ── */

.over-budget .overview-amount {
    color: #EF4444 !important;
}

/* ── Action Buttons ── */

.actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px 20px 70px;
}

.actions button {
    padding: 15px 35px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

#clearBtn {
    background: transparent;
    border: 2px solid #EF4444 !important;
    color: #EF4444;
}

#clearBtn:hover {
    background: #EF4444;
    color: white;
    transform: translateY(-3px);
}

#backBtn {
    background: #2E8B57;
    color: white;
}

#backBtn:hover {
    background: #236b45;
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(46, 139, 87, 0.3);
}

/* ── Responsive ── */

@media (max-width: 768px) {

    .budget-header h1 {
        font-size: 32px;
    }

    .expense-form {
        grid-template-columns: 1fr;
    }

    .add-expense-card,
    .expenses-card {
        padding: 25px 20px;
    }

    .overview-card {
        width: 100%;
        max-width: 400px;
    }

    .actions {
        flex-direction: column;
        align-items: center;
    }

    .actions button {
        width: 100%;
        max-width: 400px;
    }
}
