{% extends 'core/base.html' %}
{% block title %}Add Supplier - SwiftPOS{% endblock %}
{% block topbar_title %}Add Supplier{% endblock %}

{% block content %}
<div class="container-fluid px-0">
    <div class="card">
        <div class="card-body">
            <form method="post">
                {% csrf_token %}
                <div class="row g-3">
                    {% for field in form %}
                        <div class="col-md-6">
                            <label class="form-label small fw-semibold" for="{{ field.id_for_label }}">
                                {{ field.label }}
                            </label>
                            {{ field }}
                            {% if field.help_text %}
                                <div class="form-text small">{{ field.help_text }}</div>
                            {% endif %}
                            {% for error in field.errors %}
                                <div class="text-danger small">{{ error }}</div>
                            {% endfor %}
                        </div>
                    {% endfor %}
                </div>
                <div class="mt-3 d-flex justify-content-end gap-2">
                    <a href="{% url 'inventory:supplier_list' %}" class="btn btn-outline-secondary btn-sm">Cancel</a>
                    <button type="submit" class="btn btn-primary btn-sm">Save supplier</button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
