{% extends 'base.html' %}
{% block content %}
<div class="card shadow-sm">
  <div class="card-header fw-bold">Auditoría reciente</div>
  <div class="table-responsive">
    <table class="table align-middle mb-0">
      <thead><tr><th>Fecha</th><th>Actor</th><th>Acción</th><th>Entidad</th><th>Detalle</th></tr></thead>
      <tbody>
      {% for item in logs %}
        <tr>
          <td>{{ item.created_at.strftime('%d/%m/%Y %H:%M') }}</td>
          <td>{{ item.actor_email }}</td>
          <td>{{ item.action }}</td>
          <td>{{ item.entity_type }} #{{ item.entity_id or '-' }}</td>
          <td>{{ item.details }}</td>
        </tr>
      {% else %}
        <tr><td colspan="5" class="text-center text-muted py-4">Sin movimientos.</td></tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>
{% endblock %}
