{% extends "emails/_base.html" %}
{% from "emails/_macros.html" import email_button, heat_badge_sm %}

{% block body %}
<h2 style="margin:0 0 8px;color:#0F172A;font-size:18px;">
  Your weekly lead digest &mdash; {{ leads | length }} new {{ "lead" if leads | length == 1 else "leads" }}
</h2>
<hr style="border:none;border-top:1px solid #E2E8F0;margin:0 0 16px;">
<p style="font-size:14px;color:#334155;">New matching leads in your service area this week:</p>

<table cellpadding="0" cellspacing="0" style="margin-bottom:20px;width:100%;">
  <thead>
    <tr>
      <th style="text-align:left;font-size:11px;color:#94A3B8;padding:0 12px 6px 0;text-transform:uppercase;">Project</th>
      <th style="text-align:left;font-size:11px;color:#94A3B8;padding:0 12px 6px 0;text-transform:uppercase;">Country</th>
      <th style="text-align:left;font-size:11px;color:#94A3B8;text-transform:uppercase;">Timeline</th>
    </tr>
  </thead>
  <tbody>
    {% for lead in leads %}
    <tr>
      <td style="padding:6px 12px 6px 0;font-size:13px;color:#1E293B;">
        {{ heat_badge_sm(lead.heat | upper) }} {{ lead.facility_type or "Padel" }}, {{ lead.court_count or "?" }} courts
      </td>
      <td style="padding:6px 12px 6px 0;font-size:13px;color:#64748B;">{{ lead.country or "-" }}</td>
      <td style="padding:6px 0;font-size:13px;color:#64748B;">{{ lead.timeline or "-" }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{{ email_button(base_url ~ "/suppliers/leads", "Unlock leads →") }}
{% endblock %}
