{% extends "base.html" %} {% block title %}ITV{% endblock %} {% block extra_css %} .filter-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; } .filter-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; } .filter-group { display: flex; flex-direction: column; gap: 6px; } .filter-group label { font-size: 11px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); } .filter-group input[type="date"] { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; padding: 9px 12px; outline: none; transition: border-color .15s; min-width: 160px; } .filter-group input[type="date"]:focus { border-color: var(--accent); } .itv-vencida td { color: #f87171 !important; } .itv-proxima td { color: #f59e0b !important; } .badge-vencida { background:rgba(248,113,113,.12); color:#f87171; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; border:1px solid rgba(248,113,113,.3); white-space:nowrap; } .badge-proxima { background:rgba(245,158,11,.12); color:#f59e0b; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; border:1px solid rgba(245,158,11,.3); white-space:nowrap; } .badge-ok { background:rgba(52,211,153,.12); color:#34d399; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; border:1px solid rgba(52,211,153,.3); white-space:nowrap; } {% endblock %} {% block content %}
{# Campo de filtro - sustituye el anterior #}
{# Botón limpiar #} {% if desde or hasta or q_itv %} ✕ Limpiar {% endif %} {% if buscado and rows %}
Excel
{% endif %}
{% if not buscado %}

Selecciona un rango de fechas y pulsa Buscar.

{% elif rows %}

{{ rows|length }} vehículo{{ 's' if rows|length != 1 }} {% if desde and hasta %} con ITV entre {{ desde | fecha_es}} y {{ hasta | fecha_es }} {% elif desde %} con ITV desde {{ desde | fecha_es}} {% elif hasta %} con ITV hasta {{ hasta | fecha_es}}{% endif %} {% if unidad %} · unidad_itv: {{ unidad_itv }}{% endif %}

{% set hoy = now %} {% for r in rows %} {% set itv_str = r['itv'][:10] if r['itv'] else '' %} {% endfor %}
M. Oficial M. Civil Marca Modelo Tipo Poblacion Unidad Fecha ITV Estado
{{ r['m_oficial'] or '—' }} {{ r['m_civil'] or '—' }} {{ r['marca'] or '—' }} {{ r['modelo'] or '—' }} {{ r['tipo'] or '—' }} {{ r['poblacion'] or '—' }} {{ r['unidad'] or '—' }} {{ itv_str | fecha_es}}
{% else %}

No se encontraron vehículos con ITV en ese rango de fechas.

{% endif %} {% endblock %}