{% extends 'base.html' %}

{% block titulo %} Editar Vehículo Táctico {% endblock %}

{% block vertical %} {% include 'partes/vertical.html' %} {% endblock %}

{% block horizontal %} {% include 'partes/horizontal.html' %} {% endblock %}

{% block seccion %}
<div class="d-flex align-items-left align-items-md-center flex-column flex-md-row pt-2 pb-4">
    <div>
        <h3 class="fw-bold mb-3">Editar Registro del Inventario</h3>
        <h6 class="op-7 mb-2">Servicio de Transporte del Ejército Bolivariano</h6>
    </div>
</div>
{% endblock %}

{% block contenido %}
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-12 col-lg-8 col-xl-6">
            <div class="card shadow-lg border-primary">
                <div class="card-header bg-primary text-white py-3">
                    <h3 class="mb-0 text-center">
                        <i class="bi bi-clipboard-data me-2"></i>Editar Vehículo Táctico
                    </h3>
                </div>
                <div class="card-body p-4">
                    {% if messages %}
                        {% for message in messages %}
                            <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                                {{ message }}
                                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                            </div>
                        {% endfor %}
                    {% endif %}

                    <form method="post" novalidate>
                        {% csrf_token %}
                        {% for field in form %}
                        <div class="mb-4">
                            <label for="{{ field.id_for_label }}" class="form-label fw-semibold">
                                {{ field.label }}
                                {% if field.field.required %}<span class="text-danger">*</span>{% endif %}
                            </label>
                            {{ field }}
                            {% if field.help_text %}
                                <small class="form-text text-muted">{{ field.help_text }}</small>
                            {% endif %}
                            {% for error in field.errors %}
                                <div class="invalid-feedback d-block">{{ error }}</div>
                            {% endfor %}
                        </div>
                        {% endfor %}
                        <div class="d-grid gap-3 d-md-flex justify-content-md-end mt-4 border-top pt-4">
                            <button type="submit" class="btn btn-success px-4">
                                <i class="bi bi-check-circle me-2"></i>Guardar
                            </button>
                            <a href="{% url 'listar_inventario_tactico' %}" class="btn btn-secondary px-4">
                                <i class="bi bi-x-circle me-2"></i>Cancelar
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    .form-control:focus, .form-select:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }
    .card { border-radius: 15px; }
    .card-header { border-radius: 15px 15px 0 0 !important; }
</style>
{% endblock %}

{% block pie %} {% include 'partes/pie.html' %} {% endblock %}