{% extends "base.html" %}
{% from "_componentes/tarjeta.html" import tarjeta %}
{% from "_componentes/badges.html" import badge, badge_nivel %}
{% from "_componentes/tabla.html" import tabla %}
{% from "_componentes/aviso.html" import aviso %}
{% from "operaciones/_paso5.html" import pestanas, estilos %}
{% block titulo %}Carga {{ lote.id }}{% endblock %}
{% block cabecera %}{{ estilos() }}{% endblock %}
{% block contenido %}
{{ datos.get("archivo", "—") }} · {{ lote.created_at.strftime("%d/%m/%Y %H:%M") }} · {{ lote.usuario }} · SHA-256 Carga {{ lote.id }} {{ badge("Confirmada", "exito") if datos.get("estado") == "confirmada" else badge("Rechazada", "peligro") }}
{{ lote.archivo_hash[:16] }}…
recalcular_agregados).{{ datos.get("evento", "—") }} (solicitar_reevaluacion).ejecutar_reglas){% if datos.get("alertas_por_regla") %}: {% for clave, n in datos.alertas_por_regla.items() %}{{ clave }} × {{ n }}{% if not loop.last %}, {% endif %}{% endfor %}{% else %}: ninguna alerta nueva{% endif %}.{{ fila.id_externo }}
{% elif fila[col.clave] %}{{ badge_nivel(fila[col.clave]) }}{% else %}{{ badge("Sin evaluar") }}{% endif %}
{% endcall %}
{% endcall %}
{% call tarjeta("Clientes afectados", subtitulo=(datos.get("clientes") or []) | length ~ " clientes") %}
{% for c in datos.get("clientes") or [] %}{{ c.id_externo }}{% if not loop.last %} · {% endif %}{% else %}—{% endfor %}
{{ fila.campo }}
{% else %}{{ fila[col.clave] }}{% endif %}
{% endcall %}
{% endcall %}
{% endif %}
{% endblock %}