{% extends "base.html" %}
{% block title %}Add Expense{% endblock %}

{% block content %}
<div class="container mt-3 fade-in">

    <!-- ================= HEADER ================= -->
    <div class="d-flex justify-content-between align-items-center mb-3">
        <div>
            <h4><i class="bi bi-plus-circle"></i> Add Expense</h4>
            <p class="text-muted mb-0">Record a new operational cost</p>
        </div>

        <a href="{% url 'expense_list' %}" class="btn btn-outline-dark btn-sm">
            <i class="bi bi-arrow-left"></i> Back
        </a>
    </div>

    <!-- ================= FORM CARD ================= -->
    <div class="card shadow-lg p-4">

        <form method="POST">
            {% csrf_token %}

            <div class="row">

                <!-- LEFT COLUMN -->
                <div class="col-md-6">

                    <div class="mb-3">
                        <label class="form-label">Building</label>
                        {{ form.building }}
                    </div>

                    <div class="mb-3">
                        <label class="form-label">Category</label>
                        {{ form.category }}
                    </div>

                    <div class="mb-3">
                        <label class="form-label">Amount (KES)</label>
                        {{ form.amount }}
                    </div>

                </div>

                <!-- RIGHT COLUMN -->
                <div class="col-md-6">

                    <div class="mb-3">
                        <label class="form-label">Expense Date</label>
                        {{ form.expense_date }}
                    </div>

                    <div class="mb-3">
                        <label class="form-label">Frequency</label>
                        {{ form.frequency }}
                    </div>

                    <div class="mb-3">
                        <label class="form-label">Notes</label>
                        {{ form.notes }}
                    </div>

                </div>

            </div>

            <hr>

            <!-- ================= SUBMIT ================= -->
            <div class="d-flex justify-content-end">
                <button class="btn btn-primary">
                    <i class="bi bi-check-circle"></i> Save Expense
                </button>
            </div>

        </form>

    </div>

</div>
{% endblock %}