<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Documentos del legajo próximos a vencer</title>
</head>
<body style="margin:0;padding:0;background:#f3f6fa;font-family:Arial,Helvetica,sans-serif;color:#212121;">
  <table width="100%" cellpadding="0" cellspacing="0" style="background:#f3f6fa;padding:24px 0;">
    <tr><td align="center">
      <table width="600" cellpadding="0" cellspacing="0" style="background:#ffffff;border-radius:8px;overflow:hidden;border:1px solid #e0e7ee;">
        <tr>
          <td style="background:linear-gradient(135deg,#1565c0,#0d47a1);color:#ffffff;padding:20px 24px;">
            <h1 style="margin:0;font-size:18px;font-weight:600;">{{empresaNombre}} — Legajo digital</h1>
            <p style="margin:4px 0 0;font-size:13px;opacity:.9;">Documentos próximos a vencer / vencidos</p>
          </td>
        </tr>
        <tr>
          <td style="padding:20px 24px 8px;">
            <p style="margin:0 0 12px;font-size:14px;">
              {{#if esEmpleado}}
                Hola <strong>{{empleadoNombre}}</strong>,
              {{else}}
                Hola,
              {{/if}}
            </p>
            <p style="margin:0 0 16px;font-size:14px;line-height:1.5;">
              Te enviamos esta notificación porque hay documentos del legajo de
              <strong>{{empleadoNombre}}</strong> que están <strong>{{categoria}}</strong>.
              Por favor regulariza la situación cargando los documentos renovados.
            </p>
          </td>
        </tr>
        <tr>
          <td style="padding:0 24px 16px;">
            <table width="100%" cellpadding="8" cellspacing="0" style="border-collapse:collapse;font-size:13px;">
              <thead>
                <tr style="background:#eef3f8;text-align:left;">
                  <th style="padding:8px;border-bottom:1px solid #cfd8dc;">Documento</th>
                  <th style="padding:8px;border-bottom:1px solid #cfd8dc;">Vencimiento</th>
                  <th style="padding:8px;border-bottom:1px solid #cfd8dc;">Estado</th>
                </tr>
              </thead>
              <tbody>
                {{#each documentos}}
                <tr style="border-bottom:1px solid #eceff1;">
                  <td style="padding:8px;">
                    <div style="font-weight:600;">{{this.tipo_nombre}}</div>
                    <div style="font-size:11px;color:#78909c;">{{this.codigo}} · {{this.nombre_original}}</div>
                  </td>
                  <td style="padding:8px;">{{this.fecha_vencimiento}}</td>
                  <td style="padding:8px;">
                    <span style="display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600;
                      {{#if this.es_vencido}}background:#ffebee;color:#c62828;{{else}}background:#fff8e1;color:#ef6c00;{{/if}}">
                      {{#if this.es_vencido}}Vencido{{else}}Vence en {{this.dias_para_vencer}} días{{/if}}
                    </span>
                  </td>
                </tr>
                {{/each}}
              </tbody>
            </table>
          </td>
        </tr>
        <tr>
          <td style="padding:8px 24px 24px;font-size:12px;color:#607d8b;border-top:1px solid #eceff1;">
            <p style="margin:8px 0 0;">
              Esta es una notificación automática del sistema Novasis ERP — Módulo de Legajos Digitales.
              Para actualizar los documentos, ingresá a <strong>RRHH › Legajos</strong>.
            </p>
          </td>
        </tr>
      </table>
    </td></tr>
  </table>
</body>
</html>
