<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>{{ subject or "Notification" }}</title>
  </head>
  <body style="margin:0;padding:0;background-color:#f4f6fb;font-family:Arial, sans-serif;">
    <table width="100%" cellpadding="0" cellspacing="0" style="background-color:#f4f6fb;padding:24px 0;">
      <tr>
        <td align="center">
          <table width="600" cellpadding="0" cellspacing="0" style="background:#ffffff;border-radius:8px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.08);">
            <tr>
              <td style="background:{{ (brand.primary_color if brand else '#1f2937') }};color:#ffffff;padding:16px 24px;font-size:18px;font-weight:bold;">
                {% if brand and brand.logo_url %}
                  <img src="{{ brand.logo_url }}" alt="{{ brand.company_name or brand.app_name or 'Logo' }}" style="height:28px;vertical-align:middle;margin-right:10px;" />
                {% endif %}
                {{ (brand.app_name if brand else app_name) or "Jana ERP" }}
              </td>
            </tr>
            <tr>
              <td style="padding:24px;color:#111827;font-size:14px;line-height:1.6;">
                {% block content %}{% endblock %}
              </td>
            </tr>
            <tr>
              <td style="padding:16px 24px;color:#6b7280;font-size:12px;border-top:1px solid #e5e7eb;">
                {% if brand and brand.footer_text %}
                  {{ brand.footer_text }}
                {% else %}
                  You are receiving this email because you have an account with {{ (brand.app_name if brand else app_name) or "Jana ERP" }}.
                {% endif %}
                {% if brand and brand.support_email %}
                  <div style="margin-top:8px;">Support: <a href="mailto:{{ brand.support_email }}" style="color:#2563eb;text-decoration:none;">{{ brand.support_email }}</a></div>
                {% endif %}
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </body>
</html>
