<div class="flex-1 overflow-y-auto p-4 sm:p-6">
  <!-- Stats -->
  <div class="flex gap-3 sm:gap-4 mb-6 overflow-x-auto">
    <div class="flex items-center gap-3 px-4 py-3 border border-zinc-800/50 rounded-lg shrink-0">
      <svg class="w-5 h-5 text-emerald-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
      <div>
        <div class="text-lg font-bold text-zinc-200">{{ online_count }}</div>
        <div class="text-[10px] text-zinc-500 uppercase tracking-wider">Online</div>
      </div>
    </div>
    <div class="flex items-center gap-3 px-4 py-3 border border-zinc-800/50 rounded-lg shrink-0">
      <svg class="w-5 h-5 text-amber-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.636 18.364a9 9 0 010-12.728m12.728 0a9 9 0 010 12.728m-9.9-2.829a5 5 0 010-7.07m7.072 0a5 5 0 010 7.07M13 12a1 1 0 11-2 0 1 1 0 012 0z"/></svg>
      <div>
        <div class="text-lg font-bold text-zinc-200">{{ busy_count }}</div>
        <div class="text-[10px] text-zinc-500 uppercase tracking-wider">Busy</div>
      </div>
    </div>
    <div class="flex items-center gap-3 px-4 py-3 border border-zinc-800/50 rounded-lg shrink-0">
      <svg class="w-5 h-5 text-zinc-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
      <div>
        <div class="text-lg font-bold text-zinc-200">{{ event_count }}</div>
        <div class="text-[10px] text-zinc-500 uppercase tracking-wider">Events</div>
      </div>
    </div>
  </div>

  <!-- Active peers -->
  {% if active_peers %}
  <h3 class="text-[10px] font-mono text-zinc-600 uppercase tracking-wider mb-3">Active Peers</h3>
  <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 mb-6">
    {% for peer in active_peers %}
    <a href="/v2/peer/{{ peer.name }}"
            class="bg-zinc-900/50 border border-zinc-800/50 rounded-lg p-4 text-left hover:border-zinc-700 hover:bg-zinc-900 transition-all group">
      <div class="flex items-center gap-2 mb-1">
        <span class="w-2 h-2 rounded-full {{ 'bg-emerald-500' if peer.status == 'online' else 'bg-amber-500' }}"></span>
        <span class="text-sm font-medium text-zinc-200 group-hover:text-white transition-colors truncate">{{ peer.label }}</span>
        <span class="text-[10px] px-1.5 py-0.5 rounded font-mono {{ 'bg-amber-500/10 text-amber-400' if peer.status == 'busy' else 'bg-emerald-500/10 text-emerald-400' }}">{{ peer.status }}</span>
      </div>
      {% if peer.description %}
      <p class="text-xs text-zinc-500 mb-1 truncate">{{ peer.description }}</p>
      {% endif %}
      <p class="text-[10px] text-zinc-600 font-mono mb-2">{{ peer.name }}</p>
      <div class="space-y-1 text-xs text-zinc-500 font-mono">
        <div class="flex items-center gap-1 min-w-0">
          <span class="text-zinc-600">path:</span>
          <span class="text-zinc-600 truncate">{{ peer.parent_path }}</span>
          <span class="text-zinc-400 font-medium shrink-0">{{ peer.folder }}</span>
        </div>
      </div>
    </a>
    {% endfor %}
  </div>
  {% else %}
  <div class="text-center py-16">
    <div class="text-zinc-700 text-sm">No peers online</div>
    <div class="text-zinc-800 text-xs mt-1">Start an agent session to see it here</div>
  </div>
  {% endif %}

  <!-- Recent activity -->
  {% if recent_events %}
  <h3 class="text-[10px] font-mono text-zinc-600 uppercase tracking-wider mb-3">Recent Activity</h3>
  <div class="space-y-1">
    {% for event in recent_events %}
    <div class="flex items-start gap-2 text-xs font-mono text-zinc-600">
      <span class="shrink-0 text-zinc-700">{{ event.time }}</span>
      <span class="text-zinc-500">{{ event.from }} → {{ event.to }}</span>
      <span class="truncate text-zinc-600">{{ event.text }}</span>
    </div>
    {% endfor %}
  </div>
  {% endif %}
</div>
