<tr class="hover:bg-app-surfaceHover transition-colors" id="source-row-{{ s.id }}">
  <td class="px-4 py-3 font-mono text-[10px] text-app-textMuted">{{ s.id }}</td>
  <td class="px-4 py-3 uppercase text-[10px] tracking-widest font-bold text-app-textMuted">{{ s.platform }}</td>
  <td class="px-4 py-3">
    <div class="flex items-center gap-2">
      <span class="font-bold text-app-textMain">{{ s.name }}</span>
    </div>
    <div class="text-[10px] font-mono text-app-textMuted mt-1" title="External ID">{{ s.external_id or "" }}</div>
  </td>
  <td class="px-4 py-3 font-mono text-[10px] text-blue-400">#{{ s.tag or "—" }}</td>
  <td class="px-4 py-3">
    <a href="{{ s.url }}" target="_blank" class="text-app-textMuted hover:text-white hover:underline truncate inline-block max-w-[12rem]" title="{{ s.url }}">{{ s.url }}</a>
  </td>
  <td class="px-4 py-3">
    <div class="flex flex-col gap-1 items-start">
      <div class="flex items-center gap-2">
        {% if s.active %}
        <span class="flex items-center gap-1 text-[10px] font-medium text-app-success"><span class="w-1.5 h-1.5 rounded-full bg-app-success"></span> Работает</span>
        {% else %}
        <span class="flex items-center gap-1 text-[10px] font-medium text-app-error"><span class="w-1.5 h-1.5 rounded-full bg-app-error"></span> На паузе</span>
        {% endif %}
      </div>
      <div class="flex items-center gap-1 mt-0.5">
        <span class="text-[9px] text-app-textMuted uppercase tracking-wider">Парсер:</span>
        <span class="badge {% if s.status == 'ok' %}bg-app-success/10 text-app-success border-app-success/20{% elif s.status == 'error' %}bg-app-error/10 text-app-error border-app-error/20{% else %}bg-app-bg text-app-textMuted border-app-border{% endif %} px-1.5 py-0.5 text-[9px] uppercase tracking-wider">{{ s.status }}</span>
      </div>
      {% if s.status_msg %}
      <span class="text-[9px] text-app-textMuted truncate max-w-[10rem] mt-0.5" title="{{ s.status_msg }}">{{ s.status_msg }}</span>
      {% endif %}
    </div>
  </td>
  <td class="px-4 py-3 text-right">
    <div class="font-bold text-app-textMain">{{ s.posts_count }}</div>
    <div class="text-[10px] text-app-success" title="За последние 24 часа">+{{ s.posts_24h }}</div>
  </td>
  <td class="px-4 py-3 text-right text-[10px] text-app-textMuted">{{ s.last_parsed_at_fmt or "Никогда" }}</td>
  <td class="px-4 py-3 text-center">
    <div class="flex justify-center items-center gap-1">
      <a href="/sources/{{ s.id }}/edit" class="btn btn-ghost btn-icon w-8 h-8 rounded-md hover:bg-app-surface text-app-textMuted hover:text-white" title="Править">
        <i data-lucide="edit-2" class="w-4 h-4"></i>
      </a>
      <form hx-post="/sources/{{ s.id }}/toggle" hx-target="#source-row-{{ s.id }}" hx-swap="outerHTML" class="m-0">
        <input type="hidden" name="csrf_token" value="{{ user.csrf_token }}">
        <button class="btn btn-ghost btn-icon w-8 h-8 rounded-md hover:bg-app-surface text-app-textMuted hover:text-white" type="submit" title="{% if s.active %}Поставить на паузу{% else %}Возобновить{% endif %}">
          {% if s.active %}
            <i data-lucide="pause-circle" class="w-4 h-4 text-app-warning"></i>
          {% else %}
            <i data-lucide="play-circle" class="w-4 h-4 text-app-success"></i>
          {% endif %}
        </button>
      </form>
      <form hx-post="/sources/{{ s.id }}/delete" hx-target="#source-row-{{ s.id }}" hx-swap="outerHTML swap:1s" hx-confirm="Удалить источник {{ s.name }}?" class="m-0">
        <input type="hidden" name="csrf_token" value="{{ user.csrf_token }}">
        <button class="btn btn-ghost btn-icon w-8 h-8 rounded-md hover:bg-app-errorBg text-app-textMuted hover:text-app-error" type="submit" title="Удалить">
          <i data-lucide="trash-2" class="w-4 h-4"></i>
        </button>
      </form>
    </div>
  </td>
</tr>
