{# HTMX swap target: returns updated status badge + inline form #}
<div id="lead-status-section">
  <div class="flex items-center gap-3 mb-3">
    <span class="lead-status-badge lead-status-{{ status | replace(' ', '_') }}" style="font-size:0.875rem;padding:4px 12px;">
      {{ status | replace('_', ' ') }}
    </span>
    <span class="text-xs text-slate">updated</span>
  </div>
  <form hx-post="{{ url_for('admin.lead_status_htmx', lead_id=lead_id) }}"
        hx-target="#lead-status-section"
        hx-swap="outerHTML"
        class="flex items-center gap-2">
    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
    <select name="status" class="form-input" style="min-width:160px">
      {% for s in ['new','pending_verification','contacted','forwarded','closed_won','closed_lost'] %}
      <option value="{{ s }}" {% if s == status %}selected{% endif %}>{{ s | replace('_', ' ') }}</option>
      {% endfor %}
    </select>
    <button type="submit" class="btn-outline btn-sm">Update</button>
  </form>
</div>
