<div id="team-table">
  <div class="overflow-x-auto rounded-lg border border-gray-700 bg-gray-800 shadow-sm">
    <table class="min-w-full divide-y divide-gray-700">
      <thead class="bg-gray-900/80">
        <tr>
          <th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-400">Name</th>
          <th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-400">Members</th>
          <th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-400">Created</th>
          <th class="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-400">Actions</th>
        </tr>
      </thead>
      <tbody class="divide-y divide-gray-700/70 bg-gray-800">
        {% for team in teams %}
        <tr class="hover:bg-gray-700/40 transition-colors">
          <td class="px-6 py-4 whitespace-nowrap">
            <a href="{% url 'organization:team_detail' slug=team.slug %}" class="text-brand-light hover:text-brand font-medium">
              {{ team.name }}
            </a>
          </td>
          <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">{{ team.members.count }}</td>
          <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">{{ team.created_at|date:"N j, Y" }}</td>
          <td class="px-6 py-4 whitespace-nowrap text-right text-sm">
            {% if perms.organization.change_team %}
            <a href="{% url 'organization:team_update' slug=team.slug %}" class="text-brand-light hover:text-brand">Edit</a>
            {% endif %}
          </td>
        </tr>
        {% empty %}
        <tr>
          <td colspan="4" class="px-6 py-8 text-center text-sm text-gray-400">No teams found.</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
</div>
