{% if recent_cases %}
  <div class="table-responsive">
    <table class="table table-sm table-striped mb-0 align-middle">
      <thead>
        <tr>
          <th>Case</th>
          <th>Created</th>
          <th>Authors</th>
        </tr>
      </thead>
      <tbody>
        {% for case in recent_cases %}
          <tr>
            <td>
              <a href="{% url 'atlas:case_detail' case.pk %}">{{ case.title }}</a>
              <div class="text-muted small">#{{ case.pk }}</div>
            </td>
            <td class="small">{{ case.created_date|date:"Y-m-d H:i" }}</td>
            <td class="small">
              {% for author in case.author.all %}
                <a class="badge text-bg-secondary me-1 text-decoration-none" href="{% url 'atlas:case_view' %}?author={{ author.pk }}">{{ author.username }}</a>
              {% empty %}
                <span class="text-muted">None</span>
              {% endfor %}
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
{% else %}
  <div class="text-muted small">No recent cases found.</div>
{% endif %}
