<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="https://formatounico.com/formatos/feed.xml" rel="self" type="application/atom+xml" /><link href="https://formatounico.com/formatos/" rel="alternate" type="text/html" /><updated>2026-08-23T13:20:24-05:00</updated><id>https://formatounico.com/formatos/feed.xml</id><title type="html">Formatos para Llenar en Línea</title><subtitle>Plantillas, formatos interactivos y documentos listos para llenar en línea e imprimir o descargar en PDF.</subtitle><entry><title type="html">Formato No Declarante de Renta</title><link href="https://formatounico.com/formatos/formato-no-declarante-de-renta/" rel="alternate" type="text/html" title="Formato No Declarante de Renta" /><published>2026-08-18T00:00:00-05:00</published><updated>2026-08-18T00:00:00-05:00</updated><id>https://formatounico.com/formatos/formato-no-declarante-de-renta</id><content type="html" xml:base="https://formatounico.com/formatos/formato-no-declarante-de-renta/"><![CDATA[<!DOCTYPE html>
<html lang="es">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">

  <!-- SEO Primary Meta Tags -->
  <title>► formato de no declarante de renta - Rellenar y descargar PDF</title>
  <meta name="title" content="► formato de no declarante de renta - Rellenar y descargar PDF">
  <meta name="description"
    content="Descarga el modelo de formato de no declarante de renta en Colombia. Conoce los topes de la DIAN, cómo redactarlo y qué hacer si te lo piden.">
  <meta name="keywords"
    content="formato de no declarante de renta, formato no declarante de renta colombia, certificado no declarante dian, carta no declarante de renta, modelo no declarante renta word pdf, topes no declarantes dian">
  <meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
  <meta name="author" content="FormatoÚnico">
  <meta http-equiv="content-language" content="es">
  <link rel="canonical" href="https://formatounico.com/formatos/formato-no-declarante-de-renta/">
  <link rel="icon" type="image/webp" href="/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp">
  <link rel="apple-touch-icon" href="/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp">

  <!-- Open Graph / Facebook / LinkedIn / WhatsApp -->
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://formatounico.com/formatos/formato-no-declarante-de-renta/">
  <meta property="og:title" content="► formato de no declarante de renta - Rellenar y descargar PDF">
  <meta property="og:description"
    content="Descarga el modelo de formato de no declarante de renta en Colombia. Conoce los topes de la DIAN, cómo redactarlo y qué hacer si te lo piden.">
  <meta property="og:image" content="https://formatounico.com/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp">
  <meta property="og:locale" content="es_CO">
  <meta property="og:site_name" content="FormatoÚnico">

  <!-- Twitter Card -->
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:url" content="https://formatounico.com/formatos/formato-no-declarante-de-renta/">
  <meta name="twitter:title" content="► formato de no declarante de renta - Rellenar y descargar PDF">
  <meta name="twitter:description"
    content="Descarga el modelo de formato de no declarante de renta en Colombia. Conoce los topes de la DIAN, cómo redactarlo y qué hacer si te lo piden.">
  <meta name="twitter:image" content="https://formatounico.com/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp">

  <!-- Google Fonts -->
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link
    href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap"
    rel="stylesheet">

  <!-- CSS del Editor Global -->
  <link rel="stylesheet" href="/formatos/assets/editor/style.css">

  <!-- Estilos Específicos para Tabla de Personas a Cargo y Formato No Declarante -->
  <style>
    .dependents-table {
      width: 100%;
      border-collapse: collapse;
      margin: 6px 0 10px 0;
      font-size: 9.5pt;
    }
    .dependents-table th,
    .dependents-table td {
      border: 1px solid #111827;
      padding: 4px 8px;
      text-align: left;
    }
    .dependents-table th {
      background-color: #f1f5f9;
      font-weight: 700;
      text-transform: uppercase;
      font-size: 8.5pt;
      letter-spacing: 0.5px;
    }
    .dependents-table td {
      height: 22px;
    }
    .dependents-table td[contenteditable="true"]:focus {
      outline: 2px solid #3b82f6;
      background-color: #eff6ff;
    }
    .declaration-legal-text {
      text-align: justify;
      line-height: 1.35;
      font-size: 9.5pt;
      margin-bottom: 12px;
    }
    .declaration-fields-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-bottom: 12px;
      font-size: 9.5pt;
      line-height: 1.35;
    }
    .declaration-field-item {
      display: flex;
      align-items: baseline;
      gap: 6px;
    }
    .declaration-field-label {
      font-weight: 700;
      color: #0f172a;
      flex-shrink: 0;
    }
    .declaration-field-value {
      flex-grow: 1;
      border-bottom: 1px dotted #94a3b8;
      min-height: 18px;
    }
    .declaration-field-value[contenteditable="true"]:focus {
      outline: 1px solid #3b82f6;
      border-bottom-color: #3b82f6;
      background: #f8fafc;
    }
  </style>

  <!-- Supabase JS SDK -->
  <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>

  <!-- Schema.org JSON-LD Structured Data: WebApplication -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "WebApplication",
    "name": "► formato de no declarante de renta - Rellenar y descargar PDF",
    "url": "https://formatounico.com/formatos/formato-no-declarante-de-renta/",
    "description": "Descarga el modelo de formato de no declarante de renta en Colombia. Conoce los topes de la DIAN, cómo redactarlo y qué hacer si te lo piden.",
    "applicationCategory": "BusinessApplication",
    "operatingSystem": "All",
    "browserRequirements": "Requires JavaScript. Requires HTML5."
  }
  </script>

  <!-- Schema.org JSON-LD Structured Data: Article -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Article",
    "headline": "Formato No Declarante de Renta en Colombia: Modelo y Guía Práctica",
    "description": "Descarga el modelo de formato de no declarante de renta en Colombia. Conoce los topes de la DIAN, cómo redactarlo y qué hacer si te lo piden.",
    "image": "https://formatounico.com/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp",
    "author": {
      "@type": "Organization",
      "name": "FormatoÚnico",
      "url": "https://formatounico.com"
    },
    "publisher": {
      "@type": "Organization",
      "name": "FormatoÚnico",
      "logo": {
        "@type": "ImageObject",
        "url": "https://formatounico.com/favicon.svg"
      }
    },
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "https://formatounico.com/formatos/formato-no-declarante-de-renta/"
    }
  }
  </script>

  <!-- Schema.org JSON-LD Structured Data: FAQPage (10 Preguntas Clave) -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "¿Qué pasa si firmo un formato de no declarante y sí estaba obligado?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Firmar una constancia bajo gravedad de juramento con información falsa o inexacta puede acarrear implicaciones legales por falsedad en documento privado y sanciones administrativas por parte de la DIAN si se omite una obligación tributaria sustancial."
        }
      },
      {
        "@type": "Question",
        "name": "¿Una empresa o banco me puede obligar a presentar este formato?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Sí, las entidades financieras, áreas de recursos humanos o fondos de pensiones suelen solicitarlo internamente para justificar pagos, exenciones de retención en la fuente a título de renta o estudios de crédito."
        }
      },
      {
        "@type": "Question",
        "name": "¿El formato de no declarante sirve para solicitar créditos bancarios?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Sí, las entidades financieras lo aceptan junto con los extractos bancarios o certificados de ingresos laborales para evaluar la capacidad de endeudamiento y verificar la situación fiscal del solicitante."
        }
      },
      {
        "@type": "Question",
        "name": "¿Cada cuánto tiempo se debe actualizar este formato?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Por lo general, tiene vigencia por el año gravable que certifica. Cada vez que inicie un nuevo ciclo de cobro de impuestos o la entidad solicitante lo requiera, debe actualizarse con las cifras correspondientes al nuevo periodo."
        }
      },
      {
        "@type": "Question",
        "name": "¿Necesito un contador público para firmar este formato?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "No es obligatorio contar con la firma de un contador público, ya que se trata de una manifestación personal bajo gravedad de juramento sobre los propios ingresos y topes del ciudadano."
        }
      },
      {
        "@type": "Question",
        "name": "¿Dónde puedo consultar si tengo alguna obligación pendiente con la DIAN?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Puedes ingresar al portal transaccional de la DIAN con tu usuario y contraseña, consultar el estado de tu cuenta y revisar tus obligaciones tributarias en la sección de consulta de RUT y responsabilidades."
        }
      },
      {
        "@type": "Question",
        "name": "¿Qué es la retención en la fuente para no declarantes?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Es un mecanismo de recaudo anticipado del impuesto. Aunque no estés obligado a declarar renta, es posible que te practiquen retenciones en tu salario o pagos, las cuales constituyen un ingreso definitivo si no alcanzas los topes para declarar."
        }
      },
      {
        "@type": "Question",
        "name": "¿Los trabajadores independientes también pueden usar este formato?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Sí, siempre y cuando sus ingresos totales, contratos, consignaciones y patrimonio bruto del año gravable se mantengan por debajo de los topes fijados por la ley para personas naturales no obligadas."
        }
      },
      {
        "@type": "Question",
        "name": "¿Qué hago si superé los topes por un margen muy pequeño?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Si superas cualquiera de los topes establecidos por la DIAN (incluso por un monto mínimo), automáticamente adquieres la obligación legal de presentar la declaración de renta, por lo que no podrías firmar el formato de no declarante."
        }
      },
      {
        "@type": "Question",
        "name": "¿Tiene algún costo legal emitir este certificado?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "El formato redactado por ti no tiene ningún costo. Únicamente generará gastos si decides o la entidad te exige autenticar tu firma ante una Notaría pública."
        }
      }
    ]
  }
  </script>
</head>

<body class="theme-sans font-medium margin-normal spacing-normal color-black" data-document-slug="formato-no-declarante-de-renta">

  <!-- 1. BARRA DE NAVEGACIÓN UNIVERSAL (DESKTOP Y MÓVIL) -->
  <header class="app-navbar mobile-navbar no-print">
    <!-- Izquierda: Marca / Título del Formato -->
    <div class="navbar-left">
      <a href="/formatos/formato-no-declarante-de-renta/" class="navbar-brand-title" style="text-decoration: none;">
        <span>No Declarante de Renta</span>
      </a>
    </div>

    <!-- Derecha: Botón Pagar + Botón Menú Hamburguesa -->
    <div class="navbar-right">
      <!-- Botón Pagar y Descargar SIEMPRE visible en Desktop y Móvil -->
      <button class="navbar-action-btn btn-nav-pay" id="btn-generate-pdf" onclick="processPaymentFlow()"
        title="Generar código de recuperación, guardar PDF y continuar al pago">
        <span>📥</span> <span class="nav-btn-text">Pagar y Descargar</span>
      </button>

      <!-- Botón Menú Hamburguesa -->
      <button id="btn-navbar-menu-toggle" class="navbar-menu-toggle-btn no-print" onclick="toggleNavbarActionsMenu()" aria-label="Abrir menú de opciones" title="Menú de opciones">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
          <line x1="3" y1="6" x2="21" y2="6"></line>
          <line x1="3" y1="12" x2="21" y2="12"></line>
          <line x1="3" y1="18" x2="21" y2="18"></line>
        </svg>
      </button>

      <!-- Menú Desplegable con opciones -->
      <div id="navbar-actions-menu" class="navbar-actions-menu">
        <button class="navbar-action-btn" onclick="handleNavbarPreviewClick()"
          title="Ver cómo se verá el PDF final con marca de agua">
          <span>👁️</span> <span>Vista Previa PDF</span>
        </button>
        <a href="./gracias/" class="navbar-action-btn"
          title="Recuperar tu documento pagado">
          <span>🔍</span> <span>Recuperar Doc</span>
        </a>
        <button class="navbar-action-btn" onclick="resetTemplate(); toggleNavbarActionsMenu();"
          title="Restablecer documento">
          <span>🔄</span> <span>Restablecer Todo</span>
        </button>
        <div class="navbar-menu-divider"></div>
        <a href="/formatos/" class="navbar-action-btn" title="Ver todos los formatos disponibles">
          <span>📂</span> <span>Formatos</span>
        </a>
        <a href="/" class="navbar-action-btn" title="Ir a la página de inicio">
          <span>🏠</span> <span>Inicio</span>
        </a>
      </div>
    </div>
  </header>

  <!-- TELÓN DE FONDO DE LA BARRA LATERAL EN MÓVIL -->
  <div id="sidebar-backdrop" class="sidebar-backdrop no-print" onclick="closeSidebar()"></div>

  <!-- TELÓN DE FONDO DE LA VISTA PREVIA DESLIZABLE MÓVIL -->
  <div id="mobile-preview-backdrop" class="mobile-preview-backdrop no-print" onclick="toggleMobilePreview(false)"></div>

  <!-- 2. BARRA LATERAL DE CONTROL (SIDEBAR / FORMULARIO) -->
  <aside id="sidebar" class="sidebar no-print">
    <!-- Encabezado Móvil H1 Semántico -->
    <div class="mobile-page-header no-print">
      <h1 class="mobile-h1-title">► Formato de No Declarante de Renta</h1>
      <p class="mobile-h1-subtitle">Rellenar en línea y descargar PDF</p>
    </div>

    <!-- Pestañas de la Barra Lateral -->
    <div class="sidebar-tab-switcher no-print">
      <button id="tab-btn-settings" class="sidebar-tab-btn" onclick="switchSidebarTab('settings')">
        <span>🎨</span> Diseño & Guía
      </button>
      <button id="tab-btn-form" class="sidebar-tab-btn active" onclick="switchSidebarTab('form')">
        <span>📝</span> Formulario
      </button>
    </div>

    <div class="sidebar-content">
      <!-- PESTAÑA: AJUSTES DE DISEÑO & ARTÍCULO SEO -->
      <div id="tab-pane-settings" class="tab-pane" style="display: none;">
        
        <!-- Ajustes Tipográficos y de Hoja -->
        <div class="settings-group">
          <label for="font-select">Tipografía</label>
          <select id="font-select" class="settings-control" onchange="updateStyles()">
            <option value="sans" selected>Sans-Serif (Inter - Moderna)</option>
            <option value="serif">Serif (Merriweather - Formal Notarial)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="size-select">Tamaño de Letra</label>
          <select id="size-select" class="settings-control" onchange="updateStyles()">
            <option value="small">Pequeño (9.5pt)</option>
            <option value="medium" selected>Mediano (10.5pt - Estándar)</option>
            <option value="large">Grande (11.5pt)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="margin-select">Márgenes de Hoja</label>
          <select id="margin-select" class="settings-control" onchange="updateStyles()">
            <option value="narrow">Estrechos (0.5in)</option>
            <option value="normal" selected>Normales (0.75in - Carta Oficial)</option>
            <option value="wide">Anchos (1.0in)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="spacing-select">Interlineado</label>
          <select id="spacing-select" class="settings-control" onchange="updateStyles()">
            <option value="1.3">Compacto (1.3)</option>
            <option value="1.4" selected>Normal (1.4)</option>
            <option value="1.5">Espaciado (1.5)</option>
          </select>
        </div>

        <!-- Tips de Edición -->
        <div class="info-box">
          <h3>💡 Tips de edición rápida:</h3>
          <ul>
            <li>Haz clic y escribe directamente sobre cualquier campo o texto de la hoja.</li>
            <li>Puedes rellenar o borrar filas de la <b>tabla de personas a cargo</b> según tu caso.</li>
            <li>Sube tu <b>firma manuscrita en imagen</b> o fírmalo tras imprimirlo.</li>
            <li>Genera tu PDF listo para radicar ante universidades, bancos o empresas.</li>
          </ul>
        </div>

        <!-- ARTÍCULO GUÍA Y SEO DE ALTA AUTORIDAD: FORMATO NO DECLARANTE DE RENTA -->
        <article class="seo-article-box info-box">
          <header class="seo-article-header">
            <h2 class="seo-title" style="font-size: 16px; margin: 0 0 8px 0; color: #60a5fa;">Formato No Declarante de Renta en Colombia: Modelo y Guía Práctica</h2>
            <p class="seo-subtitle" style="font-size: 12px; color: #94a3b8; line-height: 1.4;">Guía jurídica y tributaria completa sobre la certificación de no obligatoriedad, topes oficiales de la DIAN en UVT, cálculo en pesos colombianos y modelo interactivo bajo gravedad de juramento.</p>
          </header>

          <!-- Featured Snippet Direct Answer -->
          <blockquote style="background: rgba(59, 130, 246, 0.1); border-left: 4px solid #3b82f6; padding: 12px 14px; margin: 14px 0; border-radius: 0 8px 8px 0; font-size: 0.85rem; line-height: 1.5; color: #cbd5e1;">
            El <strong>formato de no declarante de renta</strong> es una manifestación escrita y firmada bajo gravedad de juramento mediante la cual una persona natural residente en Colombia certifica ante un tercero (entidad financiera, empleador, empresa contratante o institución educativa) que durante el año gravable respectivo sus ingresos brutos, patrimonio bruto, consumos con tarjetas de crédito, compras y consignaciones bancarias <strong>no superaron los <a href="/topes-para-declarar-renta/" style="color: #60a5fa; text-decoration: underline;">topes para declarar renta</a></strong> fijados por la ley tributaria nacional (Estatuto Tributario, artículos 592 a 594-3 y Decreto 836 de 1991, artículo 29), quedando legalmente exonerada de presentar la <a href="/como-hacer-declaracion-de-renta/" style="color: #60a5fa; text-decoration: underline;">declaración de renta</a> ante la Dirección de Impuestos y Aduanas Nacionales (DIAN).
          </blockquote>

          <!-- Sección 1 -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">¿Qué es el formato de no declarante de renta y para qué sirve?</h3>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              En el sistema tributario colombiano, las personas naturales que no alcanzan los umbrales económicos obligatorios establecidos por el Gobierno Nacional no tienen la obligación sustancial de diligenciar el Formulario 210 de la DIAN. No obstante, en la vida civil, comercial y laboral, diversos trámites cotidianos exigen un soporte documental que justifique por qué el ciudadano no anexa una copia de su declaración tributaria.
            </p>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              Este formato sirve como **prueba documental idónea y suficiente** en los siguientes escenarios habituales:
            </p>
            <ul style="font-size: 11.5px; color: #94a3b8; line-height: 1.5; padding-left: 18px; margin: 6px 0;">
              <li><strong>Contratación por Prestación de Servicios:</strong> Para anexar a las <a href="/formatos/cuenta-de-cobro/" style="color: #60a5fa; text-decoration: underline;">cuentas de cobro</a> y contratos comerciales, permitiendo a la empresa pagadora liquidar la correcta tarifa de <a href="/que-es-retencion-en-la-fuente/" style="color: #60a5fa; text-decoration: underline;">retención en la fuente</a> según la condición del contribuyente.</li>
              <li><strong>Solicitudes de Créditos Bancarios e Hipotecarios:</strong> Las entidades financieras y cooperativas lo exigen junto con extractos bancarios para corroborar la capacidad de pago y el perfil de riesgo crediticio.</li>
              <li><strong>Matrículas Universitarias y Becas:</strong> Instituciones de educación superior públicas y privadas solicitan el documento para clasificar socioeconómicamente al estudiante y liquidar el valor semestral de la matrícula.</li>
              <li><strong>Trámites Notariales y de Registro:</strong> En la compraventa de inmuebles o vehículos para justificar el origen de recursos y el estatus tributario.</li>
              <li><strong>Subsidios de Vivienda y Cajas de Compensación:</strong> Para postulación a subsidios de vivienda de interés social (VIS) o beneficios de cajas de compensación familiar.</li>
            </ul>
          </section>

          <!-- Sección 2: Topes Detallados y Tabla Oficial -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">Topes oficiales de la DIAN para no estar obligado a declarar renta</h3>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              Para que una persona natural no esté obligada a declarar renta, debe cumplir **la totalidad** de los siguientes requisitos durante el respectivo año gravable. Si supera **incluso uno solo** de los topes por cualquier margen, adquiere inmediatamente la obligación legal de declarar dentro de las fechas fijadas en el <a href="/calendario-tributario-dian/" style="color: #60a5fa; text-decoration: underline;">calendario tributario de la DIAN</a>:
            </p>

            <div style="overflow-x: auto; margin: 10px 0;">
              <table style="width: 100%; font-size: 11px; border-collapse: collapse; color: #cbd5e1; background: #0f172a; border-radius: 6px; overflow: hidden; border: 1px solid #334155;">
                <thead>
                  <tr style="background: #1e293b; border-bottom: 1px solid #475569; color: #93c5fd;">
                    <th style="padding: 8px; text-align: left;">Requisito Tributario (Concepto)</th>
                    <th style="padding: 8px; text-align: center;">Tope en UVT</th>
                    <th style="padding: 8px; text-align: right;">Año Gravable 2024<br><span style="font-size: 9px; color: #94a3b8;">(UVT $47.065)</span></th>
                    <th style="padding: 8px; text-align: right;">Año Gravable 2025<br><span style="font-size: 9px; color: #94a3b8;">(UVT $49.799)</span></th>
                  </tr>
                </thead>
                <tbody>
                  <tr style="border-bottom: 1px solid #1e293b;">
                    <td style="padding: 7px; font-weight: 600;">Patrimonio Bruto (a dic 31)</td>
                    <td style="padding: 7px; text-align: center; color: #38bdf8; font-weight: 700;">4.500 UVT</td>
                    <td style="padding: 7px; text-align: right;">$211.792.500</td>
                    <td style="padding: 7px; text-align: right; font-weight: 700; color: #86efac;">$224.095.500</td>
                  </tr>
                  <tr style="border-bottom: 1px solid #1e293b; background: rgba(30, 41, 59, 0.3);">
                    <td style="padding: 7px; font-weight: 600;">Ingresos Totales del Año</td>
                    <td style="padding: 7px; text-align: center; color: #38bdf8; font-weight: 700;">1.400 UVT</td>
                    <td style="padding: 7px; text-align: right;">$65.891.000</td>
                    <td style="padding: 7px; text-align: right; font-weight: 700; color: #86efac;">$69.718.600</td>
                  </tr>
                  <tr style="border-bottom: 1px solid #1e293b;">
                    <td style="padding: 7px; font-weight: 600;">Consumos con Tarjeta de Crédito</td>
                    <td style="padding: 7px; text-align: center; color: #38bdf8; font-weight: 700;">1.400 UVT</td>
                    <td style="padding: 7px; text-align: right;">$65.891.000</td>
                    <td style="padding: 7px; text-align: right; font-weight: 700; color: #86efac;">$69.718.600</td>
                  </tr>
                  <tr style="border-bottom: 1px solid #1e293b; background: rgba(30, 41, 59, 0.3);">
                    <td style="padding: 7px; font-weight: 600;">Compras y Consumos Totales</td>
                    <td style="padding: 7px; text-align: center; color: #38bdf8; font-weight: 700;">1.400 UVT</td>
                    <td style="padding: 7px; text-align: right;">$65.891.000</td>
                    <td style="padding: 7px; text-align: right; font-weight: 700; color: #86efac;">$69.718.600</td>
                  </tr>
                  <tr style="border-bottom: 1px solid #1e293b;">
                    <td style="padding: 7px; font-weight: 600;">Consignaciones Bancarias / Depósitos</td>
                    <td style="padding: 7px; text-align: center; color: #38bdf8; font-weight: 700;">1.400 UVT</td>
                    <td style="padding: 7px; text-align: right;">$65.891.000</td>
                    <td style="padding: 7px; text-align: right; font-weight: 700; color: #86efac;">$69.718.600</td>
                  </tr>
                  <tr>
                    <td style="padding: 7px; font-weight: 600;">Responsabilidad frente al IVA</td>
                    <td style="padding: 7px; text-align: center; color: #f87171; font-weight: 700;">NO Responsable</td>
                    <td colspan="2" style="padding: 7px; text-align: center; color: #94a3b8;">No pertenecer al régimen común de IVA (antiguo régimen común)</td>
                  </tr>
                </tbody>
              </table>
            </div>

            <p style="font-size: 11.5px; line-height: 1.5; color: #94a3b8;">
              ⚠️ <strong>Ojo con las consignaciones bancarias:</strong> La DIAN suma todos los movimientos que ingresaron a tus cuentas (Nequi, Daviplata, cuentas corrientes, ahorros o transferencias entre cuentas propias). Si la suma acumulada en el año supera las <strong>1.400 UVT</strong>, estás obligado a declarar aunque ese dinero no haya sido ganancia real o haya correspondido a préstamos de terceros.
            </p>
          </section>

          <!-- Sección 3: Certificado DIAN vs Formato Privado -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">¿La DIAN expide un certificado oficial de no declarante?</h3>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              <strong>No. La DIAN no emite ningún certificado automatizado ni formulario oficial de no declarante.</strong>
            </p>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              La DIAN únicamente expide copias de declaraciones presentadas formalmente o constancias de devolución de saldos. Por esta razón, el marco legal colombiano (artículo 29 del Decreto 836 de 1991) avala que el propio ciudadano expida este documento privado bajo la gravedad de juramento, acompañado habitualmente de una copia de su <a href="/como-actualizar-el-rut-dian/" style="color: #60a5fa; text-decoration: underline;">RUT actualizado</a> donde conste su calidad de persona natural no responsable del IVA ni del impuesto sobre la renta.
            </p>
          </section>

          <!-- Sección 4: Tabla Comparativa de Conceptos -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">Diferencias entre No Declarante, Formulario 220 y Declaración en Ceros</h3>
            <div style="overflow-x: auto; margin-top: 6px;">
              <table style="width: 100%; font-size: 11px; border-collapse: collapse; color: #cbd5e1; background: #0f172a; border: 1px solid #334155; border-radius: 6px;">
                <thead>
                  <tr style="background: #1e293b; border-bottom: 1px solid #475569; color: #93c5fd;">
                    <th style="padding: 7px; text-align: left;">Concepto</th>
                    <th style="padding: 7px; text-align: left;">¿Quién lo expide?</th>
                    <th style="padding: 7px; text-align: left;">Objetivo Principal</th>
                  </tr>
                </thead>
                <tbody>
                  <tr style="border-bottom: 1px solid #1e293b;">
                    <td style="padding: 7px; font-weight: 700; color: #60a5fa;">Formato No Declarante</td>
                    <td style="padding: 7px;">El propio ciudadano / independiente</td>
                    <td style="padding: 7px;">Certificar bajo juramento que no superó los topes UVT de la DIAN.</td>
                  </tr>
                  <tr style="border-bottom: 1px solid #1e293b; background: rgba(30, 41, 59, 0.3);">
                    <td style="padding: 7px; font-weight: 700; color: #e2e8f0;">Certificado Formulario 220</td>
                    <td style="padding: 7px;">La empresa empleadora</td>
                    <td style="padding: 7px;">Certificado de ingresos y retenciones laborales de trabajadores dependientes.</td>
                  </tr>
                  <tr>
                    <td style="padding: 7px; font-weight: 700; color: #f87171;">Declaración de Renta en Ceros</td>
                    <td style="padding: 7px;">No existe para personas naturales</td>
                    <td style="padding: 7px;">En Colombia no se debe presentar declaración en ceros si no se está obligado legalmente.</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </section>

          <!-- Sección 5: Modelo Orientativo Copiar y Pegar -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">Modelo orientativo de formato de no declarante de renta</h3>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              Puedes generar tu documento profesional en segundos usando nuestro editor interactivo con descarga en PDF, o copiar el siguiente modelo textual:
            </p>
            <h4 style="font-size: 12px; color: #38bdf8; margin: 8px 0 4px 0; text-transform: uppercase;">Plantilla de Texto para Copiar y Pegar</h4>
            <div style="background: #0f172a; border: 1px solid #334155; padding: 12px; border-radius: 6px; font-family: monospace; font-size: 10.5px; color: #e2e8f0; line-height: 1.45; white-space: pre-wrap;">
Ciudad y fecha: [Ciudad de expedición], [Día] de [Mes] de [Año]

SEÑORES:
[Nombre de la Empresa, Banco o Entidad Solicitante]
[Dirección o Departamento Solicitante]
Ciudad

ASUNTO: Certificación de no obligatoriedad de presentar Declaración del Impuesto sobre la Renta y Complementarios por el año gravable [Año, ej. 2025].

Yo, [Nombres y Apellidos completos del declarante], mayor de edad, domiciliado(a) en la ciudad de [Ciudad], identificado(a) con la Cédula de Ciudadanía número [Número de Cédula] expedida en [Ciudad de expedición], obrando en nombre propio y actuando bajo la GRAVEDAD DE JURAMENTO, me permito manifestar que:

1. De conformidad con el artículo 29 del Decreto 836 de 1991 y los artículos 592 a 594-3 del Estatuto Tributario Nacional, NO me encuentro obligado(a) a presentar declaración de renta por el año gravable [2025].
2. Durante dicho periodo gravable NO fui responsable del Impuesto sobre las Ventas (IVA).
3. Mi Patrimonio Bruto al 31 de diciembre del respectivo año no superó el tope legal de 4.500 UVT.
4. Mis Ingresos Brutos anuales, consumos con tarjeta de crédito, compras totales y consignaciones bancarias acumuladas no superaron el límite de 1.400 UVT.
5. Manifiesto que la información suministrada se rinde bajo la gravedad de juramento, considerándose prestada con la firma del presente documento, en concordancia con el artículo 83 de la Constitución Política de Colombia (Presunción de Buena Fe).

Para constancia de lo anterior, se firma en [Ciudad] a los [Día] días del mes de [Mes] de [Año].

Atentamente,

___________________________________________
FIRMA DEL DECLARANTE
Nombre: [Nombres y Apellidos Completos]
C.C. No.: [Número de Cédula] de [Ciudad]
Teléfono: [Número de Contacto]
Dirección: [Dirección de Residencia]
RUT / Actividad Económica: [Código CIIU o Actividad]
            </div>
          </section>

          <!-- Sección 6: Guía Paso a Paso -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">¿Cómo diligenciar y presentar correctamente el formato?</h3>
            <ol style="font-size: 11.5px; color: #94a3b8; line-height: 1.5; padding-left: 18px; margin: 6px 0;">
              <li><strong>Reúne tus extractos bancarios:</strong> Suma todos los abonos, transferencias y consignaciones del 1 de enero al 31 de diciembre para certificar que no superan las 1.400 UVT.</li>
              <li><strong>Verifica tus certificados de ingresos o retención:</strong> Si eres independiente o contratista, valida con tus clientes los certificados de <a href="/que-es-retencion-en-la-fuente/" style="color: #60a5fa; text-decoration: underline;">retención en la fuente</a> practicados.</li>
              <li><strong>Diligencia los campos del editor:</strong> Ingresa tus datos completos, documento de identidad, dirección y personas a cargo en el formulario.</li>
              <li><strong>Adjunta tu RUT actualizado:</strong> Descarga desde el portal de la DIAN tu <a href="/como-actualizar-el-rut-dian/" style="color: #60a5fa; text-decoration: underline;">Registro Único Tributario (RUT)</a> con fecha de generación reciente.</li>
              <li><strong>Firma manuscrita o digital:</strong> Puedes subir tu firma manuscrita directamente en el editor interactivo o imprimir y firmar con bolígrafo.</li>
              <li><strong>Autenticación notarial (opcional):</strong> La ley no exige autenticar el documento ante Notario salvo que la entidad receptora lo requiera expresamente en sus políticas internas.</li>
            </ol>
          </section>

          <!-- Sección 7: Consecuencias Legales -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">Consecuencias y sanciones por falsedad en la certificación</h3>
            <p style="font-size: 12px; line-height: 1.5; color: #94a3b8;">
              Certificar falsamente que no estás obligado a declarar renta cuando en realidad superaste los topes acarrea graves consecuencias:
            </p>
            <ul style="font-size: 11.5px; color: #94a3b8; line-height: 1.5; padding-left: 18px; margin: 6px 0;">
              <li><strong>Sanción por no declarar (Art. 643 del Estatuto Tributario):</strong> La DIAN puede imponer multas equivalentes al 20% del valor de las consignaciones bancarias o ingresos brutos del año no declarado.</li>
              <li><strong>Sanción por extemporaneidad e intereses moratorios:</strong> Al ser emplazado por la DIAN, se aplican recargos del 5% al 10% por cada mes de retraso más intereses diarios.</li>
              <li><strong>Responsabilidad penal (Art. 289 del Código Penal):</strong> Falsedad en documento privado por certificar bajo gravedad de juramento información que no corresponde a la realidad económica.</li>
            </ul>
          </section>

          <!-- Sección 8: Preguntas Frecuentes FAQ -->
          <section class="seo-section" style="margin-top: 14px;">
            <h3 style="font-size: 13.5px; color: #f8fafc; margin-bottom: 6px;">Preguntas Frecuentes sobre el Formato de No Declarante (FAQ)</h3>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">1. ¿Qué pasa si firmo un formato de no declarante y sí estaba obligado?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Incurres en omisión del deber tributario ante la DIAN, haciéndote acreedor a la sanción por no declarar (artículo 643 del Estatuto Tributario) con multas de hasta el 20% de tus ingresos o consignaciones, además de eventuales sanciones penales por falsedad en documento privado.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">2. ¿Una empresa o banco me puede obligar a presentar este formato?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Sí. Las empresas, fondos de inversión y entidades financieras tienen la obligación de realizar debida diligencia fiscal (conocimiento del cliente) y soportar ante auditorías internas la razón por la cual no exigen copia de la declaración de renta a sus contratistas o clientes.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">3. ¿El formato de no declarante sirve para solicitar créditos bancarios?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Sí. Los bancos y entidades de financiamiento aceptan este formato acompañado de extractos bancarios de los últimos 3 a 6 meses, certificados laborales o facturas para evaluar el perfil crediticio sin exigir declaración tributaria.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">4. ¿Cada cuánto tiempo se debe actualizar este formato?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Tiene vigencia anual por el año gravable que certifica. Cada vez que inicie un nuevo ciclo de vencimientos fiscales según el calendario tributario de la DIAN, se debe expedir una nueva constancia con los valores del periodo inmediatamente anterior.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">5. ¿Necesito la firma de un contador público para que sea válido?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">No. Se trata de una manifestación personal que hace el ciudadano bajo gravedad de juramento amparado en el principio de buena fe (Constitución Política, Art. 83). No se requiere firma ni tarjeta profesional de contador público.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">6. ¿Dónde puedo consultar si tengo alguna obligación pendiente con la DIAN?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Ingresando al portal transaccional de la DIAN (www.dian.gov.co) en la sección "Información Exógena / Información Reportada por Terceros" con tu usuario y contraseña, donde podrás verificar los ingresos y compras que las empresas y bancos reportaron a tu nombre.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">7. ¿Qué es la retención en la fuente para no declarantes?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Es un mecanismo de cobro anticipado del impuesto. Si eres no declarante y te practican retención en la fuente en pagos o salarios, ese valor retenido se considera el pago definitivo de tu impuesto sobre la renta para dicho año fiscal.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">8. ¿Los trabajadores independientes pueden usar este formato?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Sí. Todos los trabajadores independientes, comerciantes, consultores y profesionales que no superen los topes en UVT fijados para el año gravable pueden presentar este formato ante sus contratantes o clientes.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">9. ¿Qué hago si superé los topes por un margen muy pequeño?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">Si superas cualquiera de los topes fijados por la DIAN (incluso por $1 peso), adquieres de manera obligatoria la responsabilidad de presentar la declaración de renta, por lo que no puedes firmar este certificado.</p>
            </details>

            <details style="margin-bottom: 8px; background: rgba(30, 41, 59, 0.4); border-radius: 6px; padding: 8px;">
              <summary style="font-size: 11.5px; font-weight: 700; color: #e2e8f0; cursor: pointer;">10. ¿Es obligatorio autenticar en Notaría el formato?</summary>
              <p style="font-size: 11px; color: #94a3b8; margin: 6px 0 0 0; line-height: 1.4;">De acuerdo con el Decreto Antitrámites (Decreto Ley 019 de 2012), las declaraciones juradas tienen plena validez con la firma simple del ciudadano sin requerir autenticación notarial, salvo solicitud expresa en el reglamento interno de la entidad que lo recibe.</p>
            </details>
          </section>

          <footer class="seo-article-footer" style="margin-top: 14px; font-size: 11px; color: #64748b; border-top: 1px solid #334155; padding-top: 10px;">
            <p><strong>Fuentes legales y normativas consultadas:</strong> Dirección de Impuestos y Aduanas Nacionales (DIAN), Estatuto Tributario Nacional (Artículos 592 a 594-3), Decreto Reglamentario 836 de 1991 (Artículo 29), Constitución Política de Colombia (Artículo 83) y Decreto Ley 019 de 2012 (Decreto Antitrámites).</p>
            <p style="margin-top: 6px;">Consulta también nuestros formatos relacionados: <a href="/formatos/cuenta-de-cobro/" style="color: #60a5fa;">Formato Cuenta de Cobro</a> y la guía completa de <a href="/como-hacer-declaracion-de-renta/" style="color: #60a5fa;">Cómo Hacer la Declaración de Renta en Colombia</a>.</p>
          </footer>
        </article>
      </div>

      <!-- PESTAÑA: FORMULARIO INTERACTIVO SINCRONIZADO -->
      <div id="tab-pane-form" class="tab-pane">
        <div class="info-box" style="margin-bottom: 10px;">
          <p style="margin: 0; font-size: 11.5px; color: #94a3b8; line-height: 1.4;">
            💡 <b>Sincronización en tiempo real:</b> Los datos que edites aquí se actualizan al instante en la hoja Carta. También puedes escribir directamente sobre cualquier texto del documento.
          </p>
        </div>

        <div id="form-container" class="form-container" style="display: flex; flex-direction: column; gap: 12px;"></div>

        <!-- Acciones Rápidas en Formulario Desktop -->
        <div class="settings-group sidebar-add-sections-group" style="margin-top: 16px;">
          <label>Añadir Nueva Sección / Hoja</label>
          <div style="display: flex; gap: 8px;">
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addNewSection('list')">+ Con Viñetas</button>
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addNewSection('text')">+ Solo Texto</button>
          </div>
          <div style="display: flex; gap: 8px; margin-top: 4px;">
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addSignatureSection()">✍️ + Firma / C.C.</button>
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addPhotoSection()">📷 + Foto</button>
          </div>
          <div style="display: flex; gap: 8px; margin-top: 6px;">
            <button class="btn-sidebar-add-page" style="flex: 1;" onclick="addNewPage()">📄 + Agregar Hoja</button>
            <button class="btn-sidebar-del-page" style="flex: 1;" onclick="deleteLastPage()"
              title="Eliminar la última página">🗑️ Eliminar Hoja</button>
          </div>
          <div style="margin-top: 6px; display: flex; gap: 8px;">
            <button class="btn-sidebar-reorder" onclick="openReorderModal()" style="flex: 1;"
              title="Reordenar la secuencia de las hojas del documento">📑 Reordenar Hojas</button>
          </div>
          <div style="margin-top: 6px;">
            <button class="btn-sidebar-add-pdf" onclick="triggerPDFUpload()"
              title="Cargar un documento PDF y adjuntarlo a este formato">📎 + Adjuntar Documento PDF</button>
          </div>
        </div>
      </div>
    </div>
  </aside>

  <!-- 3. ESPACIO DE TRABAJO (WORKSPACE / CARTA EDITABLE / BOTTOM SHEET EN MÓVIL) -->
  <main class="workspace" id="main-workspace">
    <!-- Pestaña de apertura de Bottom Sheet en Móvil -->
    <div class="mobile-sheet-handle no-print" onclick="toggleMobilePreview()">
      <span class="mobile-sheet-circle-icon">▲</span>
      <span class="mobile-sheet-title">Vista Previa del Documento</span>
      <span class="mobile-sheet-circle-icon">▲</span>
    </div>

    <div class="workspace-scroll-area">
      <!-- Banner de Advertencia de Exceso de Contenido -->
      <div id="overflow-warning" class="warning-banner no-print" style="display: none;">
        <span class="warning-icon">⚠️</span>
        <span class="warning-text">El contenido excede una página Carta. Se creará una segunda página automáticamente al exportar.</span>
      </div>

      <div class="page-shadow-wrapper">
        <div class="page" id="page-1" data-page="1" data-template="classic">
          <div class="page-watermark">formatounico.com</div>

          <div class="page-content">

            <!-- 1. TÍTULO DEL DOCUMENTO -->
            <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 10px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <h1 class="section-title" style="font-size: 13pt; font-weight: 800; text-transform: uppercase; text-align: center; border-bottom: none; margin: 0; letter-spacing: 0.5px;">
                <span contenteditable="true">FORMATO NO DECLARANTE DE RENTA</span>
              </h1>
            </div>

            <!-- 2. CIUDAD Y FECHA (ALINEADA A LA DERECHA) -->
            <div class="resume-section" data-section-type="text" style="text-align: right; margin-bottom: 12px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <p id="doc-date-text" class="section-text" contenteditable="true" style="font-size: 9.5pt; color: #1e293b; text-align: right; margin: 0;">
                Bogotá D.C., 15 de marzo de 2026
              </p>
            </div>

            <!-- 3. DESTINATARIO / ENTIDAD SOLICITANTE -->
            <div class="resume-section" data-section-type="text" style="margin-bottom: 12px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <div class="section-text" contenteditable="true" style="font-size: 9.5pt; line-height: 1.35; font-weight: 700; color: #0f172a;">
                SEÑORES<br>
                SERVICIOS EMPRESARIALES INTEGRALES S.A.S.<br>
                CIUDAD
              </div>
            </div>

            <!-- 4. PÁRRAFO LEGAL NORMATIVO Y TOPES DIAN -->
            <div class="resume-section" data-section-type="text" style="margin-bottom: 12px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <p class="section-text declaration-legal-text" contenteditable="true">
                De conformidad con el artículo 29 del decreto 836 de marzo 26 de 1991, que regula lo correspondiente al certificado de ingresos para personas independientes no obligados a declarar y que no requieren presentación ante la administración de impuestos, manifiesto que no estoy obligado a presentar declaración de impuesto sobre la renta y complementarios por el año gravable 2025, de acuerdo a lo previsto en los artículos 592 a 594-3 del Estatuto Tributario, en atención a que no soy responsable del impuesto a las ventas (IVA), y NO obtuve ingresos totales superiores a <strong>CINCUENTA Y NUEVE MILLONES TRESCIENTOS SETENTA Y SEIS MIL OCHOCIENTOS PESOS M/CTE ($59´376.800)</strong> y en mi condición de contribuyente de menores ingresos, manifiesto que NO poseía un patrimonio bruto en el último día del año 2025 superior a <strong>CIENTO NOVENTA MILLONES OCHOCIENTOS CINCUENTA Y CUATRO MIL PESOS M/CTE ($190´854.000)</strong>.
              </p>
            </div>

            <!-- 5. DATOS DEL DECLARANTE Y VALORES FINANCIEROS -->
            <div class="resume-section" data-section-type="text" style="margin-bottom: 12px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <div class="section-text declaration-fields-list" contenteditable="true">
                <div class="declaration-field-item">
                  <span class="declaration-field-label">Nombre:</span>
                  <span class="declaration-field-value">CARLOS ANDRÉS MARTÍNEZ RÍOS</span>
                </div>
                <div class="declaration-field-item">
                  <span class="declaration-field-label">C.C. o NIT:</span>
                  <span class="declaration-field-value">1.020.345.678</span>
                </div>
                <div class="declaration-field-item">
                  <span class="declaration-field-label">Dirección:</span>
                  <span class="declaration-field-value">Carrera 7 # 72 - 41, Apto 502, Bogotá D.C.</span>
                </div>
                <div class="declaration-field-item">
                  <span class="declaration-field-label">Teléfono:</span>
                  <span class="declaration-field-value">315 890 1234</span>
                </div>
                <div class="declaration-field-item">
                  <span class="declaration-field-label">Actividad económica:</span>
                  <span class="declaration-field-value">Servicios de Consultoría Profesional (Código 7020)</span>
                </div>
                <div class="declaration-field-item">
                  <span class="declaration-field-label">Valor ingresos totales recibidos (año 2025):</span>
                  <span class="declaration-field-value">$38.500.000</span>
                </div>
                <div class="declaration-field-item">
                  <span class="declaration-field-label">Valor patrimonio bruto (año 2025):</span>
                  <span class="declaration-field-value">$115.000.000</span>
                </div>
              </div>
            </div>

            <!-- 6. TABLA: RELACIÓN PERSONAS A MI CARGO -->
            <div class="resume-section" data-section-type="text" style="margin-bottom: 12px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <h3 style="font-size: 10pt; font-weight: 700; margin: 0 0 6px 0; color: #0f172a;">
                Relación personas a mi cargo
              </h3>
              <table class="dependents-table">
                <thead>
                  <tr>
                    <th style="width: 45%;">NOMBRE</th>
                    <th style="width: 30%;">IDENTIFICACION</th>
                    <th style="width: 25%;">PARENTESCO</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td contenteditable="true">MARIANA MARTÍNEZ GÓMEZ</td>
                    <td contenteditable="true">T.I. 1.098.765.432</td>
                    <td contenteditable="true">HIJA</td>
                  </tr>
                  <tr>
                    <td contenteditable="true">MATEO MARTÍNEZ GÓMEZ</td>
                    <td contenteditable="true">R.C. 1.123.456.789</td>
                    <td contenteditable="true">HIJO</td>
                  </tr>
                  <tr>
                    <td contenteditable="true">LAURA SOFÍA GÓMEZ CASTRO</td>
                    <td contenteditable="true">C.C. 52.876.543</td>
                    <td contenteditable="true">CÓNYUGE</td>
                  </tr>
                </tbody>
              </table>
            </div>

            <!-- 7. CLÁUSULA DE GRAVEDAD DE JURAMENTO -->
            <div class="resume-section" data-section-type="text" style="margin-bottom: 14px;">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <p class="section-text" contenteditable="true" style="font-size: 9pt; line-height: 1.35; text-align: justify; margin: 0;">
                La información aquí reportada, se rinde bajo gravedad de juramento, la cual se considera prestada con la firma del presente escrito de conformidad con el artículo 83 de la Constitución Política de Colombia sobre la presunción de buena fe.
              </p>
            </div>

            <!-- 8. FIRMA Y DATOS DE EXPEDICIÓN -->
            <section class="resume-section signature-section" data-section-type="signature">
              <div class="section-controls no-print" contenteditable="false">
                <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
                <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
                <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
              </div>
              <div class="signature-block" style="margin-top: 10px;">
                <div class="signature-image-area no-print">
                  <input type="file" id="default-sig-input" accept="image/*" style="display:none"
                    onchange="loadSignatureImage(this, 'default-sig')">
                  <div id="default-sig-placeholder" class="signature-img-placeholder"
                    onclick="document.getElementById('default-sig-input').click()" title="Haz clic para subir tu firma">
                    ✍️ &nbsp;Subir imagen de firma
                  </div>
                </div>
                <div id="default-sig-preview-wrapper" class="signature-preview-wrapper" style="display:none;">
                  <button type="button" class="btn-remove-signature no-print" onclick="removeSignatureImage('default-sig')" title="Eliminar imagen de firma">
                    ✕ Eliminar firma
                  </button>
                  <img id="default-sig-preview" class="signature-img-preview" src="" alt="Firma" style="cursor:pointer;" onclick="document.getElementById('default-sig-input').click()" title="Haz clic para cambiar la imagen de firma">
                </div>
                <div class="signature-line" style="width: 240px; margin: 0 0 4px 0;"></div>
                <p class="signature-name" contenteditable="true" style="font-weight: 800; font-size: 10pt; margin: 0 0 2px 0;">FIRMA</p>
                <p class="signature-cc" contenteditable="true" style="font-size: 9.5pt; margin: 0;">C.C. No. 1.020.345.678 de Bogotá D.C.</p>
              </div>
            </section>

          </div>
        </div>
      </div>

      <!-- Botones para añadir y gestionar hojas en el workspace -->
      <div class="workspace-add-page-container no-print">
        <div class="workspace-add-sections-grid">
          <button class="btn-workspace-action" onclick="addNewSection('list')">
            <span>•</span> + Con Viñetas
          </button>
          <button class="btn-workspace-action" onclick="addNewSection('text')">
            <span>¶</span> + Solo Texto
          </button>
          <button class="btn-workspace-action" onclick="addSignatureSection()">
            <span>✍️</span> + Firma / C.C.
          </button>
          <button class="btn-workspace-action" onclick="addPhotoSection()">
            <span>📷</span> + Foto
          </button>
        </div>

        <button class="btn-workspace-preview" onclick="previewPDF(true)"
          title="Ver Vista Previa del Documento con marca de agua">
          <span>👁️</span> Vista Previa PDF
        </button>
        <button class="btn-workspace-add-page" onclick="addNewPage()">
          <span>📄</span> + Agregar Nueva Hoja
        </button>
        <button class="btn-workspace-reorder" onclick="openReorderModal()">
          <span>📑</span> Reordenar Hojas
        </button>
        <button class="btn-workspace-add-pdf" onclick="triggerPDFUpload()">
          <span>📎</span> Adjuntar PDF
        </button>
        <button id="btn-workspace-del-page" class="btn-workspace-del-page" onclick="deleteLastPage()">
          <span>🗑️</span> Eliminar Última Hoja
        </button>
      </div>
    </div>
  </main>

  <!-- 4. MODALES REUTILIZABLES -->
  <!-- Modal de Código de Recuperación y Pago Wompi -->
  <div id="payment-code-modal" class="payment-modal no-print" aria-hidden="true">
    <div class="payment-backdrop" onclick="closePaymentCodeModal()"></div>
    <div class="payment-card-dialog">
      <header class="payment-modal-header">
        <div class="payment-modal-title">
          <span class="payment-icon">🔐</span>
          <h3>Código de Recuperación de tu Documento</h3>
        </div>
        <button class="payment-close-btn" onclick="closePaymentCodeModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="payment-modal-body">
        <p class="payment-instructions">
          Tu documento ha sido almacenado de forma segura. <strong>Copia y guarda tu código de recuperación</strong> antes de continuar:
        </p>

        <div class="recovery-code-box">
          <span id="display-recovery-code" class="recovery-code-text">--------</span>
          <button class="btn-copy-code" onclick="copyRecoveryCode()" title="Copiar código al portapapeles">
            <span>📋</span> <span id="copy-btn-label">Copiar Código</span>
          </button>
        </div>

        <div class="payment-info-box">
          <span class="info-badge">⚠️ IMPORTANTE</span>
          <p>
            <strong>Debes copiar este código:</strong> al momento de pagar en Wompi, el formulario de pago te lo va a pedir para asociar tu compra. Además, te permitirá recuperar tu PDF en caso de cerrar la página.
          </p>
          <p style="margin-top: 6px; font-size: 0.85rem; color: #cbd5e1;">
            ⏱️ <strong>Disponibilidad:</strong> Tu documento estará disponible para descargar durante <strong>24 horas</strong> luego de confirmado el pago.
          </p>
        </div>
      </div>

      <footer class="payment-modal-footer">
        <button class="btn btn-secondary" onclick="closePaymentCodeModal()">Guardar después</button>
        <button id="btn-continue-wompi" class="btn btn-primary" onclick="continueToWompiPayment()" style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>💳</span> Continuar al Pago
        </button>
      </footer>
    </div>
  </div>

  <!-- Modal de Reordenamiento de Hojas -->
  <div id="reorder-modal" class="reorder-modal no-print" aria-hidden="true">
    <div class="reorder-backdrop" onclick="closeReorderModal()"></div>
    <div class="reorder-card-dialog">
      <header class="reorder-modal-header">
        <div class="reorder-modal-title">
          <span class="reorder-icon">📑</span>
          <h3>Reordenar Hojas</h3>
        </div>
        <button class="reorder-close-btn" onclick="closeReorderModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="reorder-modal-body">
        <p class="reorder-help-text">Usa los botones ▲/▼ para cambiar la secuencia de las páginas de tu documento:
        </p>
        <div id="reorder-list" class="reorder-list"></div>
      </div>

      <footer class="reorder-modal-footer">
        <button class="btn btn-secondary" onclick="closeReorderModal()">Cancelar</button>
        <button class="btn btn-primary" onclick="applyPageReorder()"
          style="background: linear-gradient(135deg, #10b981, #059669); border: none;">✓ Aplicar Cambios</button>
      </footer>
    </div>
  </div>

  <!-- Modal de Vista Previa del Documento en Desktop -->
  <div id="pdf-preview-modal" class="pdf-preview-modal no-print" aria-hidden="true">
    <div class="pdf-preview-backdrop" onclick="closePDFPreviewModal()"></div>
    <div class="pdf-preview-card-dialog">
      <header class="pdf-preview-header">
        <div class="pdf-preview-title">
          <span class="pdf-preview-icon">👁️</span>
          <h3>Vista Previa del Documento</h3>
        </div>
        <button class="pdf-preview-close-btn" onclick="closePDFPreviewModal()"
          aria-label="Cerrar vista previa">✕</button>
      </header>

      <div class="pdf-preview-body">
        <p class="pdf-preview-help-text">Muestra con marca de agua de cómo se verá tu documento final:</p>
        <div id="pdf-preview-pages-container" class="pdf-preview-pages-container"></div>
      </div>

      <footer class="pdf-preview-footer">
        <button class="btn btn-secondary" onclick="closePDFPreviewModal()">Cerrar</button>
        <button class="btn btn-primary" onclick="closePDFPreviewModal(); processPaymentFlow();"
          style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>📥</span> Pagar y Descargar PDF Final
        </button>
      </footer>
    </div>
  </div>

  <!-- Modal de Recuperación de Documento Pagado -->
  <div id="document-recovery-modal" class="payment-modal no-print" aria-hidden="true">
    <div class="payment-backdrop" onclick="closeDocumentRecoveryModal()"></div>
    <div class="payment-card-dialog">
      <header class="payment-modal-header">
        <div class="payment-modal-title">
          <span class="payment-icon">🔍</span>
          <h3>Recuperar Documento Pagado</h3>
        </div>
        <button class="payment-close-btn" onclick="closeDocumentRecoveryModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="payment-modal-body">
        <p class="payment-instructions">
          Ingresa tu código único de recuperación para descargar tu documento final:
        </p>

        <div class="recovery-input-group">
          <input type="text" id="recovery-code-input" class="settings-control" placeholder="Ej. 8F4K9X2QW7" style="text-transform: uppercase; font-size: 16px; font-weight: 700; text-align: center; letter-spacing: 2px; width: 100%;">
        </div>
        <p id="recovery-error-msg" style="color: #f87171; font-size: 12.5px; margin-top: 10px; display: none; text-align: center;"></p>
      </div>

      <footer class="payment-modal-footer">
        <button class="btn btn-secondary" onclick="closeDocumentRecoveryModal()">Cancelar</button>
        <button class="btn btn-primary" onclick="lookupAndDownloadDocument()" style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>📥</span> Descargar Documento
        </button>
      </footer>
    </div>
  </div>

  <!-- Overlay de Carga para Generación de PDF -->
  <div id="pdf-loading-overlay">
    <div class="pdf-loading-card">
      <div class="pdf-spinner"></div>
      <p class="pdf-loading-title">Generando PDF</p>
      <p id="pdf-loading-msg" class="pdf-loading-sub">Iniciando...</p>
    </div>
  </div>

  <!-- Input oculto para cargar PDFs -->
  <input type="file" id="pdf-file-input" accept="application/pdf" style="display:none"
    onchange="loadPDFAttachment(this)">

  <!-- 5. BARRA FLOTANTE CONTEXTUAL DE ACCIÓN UNIVERSAL -->
  <div id="context-bar" class="context-bar no-print">
    <div id="context-content" class="context-content"></div>
  </div>

  <!-- Scripts de Interacción y Almacenamiento -->
  <script src="/formatos/assets/editor/supabase-config.js"></script>
  <script src="/formatos/assets/editor/script.js"></script>
</body>

</html>]]></content><author><name></name></author><category term="Tributario &amp; DIAN" /><summary type="html"><![CDATA[Descarga el modelo de formato de no declarante de renta en Colombia. Conoce los topes de la DIAN, cómo redactarlo y qué hacer si te lo piden.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://formatounico.com/formatos/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp" /><media:content medium="image" url="https://formatounico.com/formatos/formatos/assets/imgs/FORMATO-NO-DECLARANTE-RENTA.webp" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF</title><link href="https://formatounico.com/formatos/traspaso-de-vehiculo/" rel="alternate" type="text/html" title="Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF" /><published>2026-08-10T00:00:00-05:00</published><updated>2026-08-10T00:00:00-05:00</updated><id>https://formatounico.com/formatos/traspaso-de-vehiculo</id><content type="html" xml:base="https://formatounico.com/formatos/traspaso-de-vehiculo/"><![CDATA[<!DOCTYPE html>
<html lang="es">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">

  <!-- SEO Primary Meta Tags -->
  <title>Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF</title>
  <meta name="title" content="Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF">
  <meta name="description"
    content="Formulario Único de Solicitud de Trámites del Registro Nacional Automotor RUNT para traspaso de vehículo en Colombia. Listo para diligenciar e imprimir.">
  <meta name="keywords"
    content="traspaso de vehiculo, formato traspaso de vehiculo, formulario runt traspaso, contrato traspaso vehiculo PDF, modelo traspaso vehiculo">
  <meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
  <meta name="author" content="FormatoÚnico">
  <meta http-equiv="content-language" content="es">
  <link rel="canonical" href="https://formatounico.com/formatos/traspaso-de-vehiculo/">
  <link rel="icon" type="image/png" href="/formatos/assets/traspaso-de-vehiculo/favicon.png">
  <link rel="apple-touch-icon" href="/formatos/assets/traspaso-de-vehiculo/favicon.png">

  <!-- Open Graph / Facebook / LinkedIn / WhatsApp -->
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://formatounico.com/formatos/traspaso-de-vehiculo/">
  <meta property="og:title" content="Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF">
  <meta property="og:description"
    content="Formulario Único de Solicitud de Trámites del Registro Nacional Automotor RUNT para traspaso de vehículo en Colombia. Listo para diligenciar e imprimir.">
  <meta property="og:image" content="https://formatounico.com/formatos/assets/imgs/TRASPASO-VEHICULO.webp">
  <meta property="og:locale" content="es_CO">
  <meta property="og:site_name" content="FormatoÚnico">

  <!-- Twitter Card -->
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:url" content="https://formatounico.com/formatos/traspaso-de-vehiculo/">
  <meta name="twitter:title" content="Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF">
  <meta name="twitter:description"
    content="Formulario Único de Solicitud de Trámites del Registro Nacional Automotor RUNT para traspaso de vehículo en Colombia. Listo para diligenciar e imprimir.">
  <meta name="twitter:image" content="https://formatounico.com/formatos/assets/imgs/TRASPASO-VEHICULO.webp">

  <!-- Schema.org JSON-LD Structured Data: WebApplication -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "WebApplication",
    "name": "Formato Traspaso de Vehículo RUNT - Rellenar y descargar PDF",
    "url": "https://formatounico.com/formatos/traspaso-de-vehiculo/",
    "description": "Formulario Único de Solicitud de Trámites del Registro Nacional Automotor RUNT para traspaso de vehículo en Colombia. Listo para diligenciar e imprimir.",
    "applicationCategory": "BusinessApplication",
    "operatingSystem": "All",
    "browserRequirements": "Requires JavaScript. Requires HTML5."
  }
  </script>

  <!-- Schema.org JSON-LD Structured Data: Article -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Article",
    "headline": "Formato Traspaso de Vehículo RUNT en Colombia: Formulario y Guía",
    "description": "Formulario Único de Solicitud de Trámites del Registro Nacional Automotor RUNT para traspaso de vehículo en Colombia. Listo para diligenciar e imprimir.",
    "image": "https://formatounico.com/formatos/assets/imgs/TRASPASO-VEHICULO.webp",
    "author": {
      "@type": "Organization",
      "name": "FormatoÚnico",
      "url": "https://formatounico.com"
    },
    "publisher": {
      "@type": "Organization",
      "name": "FormatoÚnico",
      "logo": {
        "@type": "ImageObject",
        "url": "https://formatounico.com/favicon.svg"
      }
    },
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "https://formatounico.com/formatos/traspaso-de-vehiculo/"
    }
  }
  </script>

  <!-- Google Fonts -->
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap" rel="stylesheet">

  <!-- CSS del Editor Compartido -->
  <link rel="stylesheet" href="/formatos/assets/editor/style.css">

  <!-- Supabase JS SDK, PDF.js & PDF-lib -->
  <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
  <script src="https://unpkg.com/pdf-lib@1.17.1/dist/pdf-lib.min.js"></script>

  <style>
    /* ESCRITORIO (> 900px): Ocupa todo el espacio disponible con aspect-ratio exacto del PDF */
    @media screen and (min-width: 901px) {
      .pdf-page-container {
        position: relative;
        width: 100%;
        max-width: 1100px;
        aspect-ratio: 792 / 612;
        background: #ffffff;
        margin: 0 auto 24px auto;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
        border-radius: 4px;
        overflow: hidden;
      }
      .mobile-sheet-handle {
        display: none !important;
      }
      .mobile-preview-backdrop {
        display: none !important;
      }
      .workspace-scroll-area {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      .pdf-render-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      .workspace-add-page-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 24px auto 36px auto !important;
        box-sizing: border-box !important;
      }
      .btn-workspace-preview,
      .btn-workspace-reorder,
      .btn-workspace-add-pdf,
      .btn-workspace-del-page {
        width: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 11px 22px !important;
        border-radius: 8px !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
        gap: 8px !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
        cursor: pointer !important;
      }
      .btn-workspace-preview,
      .btn-workspace-reorder {
        background-color: #1e293b !important;
        border: 1px solid #334155 !important;
        color: #f8fafc !important;
      }
      .btn-workspace-preview:hover,
      .btn-workspace-reorder:hover {
        background-color: #2b374e !important;
        border-color: #475569 !important;
        color: #ffffff !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
      }
      .btn-workspace-add-pdf {
        background: #131b2e !important;
        border: 1.5px dashed #a855f7 !important;
        color: #c084fc !important;
      }
      .btn-workspace-add-pdf:hover {
        background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
        color: #ffffff !important;
        border-style: solid !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4) !important;
      }
      .btn-workspace-del-page {
        background: #131b2e !important;
        border: 1.5px dashed #ef4444 !important;
        color: #f87171 !important;
      }
      .btn-workspace-del-page:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
        color: #ffffff !important;
        border-style: solid !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4) !important;
      }
    }

    /* MÓVIL Y TABLET (<= 900px): Formulario completo visible + Bottom Sheet deslizante para Vista Previa */
    @media screen and (max-width: 900px) {
      body {
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        background-color: #0b0f19 !important;
        padding-top: 58px !important;
        padding-bottom: 76px !important;
      }

      /* El Formulario (Sidebar) es el contenido principal visible en pantalla */
      .sidebar {
        position: static !important;
        width: 94% !important;
        max-width: 580px !important;
        margin: 0 auto !important;
        height: auto !important;
        min-height: auto !important;
        transform: none !important;
        box-shadow: none !important;
        border-right: none !important;
        background: transparent !important;
        backdrop-filter: none !important;
        z-index: 10 !important;
        display: block !important;
        box-sizing: border-box !important;
      }

      .sidebar-header {
        padding: 16px 14px 12px 14px !important;
        border-bottom: 1px solid #1e293b !important;
        background: rgba(15, 23, 42, 0.6) !important;
      }

      .sidebar-close-btn {
        display: none !important;
      }

      .sidebar-main-actions {
        display: none !important;
      }

      .sidebar-content {
        padding: 16px 12px 24px 12px !important;
        overflow: visible !important;
        height: auto !important;
        gap: 14px !important;
      }

      /* Telón de fondo oscuro al abrir el bottom sheet */
      .mobile-preview-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(3, 7, 18, 0.7);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1100;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
      }

      .mobile-preview-backdrop.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
      }

      /* El Espacio de Trabajo (Workspace) como Bottom Sheet Deslizable */
      .workspace {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        height: 70vh !important;
        max-height: 70vh !important;
        background: #0b0f19 !important;
        border-top: 2px solid #0b91a6 !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.75) !important;
        z-index: 1200 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateY(calc(100% - 56px)) !important;
        transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
      }

      .workspace.preview-open {
        transform: translateY(0) !important;
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.95) !important;
      }

      /* Área de scroll interna: Permite scroll táctil 2D (horizontal y vertical libre) */
      .workspace-scroll-area {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-x pan-y !important;
        padding: 16px 12px 30px 12px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background-color: #0b0f19 !important;
      }

      .pdf-render-container {
        width: max-content !important;
        min-width: 100% !important;
        display: block !important;
        margin: 0 !important;
        touch-action: pan-x pan-y !important;
      }

      .pdf-page-container {
        position: relative !important;
        width: 8.5in !important;
        min-width: 8.5in !important;
        max-width: 8.5in !important;
        aspect-ratio: 792 / 612 !important;
        background: #ffffff !important;
        margin: 0 0 20px 0 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
        border-radius: 4px !important;
        touch-action: pan-x pan-y !important;
      }

      /* Botones de acción al final de la vista previa */
      .workspace-add-page-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: min(92vw, 360px) !important;
        max-width: 360px !important;
        position: sticky !important;
        left: 16px !important;
        margin: 20px auto 36px auto !important;
        box-sizing: border-box !important;
        padding: 0 !important;
      }

      .btn-workspace-preview {
        display: none !important;
      }

      .btn-workspace-reorder,
      .btn-workspace-add-pdf,
      .btn-workspace-del-page {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 13px 18px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        text-align: center !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
        transition: all 0.2s ease !important;
      }

      .btn-workspace-reorder {
        background: #161f30 !important;
        border: 1px solid #334155 !important;
        color: #ffffff !important;
      }

      .btn-workspace-reorder:hover {
        background: #243249 !important;
        border-color: #475569 !important;
      }

      .btn-workspace-add-pdf {
        background: #131b2e !important;
        border: 1.5px dashed #a855f7 !important;
        color: #c084fc !important;
      }

      .btn-workspace-add-pdf:hover {
        background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
        color: #ffffff !important;
        border-style: solid !important;
      }

      .btn-workspace-del-page {
        background: #131b2e !important;
        border: 1.5px dashed #ef4444 !important;
        color: #f87171 !important;
      }

      .btn-workspace-del-page:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
        color: #ffffff !important;
        border-style: solid !important;
      }
    }

    .pdf-page-canvas {
      width: 100% !important;
      height: 100% !important;
      object-fit: fill;
      display: block;
    }

    /* HERRAMIENTAS DE DESARROLLO (SOLO ACTIVAS AUTOMÁTICAMENTE EN LOCALHOST) */
    .dev-only-tool {
      display: none !important;
    }
    body.is-dev-mode .dev-only-tool {
      display: block !important;
    }
    body.is-dev-mode button.dev-only-tool {
      display: inline-block !important;
    }

    .dev-calibrator-bar {
      display: none !important;
    }
    body.is-dev-mode .dev-calibrator-bar {
      position: fixed !important;
      bottom: 24px !important;
      right: 24px !important;
      z-index: 2147483647 !important;
      background: #0f172a;
      border: 2px solid #3b82f6;
      border-radius: 12px;
      padding: 16px;
      color: #f8fafc;
      font-family: monospace;
      font-size: 12px;
      box-shadow: 0 20px 40px rgba(0,0,0,0.8);
      display: flex !important;
      flex-direction: column;
      gap: 8px;
      min-width: 320px;
      width: 320px;
    }
    body.is-dev-mode .dev-calibrator-bar.hidden {
      display: none !important;
    }

    /* BOTÓN FLOTANTE FIJO DEV BLOB */
    .dev-fixed-blob-btn {
      display: none !important;
    }
    body.is-dev-mode .dev-fixed-blob-btn {
      position: fixed !important;
      bottom: 24px !important;
      left: 24px !important;
      z-index: 2147483647 !important;
      background: rgba(234, 179, 8, 0.95) !important;
      color: #0f172a !important;
      border: 2px solid #fde047 !important;
      border-radius: 50px !important;
      padding: 12px 22px !important;
      font-weight: 800 !important;
      font-size: 14px !important;
      box-shadow: 0 10px 25px rgba(234, 179, 8, 0.4), 0 4px 10px rgba(0,0,0,0.5) !important;
      cursor: pointer !important;
      display: flex !important;
      align-items: center !important;
      gap: 8px !important;
      backdrop-filter: blur(8px) !important;
      transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    }
    body.is-dev-mode .dev-fixed-blob-btn:hover {
      transform: translateY(-3px) scale(1.05) !important;
      box-shadow: 0 15px 30px rgba(234, 179, 8, 0.6) !important;
      background: #fde047 !important;
    }

    /* OCULTAR HERRAMIENTAS FLOTANTES DEV CUANDO HAYA UN MODAL O VISTA DE PAGO ACTIVA */
    body:has(#payment-code-modal.open) .dev-calibrator-bar,
    body:has(#payment-code-modal.open) .dev-fixed-blob-btn,
    body:has(#pdf-preview-modal.open) .dev-calibrator-bar,
    body:has(#pdf-preview-modal.open) .dev-fixed-blob-btn,
    body:has(#pdf-loading-overlay.active) .dev-calibrator-bar,
    body:has(#pdf-loading-overlay.active) .dev-fixed-blob-btn,
    body:has(#document-recovery-modal.open) .dev-calibrator-bar,
    body:has(#document-recovery-modal.open) .dev-fixed-blob-btn {
      display: none !important;
    }

    /* ESTILOS DE SUPERPOSICIÓN: EN PRODUCCIÓN LIMPIO, EN DEV MODO ARRASTRE */
    .runt-pdf-overlay > div {
      pointer-events: none;
      user-select: none;
      box-sizing: border-box;
      white-space: nowrap;
    }
    body.is-dev-mode .runt-pdf-overlay > div {
      pointer-events: auto !important;
      cursor: grab !important;
      user-select: none !important;
      border: 1px dashed rgba(239, 68, 68, 0.7) !important;
      background: rgba(239, 68, 68, 0.15) !important;
      min-height: 14px;
      min-width: 14px;
      padding: 1px 3px;
      box-sizing: border-box;
      border-radius: 3px;
      transition: all 0.15s ease;
    }
    body.is-dev-mode .runt-pdf-overlay > div:hover {
      border-color: #ef4444 !important;
      background: rgba(239, 68, 68, 0.35) !important;
      box-shadow: 0 0 8px rgba(239, 68, 68, 0.5) !important;
    }
    body.is-dev-mode .runt-pdf-overlay > div.dev-selected {
      border: 2px solid #ef4444 !important;
      background: rgba(239, 68, 68, 0.5) !important;
      box-shadow: 0 0 14px rgba(239, 68, 68, 0.9) !important;
      cursor: grabbing !important;
      z-index: 99999 !important;
    }

    @keyframes pinPop {
      0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
      70% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
      100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    }
  </style>
</head>

<body class="theme-sans font-medium margin-normal spacing-normal color-black" data-document-slug="traspaso-de-vehiculo">

  <!-- BARRA DE NAVEGACIÓN UNIVERSAL (DESKTOP Y MÓVIL) -->
  <header class="app-navbar mobile-navbar no-print">
    <!-- Izquierda: Marca -->
    <div class="navbar-left">
      <a href="/formatos/traspaso-de-vehiculo/" class="navbar-brand-title" style="text-decoration: none;">
        <span>Traspaso de Vehículo</span>
      </a>
    </div>

    <!-- Derecha: Botón Pagar + Botón Menú Hamburguesa -->
    <div class="navbar-right">
      <!-- Botón Pagar y Descargar SIEMPRE visible en la barra -->
      <button class="navbar-action-btn btn-nav-pay" id="btn-generate-pdf" onclick="processPaymentFlow()"
        title="Generar código de recuperación, guardar PDF y continuar al pago">
        <span>📥</span> <span class="nav-btn-text">Pagar y Descargar</span>
      </button>

      <!-- Botón Menú Hamburguesa -->
      <button id="btn-navbar-menu-toggle" class="navbar-menu-toggle-btn no-print" onclick="toggleNavbarActionsMenu()" aria-label="Abrir menú de opciones" title="Menú de opciones">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
          <line x1="3" y1="6" x2="21" y2="6"></line>
          <line x1="3" y1="12" x2="21" y2="12"></line>
          <line x1="3" y1="18" x2="21" y2="18"></line>
        </svg>
      </button>

      <!-- Menú Desplegable con opciones -->
      <div id="navbar-actions-menu" class="navbar-actions-menu">
        <button class="navbar-action-btn" onclick="handleNavbarPreviewClick()"
          title="Ver cómo se verá el PDF final con marca de agua">
          <span>👁️</span> <span>Vista Previa PDF</span>
        </button>
        <a href="/formatos/traspaso-de-vehiculo/gracias/" class="navbar-action-btn"
          title="Recuperar tu documento pagado">
          <span>🔍</span> <span>Recuperar Doc</span>
        </a>
        <button class="navbar-action-btn" onclick="resetTemplate(); toggleNavbarActionsMenu();"
          title="Restablecer formulario">
          <span>🔄</span> <span>Restablecer Todo</span>
        </button>
        <div class="navbar-menu-divider"></div>
        <a href="/formatos/" class="navbar-action-btn" title="Ver todos los formatos disponibles">
          <span>📂</span> <span>Formatos</span>
        </a>
        <a href="/" class="navbar-action-btn" title="Ir a la página de inicio">
          <span>🏠</span> <span>Inicio</span>
        </a>
        <div class="navbar-menu-divider dev-only-tool"></div>
        <button class="navbar-action-btn dev-only-tool" onclick="openDevPDFBlob(); toggleNavbarActionsMenu();"
          title="Ver PDF Blob generado en modo desarrollo">
          <span>🧪</span> <span>Ver PDF Blob (Dev)</span>
        </button>
      </div>
    </div>
  </header>

  <!-- TELÓN DE FONDO DE LA BARRA LATERAL EN MÓVIL -->
  <div id="sidebar-backdrop" class="sidebar-backdrop no-print" onclick="closeSidebar()"></div>

  <!-- TELÓN DE FONDO DE LA VISTA PREVIA DESLIZABLE MÓVIL -->
  <div id="mobile-preview-backdrop" class="mobile-preview-backdrop no-print" onclick="toggleMobilePreview(false)"></div>

  <!-- BARRA LATERAL DE CONTROL (COMPLETA) -->
  <aside id="sidebar" class="sidebar no-print">
    <!-- Encabezado Móvil H1 -->
    <div class="mobile-page-header no-print">
      <h1 class="mobile-h1-title">Formato Traspaso de Vehículo</h1>
      <p class="mobile-h1-subtitle">Rellenar en línea y descargar PDF</p>
    </div>

    <!-- PESTAÑAS DEL PANEL DE CONTROL -->
    <div class="sidebar-tab-switcher no-print">
      <button id="tab-btn-form" class="sidebar-tab-btn active" onclick="switchSidebarTab('form')">
        <span>📝</span> Formulario
      </button>
      <button id="tab-btn-settings" class="sidebar-tab-btn" onclick="switchSidebarTab('settings')">
        <span>ℹ️</span> Guía & Requisitos
      </button>
    </div>

    <div class="sidebar-content">
      <!-- PESTAÑA 1: FORMULARIO INTERACTIVO RUNT -->
      <div id="tab-pane-form" class="tab-pane">
        <!-- HERRAMIENTAS DE DESARROLLO Y CALIBRACIÓN -->
        <div class="dev-only-tool" style="margin-bottom: 12px;">
          <button class="btn btn-secondary" onclick="toggleDevCalibrator()" style="background: rgba(59, 130, 246, 0.2); border: 1px solid #3b82f6; color: #60a5fa; font-weight: 700; width: 100%;">
            🎯 Calibrador Coordenadas
          </button>

          <div id="sidebar-calibrator-panel" style="display: block; background: #0f172a; border: 1.5px solid #3b82f6; border-radius: 8px; padding: 12px; margin-top: 10px; width: 100%; box-sizing: border-box;">
            <div style="color: #60a5fa; font-weight: 800; font-size: 0.85rem; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center;">
              <span>🎯 Coordenadas Capturadas:</span>
              <span id="dev-cursor-live" style="font-size: 0.75rem; color: #38bdf8; font-weight: normal;">L:0% T:0%</span>
            </div>

            <div id="dev-selected-info" style="background: #1e293b; border: 1px dashed #3b82f6; border-radius: 6px; padding: 10px; font-size: 0.8rem; color: #cbd5e1; font-family: monospace; line-height: 1.5; margin-bottom: 8px; word-break: break-word;">
              👉 Haz clic en cualquier lugar de la hoja PDF para marcar y medir su posición.
            </div>

            <div style="display: flex; gap: 6px;">
              <button onclick="copyAllCoordinatesJSON()" style="flex: 2; background: #2563eb; color: #fff; border: none; padding: 8px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 0.75rem;">
                📋 Copiar JSON Coordenadas
              </button>
              <button onclick="clearDevMarkers()" style="flex: 1; background: #334155; color: #f8fafc; border: none; padding: 8px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 0.75rem;">
                🗑️ Limpiar
              </button>
            </div>
          </div>
        </div>

        <!-- GRUPO 1: ORGANISMO DE TRÁNSITO -->
        <div class="form-accordion open">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🏛️</span> 1. ORGANISMO DE TRÁNSITO</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-organismo-nombre">NOMBRE ORGANISMO</label>
                <div class="form-font-adjuster">
                  <span style="font-size: 11px; color: #38bdf8; font-weight: 700;">Letra:</span>
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-organismo-nombre', -0.5)" title="Reducir">A-</button>
                  <span id="font-size-label-overlay-organismo-nombre" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-organismo-nombre', 0.5)" title="Aumentar">A+</button>
                </div>
              </div>
              <input type="text" id="runt-organismo-nombre" class="form-input" placeholder="Ej: SIM Bogotá" oninput="updateRuntPDFOverlay()">
            </div>

            <div class="form-row">
              <div class="form-group form-col">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-organismo-ciudad">CIUDAD</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-organismo-ciudad', -0.5)">A-</button>
                    <span id="font-size-label-overlay-organismo-ciudad" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-organismo-ciudad', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-organismo-ciudad" class="form-input" placeholder="Ej: Bogotá" oninput="updateRuntPDFOverlay()">
              </div>
              <div class="form-group form-col">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-organismo-codigo">CÓDIGO</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-organismo-codigo', -0.5)">A-</button>
                    <span id="font-size-label-overlay-organismo-codigo" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-organismo-codigo', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-organismo-codigo" class="form-input" placeholder="Ej: 11001" oninput="updateRuntPDFOverlay()">
              </div>
            </div>

            <div class="form-group">
              <label>FECHA DE TRÁMITE</label>
              <div class="form-row">
                <input type="text" id="runt-organismo-dia" class="form-input form-col" placeholder="DÍA" maxlength="2" oninput="updateRuntPDFOverlay()" style="text-align: center;">
                <input type="text" id="runt-organismo-mes" class="form-input form-col" placeholder="MES" maxlength="2" oninput="updateRuntPDFOverlay()" style="text-align: center;">
                <input type="text" id="runt-organismo-anio" class="form-input form-col" placeholder="AÑO" maxlength="4" oninput="updateRuntPDFOverlay()" style="text-align: center; flex: 1.5;">
              </div>
            </div>
          </div>
        </div>

        <!-- GRUPO 2: PLACA -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🚘</span> 2. PLACA</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-row">
              <div class="form-group form-col">
                <label for="runt-placa-letras">LETRAS</label>
                <input type="text" id="runt-placa-letras" class="form-input" placeholder="Ej: ABC" maxlength="4" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-align: center; text-transform: uppercase;">
              </div>
              <div class="form-group form-col">
                <label for="runt-placa-numeros">NÚMEROS</label>
                <input type="text" id="runt-placa-numeros" class="form-input" placeholder="Ej: 123" maxlength="4" oninput="updateRuntPDFOverlay()" style="text-align: center;">
              </div>
            </div>
          </div>
        </div>

        <!-- GRUPO 3: TRÁMITE SOLICITADO -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>📋</span> 3. TRÁMITE SOLICITADO</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <label for="runt-tramite-select">SELECCIONE EL TRÁMITE</label>
              <select id="runt-tramite-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Ninguno Seleccionado --</option>
                <option value="1">1. MATRÍCULA / REGISTRO</option>
                <option value="2">2. TRASPASO</option>
                <option value="3">3. TRASLADO MATRICULA / REGISTRO</option>
                <option value="4">4. RADICADO MATRICULA / REGISTRO</option>
                <option value="5">5. CAMBIO DE COLOR</option>
                <option value="6">6. CAMBIO DE SERVICIO</option>
                <option value="7">7. REGRABAR MOTOR</option>
                <option value="8">8. REGRABAR CHASIS</option>
                <option value="9">9. TRANSFORMACIÓN</option>
                <option value="10">10. DUPLICADO LICENCIA TRANSITO</option>
                <option value="11">11. INSCRIPC. PRENDA</option>
                <option value="12">12. LEVANTA PRENDA</option>
                <option value="13">13. CANCELACIÓN MATRICULA / REGISTRO</option>
                <option value="14">14. CAMBIO DE PLACAS</option>
                <option value="15">15. DUPLICADO DE PLACAS</option>
                <option value="16">16. REMATRICULA</option>
                <option value="17">17. CAMBIO DE CARROCERÍA</option>
                <option value="18">18. OTROS</option>
              </select>
            </div>
          </div>
        </div>

        <!-- GRUPO 4: CLASE DE VEHÍCULO -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🚙</span> 4. CLASE DE VEHÍCULO</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <label for="runt-clase-select">SELECCIONE LA CLASE</label>
              <select id="runt-clase-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Ninguno Seleccionado --</option>
                <option value="1">1. AUTOMÓVIL</option>
                <option value="2">2. BUS</option>
                <option value="3">3. BUSETA</option>
                <option value="4">4. CAMIÓN</option>
                <option value="5">5. CAMIONETA</option>
                <option value="6">6. CAMPERO</option>
                <option value="7">7. MICROBÚS</option>
                <option value="8">8. TRACTOCAMIÓN</option>
                <option value="9">9. MOTOCICLETA</option>
                <option value="10">10. MOTOCARRO</option>
                <option value="11">11. MOTOTRICICLO</option>
                <option value="12">12. CUATRIMOTO</option>
                <option value="13">13. VOLQUETA</option>
                <option value="14">14. OTRO</option>
              </select>
            </div>
          </div>
        </div>

        <!-- GRUPO: CARACTERÍSTICAS DEL VEHÍCULO (SECCIONES 5 - 15) -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🚗</span> CARACTERÍSTICAS DEL VEHÍCULO</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <!-- 5. MARCA & 6. LÍNEA -->
            <div class="form-row">
              <div class="form-group form-col">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-vehiculo-marca">5. MARCA</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-vehiculo-marca', -0.5)">A-</button>
                    <span id="font-size-label-overlay-vehiculo-marca" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-vehiculo-marca', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-vehiculo-marca" class="form-input" placeholder="Ej: CHEVROLET" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
              <div class="form-group form-col">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-vehiculo-linea">6. LÍNEA</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-vehiculo-linea', -0.5)">A-</button>
                    <span id="font-size-label-overlay-vehiculo-linea" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-vehiculo-linea', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-vehiculo-linea" class="form-input" placeholder="Ej: AVEO" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
            </div>

            <!-- 7. COMBUSTIBLE -->
            <div class="form-group">
              <label for="runt-combustible-select">7. COMBUSTIBLE</label>
              <select id="runt-combustible-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Seleccionar --</option>
                <option value="1">1. GASOLINA</option>
                <option value="2">2. DIESEL</option>
                <option value="3">3. GAS</option>
                <option value="4">4. MIXTO</option>
                <option value="5">5. ELÉCTRICO</option>
                <option value="6">6. HIDRÓGENO</option>
                <option value="7">7. ETANOL</option>
                <option value="8">8. BIODIESEL</option>
              </select>
            </div>

            <!-- 8. COLORES -->
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-vehiculo-colores">8. COLORES</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-vehiculo-colores', -0.5)">A-</button>
                  <span id="font-size-label-overlay-vehiculo-colores" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-vehiculo-colores', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-vehiculo-colores" class="form-input" placeholder="Ej: ROJO METALIZADO" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <!-- 9. MODELO & 10. CILINDRADA -->
            <div class="form-row">
              <div class="form-group form-col">
                <label for="runt-vehiculo-modelo">9. MODELO</label>
                <input type="text" id="runt-vehiculo-modelo" class="form-input" placeholder="Ej: 2018" maxlength="4" oninput="updateRuntPDFOverlay()" style="text-align: center;">
              </div>
              <div class="form-group form-col">
                <label for="runt-vehiculo-cilindrada">10. CILINDRADA</label>
                <input type="text" id="runt-vehiculo-cilindrada" class="form-input" placeholder="Ej: 1600" oninput="updateRuntPDFOverlay()" style="text-align: center;">
              </div>
            </div>

            <!-- 11. CAPACIDAD & 14. POTENCIA/HP -->
            <div class="form-row">
              <div class="form-group form-col">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-vehiculo-capacidad">11. CAPACIDAD</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-vehiculo-capacidad', -0.5)">A-</button>
                    <span id="font-size-label-overlay-vehiculo-capacidad" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-vehiculo-capacidad', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-vehiculo-capacidad" class="form-input" placeholder="Ej: 5 PASAJEROS" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
              <div class="form-group form-col">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-vehiculo-potencia">14. POTENCIA/HP</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-vehiculo-potencia', -0.5)">A-</button>
                    <span id="font-size-label-overlay-vehiculo-potencia" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-vehiculo-potencia', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-vehiculo-potencia" class="form-input" placeholder="Ej: 105 HP" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
            </div>

            <!-- 12. BLINDAJE -->
            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <span class="form-card-item-title">12. BLINDAJE</span>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-blindaje-resolucion', -0.5)">A-</button>
                  <span id="font-size-label-overlay-blindaje-resolucion" class="form-font-adjuster-val">10px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-blindaje-resolucion', 0.5)">A+</button>
                </div>
              </div>
              <div class="form-radio-group">
                <label class="form-radio-label"><input type="radio" name="runt-blindaje-opcion" value="SI" onchange="updateRuntPDFOverlay()"> SI</label>
                <label class="form-radio-label"><input type="radio" name="runt-blindaje-opcion" value="NO" onchange="updateRuntPDFOverlay()" checked> NO</label>
              </div>
              <input type="text" id="runt-blindaje-resolucion" class="form-input" placeholder="Resolución No. (DD/MM/AÑO)" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <!-- 13. DESMONTE BLINDAJE -->
            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <span class="form-card-item-title">13. DESMONTE BLINDAJE</span>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-desmonte-resolucion', -0.5)">A-</button>
                  <span id="font-size-label-overlay-desmonte-resolucion" class="form-font-adjuster-val">10px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-desmonte-resolucion', 0.5)">A+</button>
                </div>
              </div>
              <div class="form-radio-group">
                <label class="form-radio-label"><input type="radio" name="runt-desmonte-opcion" value="SI" onchange="updateRuntPDFOverlay()"> SI</label>
                <label class="form-radio-label"><input type="radio" name="runt-desmonte-opcion" value="NO" onchange="updateRuntPDFOverlay()" checked> NO</label>
              </div>
              <input type="text" id="runt-desmonte-resolucion" class="form-input" placeholder="Resolución No. (DD/MM/AÑO)" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <!-- 15. CARROCERÍA -->
            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <span class="form-card-item-title">15. CARROCERÍA</span>
                <div style="display: flex; gap: 4px; align-items: center;">
                  <span style="font-size: 11px; color: #38bdf8; font-weight: 700;">Cód:</span>
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-carroceria-codigo', -0.5)">A-</button>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-carroceria-codigo', 0.5)">A+</button>
                  <span style="font-size: 11px; color: #38bdf8; font-weight: 700; margin-left: 2px;">Tipo:</span>
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-carroceria-tipo', -0.5)">A-</button>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-carroceria-tipo', 0.5)">A+</button>
                </div>
              </div>
              <div class="form-row">
                <input type="text" id="runt-carroceria-codigo" class="form-input form-col" placeholder="CÓDIGO" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
                <input type="text" id="runt-carroceria-tipo" class="form-input" placeholder="TIPO (Ej: SEDAN, FURGON)" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase; flex: 2;">
              </div>
            </div>
          </div>
        </div>

        <!-- GRUPO 16: IDENTIFICACIÓN INTERNA DEL VEHÍCULO -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🔍</span> 16. IDENTIFICACIÓN INTERNA</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <!-- No. DE MOTOR -->
            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px;">
                <label for="runt-ident-motor" style="font-size: 11px; color: #94a3b8; font-weight: 700;">No. DE MOTOR</label>
                <div style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap;">
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-ident-motor', -0.5)">A-</button>
                    <span id="font-size-label-overlay-ident-motor" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-ident-motor', 0.5)">A+</button>
                  </div>
                  <span style="font-size: 11px; color: #64748b; font-weight: 600;">REGRABADO:</span>
                  <div class="form-radio-group" style="padding: 2px 8px;">
                    <label class="form-radio-label"><input type="radio" name="runt-motor-regrabado" value="SI" onchange="updateRuntPDFOverlay()"> SI</label>
                    <label class="form-radio-label"><input type="radio" name="runt-motor-regrabado" value="NO" onchange="updateRuntPDFOverlay()" checked> NO</label>
                  </div>
                </div>
              </div>
              <input type="text" id="runt-ident-motor" class="form-input" placeholder="Número de Motor" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <!-- No. DE CHASIS -->
            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px;">
                <label for="runt-ident-chasis" style="font-size: 11px; color: #94a3b8; font-weight: 700;">No. DE CHASIS</label>
                <div style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap;">
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-ident-chasis', -0.5)">A-</button>
                    <span id="font-size-label-overlay-ident-chasis" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-ident-chasis', 0.5)">A+</button>
                  </div>
                  <span style="font-size: 11px; color: #64748b; font-weight: 600;">REGRABADO:</span>
                  <div class="form-radio-group" style="padding: 2px 8px;">
                    <label class="form-radio-label"><input type="radio" name="runt-chasis-regrabado" value="SI" onchange="updateRuntPDFOverlay()"> SI</label>
                    <label class="form-radio-label"><input type="radio" name="runt-chasis-regrabado" value="NO" onchange="updateRuntPDFOverlay()" checked> NO</label>
                  </div>
                </div>
              </div>
              <input type="text" id="runt-ident-chasis" class="form-input" placeholder="Número de Chasis" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <!-- No. DE SERIE -->
            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px;">
                <label for="runt-ident-serie" style="font-size: 11px; color: #94a3b8; font-weight: 700;">No. DE SERIE</label>
                <div style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap;">
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-ident-serie', -0.5)">A-</button>
                    <span id="font-size-label-overlay-ident-serie" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-ident-serie', 0.5)">A+</button>
                  </div>
                  <span style="font-size: 11px; color: #64748b; font-weight: 600;">REGRABADO:</span>
                  <div class="form-radio-group" style="padding: 2px 8px;">
                    <label class="form-radio-label"><input type="radio" name="runt-serie-regrabado" value="SI" onchange="updateRuntPDFOverlay()"> SI</label>
                    <label class="form-radio-label"><input type="radio" name="runt-serie-regrabado" value="NO" onchange="updateRuntPDFOverlay()" checked> NO</label>
                  </div>
                </div>
              </div>
              <input type="text" id="runt-ident-serie" class="form-input" placeholder="Número de Serie" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <!-- No. DE VIN -->
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-ident-vin">No. DE VIN VEHÍCULOS AUTOMOTORES</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-ident-vin', -0.5)">A-</button>
                  <span id="font-size-label-overlay-ident-vin" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-ident-vin', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-ident-vin" class="form-input" placeholder="Número VIN de 17 caracteres" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>
          </div>
        </div>

        <!-- GRUPO 17: IMPORTACIÓN O REMATE -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>📦</span> 17. IMPORTACIÓN O REMATE</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <label for="runt-import-select">TIPO DE DOCUMENTO / REMATE</label>
              <select id="runt-import-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Ninguno Seleccionado --</option>
                <option value="1">1. IMPORTACIÓN: MANIF. O ACTA</option>
                <option value="2">2. IMPORTACIÓN: DEC. DE IMPORT.</option>
                <option value="3">3. REMATE: ACTA</option>
                <option value="4">4. REMATE: ENTIDAD</option>
                <option value="5">5. REMATE: LUGAR (CIUDAD)</option>
                <option value="6">6. REMATE: CÓDIGO</option>
              </select>
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-import-numdoc">No. DOCUMENTO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-import-numdoc', -0.5)">A-</button>
                  <span id="font-size-label-overlay-import-numdoc" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-import-numdoc', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-import-numdoc" class="form-input" placeholder="Número de Documento" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <label>FECHA DOCUMENTO</label>
              <div class="form-row">
                <input type="text" id="runt-import-dia" class="form-input form-col" placeholder="DÍA" maxlength="2" oninput="updateRuntPDFOverlay()" style="text-align: center;">
                <input type="text" id="runt-import-mes" class="form-input form-col" placeholder="MES" maxlength="2" oninput="updateRuntPDFOverlay()" style="text-align: center;">
                <input type="text" id="runt-import-anio" class="form-input form-col" placeholder="AÑO" maxlength="4" oninput="updateRuntPDFOverlay()" style="text-align: center; flex: 1.5;">
              </div>
            </div>
          </div>
        </div>

        <!-- GRUPO 18: TIPO DE SERVICIO -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🚘</span> 18. TIPO DE SERVICIO</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <label for="runt-servicio-select">SELECCIONE EL SERVICIO</label>
              <select id="runt-servicio-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Ninguno Seleccionado --</option>
                <option value="1">1. PARTICULAR</option>
                <option value="2">2. PÚBLICO</option>
                <option value="3">3. DIPLOMÁTICO</option>
                <option value="4">4. OFICIAL</option>
                <option value="5">5. ESPECIAL</option>
                <option value="6">6. OTROS</option>
              </select>
            </div>
          </div>
        </div>

        <!-- GRUPO 19: EMPRESA VINCULADORA -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>🏢</span> 19. EMPRESA VINCULADORA</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-empresa-nombre">NOMBRE DE LA EMPRESA</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-empresa-nombre', -0.5)">A-</button>
                  <span id="font-size-label-overlay-empresa-nombre" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-empresa-nombre', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-empresa-nombre" class="form-input" placeholder="Nombre completo de la empresa" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-empresa-nit">NIT</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-empresa-nit', -0.5)">A-</button>
                  <span id="font-size-label-overlay-empresa-nit" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-empresa-nit', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-empresa-nit" class="form-input" placeholder="Número de NIT" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>
          </div>
        </div>

        <!-- GRUPO 20: DATOS DE ALERTA -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>⚠️</span> 20. DATOS DE ALERTA</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <label for="runt-alerta-select">TIPO DE ALERTA</label>
              <select id="runt-alerta-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Ninguno Seleccionado --</option>
                <option value="1">1. HURTO</option>
                <option value="2">2. LIM. PROPIEDAD</option>
                <option value="3">3. EMBARGO</option>
                <option value="4">4. OTRO</option>
              </select>
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-alerta-afavor">A FAVOR DE (5)</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-alerta-afavor', -0.5)">A-</button>
                  <span id="font-size-label-overlay-alerta-afavor" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-alerta-afavor', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-alerta-afavor" class="form-input" placeholder="Entidad o Persona A Favor De" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>
          </div>
        </div>

        <!-- GRUPO 21: DATOS DEL PROPIETARIO -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>👤</span> 21. DATOS DEL PROPIETARIO</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-prop-primer-apellido">PRIMER APELLIDO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-prop-primer-apellido', -0.5)">A-</button>
                  <span id="font-size-label-overlay-prop-primer-apellido" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-prop-primer-apellido', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-prop-primer-apellido" class="form-input" placeholder="Primer Apellido" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-prop-segundo-apellido">SEGUNDO APELLIDO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-prop-segundo-apellido', -0.5)">A-</button>
                  <span id="font-size-label-overlay-prop-segundo-apellido" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-prop-segundo-apellido', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-prop-segundo-apellido" class="form-input" placeholder="Segundo Apellido" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-prop-nombres">NOMBRES</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-prop-nombres', -0.5)">A-</button>
                  <span id="font-size-label-overlay-prop-nombres" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-prop-nombres', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-prop-nombres" class="form-input" placeholder="Nombres Completos" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <label for="runt-prop-tipodoc-select">TIPO DE DOCUMENTO</label>
              <select id="runt-prop-tipodoc-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Seleccione Tipo de Doc --</option>
                <option value="1">C.C. (Cédula de Ciudadanía - C)</option>
                <option value="2">NIT (N)</option>
                <option value="3">N.N. (X)</option>
                <option value="4">PASAPORTE (P)</option>
                <option value="5">C. EXTRANJ. (Cédula Extranjería - E)</option>
                <option value="6">T. IDENTI. (Tarjeta Identidad - T)</option>
                <option value="7">NUIP (U)</option>
                <option value="8">C. DIPLOMÁTICO (D)</option>
              </select>
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-prop-numdoc">No. DOCUMENTO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-prop-numdoc', -0.5)">A-</button>
                  <span id="font-size-label-overlay-prop-numdoc" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-prop-numdoc', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-prop-numdoc" class="form-input" placeholder="Número de Documento" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-prop-direccion">DIRECCIÓN</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-prop-direccion', -0.5)">A-</button>
                  <span id="font-size-label-overlay-prop-direccion" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-prop-direccion', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-prop-direccion" class="form-input" placeholder="Dirección de Residencia/Empresa" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-row">
              <div class="form-group form-col" style="flex: 1.5;">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-prop-ciudad">CIUDAD</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-prop-ciudad', -0.5)">A-</button>
                    <span id="font-size-label-overlay-prop-ciudad" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-prop-ciudad', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-prop-ciudad" class="form-input" placeholder="Ciudad" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
              <div class="form-group form-col">
                <label for="runt-prop-telefono">TELÉFONO</label>
                <input type="text" id="runt-prop-telefono" class="form-input" placeholder="Teléfono" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
            </div>

            <!-- FIRMA PROPIETARIO -->
            <div class="form-signature-upload">
              <label style="font-size: 11px; color: #60a5fa; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px;">
                ✍️ FIRMA DEL PROPIETARIO (IMAGEN)
              </label>
              <div style="display: flex; gap: 8px; align-items: center; justify-content: center;">
                <input type="file" id="runt-prop-firma-file" accept="image/png, image/jpeg, image/jpg, image/webp" onchange="handlePropFirmaUpload(this)" style="display: none;">
                <label for="runt-prop-firma-file" class="btn btn-secondary" style="font-size: 12px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;">
                  <span>📁</span> Seleccionar Firma...
                </label>
                <button type="button" onclick="clearPropFirma()" class="btn-sidebar-del-page" style="display: none; padding: 6px 10px; font-size: 12px;" id="btn-clear-prop-firma">
                  ✕ Quitar
                </button>
              </div>
              <div id="prop-firma-preview-container" class="form-signature-preview" style="display: none;">
                <img id="prop-firma-preview-img">
                <span id="prop-firma-filename" style="font-size: 11px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></span>
              </div>
            </div>
          </div>
        </div>

        <!-- GRUPO 22: DATOS DEL COMPRADOR -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>👤</span> 22. DATOS DEL COMPRADOR (TRASPASO)</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-comp-primer-apellido">PRIMER APELLIDO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-comp-primer-apellido', -0.5)">A-</button>
                  <span id="font-size-label-overlay-comp-primer-apellido" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-comp-primer-apellido', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-comp-primer-apellido" class="form-input" placeholder="Primer Apellido" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-comp-segundo-apellido">SEGUNDO APELLIDO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-comp-segundo-apellido', -0.5)">A-</button>
                  <span id="font-size-label-overlay-comp-segundo-apellido" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-comp-segundo-apellido', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-comp-segundo-apellido" class="form-input" placeholder="Segundo Apellido" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-comp-nombres">NOMBRES</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-comp-nombres', -0.5)">A-</button>
                  <span id="font-size-label-overlay-comp-nombres" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-comp-nombres', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-comp-nombres" class="form-input" placeholder="Nombres Completos" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <label for="runt-comp-tipodoc-select">TIPO DE DOCUMENTO</label>
              <select id="runt-comp-tipodoc-select" class="form-select" onchange="updateRuntPDFOverlay()">
                <option value="">-- Seleccione Tipo de Doc --</option>
                <option value="1">C.C. (Cédula de Ciudadanía - C)</option>
                <option value="2">NIT (N)</option>
                <option value="3">N.N. (X)</option>
                <option value="4">PASAPORTE (P)</option>
                <option value="5">C. EXTRANJ. (Cédula Extranjería - E)</option>
                <option value="6">T. IDENTI. (Tarjeta Identidad - T)</option>
                <option value="7">NUIP (U)</option>
                <option value="8">C. DIPLOMÁTICO (D)</option>
              </select>
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-comp-numdoc">No. DOCUMENTO</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-comp-numdoc', -0.5)">A-</button>
                  <span id="font-size-label-overlay-comp-numdoc" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-comp-numdoc', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-comp-numdoc" class="form-input" placeholder="Número de Documento" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-comp-direccion">DIRECCIÓN</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-comp-direccion', -0.5)">A-</button>
                  <span id="font-size-label-overlay-comp-direccion" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-comp-direccion', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-comp-direccion" class="form-input" placeholder="Dirección de Residencia/Empresa" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-row">
              <div class="form-group form-col" style="flex: 1.5;">
                <div style="display: flex; justify-content: space-between; align-items: center;">
                  <label for="runt-comp-ciudad">CIUDAD</label>
                  <div class="form-font-adjuster">
                    <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-comp-ciudad', -0.5)">A-</button>
                    <span id="font-size-label-overlay-comp-ciudad" class="form-font-adjuster-val">11px</span>
                    <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-comp-ciudad', 0.5)">A+</button>
                  </div>
                </div>
                <input type="text" id="runt-comp-ciudad" class="form-input" placeholder="Ciudad" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
              <div class="form-group form-col">
                <label for="runt-comp-telefono">TELÉFONO</label>
                <input type="text" id="runt-comp-telefono" class="form-input" placeholder="Teléfono" oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
              </div>
            </div>

            <!-- FIRMA COMPRADOR -->
            <div class="form-signature-upload">
              <label style="font-size: 11px; color: #60a5fa; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px;">
                ✍️ FIRMA DEL COMPRADOR (IMAGEN)
              </label>
              <div style="display: flex; gap: 8px; align-items: center; justify-content: center;">
                <input type="file" id="runt-comp-firma-file" accept="image/png, image/jpeg, image/jpg, image/webp" onchange="handleCompFirmaUpload(this)" style="display: none;">
                <label for="runt-comp-firma-file" class="btn btn-secondary" style="font-size: 12px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;">
                  <span>📁</span> Seleccionar Firma...
                </label>
                <button type="button" onclick="clearCompFirma()" class="btn-sidebar-del-page" style="display: none; padding: 6px 10px; font-size: 12px;" id="btn-clear-comp-firma">
                  ✕ Quitar
                </button>
              </div>
              <div id="comp-firma-preview-container" class="form-signature-preview" style="display: none;">
                <img id="comp-firma-preview-img">
                <span id="comp-firma-filename" style="font-size: 11px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"></span>
              </div>
            </div>
          </div>
        </div>

        <!-- GRUPO 23: OBSERVACIONES -->
        <div class="form-accordion">
          <div class="form-accordion-header" onclick="toggleFormAccordion(this)">
            <h4><span>📝</span> 23. OBSERVACIONES</h4>
            <span class="form-accordion-chevron">▼</span>
          </div>

          <div class="form-accordion-body">
            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-obs-1">OBSERVACIONES (LÍNEA 1)</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-obs-1', -0.5)">A-</button>
                  <span id="font-size-label-overlay-obs-1" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-obs-1', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-obs-1" class="form-input" placeholder="Especifique palabra OTRO, transformación, alerta..." oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-group">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-obs-2">OBSERVACIONES (LÍNEA 2)</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-obs-2', -0.5)">A-</button>
                  <span id="font-size-label-overlay-obs-2" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-obs-2', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-obs-2" class="form-input" placeholder="Continuación observaciones..." oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-obs-antes-1" style="font-size: 11px; color: #60a5fa; font-weight: 700;">OBSERVACIONES (ANTES DEL RUNT - LÍNEA 1)</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-obs-antes-1', -0.5)">A-</button>
                  <span id="font-size-label-overlay-obs-antes-1" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-obs-antes-1', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-obs-antes-1" class="form-input" placeholder="Carrocería y clase en licencia previa al RUNT..." oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>

            <div class="form-card-item">
              <div style="display: flex; justify-content: space-between; align-items: center;">
                <label for="runt-obs-antes-2" style="font-size: 11px; color: #60a5fa; font-weight: 700;">OBSERVACIONES (ANTES DEL RUNT - LÍNEA 2)</label>
                <div class="form-font-adjuster">
                  <button type="button" class="form-font-adjuster-btn btn-minus" onclick="changeFieldFontSize('overlay-obs-antes-2', -0.5)">A-</button>
                  <span id="font-size-label-overlay-obs-antes-2" class="form-font-adjuster-val">11px</span>
                  <button type="button" class="form-font-adjuster-btn" onclick="changeFieldFontSize('overlay-obs-antes-2', 0.5)">A+</button>
                </div>
              </div>
              <input type="text" id="runt-obs-antes-2" class="form-input" placeholder="Continuación observaciones previa RUNT..." oninput="this.value = this.value.toUpperCase(); updateRuntPDFOverlay();" style="text-transform: uppercase;">
            </div>
          </div>
        </div>

        <!-- ACCIONES DE HOJA EN DESKTOP -->
        <div class="settings-group sidebar-add-sections-group" style="margin-top: 14px; margin-bottom: 20px;">
          <div style="display: flex; gap: 8px;">
            <button class="btn-sidebar-reorder" onclick="openReorderModal()" style="flex: 1;" title="Reordenar la secuencia de las hojas del documento">📑 Reordenar Hojas</button>
          </div>
          <div style="margin-top: 6px;">
            <button class="btn-sidebar-add-pdf" onclick="triggerPDFUpload()" title="Cargar un documento PDF y adjuntarlo al traspaso">📎 + Adjuntar Documento PDF</button>
          </div>
        </div>
      </div> <!-- /#tab-pane-form -->

      <!-- PESTAÑA 2: GUÍA Y REQUISITOS (SEO & TIPS) -->
      <div id="tab-pane-settings" class="tab-pane" style="display: none;">
        <!-- TIPS DE EDICIÓN -->
        <div class="info-box">
          <h3 style="color: #fbbf24; font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 6px; margin: 0 0 8px 0;">
            💡 Tips de Edición RUNT:
          </h3>
          <ul style="margin: 0; padding-left: 16px; color: #cbd5e1; font-size: 12.5px; line-height: 1.6;">
            <li style="margin-bottom: 4px;"><strong>Mayúsculas Automáticas:</strong> Todo lo que escribes se convierte en mayúsculas sostenidas conforme al estándar de Tránsito.</li>
            <li style="margin-bottom: 4px;"><strong>Ajuste A- / A+ en Casillas:</strong> Usa los botones <code>A-</code> y <code>A+</code> de cada campo para calibrar el tamaño exacto de la fuente.</li>
            <li style="margin-bottom: 4px;"><strong>Imágenes de Firmas:</strong> Carga imágenes de las firmas del Vendedor y Comprador directamente desde tu dispositivo.</li>
            <li style="margin-bottom: 4px;"><strong>2 Hojas Oficiales:</strong> El formulario muestra ambas caras oficiales del RUNT (Anverso editable y Reverso con instrucciones).</li>
            <li style="margin-bottom: 0;"><strong>Descarga Vectorial HD:</strong> Al generar tu PDF obtienes un documento nítido listo para Notaría y Tránsito.</li>
          </ul>
        </div>

        <!-- ARTÍCULO GUÍA Y REQUISITOS LEGALES (SEO COMPLETO) -->
        <article class="seo-article-box info-box">
          <header class="seo-article-header">
            <h1 class="seo-title">Formato Traspaso de Vehículo RUNT – Rellenar y Descargar PDF</h1>
            <p class="seo-subtitle">Diligenciamiento en Línea, Requisitos RUNT, SIMIT, Tarifas 2026 y Notaría en Colombia</p>
          </header>

          <blockquote style="background: rgba(59, 130, 246, 0.1); border-left: 4px solid #3b82f6; padding: 12px 14px; margin: 14px 0; border-radius: 0 8px 8px 0; font-size: 0.85rem; line-height: 1.5; color: #cbd5e1;">
            El <strong>contrato de compraventa y traspaso de vehículo automotor</strong> es el instrumento jurídico fundamental mediante el cual el vendedor transfiere a título de venta la propiedad de un vehículo (carro, camioneta o motocicleta) al comprador en Colombia. Sirve como soporte obligatorio ante la Secretaría de Tránsito y el Registro Único Nacional de Tránsito (RUNT) según la <strong>Resolución 12379 de 2012 del Ministerio de Transporte</strong> y la Ley 769 de 2002 (Código Nacional de Tránsito).
          </blockquote>

          <section class="seo-section">
            <h3>¿Qué es el Formulario Único del RUNT y cuál es su validez jurídica?</h3>
            <p>El <strong>Formulario Único de Solicitud de Trámites del RUNT</strong> formaliza legalmente la transferencia de propiedad vehicular entre personas naturales o jurídicas. Establece con precisión la identificación del automóvil o motocicleta (Placa, Chasis, Motor, VIN), el precio pactado de la compraventa y la fecha exacta desde la cual se extingue la responsabilidad del vendedor frente a impuestos, fotomultas y responsabilidad civil contractual o extracontractual.</p>
          </section>

          <!-- TABLA 1: CUADRO COMPARATIVO DE COSTOS Y RESPONSABILIDADES -->
          <section class="seo-section">
            <h3>📊 Distribución de Gastos y Responsabilidades (Vendedor vs Comprador)</h3>
            <p>Distribución estándar en Colombia para la radicación del traspaso vehicular:</p>
            <div class="table-responsive">
              <table class="seo-table">
                <thead>
                  <tr>
                    <th>Concepto / Trámite</th>
                    <th>Vendedor</th>
                    <th>Comprador</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td><strong>Derechos de Traspaso (Tránsito)</strong></td>
                    <td>50% Tarifa Oficial</td>
                    <td>50% Tarifa Oficial</td>
                  </tr>
                  <tr>
                    <td><strong>Tarifa Ministerio / RUNT</strong></td>
                    <td>50% Tarifa RUNT</td>
                    <td>50% Tarifa RUNT</td>
                  </tr>
                  <tr>
                    <td><strong>Retención en la Fuente (1%)</strong></td>
                    <td>100% Asumido</td>
                    <td>Exento (0%)</td>
                  </tr>
                  <tr>
                    <td><strong>Impuesto Vehicular (Año Vigente)</strong></td>
                    <td>Paz y Salvo Total</td>
                    <td>Aplica periodos futuros</td>
                  </tr>
                  <tr>
                    <td><strong>Comparendos y Multas (SIMIT)</strong></td>
                    <td>Paz y Salvo Personal</td>
                    <td>Paz y Salvo Personal</td>
                  </tr>
                  <tr>
                    <td><strong>Autenticación Notarial (Biometría)</strong></td>
                    <td>Firma y Huella</td>
                    <td>Firma y Huella</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </section>

          <section class="seo-section">
            <h3>Requisitos Legales Indispensables para la Radicación</h3>
            <p>Para formalizar con éxito la solicitud ante cualquier Secretaría de Tránsito en Colombia, se debe cumplir el siguiente listado normativo:</p>
            <ul>
              <li><strong>Formulario Único del RUNT:</strong> Diligenciado completamente sin enmendaduras ni tachones, indicando la opción de traspaso de propiedad.</li>
              <li><strong>Inscripción Activa en RUNT:</strong> Tanto vendedor como comprador deben contar con registro biométrico e inscripción activa previa en el sistema RUNT.</li>
              <li><strong>Paz y Salvo SIMIT:</strong> Ninguna de las partes puede registrar multas o comparendos pendientes de pago a nivel nacional.</li>
              <li><strong>SOAT y Revisión Técnico-Mecánica (RTM):</strong> Deben estar vigentes y validados electrónicamente en la plataforma RUNT.</li>
              <li><strong>Impuestos Vehiculares al Día:</strong> Paz y salvo de la Gobernación o Secretaría de Hacienda del departamento de matricula.</li>
              <li><strong>Improntas Físicas Legibles:</strong> Adhesión de improntas del número de motor, chasis, serie o VIN en la cara correspondiente del formulario.</li>
            </ul>
          </section>

          <section class="seo-section">
            <h3>Paso a Paso para Diligenciar, Notariar y Descargar en PDF</h3>
            <ol>
              <li><strong>Completa las casillas del editor:</strong> Ingresa la información del Vendedor, Comprador y datos de la tarjeta de propiedad.</li>
              <li><strong>Calibra fuentes con A- / A+:</strong> Utiliza los botones direccionales para que textos largos quepan sin cortar.</li>
              <li><strong>Adjunta imágenes de firmas:</strong> Sube fotos de las firmas de las partes en los espacios designados.</li>
              <li><strong>Toma de improntas:</strong> Adhiere la cinta de improntas en el formulario impreso tras la descarga.</li>
              <li><strong>Vista Previa y Descarga PDF HD:</strong> Verifica en la vista previa a tamaño Carta y genera el PDF limpio listo para notariar.</li>
            </ol>
          </section>

          <section class="seo-section faq-container">
            <h3>Preguntas Frecuentes sobre el Traspaso Vehicular en Colombia</h3>

            <details class="faq-item">
              <summary><strong>¿Quién debe pagar la retención en la fuente del traspaso?</strong></summary>
              <p>La retención en la fuente (1% sobre el avalúo comercial o precio pactado) está legalmente a cargo del vendedor como sujeto pasivo del impuesto sobre la renta.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Es obligatoria la autenticación biométrica en Notaría?</strong></summary>
              <p>Sí. Las Secretarías de Tránsito exigen la verificación biométrica e impresiones dactilares notariadas para evitar suplantaciones en la compraventa.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Qué sucede si el vehículo registra una prenda o embargo?</strong></summary>
              <p>El sistema RUNT rechazará la radicación. Se debe realizar primero la levantada de prenda o adjuntar la carta de autorización formal del acreedor hipotecario/prendario.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Por qué no se debe vender un vehículo con "contrato firmado en blanco"?</strong></summary>
              <p>Vender en blanco deja al vendedor como titular registrado ante el RUNT. El vendedor seguirá siendo legalmente responsable de fotomultas, impuestos anuales e indemnizaciones civiles por accidentes de tránsito.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Qué es el Traspaso a Persona Indeterminada?</strong></summary>
              <p>Es un procedimiento legal habilitado para propietarios que vendieron su vehículo hace más de 3 años y no formalizaron el traspaso, permitiendo desvincular la propiedad ante el RUNT sin conocer el paradero del comprador.</p>
            </details>
          </section>

          <footer class="seo-article-footer">
            <p>Diligencia, personaliza y descarga tu Contrato de Traspaso RUNT en formato Carta (Letter) listo para Notaría y Tránsito.</p>
          </footer>
        </article>
      </div> <!-- /#tab-pane-settings -->
    </div>
  </aside>

  <!-- TELÓN DE FONDO DE LA VISTA PREVIA EN MÓVIL -->
  <div id="mobile-preview-backdrop" class="mobile-preview-backdrop no-print" onclick="toggleMobilePreview(false)"></div>

  <!-- ESPACIO DE TRABAJO (VISTA DEL DOCUMENTO ORIGINAL DEL RUNT / BOTTOM SHEET EN MÓVIL) -->
  <main class="workspace" id="main-workspace">
    <!-- Pestaña / Asa de agarre del Bottom Sheet en Móvil -->
    <div class="mobile-sheet-handle no-print" onclick="toggleMobilePreview()">
      <span class="mobile-sheet-circle-icon">▲</span>
      <span class="mobile-sheet-title">Vista Previa del Documento</span>
      <span class="mobile-sheet-circle-icon">▲</span>
    </div>

    <div class="workspace-scroll-area">
      <div id="pdf-render-container" class="pdf-render-container">
        <div style="color: #94a3b8; font-size: 14px; padding: 40px; text-align: center;">
          Cargando Formulario Oficial RUNT...
        </div>
      </div>

      <!-- Botones para añadir y eliminar hoja desde el área de trabajo -->
      <div class="workspace-add-page-container no-print" style="margin-top: 20px;">
        <button class="btn-workspace-preview" onclick="previewPDF(true)"
          title="Ver Vista Previa del Documento con marca de agua">
          <span>👁️</span> Vista Previa PDF
        </button>

        <button class="btn-workspace-reorder" onclick="openReorderModal()">
          <span>📑</span> Reordenar Hojas
        </button>
        <button class="btn-workspace-add-pdf" onclick="triggerPDFUpload()">
          <span>📎</span> Adjuntar PDF
        </button>
        <button id="btn-workspace-del-page" class="btn-workspace-del-page" onclick="deleteLastPage()">
          <span>🗑️</span> Eliminar Última Hoja
        </button>
      </div>
    </div>
  </main>

  <!-- MODALES Y ELEMENTOS CONTEXTUALES -->
  <!-- MODAL DE REORDENAMIENTO DE HOJAS (MOBILE-FIRST) -->
  <div id="reorder-modal" class="reorder-modal no-print" aria-hidden="true">
    <div class="reorder-backdrop" onclick="closeReorderModal()"></div>
    <div class="reorder-card-dialog">
      <header class="reorder-modal-header">
        <div class="reorder-modal-title">
          <span class="reorder-icon">📑</span>
          <h3>Reordenar Hojas</h3>
        </div>
        <button class="reorder-close-btn" onclick="closeReorderModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="reorder-modal-body">
        <p class="reorder-help-text">Usa los botones ▲/▼ para cambiar la secuencia de las páginas de tu documento:</p>
        <div id="reorder-list" class="reorder-list"></div>
      </div>

      <footer class="reorder-modal-footer">
        <button class="btn btn-secondary" onclick="closeReorderModal()">Cancelar</button>
        <button class="btn btn-primary" onclick="applyPageReorder()"
          style="background: linear-gradient(135deg, #10b981, #059669); border: none;">✓ Aplicar Cambios</button>
      </footer>
    </div>
  </div>

  <div id="pdf-loading-overlay">
    <div class="pdf-loading-card">
      <div class="pdf-spinner"></div>
      <p class="pdf-loading-title">Generando PDF</p>
      <p id="pdf-loading-msg" class="pdf-loading-sub">Iniciando...</p>
    </div>
  </div>

  <input type="file" id="pdf-file-input" accept="application/pdf" style="display:none" onchange="loadPDFAttachment(this)">

  <div id="context-bar" class="context-bar no-print">
    <div id="context-content" class="context-content"></div>
  </div>

  <!-- MODAL DE VISTA PREVIA DEL DOCUMENTO EN PÁGINA (MOBILE-FIRST) -->
  <div id="pdf-preview-modal" class="pdf-preview-modal no-print" aria-hidden="true">
    <div class="pdf-preview-backdrop" onclick="closePDFPreviewModal()"></div>
    <div class="pdf-preview-card-dialog">
      <header class="pdf-preview-header">
        <div class="pdf-preview-title">
          <span class="pdf-preview-icon">👁️</span>
          <h3>Vista Previa del Traspaso (Modo Borrador)</h3>
        </div>
        <button class="pdf-preview-close-btn" onclick="closePDFPreviewModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="pdf-preview-body">
        <p class="pdf-preview-help-text">Muestra con marca de agua de cómo se verá tu documento final:</p>
        <div id="pdf-preview-pages-container" class="pdf-preview-pages-container"></div>
      </div>

      <footer class="pdf-preview-footer">
        <button class="btn btn-secondary" onclick="closePDFPreviewModal()">Seguir Editando</button>
        <button class="btn btn-primary" onclick="closePDFPreviewModal(); processPaymentFlow();"
          style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          📥 Pagar y Descargar PDF Limpio
        </button>
      </footer>
    </div>
  </div>

  <!-- MODAL DE CÓDIGO DE RECUPERACIÓN Y PAGO WOMPI (MOBILE-FIRST) -->
  <div id="payment-code-modal" class="payment-modal no-print" aria-hidden="true">
    <div class="payment-backdrop" onclick="closePaymentCodeModal()"></div>
    <div class="payment-card-dialog">
      <header class="payment-modal-header">
        <div class="payment-modal-title">
          <span class="payment-icon">🔐</span>
          <h3>Código de Recuperación de tu Documento</h3>
        </div>
        <button class="payment-close-btn" onclick="closePaymentCodeModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="payment-modal-body">
        <p class="payment-instructions">
          Tu documento ha sido almacenado de forma segura. Copia y guarda tu código único de recuperación antes de continuar al pago:
        </p>

        <div class="recovery-code-box">
          <span id="display-recovery-code" class="recovery-code-text">--------</span>
          <button class="btn-copy-code" onclick="copyRecoveryCode()" title="Copiar código al portapapeles">
            <span>📋</span> <span id="copy-btn-label">Copiar Código</span>
          </button>
        </div>

        <div class="payment-info-box">
          <span class="info-badge">⚠️ IMPORTANTE</span>
          <p>
            <strong>Debes copiar este código:</strong> al momento de pagar en Wompi, el formulario de pago te lo va a pedir para asociar tu compra. Además, te permitirá recuperar tu PDF en caso de cerrar la página o cambiar de dispositivo.
          </p>
          <p style="margin-top: 6px; font-size: 0.85rem; color: #cbd5e1;">
            ⏱️ <strong>Disponibilidad:</strong> Tu documento estará disponible para descargar durante <strong>24 horas</strong> luego de confirmado el pago.
          </p>
        </div>
      </div>

      <footer class="payment-modal-footer">
        <button class="btn btn-secondary" onclick="closePaymentCodeModal()">Guardar después</button>
        <button id="btn-continue-wompi" class="btn btn-primary" onclick="continueToWompiPayment()" style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>💳</span> Continuar al Pago
        </button>
      </footer>
    </div>
  </div>

  <!-- MODAL DE RECUPERACIÓN DE DOCUMENTO PAGADO -->
  <div id="document-recovery-modal" class="payment-modal no-print" aria-hidden="true">
    <div class="payment-backdrop" onclick="closeDocumentRecoveryModal()"></div>
    <div class="payment-card-dialog">
      <header class="payment-modal-header">
        <div class="payment-modal-title">
          <span class="payment-icon">🔍</span>
          <h3>Recuperar Documento Pagado</h3>
        </div>
        <button class="payment-close-btn" onclick="closeDocumentRecoveryModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="payment-modal-body">
        <p class="payment-instructions">
          Ingresa el código único de recuperación de 10 caracteres que obtuviste antes de pagar tu documento:
        </p>

        <div class="recovery-input-box">
          <input type="text" id="recovery-code-input" class="recovery-input" placeholder="Ej: ABC123XYZ9" maxlength="15" autocomplete="off" spellcheck="false">
          <div id="recovery-error-msg" class="recovery-error" style="display:none;"></div>
        </div>

        <div class="recovery-note">
          <p>Solo podrás descargar documentos cuyo pago haya sido confirmado por la pasarela de pago Wompi.</p>
        </div>
      </div>

      <footer class="payment-modal-footer">
        <button class="btn btn-secondary" onclick="closeDocumentRecoveryModal()">Cancelar</button>
        <button id="btn-search-recovery" class="btn btn-primary" onclick="lookupAndDownloadDocument()" style="background-color: #38bdf8; color: #0f172a; border: 1px solid #7dd3fc; font-weight: 800;">
          <span>📥</span> Buscar y Descargar
        </button>
      </footer>
    </div>
  </div>

  <!-- SCRIPT PARA CARGAR Y RENDERIZAR EL PDF ORIGINAL DEL RUNT -->
  <script>
    window.WOMPI_PAYMENT_LINK = "https://checkout.wompi.co/l/6EckoF";
    window.pdfUrl = '/formatos/assets/imgs/formulario-traspaso-vehiculos.pdf';
    const pdfUrl = window.pdfUrl;

    if (window.pdfjsLib) {
      pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';
    }

    async function renderOriginalFormPDF() {
      const container = document.getElementById('pdf-render-container');
      if (!container || !window.pdfjsLib) return;

      try {
        const loadingTask = pdfjsLib.getDocument(pdfUrl);
        const pdf = await loadingTask.promise;

        container.innerHTML = '';

        for (let pNum = 1; pNum <= pdf.numPages; pNum++) {
          const pageDiv = document.createElement('div');
          pageDiv.className = 'pdf-page-container';
          pageDiv.style.position = 'relative';
          pageDiv.style.marginBottom = '24px';

          const canvas = document.createElement('canvas');
          canvas.className = 'pdf-page-canvas';
          pageDiv.appendChild(canvas);

          const watermarkDiv = document.createElement('div');
          watermarkDiv.className = 'page-watermark';
          watermarkDiv.textContent = 'formatounico.com';
          pageDiv.appendChild(watermarkDiv);

          if (pNum === 1) {
            const overlayDiv = document.createElement('div');
            overlayDiv.className = 'runt-pdf-overlay';
        overlayDiv.style.cssText = 'position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10;';
        overlayDiv.innerHTML = `
          <div id="overlay-organismo-nombre" style="position: absolute; top: 11.56%; left: 65.29%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-organismo-ciudad" style="position: absolute; top: 15.50%; left: 63.99%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; text-transform: uppercase; white-space: nowrap; transform: translate(-50%, -50%);"></div>
          <div id="overlay-organismo-codigo" style="position: absolute; top: 15.57%; left: 71.35%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; text-transform: uppercase; white-space: nowrap; transform: translate(-50%, -50%);"></div>
          <div id="overlay-organismo-dia" style="position: absolute; top: 16.04%; left: 77.18%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; text-transform: uppercase; transform: translate(-50%, -50%);"></div>
          <div id="overlay-organismo-mes" style="position: absolute; top: 16.04%; left: 80.56%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; text-transform: uppercase; transform: translate(-50%, -50%);"></div>
          <div id="overlay-organismo-anio" style="position: absolute; top: 16.06%; left: 84.05%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; text-transform: uppercase; transform: translate(-50%, -50%);"></div>
          <div id="overlay-placa-letras" style="position: absolute; top: 14.69%; left: 90.71%; font-family: sans-serif; font-size: 12px; font-weight: 700; color: #000000; text-align: center; text-transform: uppercase; transform: translate(-50%, -50%);"></div>
          <div id="overlay-placa-numeros" style="position: absolute; top: 14.65%; left: 94.18%; font-family: sans-serif; font-size: 12px; font-weight: 700; color: #000000; text-align: center; text-transform: uppercase; transform: translate(-50%, -50%);"></div>
          <!-- 3. TRÁMITE SOLICITADO (18 OPCIONES CON MARCA X) -->
          <div id="overlay-tramite-1" style="position: absolute; top: 21.97%; left: 4.46%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-2" style="position: absolute; top: 21.88%; left: 11.73%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-3" style="position: absolute; top: 22.13%; left: 18.86%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-4" style="position: absolute; top: 21.85%; left: 26.02%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-5" style="position: absolute; top: 21.91%; left: 33.21%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-6" style="position: absolute; top: 21.78%; left: 40.35%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-7" style="position: absolute; top: 26.00%; left: 4.60%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-8" style="position: absolute; top: 26.04%; left: 11.66%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-9" style="position: absolute; top: 25.95%; left: 18.81%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-10" style="position: absolute; top: 25.81%; left: 26.03%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-11" style="position: absolute; top: 25.90%; left: 33.19%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-12" style="position: absolute; top: 25.90%; left: 40.37%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-13" style="position: absolute; top: 30.40%; left: 4.60%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-14" style="position: absolute; top: 30.48%; left: 11.69%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-15" style="position: absolute; top: 30.48%; left: 18.93%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-16" style="position: absolute; top: 30.59%; left: 25.95%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-17" style="position: absolute; top: 30.56%; left: 33.09%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-tramite-18" style="position: absolute; top: 30.48%; left: 40.35%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <!-- 4. CLASE DE VEHÍCULO (14 OPCIONES CON MARCA X) -->
          <div id="overlay-clase-1" style="position: absolute; top: 38.00%; left: 7.00%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-2" style="position: absolute; top: 38.12%; left: 13.16%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-3" style="position: absolute; top: 37.91%; left: 19.09%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-4" style="position: absolute; top: 37.92%; left: 24.09%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-5" style="position: absolute; top: 37.92%; left: 29.36%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-6" style="position: absolute; top: 38.07%; left: 35.29%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-7" style="position: absolute; top: 38.09%; left: 42.47%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-8" style="position: absolute; top: 41.50%; left: 7.00%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-9" style="position: absolute; top: 41.53%; left: 13.09%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-10" style="position: absolute; top: 41.58%; left: 18.85%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-11" style="position: absolute; top: 41.48%; left: 24.17%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-12" style="position: absolute; top: 41.53%; left: 29.36%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-13" style="position: absolute; top: 41.66%; left: 35.36%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-clase-14" style="position: absolute; top: 41.41%; left: 42.73%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <!-- 5. MARCA & 6. LÍNEA -->
          <div id="overlay-vehiculo-marca" style="position: absolute; top: 22.62%; left: 47.45%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-vehiculo-linea" style="position: absolute; top: 22.66%; left: 57.30%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- 7. COMBUSTIBLE (8 OPCIONES CON MARCA X O NÚMERO) -->
          <div id="overlay-combustible-1" style="position: absolute; top: 22.66%; left: 69.99%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-2" style="position: absolute; top: 22.87%; left: 73.65%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-3" style="position: absolute; top: 22.91%; left: 77.07%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-4" style="position: absolute; top: 22.76%; left: 80.34%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-5" style="position: absolute; top: 22.78%; left: 83.74%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-6" style="position: absolute; top: 22.84%; left: 87.43%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-7" style="position: absolute; top: 22.83%; left: 90.82%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-combustible-8" style="position: absolute; top: 22.84%; left: 94.09%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <!-- 8. COLORES, 9. MODELO, 10. CILINDRADA -->
          <div id="overlay-vehiculo-colores" style="position: absolute; top: 26.71%; left: 47.57%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-vehiculo-modelo" style="position: absolute; top: 26.55%; left: 80.61%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-vehiculo-cilindrada" style="position: absolute; top: 26.57%; left: 89.27%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <!-- 11. CAPACIDAD, 12. BLINDAJE (SI/NO + RES), 13. DESMONTE (SI/NO + RES), 14. POTENCIA -->
          <div id="overlay-vehiculo-capacidad" style="position: absolute; top: 30.85%; left: 47.63%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <div id="overlay-blindaje-si" style="position: absolute; top: 28.68%; left: 65.35%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-blindaje-no" style="position: absolute; top: 28.83%; left: 68.27%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-blindaje-resolucion" style="position: absolute; top: 31.70%; left: 57.85%; font-family: sans-serif; font-size: 10px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <div id="overlay-desmonte-si" style="position: absolute; top: 28.79%; left: 82.55%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-desmonte-no" style="position: absolute; top: 28.49%; left: 84.80%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-desmonte-resolucion" style="position: absolute; top: 31.74%; left: 71.82%; font-family: sans-serif; font-size: 10px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <div id="overlay-vehiculo-potencia" style="position: absolute; top: 30.86%; left: 85.90%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- 15. CARROCERÍA (CÓDIGO Y TIPO) -->
          <div id="overlay-carroceria-codigo" style="position: absolute; top: 37.68%; left: 47.63%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-carroceria-tipo" style="position: absolute; top: 42.00%; left: 47.70%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- 16. IDENTIFICACIÓN INTERNA DEL VEHÍCULO -->
          <div id="overlay-ident-motor" style="position: absolute; top: 37.87%; left: 72.11%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-motor-regrabado-si" style="position: absolute; top: 38.22%; left: 90.55%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-motor-regrabado-no" style="position: absolute; top: 38.27%; left: 93.64%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-ident-chasis" style="position: absolute; top: 42.37%; left: 72.01%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-chasis-regrabado-si" style="position: absolute; top: 42.65%; left: 90.44%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-chasis-regrabado-no" style="position: absolute; top: 42.74%; left: 93.67%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-ident-serie" style="position: absolute; top: 46.78%; left: 72.15%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-serie-regrabado-si" style="position: absolute; top: 47.34%; left: 90.46%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-serie-regrabado-no" style="position: absolute; top: 47.36%; left: 93.63%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-ident-vin" style="position: absolute; top: 51.82%; left: 72.07%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- 17. IMPORTACIÓN O REMATE (6 OPCIONES CON MARCA X + DOC + FECHA) -->
          <div id="overlay-import-1" style="position: absolute; top: 53.98%; left: 48.73%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-2" style="position: absolute; top: 54.16%; left: 51.91%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-3" style="position: absolute; top: 54.08%; left: 54.89%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-4" style="position: absolute; top: 53.88%; left: 58.55%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-5" style="position: absolute; top: 54.00%; left: 62.09%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-6" style="position: absolute; top: 53.86%; left: 67.38%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-import-numdoc" style="position: absolute; top: 58.18%; left: 47.75%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-import-dia" style="position: absolute; top: 59.89%; left: 58.55%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-mes" style="position: absolute; top: 60.16%; left: 62.20%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-import-anio" style="position: absolute; top: 60.15%; left: 67.35%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <!-- 18. TIPO DE SERVICIO (6 OPCIONES CON MARCA X) -->
          <div id="overlay-servicio-1" style="position: absolute; top: 61.82%; left: 73.55%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-servicio-2" style="position: absolute; top: 61.82%; left: 76.91%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-servicio-3" style="position: absolute; top: 61.82%; left: 80.27%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-servicio-4" style="position: absolute; top: 61.91%; left: 83.63%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-servicio-5" style="position: absolute; top: 62.04%; left: 87.21%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-servicio-6" style="position: absolute; top: 61.87%; left: 92.36%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <!-- 19. EMPRESA VINCULADORA (NOMBRE Y NIT) -->
          <div id="overlay-empresa-nombre" style="position: absolute; top: 67.76%; left: 72.45%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-empresa-nit" style="position: absolute; top: 67.39%; left: 89.20%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- 20. DATOS DE ALERTA (4 OPCIONES CON MARCA X + A FAVOR DE 5) -->
          <div id="overlay-alerta-1" style="position: absolute; top: 69.94%; left: 48.73%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-alerta-2" style="position: absolute; top: 69.79%; left: 53.36%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-alerta-3" style="position: absolute; top: 69.79%; left: 58.73%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-alerta-4" style="position: absolute; top: 69.61%; left: 62.46%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-alerta-afavor" style="position: absolute; top: 68.96%; left: 64.26%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- 21. DATOS DEL PROPIETARIO -->
          <div id="overlay-prop-primer-apellido" style="position: absolute; top: 51.12%; left: 4.40%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-prop-segundo-apellido" style="position: absolute; top: 51.05%; left: 17.07%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-prop-nombres" style="position: absolute; top: 51.27%; left: 32.70%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- TIPO DE DOC PROPIETARIO (8 OPCIONES CON MARCA X) -->
          <div id="overlay-prop-tipodoc-1" style="position: absolute; top: 56.17%; left: 4.93%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-2" style="position: absolute; top: 56.29%; left: 8.49%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-3" style="position: absolute; top: 56.41%; left: 11.80%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-4" style="position: absolute; top: 56.31%; left: 15.30%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-5" style="position: absolute; top: 56.45%; left: 19.50%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-6" style="position: absolute; top: 56.37%; left: 24.30%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-7" style="position: absolute; top: 56.57%; left: 29.91%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-prop-tipodoc-8" style="position: absolute; top: 56.29%; left: 35.50%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-prop-numdoc" style="position: absolute; top: 56.00%; left: 38.99%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-prop-direccion" style="position: absolute; top: 60.07%; left: 4.14%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-prop-ciudad" style="position: absolute; top: 60.11%; left: 24.78%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-prop-telefono" style="position: absolute; top: 60.03%; left: 38.91%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- FIRMA PROPIETARIO IMAGEN OVERLAY -->
          <div id="overlay-prop-firma" style="position: absolute; top: 65.17%; left: 11.36%; transform: translate(-50%, -50%); display: none;">
            <img id="overlay-prop-firma-img" style="max-height: 45px; max-width: 180px; object-fit: contain;">
          </div>

          <!-- 22. DATOS DEL COMPRADOR (TRASPASO) -->
          <div id="overlay-comp-primer-apellido" style="position: absolute; top: 74.20%; left: 4.20%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-comp-segundo-apellido" style="position: absolute; top: 74.10%; left: 17.07%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-comp-nombres" style="position: absolute; top: 74.20%; left: 32.70%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- TIPO DE DOC COMPRADOR (8 OPCIONES CON MARCA X) -->
          <div id="overlay-comp-tipodoc-1" style="position: absolute; top: 79.50%; left: 4.93%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-2" style="position: absolute; top: 79.60%; left: 8.49%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-3" style="position: absolute; top: 79.60%; left: 11.80%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-4" style="position: absolute; top: 79.60%; left: 15.30%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-5" style="position: absolute; top: 79.70%; left: 19.50%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-6" style="position: absolute; top: 79.70%; left: 24.30%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-7" style="position: absolute; top: 79.70%; left: 29.91%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>
          <div id="overlay-comp-tipodoc-8" style="position: absolute; top: 79.60%; left: 35.50%; font-family: sans-serif; font-size: 16px; font-weight: 800; color: #000000; text-align: center; transform: translate(-50%, -50%);"></div>

          <div id="overlay-comp-numdoc" style="position: absolute; top: 79.20%; left: 38.99%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-comp-direccion" style="position: absolute; top: 83.30%; left: 4.14%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-comp-ciudad" style="position: absolute; top: 83.30%; left: 24.68%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-comp-telefono" style="position: absolute; top: 83.30%; left: 39.01%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>

          <!-- FIRMA COMPRADOR IMAGEN OVERLAY -->
          <div id="overlay-comp-firma" style="position: absolute; top: 87.90%; left: 10.24%; transform: translate(-50%, -50%); display: none;">
            <img id="overlay-comp-firma-img" style="max-height: 45px; max-width: 180px; object-fit: contain;">
          </div>

          <!-- 23. OBSERVACIONES GENERALES Y ANTES DEL RUNT -->
          <div id="overlay-obs-1" style="position: absolute; top: 78.25%; left: 47.60%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-obs-2" style="position: absolute; top: 80.22%; left: 47.58%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-obs-antes-1" style="position: absolute; top: 89.53%; left: 47.63%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
          <div id="overlay-obs-antes-2" style="position: absolute; top: 91.67%; left: 47.48%; font-family: sans-serif; font-size: 11px; font-weight: 600; color: #000000; text-transform: uppercase; white-space: nowrap; transform: translateY(-50%);"></div>
        `;
            pageDiv.appendChild(overlayDiv);
          }

          container.appendChild(pageDiv);

          const page = await pdf.getPage(pNum);
          const viewport = page.getViewport({ scale: 2.5 }); // Alta resolución (2.5x)

          canvas.width = viewport.width;
          canvas.height = viewport.height;
          const context = canvas.getContext('2d');

          await page.render({
            canvasContext: context,
            viewport: viewport
          }).promise;
        }

        updateRuntPDFOverlay();
      } catch (err) {
        console.error('Error renderizando PDF original:', err);
      }
    }

    const isLocalDev = window.location.hostname === 'localhost' || 
                       window.location.hostname === '127.0.0.1' || 
                       window.location.hostname === '0.0.0.0' || 
                       window.location.hostname.startsWith('192.168.') || 
                       window.location.protocol === 'file:';

    function updateRuntPDFOverlay() {
      const fields = [
        { inputId: 'runt-organismo-nombre', overlayId: 'overlay-organismo-nombre', placeholder: '[1. NOMBRE]' },
        { inputId: 'runt-organismo-ciudad', overlayId: 'overlay-organismo-ciudad', placeholder: '[1. CIUDAD]' },
        { inputId: 'runt-organismo-codigo', overlayId: 'overlay-organismo-codigo', placeholder: '[1. CODIGO]' },
        { inputId: 'runt-organismo-dia', overlayId: 'overlay-organismo-dia', placeholder: '[1. DIA]' },
        { inputId: 'runt-organismo-mes', overlayId: 'overlay-organismo-mes', placeholder: '[1. MES]' },
        { inputId: 'runt-organismo-anio', overlayId: 'overlay-organismo-anio', placeholder: '[1. AÑO]' },
        { inputId: 'runt-placa-letras', overlayId: 'overlay-placa-letras', placeholder: '[2. LETRAS]' },
        { inputId: 'runt-placa-numeros', overlayId: 'overlay-placa-numeros', placeholder: '[2. NUMEROS]' },
        { inputId: 'runt-vehiculo-marca', overlayId: 'overlay-vehiculo-marca', placeholder: '[5. MARCA]' },
        { inputId: 'runt-vehiculo-linea', overlayId: 'overlay-vehiculo-linea', placeholder: '[6. LÍNEA]' },
        { inputId: 'runt-vehiculo-colores', overlayId: 'overlay-vehiculo-colores', placeholder: '[8. COLORES]' },
        { inputId: 'runt-vehiculo-modelo', overlayId: 'overlay-vehiculo-modelo', placeholder: '[9. MODELO]' },
        { inputId: 'runt-vehiculo-cilindrada', overlayId: 'overlay-vehiculo-cilindrada', placeholder: '[10. CILINDRADA]' },
        { inputId: 'runt-vehiculo-capacidad', overlayId: 'overlay-vehiculo-capacidad', placeholder: '[11. CAPACIDAD]' },
        { inputId: 'runt-blindaje-resolucion', overlayId: 'overlay-blindaje-resolucion', placeholder: '[12. RES BLINDAJE]' },
        { inputId: 'runt-desmonte-resolucion', overlayId: 'overlay-desmonte-resolucion', placeholder: '[13. RES DESMONTE]' },
        { inputId: 'runt-vehiculo-potencia', overlayId: 'overlay-vehiculo-potencia', placeholder: '[14. POTENCIA]' },
        { inputId: 'runt-carroceria-codigo', overlayId: 'overlay-carroceria-codigo', placeholder: '[15. CODIGO CARROCERÍA]' },
        { inputId: 'runt-carroceria-tipo', overlayId: 'overlay-carroceria-tipo', placeholder: '[15. TIPO CARROCERÍA]' },
        { inputId: 'runt-ident-motor', overlayId: 'overlay-ident-motor', placeholder: '[16. No. MOTOR]' },
        { inputId: 'runt-ident-chasis', overlayId: 'overlay-ident-chasis', placeholder: '[16. No. CHASIS]' },
        { inputId: 'runt-ident-serie', overlayId: 'overlay-ident-serie', placeholder: '[16. No. SERIE]' },
        { inputId: 'runt-ident-vin', overlayId: 'overlay-ident-vin', placeholder: '[16. No. VIN]' },
        { inputId: 'runt-import-numdoc', overlayId: 'overlay-import-numdoc', placeholder: '[17. No. DOC]' },
        { inputId: 'runt-import-dia', overlayId: 'overlay-import-dia', placeholder: '[17. DIA]' },
        { inputId: 'runt-import-mes', overlayId: 'overlay-import-mes', placeholder: '[17. MES]' },
        { inputId: 'runt-import-anio', overlayId: 'overlay-import-anio', placeholder: '[17. AÑO]' },
        { inputId: 'runt-empresa-nombre', overlayId: 'overlay-empresa-nombre', placeholder: '[19. EMPRESA VINCULADORA]' },
        { inputId: 'runt-empresa-nit', overlayId: 'overlay-empresa-nit', placeholder: '[19. NIT EMPRESA]' },
        { inputId: 'runt-alerta-afavor', overlayId: 'overlay-alerta-afavor', placeholder: '[20. A FAVOR DE]' },
        { inputId: 'runt-prop-primer-apellido', overlayId: 'overlay-prop-primer-apellido', placeholder: '[21. PRIMER APELLIDO]' },
        { inputId: 'runt-prop-segundo-apellido', overlayId: 'overlay-prop-segundo-apellido', placeholder: '[21. SEGUNDO APELLIDO]' },
        { inputId: 'runt-prop-nombres', overlayId: 'overlay-prop-nombres', placeholder: '[21. NOMBRES]' },
        { inputId: 'runt-prop-numdoc', overlayId: 'overlay-prop-numdoc', placeholder: '[21. No. DOCUMENTO]' },
        { inputId: 'runt-prop-direccion', overlayId: 'overlay-prop-direccion', placeholder: '[21. DIRECCIÓN]' },
        { inputId: 'runt-prop-ciudad', overlayId: 'overlay-prop-ciudad', placeholder: '[21. CIUDAD]' },
        { inputId: 'runt-prop-telefono', overlayId: 'overlay-prop-telefono', placeholder: '[21. TELÉFONO]' },
        { inputId: 'runt-comp-primer-apellido', overlayId: 'overlay-comp-primer-apellido', placeholder: '[22. PRIMER APELLIDO]' },
        { inputId: 'runt-comp-segundo-apellido', overlayId: 'overlay-comp-segundo-apellido', placeholder: '[22. SEGUNDO APELLIDO]' },
        { inputId: 'runt-comp-nombres', overlayId: 'overlay-comp-nombres', placeholder: '[22. NOMBRES]' },
        { inputId: 'runt-comp-numdoc', overlayId: 'overlay-comp-numdoc', placeholder: '[22. No. DOCUMENTO]' },
        { inputId: 'runt-comp-direccion', overlayId: 'overlay-comp-direccion', placeholder: '[22. DIRECCIÓN]' },
        { inputId: 'runt-comp-ciudad', overlayId: 'overlay-comp-ciudad', placeholder: '[22. CIUDAD]' },
        { inputId: 'runt-comp-telefono', overlayId: 'overlay-comp-telefono', placeholder: '[22. TELÉFONO]' },
        { inputId: 'runt-obs-1', overlayId: 'overlay-obs-1', placeholder: '[23. OBSERVACIONES 1]' },
        { inputId: 'runt-obs-2', overlayId: 'overlay-obs-2', placeholder: '[23. OBSERVACIONES 2]' },
        { inputId: 'runt-obs-antes-1', overlayId: 'overlay-obs-antes-1', placeholder: '[23. ANTES RUNT 1]' },
        { inputId: 'runt-obs-antes-2', overlayId: 'overlay-obs-antes-2', placeholder: '[23. ANTES RUNT 2]' }
      ];

      fields.forEach(f => {
        const inputEl = document.getElementById(f.inputId);
        const overlayEl = document.getElementById(f.overlayId);
        if (inputEl && overlayEl) {
          const val = inputEl.value.trim();
          if (val) {
            overlayEl.textContent = val;
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? f.placeholder : '';
            overlayEl.style.opacity = isLocalDev ? '0.6' : '1';
          }
        }
      });

      // Manejar el marcado de 'X' para los 18 trámites
      const tramiteSelect = document.getElementById('runt-tramite-select');
      const selectedVal = tramiteSelect ? tramiteSelect.value : '';

      for (let i = 1; i <= 18; i++) {
        const overlayEl = document.getElementById(`overlay-tramite-${i}`);
        if (overlayEl) {
          if (selectedVal === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[3.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para las 14 Clases de Vehículo
      const claseSelect = document.getElementById('runt-clase-select');
      const selectedClase = claseSelect ? claseSelect.value : '';

      for (let i = 1; i <= 14; i++) {
        const overlayEl = document.getElementById(`overlay-clase-${i}`);
        if (overlayEl) {
          if (selectedClase === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[4.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para las 6 Opciones de Importación / Remate
      const importSelect = document.getElementById('runt-import-select');
      const selectedImport = importSelect ? importSelect.value : '';

      for (let i = 1; i <= 6; i++) {
        const overlayEl = document.getElementById(`overlay-import-${i}`);
        if (overlayEl) {
          if (selectedImport === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[17.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para las 6 Opciones de Tipo de Servicio
      const servicioSelect = document.getElementById('runt-servicio-select');
      const selectedServicio = servicioSelect ? servicioSelect.value : '';

      for (let i = 1; i <= 6; i++) {
        const overlayEl = document.getElementById(`overlay-servicio-${i}`);
        if (overlayEl) {
          if (selectedServicio === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[18.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para las 4 Opciones de Datos de Alerta
      const alertaSelect = document.getElementById('runt-alerta-select');
      const selectedAlerta = alertaSelect ? alertaSelect.value : '';

      for (let i = 1; i <= 4; i++) {
        const overlayEl = document.getElementById(`overlay-alerta-${i}`);
        if (overlayEl) {
          if (selectedAlerta === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[20.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para los 8 Tipos de Documento del Propietario
      const propTipoDocSelect = document.getElementById('runt-prop-tipodoc-select');
      const selectedPropTipoDoc = propTipoDocSelect ? propTipoDocSelect.value : '';

      for (let i = 1; i <= 8; i++) {
        const overlayEl = document.getElementById(`overlay-prop-tipodoc-${i}`);
        if (overlayEl) {
          if (selectedPropTipoDoc === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[21.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para los 8 Tipos de Documento del Comprador
      const compTipoDocSelect = document.getElementById('runt-comp-tipodoc-select');
      const selectedCompTipoDoc = compTipoDocSelect ? compTipoDocSelect.value : '';

      for (let i = 1; i <= 8; i++) {
        const overlayEl = document.getElementById(`overlay-comp-tipodoc-${i}`);
        if (overlayEl) {
          if (selectedCompTipoDoc === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[22.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar el marcado de 'X' para Combustible (1 a 8)
      const combSelect = document.getElementById('runt-combustible-select');
      const selectedComb = combSelect ? combSelect.value : '';

      for (let i = 1; i <= 8; i++) {
        const overlayEl = document.getElementById(`overlay-combustible-${i}`);
        if (overlayEl) {
          if (selectedComb === String(i)) {
            overlayEl.textContent = 'X';
            overlayEl.style.opacity = '1';
          } else {
            overlayEl.textContent = isLocalDev ? `[7.${i}]` : '';
            overlayEl.style.opacity = isLocalDev ? '0.5' : '1';
          }
        }
      }

      // Manejar marcas X de Blindaje SI/NO
      const blindajeRadio = document.querySelector('input[name="runt-blindaje-opcion"]:checked');
      const blindajeVal = blindajeRadio ? blindajeRadio.value : 'NO';
      const bSi = document.getElementById('overlay-blindaje-si');
      const bNo = document.getElementById('overlay-blindaje-no');
      if (bSi) { bSi.textContent = blindajeVal === 'SI' ? 'X' : (isLocalDev ? '[12.SI]' : ''); bSi.style.opacity = (blindajeVal === 'SI' || !isLocalDev) ? '1' : '0.5'; }
      if (bNo) { bNo.textContent = blindajeVal === 'NO' ? 'X' : (isLocalDev ? '[12.NO]' : ''); bNo.style.opacity = (blindajeVal === 'NO' || !isLocalDev) ? '1' : '0.5'; }

      // Manejar marcas X de Desmonte Blindaje SI/NO
      const desmonteRadio = document.querySelector('input[name="runt-desmonte-opcion"]:checked');
      const desmonteVal = desmonteRadio ? desmonteRadio.value : 'NO';
      const dSi = document.getElementById('overlay-desmonte-si');
      const dNo = document.getElementById('overlay-desmonte-no');
      if (dSi) { dSi.textContent = desmonteVal === 'SI' ? 'X' : (isLocalDev ? '[13.SI]' : ''); dSi.style.opacity = (desmonteVal === 'SI' || !isLocalDev) ? '1' : '0.5'; }
      if (dNo) { dNo.textContent = desmonteVal === 'NO' ? 'X' : (isLocalDev ? '[13.NO]' : ''); dNo.style.opacity = (desmonteVal === 'NO' || !isLocalDev) ? '1' : '0.5'; }

      // Manejar marcas X de Motor Regrabado SI/NO
      const mReg = (document.querySelector('input[name="runt-motor-regrabado"]:checked') || {}).value || 'NO';
      const mSi = document.getElementById('overlay-motor-regrabado-si');
      const mNo = document.getElementById('overlay-motor-regrabado-no');
      if (mSi) { mSi.textContent = mReg === 'SI' ? 'X' : (isLocalDev ? '[16.M.SI]' : ''); mSi.style.opacity = (mReg === 'SI' || !isLocalDev) ? '1' : '0.5'; }
      if (mNo) { mNo.textContent = mReg === 'NO' ? 'X' : (isLocalDev ? '[16.M.NO]' : ''); mNo.style.opacity = (mReg === 'NO' || !isLocalDev) ? '1' : '0.5'; }

      // Manejar marcas X de Chasis Regrabado SI/NO
      const cReg = (document.querySelector('input[name="runt-chasis-regrabado"]:checked') || {}).value || 'NO';
      const cSi = document.getElementById('overlay-chasis-regrabado-si');
      const cNo = document.getElementById('overlay-chasis-regrabado-no');
      if (cSi) { cSi.textContent = cReg === 'SI' ? 'X' : (isLocalDev ? '[16.C.SI]' : ''); cSi.style.opacity = (cReg === 'SI' || !isLocalDev) ? '1' : '0.5'; }
      if (cNo) { cNo.textContent = cReg === 'NO' ? 'X' : (isLocalDev ? '[16.C.NO]' : ''); cNo.style.opacity = (cReg === 'NO' || !isLocalDev) ? '1' : '0.5'; }

      // Manejar marcas X de Serie Regrabado SI/NO
      const sReg = (document.querySelector('input[name="runt-serie-regrabado"]:checked') || {}).value || 'NO';
      const sSi = document.getElementById('overlay-serie-regrabado-si');
      const sNo = document.getElementById('overlay-serie-regrabado-no');
      if (sSi) { sSi.textContent = sReg === 'SI' ? 'X' : (isLocalDev ? '[16.S.SI]' : ''); sSi.style.opacity = (sReg === 'SI' || !isLocalDev) ? '1' : '0.5'; }
      if (sNo) { sNo.textContent = sReg === 'NO' ? 'X' : (isLocalDev ? '[16.S.NO]' : ''); sNo.style.opacity = (sReg === 'NO' || !isLocalDev) ? '1' : '0.5'; }
    }

    document.addEventListener('DOMContentLoaded', () => {
      if (isLocalDev) {
        document.body.classList.add('is-dev-mode');
        initDevCalibrator();
      }
      renderOriginalFormPDF();
    });

    /* ── TOOL DE MANEJADORES Y CALIBRACIÓN EN TIEMPO REAL (SOLO DESARROLLO) ── */
    let loggedCoordinates = [];
    let isDevCalibratorActive = true;
    let selectedDevOverlayEl = null;
    let isDraggingOverlay = false;
    let dragStartX = 0, dragStartY = 0;
    let dragStartLeft = 0, dragStartTop = 0;

    function selectDevOverlayElement(el) {
      document.querySelectorAll('.runt-pdf-overlay > div').forEach(item => item.classList.remove('dev-selected'));
      if (!el) {
        selectedDevOverlayEl = null;
        return;
      }
      selectedDevOverlayEl = el;
      el.classList.add('dev-selected');
      updateDevSelectedPanelInfo();
    }

    function changeFieldFontSize(overlayId, delta) {
      const overlayEl = document.getElementById(overlayId);
      if (!overlayEl) return;
      let currSize = parseFloat(overlayEl.style.fontSize);
      if (isNaN(currSize)) currSize = 11;
      currSize = Math.max(6, Math.min(24, currSize + delta));
      overlayEl.style.fontSize = `${currSize.toFixed(1)}px`;

      const labelEl = document.getElementById(`font-size-label-${overlayId}`);
      if (labelEl) {
        labelEl.textContent = `${currSize.toFixed(1)}px`;
      }
    }

    function toggleRuntSection(headerEl) {
      const section = headerEl.closest('.runt-form-section');
      const bodyEl = section ? section.querySelector('.runt-section-body') : headerEl.nextElementSibling;
      const arrowEl = headerEl.querySelector('.runt-acc-arrow');
      if (!bodyEl) return;
      const isHidden = (window.getComputedStyle(bodyEl).display === 'none');
      if (isHidden) {
        bodyEl.style.display = 'block';
        headerEl.style.color = '#60a5fa';
        if (arrowEl) {
          arrowEl.style.transform = 'rotate(0deg)';
          arrowEl.style.color = '#38bdf8';
        }
      } else {
        bodyEl.style.display = 'none';
        headerEl.style.color = '#94a3b8';
        if (arrowEl) {
          arrowEl.style.transform = 'rotate(-90deg)';
          arrowEl.style.color = '#64748b';
        }
      }
    }

    function expandAllRuntSections() {
      document.querySelectorAll('.runt-form-section').forEach(sec => {
        const header = sec.querySelector('.runt-section-header');
        const body = sec.querySelector('.runt-section-body');
        const arrow = sec.querySelector('.runt-acc-arrow');
        if (body) body.style.display = 'block';
        if (header) header.style.color = '#60a5fa';
        if (arrow) { arrow.style.transform = 'rotate(0deg)'; arrow.style.color = '#38bdf8'; }
      });
    }

    function collapseAllRuntSections() {
      document.querySelectorAll('.runt-form-section').forEach((sec, idx) => {
        if (idx === 0) return; // Mantiene el primer grupo visible por defecto
        const header = sec.querySelector('.runt-section-header');
        const body = sec.querySelector('.runt-section-body');
        const arrow = sec.querySelector('.runt-acc-arrow');
        if (body) body.style.display = 'none';
        if (header) header.style.color = '#94a3b8';
        if (arrow) { arrow.style.transform = 'rotate(-90deg)'; arrow.style.color = '#64748b'; }
      });
    }

    function updateDevSelectedPanelInfo() {
      const infoElements = document.querySelectorAll('#dev-selected-info');
      if (!infoElements.length || !selectedDevOverlayEl) return;
      const leftVal = parseFloat(selectedDevOverlayEl.style.left) || 0;
      const topVal = parseFloat(selectedDevOverlayEl.style.top) || 0;
      const fontSizeVal = parseFloat(selectedDevOverlayEl.style.fontSize) || 11;
      const pdfX = (792 * (leftVal / 100)).toFixed(1);
      const pdfY = (612 * (1 - (topVal / 100))).toFixed(1);

      const htmlContent = `
        <div style="color: #ef4444; font-weight: bold; margin-bottom: 2px;">🎯 Campo Seleccionado:</div>
        <div style="font-size: 11px; color: #f8fafc; font-weight: 600;">${selectedDevOverlayEl.id}</div>
        <div style="margin-top: 4px; display: flex; justify-content: space-between;">
          <span><b>Left:</b> ${leftVal.toFixed(2)}%</span>
          <span><b>Top:</b> ${topVal.toFixed(2)}%</span>
        </div>
        <div style="margin-top: 3px; display: flex; justify-content: space-between; align-items: center; background: rgba(15, 23, 42, 0.6); padding: 4px 6px; border-radius: 4px; border: 1px solid #334155;">
          <span style="color: #38bdf8; font-weight: bold;">🔤 Fuente: ${fontSizeVal.toFixed(1)}px</span>
          <span style="display: flex; gap: 4px;">
            <button onclick="nudgeSelectedFontSize(-0.5)" style="background: #ef4444; color: #fff; border: none; border-radius: 3px; padding: 2px 8px; cursor: pointer; font-weight: bold; font-size: 11px;" title="Reducir Letra (Tecla -)">A-</button>
            <button onclick="nudgeSelectedFontSize(0.5)" style="background: #2563eb; color: #fff; border: none; border-radius: 3px; padding: 2px 8px; cursor: pointer; font-weight: bold; font-size: 11px;" title="Aumentar Letra (Tecla +)">A+</button>
          </span>
        </div>
        <div style="margin-top: 2px; color: #a7f3d0;">
          <b>PDFLib:</b> X: ${pdfX}pt | Y: ${pdfY}pt
        </div>
      `;

      infoElements.forEach(el => el.innerHTML = htmlContent);
    }

    function nudgeSelectedFontSize(dSize) {
      if (!selectedDevOverlayEl) return;
      let currSize = parseFloat(selectedDevOverlayEl.style.fontSize) || 11;
      currSize = Math.max(6, Math.min(24, currSize + dSize));
      selectedDevOverlayEl.style.fontSize = `${currSize.toFixed(1)}px`;
      selectedDevOverlayEl.dataset.customFontSize = 'true';
      updateDevSelectedPanelInfo();
    }

    function nudgeSelectedOverlay(dLeft, dTop) {
      if (!selectedDevOverlayEl) return;
      let currLeft = parseFloat(selectedDevOverlayEl.style.left) || 0;
      let currTop = parseFloat(selectedDevOverlayEl.style.top) || 0;

      currLeft = Math.max(0, Math.min(100, currLeft + dLeft));
      currTop = Math.max(0, Math.min(100, currTop + dTop));

      selectedDevOverlayEl.style.left = `${currLeft.toFixed(2)}%`;
      selectedDevOverlayEl.style.top = `${currTop.toFixed(2)}%`;

      updateDevSelectedPanelInfo();
    }

    function initDevCalibrator() {
      // Manejador de clic directo sobre el contenedor o canvas para marcar / medir posición
      document.addEventListener('click', (e) => {
        const page1 = document.querySelector('.pdf-page-container');
        if (!page1) return;

        const rect = page1.getBoundingClientRect();
        // Verificar si el clic fue dentro de la hoja PDF (y no dentro de la barra lateral ni controles)
        if (e.clientX >= rect.left && e.clientX <= rect.right && e.clientY >= rect.top && e.clientY <= rect.bottom) {
          // Si el clic fue en un cuadro overlay existente, ignorar este evento (ya lo maneja mousedown)
          if (e.target.closest('.runt-pdf-overlay > div')) return;

          const leftPercent = parseFloat((((e.clientX - rect.left) / rect.width) * 100).toFixed(2));
          const topPercent = parseFloat((((e.clientY - rect.top) / rect.height) * 100).toFixed(2));
          const pdfX = (792 * (leftPercent / 100)).toFixed(1);
          const pdfY = (612 * (1 - (topPercent / 100))).toFixed(1);

          // Actualizar live cursor
          const liveEl = document.getElementById('dev-cursor-live');
          if (liveEl) liveEl.textContent = `L:${leftPercent}% T:${topPercent}%`;

          // Crear y colocar un punto rojo/marcador visual interactivo en el PDF
          createClickMarkerPin(leftPercent, topPercent, pdfX, pdfY);

          // Si hay un elemento seleccionado, moverlo a la posición clicada
          if (selectedDevOverlayEl) {
            selectedDevOverlayEl.style.left = `${leftPercent}%`;
            selectedDevOverlayEl.style.top = `${topPercent}%`;
            updateDevSelectedPanelInfo();
          } else {
            // Mostrar en los dos paneles la posición marcada
            const infoSidebar = document.getElementById('dev-selected-info');
            const infoContent = `
              <div style="color: #ef4444; font-weight: bold; margin-bottom: 2px;">📍 Punto Rojo Marcado:</div>
              <div style="margin-top: 4px; display: flex; justify-content: space-between;">
                <span><b>Left:</b> ${leftPercent}%</span>
                <span><b>Top:</b> ${topPercent}%</span>
              </div>
              <div style="margin-top: 2px; color: #a7f3d0;">
                <b>PDFLib:</b> X: ${pdfX}pt | Y: ${pdfY}pt
              </div>
            `;
            if (infoSidebar) infoSidebar.innerHTML = infoContent;
            const infoBar = document.querySelectorAll('#dev-selected-info')[1];
            if (infoBar) infoBar.innerHTML = infoContent;
          }
        }
      });

      // Manejador de Drag & Drop para elementos overlay
      document.addEventListener('mousedown', (e) => {
        const overlayItem = e.target.closest('.runt-pdf-overlay > div');
        if (overlayItem) {
          e.stopPropagation();
          selectDevOverlayElement(overlayItem);
          isDraggingOverlay = true;
          dragStartX = e.clientX;
          dragStartY = e.clientY;

          const page1 = document.querySelector('.pdf-page-container');
          if (page1) {
            const rect = page1.getBoundingClientRect();
            dragStartLeft = parseFloat(overlayItem.style.left) || (((overlayItem.getBoundingClientRect().left - rect.left) / rect.width) * 100);
            dragStartTop = parseFloat(overlayItem.style.top) || (((overlayItem.getBoundingClientRect().top - rect.top) / rect.height) * 100);
          }
        } else if (!e.target.closest('#dev-calibrator-bar') && !e.target.closest('#sidebar-calibrator-panel') && !e.target.closest('.pdf-page-container')) {
          selectDevOverlayElement(null);
        }
      });

      document.addEventListener('mousemove', (e) => {
        const page1 = document.querySelector('.pdf-page-container');
        if (!page1) return;

        if (isDraggingOverlay && selectedDevOverlayEl) {
          const rect = page1.getBoundingClientRect();
          const deltaXPercent = ((e.clientX - dragStartX) / rect.width) * 100;
          const deltaYPercent = ((e.clientY - dragStartY) / rect.height) * 100;

          let newLeft = Math.max(0, Math.min(100, dragStartLeft + deltaXPercent));
          let newTop = Math.max(0, Math.min(100, dragStartTop + deltaYPercent));

          selectedDevOverlayEl.style.left = `${newLeft.toFixed(2)}%`;
          selectedDevOverlayEl.style.top = `${newTop.toFixed(2)}%`;

          updateDevSelectedPanelInfo();
          return;
        }

        const rect = page1.getBoundingClientRect();
        if (e.clientX >= rect.left && e.clientX <= rect.right && e.clientY >= rect.top && e.clientY <= rect.bottom) {
          const leftPercent = (((e.clientX - rect.left) / rect.width) * 100).toFixed(2);
          const topPercent = (((e.clientY - rect.top) / rect.height) * 100).toFixed(2);
          const pdfX = (792 * (leftPercent / 100)).toFixed(1);
          const pdfY = (612 * (1 - (topPercent / 100))).toFixed(1);

          const hEl = document.getElementById('dev-coord-html');
          const pEl = document.getElementById('dev-coord-pdf');
          const liveEl = document.getElementById('dev-cursor-live');
          if (hEl) hEl.textContent = `Left: ${leftPercent}% | Top: ${topPercent}%`;
          if (pEl) pEl.textContent = `X: ${pdfX}pt | Y: ${pdfY}pt`;
          if (liveEl) liveEl.textContent = `L:${leftPercent}% T:${topPercent}%`;
        }
      });

      document.addEventListener('mouseup', () => {
        isDraggingOverlay = false;
      });

      // Manejador de Teclado (Flechas para ajuste fino y + / - para fuente)
      document.addEventListener('keydown', (e) => {
        if (!selectedDevOverlayEl) return;
        if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key)) {
          e.preventDefault();
          const step = e.shiftKey ? 0.5 : 0.1;
          if (e.key === 'ArrowUp') nudgeSelectedOverlay(0, -step);
          if (e.key === 'ArrowDown') nudgeSelectedOverlay(0, step);
          if (e.key === 'ArrowLeft') nudgeSelectedOverlay(-step, 0);
          if (e.key === 'ArrowRight') nudgeSelectedOverlay(step, 0);
        } else if (e.key === '+' || e.key === '=') {
          e.preventDefault();
          nudgeSelectedFontSize(0.5);
        } else if (e.key === '-' || e.key === '_') {
          e.preventDefault();
          nudgeSelectedFontSize(-0.5);
        }
      });
    }

    function copyAllCoordinatesJSON() {
      const items = [
        { punto: 1, name: 'INPUT NOMBRE', id: 'overlay-organismo-nombre' },
        { punto: 2, name: 'INPUT CIUDAD', id: 'overlay-organismo-ciudad' },
        { punto: 3, name: 'INPUT CODIGO', id: 'overlay-organismo-codigo' },
        { punto: 4, name: 'INPUT DIA', id: 'overlay-organismo-dia' },
        { punto: 5, name: 'INPUT MES', id: 'overlay-organismo-mes' },
        { punto: 6, name: 'INPUT AÑO', id: 'overlay-organismo-anio' },
        { punto: 7, name: 'PLACA LETRAS', id: 'overlay-placa-letras' },
        { punto: 8, name: 'PLACA NÚMEROS', id: 'overlay-placa-numeros' },
        { punto: 9, name: 'TRÁMITE 1 (MATRÍCULA)', id: 'overlay-tramite-1' },
        { punto: 10, name: 'TRÁMITE 2 (TRASPASO)', id: 'overlay-tramite-2' },
        { punto: 11, name: 'TRÁMITE 3 (TRASLADO)', id: 'overlay-tramite-3' },
        { punto: 12, name: 'TRÁMITE 4 (RADICADO)', id: 'overlay-tramite-4' },
        { punto: 13, name: 'TRÁMITE 5 (CAMBIO COLOR)', id: 'overlay-tramite-5' },
        { punto: 14, name: 'TRÁMITE 6 (CAMBIO SERVICIO)', id: 'overlay-tramite-6' },
        { punto: 15, name: 'TRÁMITE 7 (REGRABAR MOTOR)', id: 'overlay-tramite-7' },
        { punto: 16, name: 'TRÁMITE 8 (REGRABAR CHASIS)', id: 'overlay-tramite-8' },
        { punto: 17, name: 'TRÁMITE 9 (TRANSFORMACIÓN)', id: 'overlay-tramite-9' },
        { punto: 18, name: 'TRÁMITE 10 (DUPLICADO LIC)', id: 'overlay-tramite-10' },
        { punto: 19, name: 'TRÁMITE 11 (INSCRIPC PRENDA)', id: 'overlay-tramite-11' },
        { punto: 20, name: 'TRÁMITE 12 (LEVANTA PRENDA)', id: 'overlay-tramite-12' },
        { punto: 21, name: 'TRÁMITE 13 (CANCELACIÓN)', id: 'overlay-tramite-13' },
        { punto: 22, name: 'TRÁMITE 14 (CAMBIO PLACAS)', id: 'overlay-tramite-14' },
        { punto: 23, name: 'TRÁMITE 15 (DUPLICADO PLACAS)', id: 'overlay-tramite-15' },
        { punto: 24, name: 'TRÁMITE 16 (REMATRICULA)', id: 'overlay-tramite-16' },
        { punto: 25, name: 'TRÁMITE 17 (CAMBIO CARROCERÍA)', id: 'overlay-tramite-17' },
        { punto: 26, name: 'TRÁMITE 18 (OTROS)', id: 'overlay-tramite-18' },
        { punto: 27, name: 'CLASE 1 (AUTOMÓVIL)', id: 'overlay-clase-1' },
        { punto: 28, name: 'CLASE 2 (BUS)', id: 'overlay-clase-2' },
        { punto: 29, name: 'CLASE 3 (BUSETA)', id: 'overlay-clase-3' },
        { punto: 30, name: 'CLASE 4 (CAMIÓN)', id: 'overlay-clase-4' },
        { punto: 31, name: 'CLASE 5 (CAMIONETA)', id: 'overlay-clase-5' },
        { punto: 32, name: 'CLASE 6 (CAMPERO)', id: 'overlay-clase-6' },
        { punto: 33, name: 'CLASE 7 (MICROBÚS)', id: 'overlay-clase-7' },
        { punto: 34, name: 'CLASE 8 (TRACTOCAMIÓN)', id: 'overlay-clase-8' },
        { punto: 35, name: 'CLASE 9 (MOTOCICLETA)', id: 'overlay-clase-9' },
        { punto: 36, name: 'CLASE 10 (MOTOCARRO)', id: 'overlay-clase-10' },
        { punto: 37, name: 'CLASE 11 (MOTOTRICICLO)', id: 'overlay-clase-11' },
        { punto: 38, name: 'CLASE 12 (CUATRIMOTO)', id: 'overlay-clase-12' },
        { punto: 39, name: 'CLASE 13 (VOLQUETA)', id: 'overlay-clase-13' },
        { punto: 40, name: 'CLASE 14 (OTRO)', id: 'overlay-clase-14' },
        { punto: 41, name: '5. MARCA', id: 'overlay-vehiculo-marca' },
        { punto: 28, name: '6. LÍNEA', id: 'overlay-vehiculo-linea' },
        { punto: 29, name: '7. COMBUSTIBLE 1 (GASOLINA)', id: 'overlay-combustible-1' },
        { punto: 30, name: '7. COMBUSTIBLE 2 (DIESEL)', id: 'overlay-combustible-2' },
        { punto: 31, name: '7. COMBUSTIBLE 3 (GAS)', id: 'overlay-combustible-3' },
        { punto: 32, name: '7. COMBUSTIBLE 4 (MIXTO)', id: 'overlay-combustible-4' },
        { punto: 33, name: '7. COMBUSTIBLE 5 (ELÉCTRICO)', id: 'overlay-combustible-5' },
        { punto: 34, name: '7. COMBUSTIBLE 6 (HIDRÓGENO)', id: 'overlay-combustible-6' },
        { punto: 35, name: '7. COMBUSTIBLE 7 (ETANOL)', id: 'overlay-combustible-7' },
        { punto: 36, name: '7. COMBUSTIBLE 8 (BIODIESEL)', id: 'overlay-combustible-8' },
        { punto: 37, name: '8. COLORES', id: 'overlay-vehiculo-colores' },
        { punto: 38, name: '9. MODELO', id: 'overlay-vehiculo-modelo' },
        { punto: 39, name: '10. CILINDRADA', id: 'overlay-vehiculo-cilindrada' },
        { punto: 40, name: '11. CAPACIDAD', id: 'overlay-vehiculo-capacidad' },
        { punto: 41, name: '12. BLINDAJE SI', id: 'overlay-blindaje-si' },
        { punto: 42, name: '12. BLINDAJE NO', id: 'overlay-blindaje-no' },
        { punto: 43, name: '12. RES BLINDAJE', id: 'overlay-blindaje-resolucion' },
        { punto: 44, name: '13. DESMONTE SI', id: 'overlay-desmonte-si' },
        { punto: 45, name: '13. DESMONTE NO', id: 'overlay-desmonte-no' },
        { punto: 46, name: '13. RES DESMONTE', id: 'overlay-desmonte-resolucion' },
        { punto: 47, name: '14. POTENCIA', id: 'overlay-vehiculo-potencia' },
        { punto: 48, name: '15. CÓDIGO CARROCERÍA', id: 'overlay-carroceria-codigo' },
        { punto: 49, name: '15. TIPO CARROCERÍA', id: 'overlay-carroceria-tipo' },
        { punto: 50, name: '16. No. MOTOR', id: 'overlay-ident-motor' },
        { punto: 51, name: '16. MOTOR REGRABADO SI', id: 'overlay-motor-regrabado-si' },
        { punto: 52, name: '16. MOTOR REGRABADO NO', id: 'overlay-motor-regrabado-no' },
        { punto: 53, name: '16. No. CHASIS', id: 'overlay-ident-chasis' },
        { punto: 54, name: '16. CHASIS REGRABADO SI', id: 'overlay-chasis-regrabado-si' },
        { punto: 55, name: '16. CHASIS REGRABADO NO', id: 'overlay-chasis-regrabado-no' },
        { punto: 56, name: '16. No. SERIE', id: 'overlay-ident-serie' },
        { punto: 57, name: '16. SERIE REGRABADO SI', id: 'overlay-serie-regrabado-si' },
        { punto: 58, name: '16. SERIE REGRABADO NO', id: 'overlay-serie-regrabado-no' },
        { punto: 59, name: '16. No. VIN', id: 'overlay-ident-vin' },
        { punto: 60, name: '17. IMPORTACIÓN 1 (MANIF. O ACTA)', id: 'overlay-import-1' },
        { punto: 61, name: '17. IMPORTACIÓN 2 (DEC. DE IMPORT.)', id: 'overlay-import-2' },
        { punto: 62, name: '17. REMATE 3 (ACTA)', id: 'overlay-import-3' },
        { punto: 63, name: '17. REMATE 4 (ENTIDAD)', id: 'overlay-import-4' },
        { punto: 64, name: '17. REMATE 5 (LUGAR/CIUDAD)', id: 'overlay-import-5' },
        { punto: 65, name: '17. REMATE 6 (CÓDIGO)', id: 'overlay-import-6' },
        { punto: 66, name: '17. No. DOCUMENTO', id: 'overlay-import-numdoc' },
        { punto: 67, name: '17. FECHA DÍA', id: 'overlay-import-dia' },
        { punto: 68, name: '17. FECHA MES', id: 'overlay-import-mes' },
        { punto: 69, name: '17. FECHA AÑO', id: 'overlay-import-anio' },
        { punto: 70, name: '18. SERVICIO 1 (PARTICULAR)', id: 'overlay-servicio-1' },
        { punto: 71, name: '18. SERVICIO 2 (PÚBLICO)', id: 'overlay-servicio-2' },
        { punto: 72, name: '18. SERVICIO 3 (DIPLOMÁTICO)', id: 'overlay-servicio-3' },
        { punto: 73, name: '18. SERVICIO 4 (OFICIAL)', id: 'overlay-servicio-4' },
        { punto: 74, name: '18. SERVICIO 5 (ESPECIAL)', id: 'overlay-servicio-5' },
        { punto: 75, name: '18. SERVICIO 6 (OTROS)', id: 'overlay-servicio-6' },
        { punto: 76, name: '19. EMPRESA VINCULADORA NOMBRE', id: 'overlay-empresa-nombre' },
        { punto: 77, name: '19. EMPRESA VINCULADORA NIT', id: 'overlay-empresa-nit' },
        { punto: 78, name: '20. ALERTA 1 (HURTO)', id: 'overlay-alerta-1' },
        { punto: 79, name: '20. ALERTA 2 (LIM. PROPIEDAD)', id: 'overlay-alerta-2' },
        { punto: 80, name: '20. ALERTA 3 (EMBARGO)', id: 'overlay-alerta-3' },
        { punto: 81, name: '20. ALERTA 4 (OTRO)', id: 'overlay-alerta-4' },
        { punto: 82, name: '20. ALERTA A FAVOR DE (5)', id: 'overlay-alerta-afavor' },
        { punto: 83, name: '21. PROPIETARIO PRIMER APELLIDO', id: 'overlay-prop-primer-apellido' },
        { punto: 84, name: '21. PROPIETARIO SEGUNDO APELLIDO', id: 'overlay-prop-segundo-apellido' },
        { punto: 85, name: '21. PROPIETARIO NOMBRES', id: 'overlay-prop-nombres' },
        { punto: 86, name: '21. PROPIETARIO TIPODOC 1 (C.C.)', id: 'overlay-prop-tipodoc-1' },
        { punto: 87, name: '21. PROPIETARIO TIPODOC 2 (NIT)', id: 'overlay-prop-tipodoc-2' },
        { punto: 88, name: '21. PROPIETARIO TIPODOC 3 (N.N.)', id: 'overlay-prop-tipodoc-3' },
        { punto: 89, name: '21. PROPIETARIO TIPODOC 4 (PASAPORTE)', id: 'overlay-prop-tipodoc-4' },
        { punto: 90, name: '21. PROPIETARIO TIPODOC 5 (C. EXTRANJ.)', id: 'overlay-prop-tipodoc-5' },
        { punto: 91, name: '21. PROPIETARIO TIPODOC 6 (T. IDENTI.)', id: 'overlay-prop-tipodoc-6' },
        { punto: 92, name: '21. PROPIETARIO TIPODOC 7 (NUIP)', id: 'overlay-prop-tipodoc-7' },
        { punto: 93, name: '21. PROPIETARIO TIPODOC 8 (C. DIPLOMÁTICO)', id: 'overlay-prop-tipodoc-8' },
        { punto: 94, name: '21. PROPIETARIO No. DOCUMENTO', id: 'overlay-prop-numdoc' },
        { punto: 95, name: '21. PROPIETARIO DIRECCIÓN', id: 'overlay-prop-direccion' },
        { punto: 96, name: '21. PROPIETARIO CIUDAD', id: 'overlay-prop-ciudad' },
        { punto: 97, name: '21. PROPIETARIO TELÉFONO', id: 'overlay-prop-telefono' },
        { punto: 98, name: '21. PROPIETARIO FIRMA (IMAGEN)', id: 'overlay-prop-firma' },
        { punto: 99, name: '22. COMPRADOR PRIMER APELLIDO', id: 'overlay-comp-primer-apellido' },
        { punto: 100, name: '22. COMPRADOR SEGUNDO APELLIDO', id: 'overlay-comp-segundo-apellido' },
        { punto: 101, name: '22. COMPRADOR NOMBRES', id: 'overlay-comp-nombres' },
        { punto: 102, name: '22. COMPRADOR TIPODOC 1 (C.C.)', id: 'overlay-comp-tipodoc-1' },
        { punto: 103, name: '22. COMPRADOR TIPODOC 2 (NIT)', id: 'overlay-comp-tipodoc-2' },
        { punto: 104, name: '22. COMPRADOR TIPODOC 3 (N.N.)', id: 'overlay-comp-tipodoc-3' },
        { punto: 105, name: '22. COMPRADOR TIPODOC 4 (PASAPORTE)', id: 'overlay-comp-tipodoc-4' },
        { punto: 106, name: '22. COMPRADOR TIPODOC 5 (C. EXTRANJ.)', id: 'overlay-comp-tipodoc-5' },
        { punto: 107, name: '22. COMPRADOR TIPODOC 6 (T. IDENTI.)', id: 'overlay-comp-tipodoc-6' },
        { punto: 108, name: '22. COMPRADOR TIPODOC 7 (NUIP)', id: 'overlay-comp-tipodoc-7' },
        { punto: 109, name: '22. COMPRADOR TIPODOC 8 (C. DIPLOMÁTICO)', id: 'overlay-comp-tipodoc-8' },
        { punto: 110, name: '22. COMPRADOR No. DOCUMENTO', id: 'overlay-comp-numdoc' },
        { punto: 111, name: '22. COMPRADOR DIRECCIÓN', id: 'overlay-comp-direccion' },
        { punto: 112, name: '22. COMPRADOR CIUDAD', id: 'overlay-comp-ciudad' },
        { punto: 113, name: '22. COMPRADOR TELÉFONO', id: 'overlay-comp-telefono' },
        { punto: 114, name: '22. COMPRADOR FIRMA (IMAGEN)', id: 'overlay-comp-firma' },
        { punto: 115, name: '23. OBSERVACIONES LÍNEA 1', id: 'overlay-obs-1' },
        { punto: 116, name: '23. OBSERVACIONES LÍNEA 2', id: 'overlay-obs-2' },
        { punto: 117, name: '23. OBSERVACIONES ANTES RUNT LÍNEA 1', id: 'overlay-obs-antes-1' },
        { punto: 118, name: '23. OBSERVACIONES ANTES RUNT LÍNEA 2', id: 'overlay-obs-antes-2' }
      ];

      const jsonResult = items.map(item => {
        const el = document.getElementById(item.id);
        const leftVal = parseFloat(el ? el.style.left : 0) || 0;
        const topVal = parseFloat(el ? el.style.top : 0) || 0;
        const pdfX = parseFloat((792 * (leftVal / 100)).toFixed(1));
        const pdfY = parseFloat((612 * (1 - (topVal / 100))).toFixed(1));
        return {
          punto: item.punto,
          campo: item.name,
          leftPercent: `${leftVal.toFixed(2)}%`,
          topPercent: `${topVal.toFixed(2)}%`,
          pdfX: pdfX,
          pdfY: pdfY
        };
      });

      const textToCopy = JSON.stringify(jsonResult, null, 2);
      navigator.clipboard.writeText(textToCopy).then(() => {
        alert('¡Coordenadas reales copiadas al portapapeles! Pégalas directamente aquí.');
      }).catch(err => {
        prompt('Copia manualmente este JSON de coordenadas:', textToCopy);
      });
    }

    function createClickMarkerPin(leftPercent, topPercent, pdfX, pdfY) {
      const overlayContainer = document.querySelector('.runt-pdf-overlay');
      if (!overlayContainer) return;

      const pin = document.createElement('div');
      pin.className = 'dev-click-pin-dot';
      pin.style.cssText = `
        position: absolute;
        top: ${topPercent}%;
        left: ${leftPercent}%;
        width: 14px;
        height: 14px;
        background: #ef4444;
        border: 2px solid #ffffff;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.8), 0 2px 4px rgba(0,0,0,0.5);
        z-index: 99999;
        pointer-events: none;
        animation: pinPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      `;

      overlayContainer.appendChild(pin);

      // Guardar coordenada registrada
      loggedCoordinates.push({ leftPercent: `${leftPercent}%`, topPercent: `${topPercent}%`, pdfX: `${pdfX}pt`, pdfY: `${pdfY}pt` });
    }

    function clearDevMarkers() {
      selectDevOverlayElement(null);
      document.querySelectorAll('.dev-click-pin-dot').forEach(el => el.remove());
      loggedCoordinates = [];
      const infoElements = document.querySelectorAll('#dev-selected-info');
      infoElements.forEach(infoEl => {
        infoEl.innerHTML = '👉 Haz clic en cualquier lugar de la hoja PDF para marcar y medir su posición.';
      });
    }

    let propFirmaBase64 = null;

    function handlePropFirmaUpload(input) {
      if (input.files && input.files[0]) {
        const file = input.files[0];
        const reader = new FileReader();
        reader.onload = function(e) {
          propFirmaBase64 = e.target.result;
          
          // Mostrar vista previa en la barra lateral
          const previewImg = document.getElementById('prop-firma-preview-img');
          const previewContainer = document.getElementById('prop-firma-preview-container');
          const fileNameSpan = document.getElementById('prop-firma-filename');
          const btnClear = document.getElementById('btn-clear-prop-firma');
          
          if (previewImg) previewImg.src = propFirmaBase64;
          if (fileNameSpan) fileNameSpan.textContent = file.name;
          if (previewContainer) previewContainer.style.display = 'flex';
          if (btnClear) btnClear.style.display = 'inline-block';

          // Mostrar en el overlay del canvas HTML
          const overlayImg = document.getElementById('overlay-prop-firma-img');
          const overlayContainer = document.getElementById('overlay-prop-firma');
          if (overlayImg) overlayImg.src = propFirmaBase64;
          if (overlayContainer) overlayContainer.style.display = 'block';
        };
        reader.readAsDataURL(file);
      }
    }

    function clearPropFirma() {
      propFirmaBase64 = null;
      const fileInput = document.getElementById('runt-prop-firma-file');
      if (fileInput) fileInput.value = '';

      const previewContainer = document.getElementById('prop-firma-preview-container');
      const btnClear = document.getElementById('btn-clear-prop-firma');
      if (previewContainer) previewContainer.style.display = 'none';
      if (btnClear) btnClear.style.display = 'none';

      const overlayContainer = document.getElementById('overlay-prop-firma');
      if (overlayContainer) overlayContainer.style.display = 'none';
    }

    let compFirmaBase64 = null;

    function handleCompFirmaUpload(input) {
      if (input.files && input.files[0]) {
        const file = input.files[0];
        const reader = new FileReader();
        reader.onload = function(e) {
          compFirmaBase64 = e.target.result;
          
          const previewImg = document.getElementById('comp-firma-preview-img');
          const previewContainer = document.getElementById('comp-firma-preview-container');
          const fileNameSpan = document.getElementById('comp-firma-filename');
          const btnClear = document.getElementById('btn-clear-comp-firma');
          
          if (previewImg) previewImg.src = compFirmaBase64;
          if (fileNameSpan) fileNameSpan.textContent = file.name;
          if (previewContainer) previewContainer.style.display = 'flex';
          if (btnClear) btnClear.style.display = 'inline-block';

          const overlayImg = document.getElementById('overlay-comp-firma-img');
          const overlayContainer = document.getElementById('overlay-comp-firma');
          if (overlayImg) overlayImg.src = compFirmaBase64;
          if (overlayContainer) overlayContainer.style.display = 'block';
        };
        reader.readAsDataURL(file);
      }
    }

    function clearCompFirma() {
      compFirmaBase64 = null;
      const fileInput = document.getElementById('runt-comp-firma-file');
      if (fileInput) fileInput.value = '';

      const previewContainer = document.getElementById('comp-firma-preview-container');
      const btnClear = document.getElementById('btn-clear-comp-firma');
      if (previewContainer) previewContainer.style.display = 'none';
      if (btnClear) btnClear.style.display = 'none';

      const overlayContainer = document.getElementById('overlay-comp-firma');
      if (overlayContainer) overlayContainer.style.display = 'none';
    }

    function toggleDevCalibrator() {
      const bar = document.getElementById('dev-calibrator-bar');
      if (bar) {
        bar.classList.toggle('hidden');
      }
    }

    async function generateCustomVectorPDFBlob(onProgress) {
      if (!window.PDFLib) {
        alert('Cargando librería PDFLib... Por favor intenta en 2 segundos.');
        return null;
      }

      try {
        if (onProgress) onProgress('Generando documento PDF vectorial completo...');
        const response = await fetch(pdfUrl);
        const existingPdfBytes = await response.arrayBuffer();
        const pdfDoc = await window.PDFLib.PDFDocument.load(existingPdfBytes);
        const font = await pdfDoc.embedFont(window.PDFLib.StandardFonts.HelveticaBold);
        const pages = pdfDoc.getPages();
        const firstPage = pages[0];

        const sanitizeWinAnsi = (str) => {
          return (str || '')
            .normalize('NFD')
            .replace(/[\u0300-\u036f]/g, '')
            .replace(/[^\x20-\x7E]/g, '');
        };

        const drawFieldAbs = (overlayId, inputId, defaultFontSize = 8.5, isCentered = false, forceText = null) => {
          const overlayEl = document.getElementById(overlayId);
          const inputEl = document.getElementById(inputId);
          const rawVal = forceText !== null ? forceText : (inputEl ? inputEl.value : '').trim().toUpperCase();
          const val = sanitizeWinAnsi(rawVal);
          if (val && overlayEl) {
            const leftVal = parseFloat(overlayEl.style.left) || 0;
            const topVal = parseFloat(overlayEl.style.top) || 0;
            const pdfX = parseFloat((792 * (leftVal / 100)).toFixed(1));
            const pdfY = parseFloat((612 * (1 - (topVal / 100))).toFixed(1));

            let fontSize = defaultFontSize;
            if (overlayEl.style.fontSize) {
              const domFontSize = parseFloat(overlayEl.style.fontSize);
              if (!isNaN(domFontSize)) {
                fontSize = parseFloat((domFontSize * 0.77).toFixed(1));
              }
            }

            let x = pdfX;
            if (isCentered) {
              const textWidth = font.widthOfTextAtSize(val, fontSize);
              x = x - (textWidth / 2);
            }
            firstPage.drawText(val, {
              x: x,
              y: pdfY,
              size: fontSize,
              font: font,
              color: window.PDFLib.rgb(0, 0, 0)
            });
          }
        };

        // Estampar campos con coordenadas en tiempo real desde el canvas
        drawFieldAbs('overlay-organismo-nombre', 'runt-organismo-nombre', 8.5, false);
        drawFieldAbs('overlay-organismo-ciudad', 'runt-organismo-ciudad', 8.0, true);
        drawFieldAbs('overlay-organismo-codigo', 'runt-organismo-codigo', 8.0, true);
        drawFieldAbs('overlay-organismo-dia', 'runt-organismo-dia', 8.0, true);
        drawFieldAbs('overlay-organismo-mes', 'runt-organismo-mes', 8.0, true);
        drawFieldAbs('overlay-organismo-anio', 'runt-organismo-anio', 8.0, true);
        drawFieldAbs('overlay-placa-letras', 'runt-placa-letras', 9.0, true);
        drawFieldAbs('overlay-placa-numeros', 'runt-placa-numeros', 9.0, true);

        // Estampar la marca 'X' en la casilla del trámite seleccionado
        const tramiteSelect = document.getElementById('runt-tramite-select');
        const selectedVal = tramiteSelect ? tramiteSelect.value : '';
        if (selectedVal && parseInt(selectedVal) >= 1 && parseInt(selectedVal) <= 18) {
          drawFieldAbs(`overlay-tramite-${selectedVal}`, 'runt-tramite-select', 14.0, true, 'X');
        }

        // Estampar la marca 'X' en la casilla de Clase de Vehículo seleccionada
        const claseSelect = document.getElementById('runt-clase-select');
        const selectedClaseVal = claseSelect ? claseSelect.value : '';
        if (selectedClaseVal && parseInt(selectedClaseVal) >= 1 && parseInt(selectedClaseVal) <= 14) {
          drawFieldAbs(`overlay-clase-${selectedClaseVal}`, 'runt-clase-select', 14.0, true, 'X');
        }

        // Estampar campos de características del vehículo
        drawFieldAbs('overlay-vehiculo-marca', 'runt-vehiculo-marca', 8.5, false);
        drawFieldAbs('overlay-vehiculo-linea', 'runt-vehiculo-linea', 8.5, false);
        drawFieldAbs('overlay-vehiculo-colores', 'runt-vehiculo-colores', 8.5, false);
        drawFieldAbs('overlay-vehiculo-modelo', 'runt-vehiculo-modelo', 8.5, true);
        drawFieldAbs('overlay-vehiculo-cilindrada', 'runt-vehiculo-cilindrada', 8.5, true);
        drawFieldAbs('overlay-vehiculo-capacidad', 'runt-vehiculo-capacidad', 8.5, false);
        drawFieldAbs('overlay-blindaje-resolucion', 'runt-blindaje-resolucion', 7.5, false);
        drawFieldAbs('overlay-desmonte-resolucion', 'runt-desmonte-resolucion', 7.5, false);
        drawFieldAbs('overlay-vehiculo-potencia', 'runt-vehiculo-potencia', 8.5, false);
        drawFieldAbs('overlay-carroceria-codigo', 'runt-carroceria-codigo', 8.5, false);
        drawFieldAbs('overlay-carroceria-tipo', 'runt-carroceria-tipo', 8.5, false);

        // Combustible X
        const combSelect = document.getElementById('runt-combustible-select');
        const selectedComb = combSelect ? combSelect.value : '';
        if (selectedComb && parseInt(selectedComb) >= 1 && parseInt(selectedComb) <= 8) {
          drawFieldAbs(`overlay-combustible-${selectedComb}`, 'runt-combustible-select', 12.0, true, 'X');
        }

        // Blindaje SI/NO X
        const blindajeRadio = document.querySelector('input[name="runt-blindaje-opcion"]:checked');
        const blindajeVal = blindajeRadio ? blindajeRadio.value : 'NO';
        if (blindajeVal === 'SI') drawFieldAbs('overlay-blindaje-si', 'runt-blindaje-resolucion', 12.0, true, 'X');
        if (blindajeVal === 'NO') drawFieldAbs('overlay-blindaje-no', 'runt-blindaje-resolucion', 12.0, true, 'X');

        // Desmonte Blindaje SI/NO X
        const desmonteRadio = document.querySelector('input[name="runt-desmonte-opcion"]:checked');
        const desmonteVal = desmonteRadio ? desmonteRadio.value : 'NO';
        if (desmonteVal === 'SI') drawFieldAbs('overlay-desmonte-si', 'runt-desmonte-resolucion', 12.0, true, 'X');
        if (desmonteVal === 'NO') drawFieldAbs('overlay-desmonte-no', 'runt-desmonte-resolucion', 12.0, true, 'X');

        // Estampar campos de Identificación Interna (Sección 16)
        drawFieldAbs('overlay-ident-motor', 'runt-ident-motor', 8.5, false);
        drawFieldAbs('overlay-ident-chasis', 'runt-ident-chasis', 8.5, false);
        drawFieldAbs('overlay-ident-serie', 'runt-ident-serie', 8.5, false);
        drawFieldAbs('overlay-ident-vin', 'runt-ident-vin', 8.5, false);

        // Regrabado Motor SI/NO X
        const mReg = (document.querySelector('input[name="runt-motor-regrabado"]:checked') || {}).value || 'NO';
        if (mReg === 'SI') drawFieldAbs('overlay-motor-regrabado-si', 'runt-ident-motor', 12.0, true, 'X');
        if (mReg === 'NO') drawFieldAbs('overlay-motor-regrabado-no', 'runt-ident-motor', 12.0, true, 'X');

        // Regrabado Chasis SI/NO X
        const cReg = (document.querySelector('input[name="runt-chasis-regrabado"]:checked') || {}).value || 'NO';
        if (cReg === 'SI') drawFieldAbs('overlay-chasis-regrabado-si', 'runt-ident-chasis', 12.0, true, 'X');
        if (cReg === 'NO') drawFieldAbs('overlay-chasis-regrabado-no', 'runt-ident-chasis', 12.0, true, 'X');

        // Regrabado Serie SI/NO X
        const sReg = (document.querySelector('input[name="runt-serie-regrabado"]:checked') || {}).value || 'NO';
        if (sReg === 'SI') drawFieldAbs('overlay-serie-regrabado-si', 'runt-ident-serie', 12.0, true, 'X');
        if (sReg === 'NO') drawFieldAbs('overlay-serie-regrabado-no', 'runt-ident-serie', 12.0, true, 'X');

        // Estampar campos de Importación o Remate (Sección 17)
        drawFieldAbs('overlay-import-numdoc', 'runt-import-numdoc', 8.5, false);
        drawFieldAbs('overlay-import-dia', 'runt-import-dia', 8.0, true);
        drawFieldAbs('overlay-import-mes', 'runt-import-mes', 8.0, true);
        drawFieldAbs('overlay-import-anio', 'runt-import-anio', 8.0, true);

        const importSelect = document.getElementById('runt-import-select');
        const selectedImportVal = importSelect ? importSelect.value : '';
        if (selectedImportVal && parseInt(selectedImportVal) >= 1 && parseInt(selectedImportVal) <= 6) {
          drawFieldAbs(`overlay-import-${selectedImportVal}`, 'runt-import-select', 14.0, true, 'X');
        }

        // Estampar Tipo de Servicio (Sección 18) X
        const servicioSelect = document.getElementById('runt-servicio-select');
        const selectedServicioVal = servicioSelect ? servicioSelect.value : '';
        if (selectedServicioVal && parseInt(selectedServicioVal) >= 1 && parseInt(selectedServicioVal) <= 6) {
          drawFieldAbs(`overlay-servicio-${selectedServicioVal}`, 'runt-servicio-select', 14.0, true, 'X');
        }

        // Estampar Empresa Vinculadora (Sección 19)
        drawFieldAbs('overlay-empresa-nombre', 'runt-empresa-nombre', 8.5, false);
        drawFieldAbs('overlay-empresa-nit', 'runt-empresa-nit', 8.5, false);

        // Estampar Datos de Alerta (Sección 20)
        const alertaSelect = document.getElementById('runt-alerta-select');
        const selectedAlertaVal = alertaSelect ? alertaSelect.value : '';
        if (selectedAlertaVal && parseInt(selectedAlertaVal) >= 1 && parseInt(selectedAlertaVal) <= 4) {
          drawFieldAbs(`overlay-alerta-${selectedAlertaVal}`, 'runt-alerta-select', 14.0, true, 'X');
        }
        drawFieldAbs('overlay-alerta-afavor', 'runt-alerta-afavor', 8.5, false);

        // Estampar Datos del Propietario (Sección 21)
        drawFieldAbs('overlay-prop-primer-apellido', 'runt-prop-primer-apellido', 8.5, false);
        drawFieldAbs('overlay-prop-segundo-apellido', 'runt-prop-segundo-apellido', 8.5, false);
        drawFieldAbs('overlay-prop-nombres', 'runt-prop-nombres', 8.5, false);
        drawFieldAbs('overlay-prop-numdoc', 'runt-prop-numdoc', 8.5, false);
        drawFieldAbs('overlay-prop-direccion', 'runt-prop-direccion', 8.5, false);
        drawFieldAbs('overlay-prop-ciudad', 'runt-prop-ciudad', 8.5, false);
        drawFieldAbs('overlay-prop-telefono', 'runt-prop-telefono', 8.5, false);

        const propTipoDocSelect = document.getElementById('runt-prop-tipodoc-select');
        const selectedPropTipoDocVal = propTipoDocSelect ? propTipoDocSelect.value : '';
        if (selectedPropTipoDocVal && parseInt(selectedPropTipoDocVal) >= 1 && parseInt(selectedPropTipoDocVal) <= 8) {
          drawFieldAbs(`overlay-prop-tipodoc-${selectedPropTipoDocVal}`, 'runt-prop-tipodoc-select', 14.0, true, 'X');
        }

        // Estampar Firma Imagen del Propietario (Sección 21)
        if (propFirmaBase64) {
          const overlayFirmaEl = document.getElementById('overlay-prop-firma');
          if (overlayFirmaEl) {
            const leftVal = parseFloat(overlayFirmaEl.style.left) || 0;
            const topVal = parseFloat(overlayFirmaEl.style.top) || 0;
            const pdfX = parseFloat((792 * (leftVal / 100)).toFixed(1));
            const pdfY = parseFloat((612 * (1 - (topVal / 100))).toFixed(1));

            let embeddedImage;
            if (propFirmaBase64.startsWith('data:image/png')) {
              embeddedImage = await pdfDoc.embedPng(propFirmaBase64);
            } else {
              embeddedImage = await pdfDoc.embedJpg(propFirmaBase64);
            }

            const imgWidth = 120;
            const imgHeight = (embeddedImage.height / embeddedImage.width) * imgWidth;

            firstPage.drawImage(embeddedImage, {
              x: pdfX - (imgWidth / 2),
              y: pdfY - (imgHeight / 2),
              width: imgWidth,
              height: imgHeight
            });
          }
        }

        // Estampar Datos del Comprador (Sección 22)
        drawFieldAbs('overlay-comp-primer-apellido', 'runt-comp-primer-apellido', 8.5, false);
        drawFieldAbs('overlay-comp-segundo-apellido', 'runt-comp-segundo-apellido', 8.5, false);
        drawFieldAbs('overlay-comp-nombres', 'runt-comp-nombres', 8.5, false);
        drawFieldAbs('overlay-comp-numdoc', 'runt-comp-numdoc', 8.5, false);
        drawFieldAbs('overlay-comp-direccion', 'runt-comp-direccion', 8.5, false);
        drawFieldAbs('overlay-comp-ciudad', 'runt-comp-ciudad', 8.5, false);
        drawFieldAbs('overlay-comp-telefono', 'runt-comp-telefono', 8.5, false);

        const compTipoDocSelect = document.getElementById('runt-comp-tipodoc-select');
        const selectedCompTipoDocVal = compTipoDocSelect ? compTipoDocSelect.value : '';
        if (selectedCompTipoDocVal && parseInt(selectedCompTipoDocVal) >= 1 && parseInt(selectedCompTipoDocVal) <= 8) {
          drawFieldAbs(`overlay-comp-tipodoc-${selectedCompTipoDocVal}`, 'runt-comp-tipodoc-select', 14.0, true, 'X');
        }

        // Estampar Firma Imagen del Comprador (Sección 22)
        if (compFirmaBase64) {
          const overlayFirmaEl = document.getElementById('overlay-comp-firma');
          if (overlayFirmaEl) {
            const leftVal = parseFloat(overlayFirmaEl.style.left) || 0;
            const topVal = parseFloat(overlayFirmaEl.style.top) || 0;
            const pdfX = parseFloat((792 * (leftVal / 100)).toFixed(1));
            const pdfY = parseFloat((612 * (1 - (topVal / 100))).toFixed(1));

            let embeddedImage;
            if (compFirmaBase64.startsWith('data:image/png')) {
              embeddedImage = await pdfDoc.embedPng(compFirmaBase64);
            } else {
              embeddedImage = await pdfDoc.embedJpg(compFirmaBase64);
            }

            const imgWidth = 120;
            const imgHeight = (embeddedImage.height / embeddedImage.width) * imgWidth;

            firstPage.drawImage(embeddedImage, {
              x: pdfX - (imgWidth / 2),
              y: pdfY - (imgHeight / 2),
              width: imgWidth,
              height: imgHeight
            });
          }
        }

        // Estampar Observaciones (Sección 23)
        drawFieldAbs('overlay-obs-1', 'runt-obs-1', 8.5, false);
        drawFieldAbs('overlay-obs-2', 'runt-obs-2', 8.5, false);
        drawFieldAbs('overlay-obs-antes-1', 'runt-obs-antes-1', 8.5, false);
        drawFieldAbs('overlay-obs-antes-2', 'runt-obs-antes-2', 8.5, false);

        // Anexar las hojas de PDF adjuntas normalizadas a tamaño Carta:
        const LETTER_WIDTH = 612;
        const LETTER_HEIGHT = 792;
        const MARGIN = 15;
        const targetW = LETTER_WIDTH - (MARGIN * 2);
        const targetH = LETTER_HEIGHT - (MARGIN * 2);

        const attachedPdfSecs = document.querySelectorAll('.pdf-attached-page-section');
        for (const pdfSec of attachedPdfSecs) {
          const dataUrl = pdfSec.getAttribute('data-pdf-base64');
          const pageIdx = parseInt(pdfSec.getAttribute('data-pdf-page-index') || '0', 10);
          if (dataUrl) {
            try {
              const res = await fetch(dataUrl);
              const arrayBuffer = await res.arrayBuffer();
              const attachedDoc = await window.PDFLib.PDFDocument.load(arrayBuffer, { ignoreEncryption: true });
              const totalPages = attachedDoc.getPageCount();
              if (pageIdx < totalPages) {
                const sourcePage = attachedDoc.getPage(pageIdx);
                const { width: origW, height: origH } = sourcePage.getSize();
                const rotationAngle = (sourcePage.getRotation()?.angle || 0) % 360;

                const embeddedPage = await pdfDoc.embedPage(sourcePage);
                const newPage = pdfDoc.addPage([LETTER_WIDTH, LETTER_HEIGHT]);

                const isRotated90or270 = (rotationAngle === 90 || rotationAngle === 270);
                const effectiveW = isRotated90or270 ? origH : origW;
                const effectiveH = isRotated90or270 ? origW : origH;

                const scale = Math.min(targetW / effectiveW, targetH / effectiveH, 1.0);
                const drawW = effectiveW * scale;
                const drawH = effectiveH * scale;

                const x = (LETTER_WIDTH - drawW) / 2;
                const y = (LETTER_HEIGHT - drawH) / 2;

                let drawX = x, drawY = y, elemW = drawW, elemH = drawH;
                if (rotationAngle === 90) {
                  drawX = x + drawW; elemW = drawH; elemH = drawW;
                } else if (rotationAngle === 180) {
                  drawX = x + drawW; drawY = y + drawH;
                } else if (rotationAngle === 270) {
                  drawY = y + drawH; elemW = drawH; elemH = drawW;
                }

                newPage.drawPage(embeddedPage, {
                  x: drawX,
                  y: drawY,
                  width: elemW,
                  height: elemH,
                  rotate: window.PDFLib.degrees(rotationAngle)
                });
              }
            } catch (attachErr) {
              console.error('[generateCustomVectorPDFBlob] Error adjuntando PDF:', attachErr);
            }
          }
        }

        const pdfBytes = await pdfDoc.save({ useObjectStreams: true });
        return new Blob([pdfBytes], { type: 'application/pdf' });
      } catch (err) {
        console.error('Error generando PDF Blob:', err);
        return null;
      }
    }
    window.generateCustomVectorPDFBlob = generateCustomVectorPDFBlob;

    async function openDevPDFBlob() {
      const blob = await generateCustomVectorPDFBlob();
      if (blob) {
        const blobUrl = URL.createObjectURL(blob);
        window.open(blobUrl, '_blank');
      }
    }

    function toggleMobilePreview(forceState) {
      const workspace = document.getElementById('main-workspace');
      const backdrop = document.getElementById('mobile-preview-backdrop');
      if (!workspace) return;
      
      const shouldOpen = (typeof forceState === 'boolean') ? forceState : !workspace.classList.contains('preview-open');
      
      if (shouldOpen) {
        workspace.classList.add('preview-open');
        if (backdrop) backdrop.classList.add('active');
        const scrollArea = workspace.querySelector('.workspace-scroll-area');
        if (scrollArea && scrollArea.scrollTop === 0) {
          // Mantener vista centrada al abrir
        }
      } else {
        workspace.classList.remove('preview-open');
        if (backdrop) backdrop.classList.remove('active');
      }
    }
    window.toggleMobilePreview = toggleMobilePreview;
  </script>



  <!-- SCRIPTS DE INTERACCIÓN Compartidos -->
  <script src="/formatos/assets/editor/supabase-config.js"></script>
  <script src="/formatos/assets/editor/script.js"></script>
</body>

</html>]]></content><author><name></name></author><category term="Traspaso &amp; Vehículos" /><summary type="html"><![CDATA[Formulario Único de Solicitud de Trámites del Registro Nacional Automotor RUNT para traspaso de vehículo.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://formatounico.com/formatos/assets/imgs/TRASPASO-VEHICULO.webp" /><media:content medium="image" url="https://formatounico.com/formatos/assets/imgs/TRASPASO-VEHICULO.webp" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Formato Cuenta de Cobro</title><link href="https://formatounico.com/formatos/cuenta-de-cobro/" rel="alternate" type="text/html" title="Formato Cuenta de Cobro" /><published>2026-08-09T00:00:00-05:00</published><updated>2026-08-09T00:00:00-05:00</updated><id>https://formatounico.com/formatos/cuenta-de-cobro</id><content type="html" xml:base="https://formatounico.com/formatos/cuenta-de-cobro/"><![CDATA[<!DOCTYPE html>
<html lang="es">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">

  <!-- SEO Primary Meta Tags -->
  <title>Formato Cuenta de Cobro – Rellenar y descargar PDF</title>
  <meta name="title" content="Formato Cuenta de Cobro – Rellenar y descargar PDF">
  <meta name="description"
    content="Crea, edita y descarga tu Cuenta de Cobro en PDF. Plantilla profesional en formato válido para Colombia.">
  <meta name="keywords"
    content="cuenta de cobro, formato cuenta de cobro, plantilla cuenta de cobro, descargar PDF cuenta de cobro, modelo cuenta de cobro colombia">
  <meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
  <meta name="author" content="FormatoÚnico">
  <meta http-equiv="content-language" content="es">
  <link rel="canonical" href="https://formatounico.com/formatos/cuenta-de-cobro/">
  <link rel="icon" type="image/png" href="/formatos/assets/imgs/FORMATO-CUENTA-COBRO.webp">
  <link rel="apple-touch-icon" href="/formatos/assets/imgs/FORMATO-CUENTA-COBRO.webp">

  <!-- Open Graph / Facebook / LinkedIn / WhatsApp -->
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://formatounico.com/formatos/cuenta-de-cobro/">
  <meta property="og:title" content="Formato Cuenta de Cobro – Rellenar y descargar PDF">
  <meta property="og:description"
    content="Crea y descarga tu Cuenta de Cobro editable en PDF lista para diligenciar e imprimir.">
  <meta property="og:image" content="https://formatounico.com/formatos/assets/imgs/FORMATO-CUENTA-COBRO.webp">
  <meta property="og:locale" content="es_CO">
  <meta property="og:site_name" content="FormatoÚnico">

  <!-- Twitter Card -->
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:url" content="https://formatounico.com/formatos/cuenta-de-cobro/">
  <meta name="twitter:title" content="Formato Cuenta de Cobro – Rellenar y descargar PDF">
  <meta name="twitter:description"
    content="Crea y descarga tu Cuenta de Cobro editable en PDF lista para diligenciar e imprimir.">
  <meta name="twitter:image" content="https://formatounico.com/formatos/assets/imgs/FORMATO-CUENTA-COBRO.webp">

  <!-- Google Fonts -->
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link
    href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap"
    rel="stylesheet">

  <!-- CSS del Proyecto Cuenta de Cobro -->
  <link rel="stylesheet" href="/formatos/assets/editor/style.css">

  <!-- Supabase JS SDK -->
  <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>

  <!-- Schema.org JSON-LD Structured Data for WebApplication -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "WebApplication",
    "name": "Formato Cuenta de Cobro – Rellenar y descargar PDF",
    "url": "https://formatounico.com/formatos/cuenta-de-cobro/",
    "description": "Crea, edita y descarga tu formato de cuenta de cobro en PDF. Plantilla profesional adaptada a la normativa colombiana.",
    "applicationCategory": "BusinessApplication",
    "operatingSystem": "All",
    "browserRequirements": "Requires JavaScript. Requires HTML5."
  }
  </script>

  <!-- Schema.org JSON-LD Structured Data for FAQPage -->
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "¿Requiere numeración o consecutivo?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "No es estrictamente obligatorio por ley, pero se recomienda llevar un consecutivo interno para control contable y evitar duplicidad de cobros."
        }
      },
      {
        "@type": "Question",
        "name": "¿Se puede cobrar IVA en una cuenta de cobro?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "No. Si eres responsable de IVA (Régimen Común), estás obligado a emitir Factura Electrónica. La cuenta de cobro es exclusiva para no responsables de IVA (Régimen Simplificado)."
        }
      },
      {
        "@type": "Question",
        "name": "¿Sirve como soporte contable para costos/gastos deducibles en empresas?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Sí, siempre y cuando el pagador genere el Documento Soporte en Adquisiciones Efectuadas a No Obligados a Facturar Electrónicamente y lo transmita a la DIAN."
        }
      },
      {
        "@type": "Question",
        "name": "¿Es legal firmar con imagen escaneada o digital?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Sí. Según la Ley 527 de 1999 en Colombia, la firma digital, escaneada o mecánica tiene la misma validez legal si expresa la voluntad inequívoca de quien presta el servicio."
        }
      }
    ]
  }
  </script>
</head>

<body>

  <!-- BARRA DE NAVEGACIÓN UNIVERSAL (DESKTOP Y MÓVIL) -->
  <header class="app-navbar mobile-navbar no-print">
    <!-- Izquierda: Marca -->
    <div class="navbar-left">
      <a href="/formatos/cuenta-de-cobro/" class="navbar-brand-title" style="text-decoration: none;">
        <span>Cuenta de Cobro</span>
      </a>
    </div>

    <!-- Derecha: Botón Pagar + Botón Menú Hamburguesa -->
    <div class="navbar-right">
      <!-- Botón Pagar y Descargar SIEMPRE visible en la barra -->
      <button class="navbar-action-btn btn-nav-pay" id="btn-generate-pdf" onclick="processPaymentFlow()"
        title="Generar código de recuperación, guardar PDF y continuar al pago">
        <span>📥</span> <span class="nav-btn-text">Pagar y Descargar</span>
      </button>

      <!-- Botón Menú Hamburguesa -->
      <button id="btn-navbar-menu-toggle" class="navbar-menu-toggle-btn no-print" onclick="toggleNavbarActionsMenu()" aria-label="Abrir menú de opciones" title="Menú de opciones">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
          <line x1="3" y1="6" x2="21" y2="6"></line>
          <line x1="3" y1="12" x2="21" y2="12"></line>
          <line x1="3" y1="18" x2="21" y2="18"></line>
        </svg>
      </button>

      <!-- Menú Desplegable con opciones -->
      <div id="navbar-actions-menu" class="navbar-actions-menu">
        <button class="navbar-action-btn" onclick="handleNavbarPreviewClick()"
          title="Ver cómo se verá el PDF final con marca de agua">
          <span>👁️</span> <span>Vista Previa PDF</span>
        </button>
        <a href="/formatos/cuenta-de-cobro/gracias/" class="navbar-action-btn"
          title="Recuperar tu documento pagado">
          <span>🔍</span> <span>Recuperar Doc</span>
        </a>
        <button class="navbar-action-btn" onclick="resetTemplate(); toggleNavbarActionsMenu();"
          title="Restablecer plantilla">
          <span>🔄</span> <span>Restablecer Todo</span>
        </button>
        <div class="navbar-menu-divider"></div>
        <a href="/formatos/" class="navbar-action-btn" title="Ver todos los formatos disponibles">
          <span>📂</span> <span>Formatos</span>
        </a>
        <a href="/" class="navbar-action-btn" title="Ir a la página de inicio">
          <span>🏠</span> <span>Inicio</span>
        </a>
      </div>
    </div>
  </header>

  <!-- TELÓN DE FONDO DE LA BARRA LATERAL EN MÓVIL -->
  <div id="sidebar-backdrop" class="sidebar-backdrop no-print" onclick="closeSidebar()"></div>

  <!-- TELÓN DE FONDO DE LA VISTA PREVIA DESLIZABLE MÓVIL -->
  <div id="mobile-preview-backdrop" class="mobile-preview-backdrop no-print" onclick="toggleMobilePreview(false)"></div>

  <!-- BARRA LATERAL DE CONTROL (SOLO EN PANTALLA) -->
  <aside id="sidebar" class="sidebar no-print">
    <!-- Encabezado Móvil H1 -->
    <div class="mobile-page-header no-print">
      <h1 class="mobile-h1-title">Formato Cuenta de Cobro</h1>
      <p class="mobile-h1-subtitle">Rellenar en línea y descargar PDF</p>
    </div>

    <!-- PESTAÑAS DE LA BARRA LATERAL -->
    <div class="sidebar-tab-switcher no-print">
      <button id="tab-btn-settings" class="sidebar-tab-btn" onclick="switchSidebarTab('settings')">
        <span>🎨</span> Diseño
      </button>
      <button id="tab-btn-form" class="sidebar-tab-btn active" onclick="switchSidebarTab('form')">
        <span>📝</span> Formulario
      </button>
    </div>

    <div class="sidebar-content">
      <!-- PESTAÑA: AJUSTES DE DISEÑO -->
      <div id="tab-pane-settings" class="tab-pane" style="display: none;">
        <!-- Ajustes de Estructura / Plantilla -->
        <div class="settings-group">
          <label for="template-select">Estructura / Plantilla (10 Opciones)</label>
          <select id="template-select" class="settings-control" onchange="updateStyles()">
            <option value="classic" selected>1. Clásica Formal (Tradicional y Equilibrada)</option>
            <option value="executive">2. Ejecutiva Corporativa (Franja y Tarjetas)</option>
            <option value="minimalist">3. Minimalista Elegante (Espaciada y Limpia)</option>
            <option value="tech">4. Comercial con Recibo (Cuadrícula y Marcos)</option>
            <option value="harvard">5. Legal / Notarial (Doble Borde y Formal)</option>
            <option value="compact">6. Compacta Alto Impacto (Listón y Eficiencia)</option>
            <option value="corporate">7. Corporativa Premium (Franja y Fondos Suaves)</option>
            <option value="creative">8. Creativa Freelance (Acentos Modernos)</option>
            <option value="international">9. Internacional / Bilingüe (Doble Divisor y Versalitas)</option>
            <option value="analytics">10. Contable / Financiera (Detalles Técnicos)</option>
          </select>
        </div>

        <!-- Cuadrícula de Tarjetas Visuales de Selección de Estructura (10 Plantillas) -->
        <div class="template-selector-grid">
          <button type="button" class="template-card-btn active" data-template-value="classic" onclick="selectTemplate('classic')" title="Estructura 1: Clásica Formal">
            <div class="template-mini-preview preview-classic">
              <div class="mini-head"></div>
              <div class="mini-title"></div>
              <div class="mini-line"></div>
            </div>
            <span>1. Clásica</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="executive" onclick="selectTemplate('executive')" title="Estructura 2: Ejecutiva Corporativa">
            <div class="template-mini-preview preview-executive">
              <div class="mini-head-bar"></div>
              <div class="mini-title-side"></div>
              <div class="mini-line"></div>
            </div>
            <span>2. Ejecutiva</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="minimalist" onclick="selectTemplate('minimalist')" title="Estructura 3: Minimalista Elegante">
            <div class="template-mini-preview preview-minimalist">
              <div class="mini-head"></div>
              <div class="mini-title-spaced"></div>
              <div class="mini-line-none"></div>
            </div>
            <span>3. Minimalista</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="tech" onclick="selectTemplate('tech')" title="Estructura 4: Comercial con Recibo">
            <div class="template-mini-preview preview-tech">
              <div class="mini-head"></div>
              <div class="mini-box-tag"></div>
              <div class="mini-line"></div>
            </div>
            <span>4. Comercial</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="harvard" onclick="selectTemplate('harvard')" title="Estructura 5: Legal / Notarial">
            <div class="template-mini-preview preview-harvard">
              <div class="mini-head-center"></div>
              <div class="mini-title-double"></div>
              <div class="mini-line"></div>
            </div>
            <span>5. Legal</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="compact" onclick="selectTemplate('compact')" title="Estructura 6: Compacta de Alto Impacto">
            <div class="template-mini-preview preview-compact">
              <div class="mini-head-compact"></div>
              <div class="mini-ribbon"></div>
              <div class="mini-line"></div>
            </div>
            <span>6. Compacta</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="corporate" onclick="selectTemplate('corporate')" title="Estructura 7: Corporativa Premium">
            <div class="template-mini-preview preview-corporate">
              <div class="mini-head-full"></div>
              <div class="mini-title-bg"></div>
              <div class="mini-line"></div>
            </div>
            <span>7. Corporativa</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="creative" onclick="selectTemplate('creative')" title="Estructura 8: Creativa Freelance">
            <div class="template-mini-preview preview-creative">
              <div class="mini-head-underline"></div>
              <div class="mini-chips"></div>
              <div class="mini-line"></div>
            </div>
            <span>8. Creativa</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="international" onclick="selectTemplate('international')" title="Estructura 9: Internacional / Bilingüe">
            <div class="template-mini-preview preview-international">
              <div class="mini-head-double"></div>
              <div class="mini-title-caps"></div>
              <div class="mini-line"></div>
            </div>
            <span>9. Internacional</span>
          </button>

          <button type="button" class="template-card-btn" data-template-value="analytics" onclick="selectTemplate('analytics')" title="Estructura 10: Contable / Financiera">
            <div class="template-mini-preview preview-analytics">
              <div class="mini-head-mono"></div>
              <div class="mini-title-prompt"></div>
              <div class="mini-line"></div>
            </div>
            <span>10. Contable</span>
          </button>
        </div>

        <!-- Ajustes Tipográficos y de Hoja -->
        <div class="settings-group">
          <label for="font-select">Tipografía</label>
          <select id="font-select" class="settings-control" onchange="updateStyles()">
            <option value="sans" selected>Sans-Serif (Inter - Moderna)</option>
            <option value="serif">Serif (Merriweather - Clásica)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="size-select">Tamaño de Letra</label>
          <select id="size-select" class="settings-control" onchange="updateStyles()">
            <option value="small">Pequeño (9.5pt)</option>
            <option value="medium" selected>Mediano (10.5pt)</option>
            <option value="large">Grande (11.5pt)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="margin-select">Márgenes de Hoja</label>
          <select id="margin-select" class="settings-control" onchange="updateStyles()">
            <option value="narrow">Estrechos (0.5in)</option>
            <option value="normal" selected>Normales (0.75in)</option>
            <option value="wide">Anchos (1.0in)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="spacing-select">Interlineado</label>
          <select id="spacing-select" class="settings-control" onchange="updateStyles()">
            <option value="1.3">Compacto (1.3)</option>
            <option value="1.4" selected>Normal (1.4)</option>
            <option value="1.5">Relajado (1.5)</option>
          </select>
        </div>

        <div class="settings-group">
          <label for="theme-select">Color del Nombre/Líneas</label>
          <select id="theme-select" class="settings-control" onchange="updateStyles()">
            <option value="black" selected>Negro Carbón (Recomendado)</option>
            <option value="navy">Azul Ejecutivo</option>
            <option value="emerald">Verde Esmeralda</option>
            <option value="burgundy">Rojo Borgoña</option>
          </select>
        </div>

        <!-- Tips de Edición -->
        <div class="info-box">
          <h3>💡 Tips de edición:</h3>
          <ul>
            <li>Haz clic y escribe directamente sobre cualquier texto para editarlo.</li>
            <li>Usa <b>Enter</b> en una viñeta para añadir otra viñeta automáticamente.</li>
            <li>Pasa el mouse sobre los bloques para ordenarlos con las flechas (▲/▼) o eliminarlos (✕).</li>
            <li>Sube tu imagen de firma directamente en la casilla correspondiente.</li>
          </ul>
        </div>

        <!-- ARTÍCULO GUÍA Y SEO: CUENTA DE COBRO -->
        <article class="seo-article-box info-box">
          <header class="seo-article-header">
            <h1 class="seo-title">Formato Cuenta de Cobro – Rellenar y Descargar PDF</h1>
            <p class="seo-subtitle">Guía Completa, Requisitos Legales en Colombia y Plantilla Editable en Línea</p>
          </header>

          <blockquote style="background: rgba(59, 130, 246, 0.1); border-left: 4px solid #3b82f6; padding: 12px 16px; margin: 16px 0; border-radius: 0 8px 8px 0; font-size: 0.9rem; line-height: 1.5; color: #cbd5e1;">
            La <strong>cuenta de cobro</strong> es el soporte documental fundamental emitido por trabajadores independientes, contratistas de prestación de servicios y personas naturales no obligadas a facturar electrónicamente en Colombia para solicitar y certificar el pago de sus honorarios o servicios.
          </blockquote>

          <section class="seo-section">
            <h3>¿Qué es una Cuenta de Cobro en Colombia y para qué sirve?</h3>
            <p>Una <strong>cuenta de cobro</strong> es un comprobante no fiscal de carácter comercial y contable mediante el cual una persona natural solicita formalmente a un cliente (persona natural o jurídica) el pago por la prestación de un servicio profesional, técnico, locativo o la venta de bienes.</p>
            <p>En el marco tributario colombiano regulado por la DIAN y el Estatuto Tributario, la cuenta de cobro no reemplaza la factura de venta ni la factura electrónica, sino que opera como comprobante del cobro de acreencias para quienes están legalmente exentos de expedir factura electrónica (no responsables del IVA según el Artículo 512-13 y Parágrafo 3 del Artículo 437 del Estatuto Tributario).</p>
          </section>

          <section class="seo-section">
            <h3>¿Quiénes deben expedir una Cuenta de Cobro?</h3>
            <p>Deben solicitar el pago de sus acreencias mediante este formato:</p>
            <ul>
              <li><strong>Trabajadores independientes y contratistas:</strong> Personas que prestan servicios por prestación de servicios (civiles o comerciales) sin vínculo laboral directo.</li>
              <li><strong>Profesionales independientes:</strong> Abogados, ingenieros, contadores, médicos, consultores, diseñadores y desarrolladores de software.</li>
              <li><strong>Comerciantes no obligados a facturar:</strong> Personas naturales cuyos ingresos brutos anuales no superan las 3.500 UVT y no poseen más de un establecimiento de comercio.</li>
              <li><strong>Prestadores de servicios locativos u oficios varios:</strong> Técnicos de mantenimiento, reparaciones locativas, capacitadores o prestadores de servicios eventuales.</li>
            </ul>
          </section>

          <section class="seo-section">
            <h3>Requisitos Legales e Indispensables de una Cuenta de Cobro Válida</h3>
            <p>Para que una cuenta de cobro sea válida, formal y procesada sin contratiempos por el área contable o tesorería de la empresa pagadora, debe contar con los siguientes campos indispensables:</p>
            <ol>
              <li><strong>Fecha de expedición:</strong> Indicar la ciudad y la fecha exacta (día, mes y año) en que se emite el documento.</li>
              <li><strong>Identificación del Pagador / Cliente:</strong> Nombre completo o Razón Social de la empresa, NIT o cédula, dirección y teléfono.</li>
              <li><strong>Identificación del Emisor / Prestador:</strong> Nombre completo del contratista, número de Cédula de Ciudadanía (C.C.) o extranjería, teléfono y correo electrónico.</li>
              <li><strong>Monto y valor en letras (M/CTE):</strong> Especificar de forma precisa el valor total a cobrar en cifras y la descripción en letras expresada en moneda legal colombiana.</li>
              <li><strong>Concepto claro del servicio o producto:</strong> Detallar en viñetas o texto descriptivo los servicios contratados o las actividades ejecutadas.</li>
              <li><strong>Datos de consignación bancaria:</strong> Tipo de cuenta (Ahorros o Corriente), número de cuenta y entidad bancaria de destino.</li>
              <li><strong>Firma manuscrita o digital:</strong> Firma del emisor que valida la veracidad del cobro y los datos reportados.</li>
              <li><strong>Documentos Anexos Habituales:</strong> Copia del RUT reciente, planilla de pago de seguridad social (si aplica) y el <a href="/formatos/formato-no-declarante-de-renta/" style="color: #60a5fa; text-decoration: underline;">formato de no declarante de renta</a> para la correcta liquidación de retención en la fuente.</li>
            </ol>
          </section>

          <section class="seo-section">
            <h3>Diferencias entre Cuenta de Cobro y Factura Electrónica</h3>
            <div class="table-responsive">
              <table class="seo-table">
                <thead>
                  <tr>
                    <th>Característica</th>
                    <th>Cuenta de Cobro</th>
                    <th>Factura Electrónica DIAN</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td><strong>Emisor:</strong></td>
                    <td>Persona natural no obligada a facturar</td>
                    <td>Empresas y personas responsables del IVA / Impoconsumo</td>
                  </tr>
                  <tr>
                    <td><strong>Validación DIAN:</strong></td>
                    <td>No requiere transmisión directa a la DIAN</td>
                    <td>Requiere validación previa del sistema Dian (CUFE / QR)</td>
                  </tr>
                  <tr>
                    <td><strong>Cobro de IVA:</strong></td>
                    <td>No incluye ni liquida IVA</td>
                    <td>Discrimina el IVA (19%) u otros impuestos aplicables</td>
                  </tr>
                  <tr>
                    <td><strong>Soporte Fiscal de Costos:</strong></td>
                    <td>El pagador elabora Documento Soporte en Adquisiciones</td>
                    <td>Opera directamente como soporte costo/gasto deducible</td>
                  </tr>
                </tbody>
              </table>
            </div>
          </section>

          <section class="seo-section">
            <h3>Aspectos Tributarios, Seguridad Social y Retención en la Fuente</h3>
            <p>Al presentar tu cuenta de cobro a una persona jurídica en Colombia, ten en cuenta los siguientes aspectos tributarios y legales:</p>
            <ul>
              <li><strong>Aportes a Seguridad Social (PILA):</strong> Según la Ley 1562 de 2012 y el Artículo 244 de la Ley 1955 de 2019, los contratistas independientes deben cotizar a Salud (12.5%), Pensión (16%) y ARL sobre un Ingreso Base de Cotización (IBC) mínimo del 40% del valor mensualizado del contrato. La empresa contratante exigirá la planilla de pago PILA antes de efectuar el desembolso.</li>
              <li><strong>Retención en la Fuente:</strong> Dependiendo del concepto (Honorarios, Servicios o Comisiones) y si declaraste trabajadores a cargo, el agente retenedor aplicará la tabla de retención en la fuente (10%, 11% o tarifas progresivas del Artículo 383 del Estatuto Tributario).</li>
            </ul>
          </section>

          <section class="seo-section">
            <h3>Paso a Paso para Generar y Descargar tu Cuenta de Cobro en PDF</h3>
            <ol>
              <li><strong>Editar el formato en línea:</strong> Haz clic sobre cualquier casilla editable del documento (fecha, datos de la empresa, tu nombre, C.C., valor y detalles bancarios).</li>
              <li><strong>Añadir conceptos o filas:</strong> Usa los controles flotantes para agregar viñetas o líneas adicionales de concepto según los servicios prestados.</li>
              <li><strong>Insertar tu firma:</strong> Sube la imagen transparente o clara de tu firma manuscrita en la casilla correspondiente al pie del documento.</li>
              <li><strong>Verificar vista previa y descargar:</strong> Haz clic en "Vista Previa PDF" para revisar la maquetación Carta y finalmente genera el archivo listo para enviar a cobro.</li>
            </ol>
          </section>

          <section class="seo-section faq-container">
            <h3>Preguntas Frecuentes sobre la Cuenta de Cobro</h3>

            <details class="faq-item">
              <summary><strong>¿Una cuenta de cobro requiere consecutivo o número de factura?</strong></summary>
              <p>No es de obligatorio cumplimiento legal llevar una numeración consecutiva, pero es una excelente práctica contable llevar un número de control interno (ej. Cuenta de Cobro N° 001) para tu registro de cobros e impuestos.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Puedo cobrar IVA en una cuenta de cobro?</strong></summary>
              <p>No. Las cuentas de cobro solo son emitidas por personas no responsables del IVA. Si cobras IVA, estás en la obligación legal de inscribirte en la DIAN como responsable del impuesto y expedir factura electrónica.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Sirve la cuenta de cobro como soporte contable para la empresa que me paga?</strong></summary>
              <p>Para la empresa pagadora, la cuenta de cobro es el comprobante del cobro de honorarios. Sin embargo, conforme a la resolución de la DIAN, la empresa pagadora debe transmitir electrónicamente el <em>Documento Soporte en Adquisiciones efectuadas a No Obligados a Facturar</em> para deducir legalmente dicho gasto de su renta.</p>
            </details>

            <details class="faq-item">
              <summary><strong>¿Es legal firmar la cuenta de cobro con una imagen escaneada?</strong></summary>
              <p>Sí. En Colombia, el Código de Comercio y la Ley 527 de 1999 reconocen la validez legal de las firmas mecánicas, escaneadas o digitales en documentos comerciales privados siempre que garanticen la identidad del firmante.</p>
            </details>
          </section>

          <footer class="seo-article-footer">
            <p>Utiliza nuestra herramienta en línea para diligenciar, personalizar con tu firma y generar en segundos tu <strong>Cuenta de Cobro en formato PDF</strong> profesional optimizado para impresión y envío por correo electrónico.</p>
          </footer>
        </article>
      </div>

      <!-- PESTAÑA: FORMULARIO INTERACTIVO -->
      <div id="tab-pane-form" class="tab-pane">
        <div class="info-box" style="margin-bottom: 10px;">
          <p style="margin: 0; font-size: 11.5px; color: #94a3b8; line-height: 1.4;">
            💡 <b>Sincronización en vivo:</b> Los datos que modifiques aquí se reflejan de inmediato en tu documento. También puedes hacer clic y escribir directamente sobre la hoja.
          </p>
        </div>

        <div id="form-container" class="form-container" style="display: flex; flex-direction: column; gap: 12px;"></div>

        <!-- Añadir Nueva Sección desde el Formulario -->
        <div class="settings-group sidebar-add-sections-group" style="margin-top: 16px;">
          <label>Añadir Nueva Sección / Hoja</label>
          <div style="display: flex; gap: 8px;">
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addNewSection('list')">+ Con Viñetas</button>
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addNewSection('text')">+ Solo Texto</button>
          </div>
          <div style="display: flex; gap: 8px; margin-top: 4px;">
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addSignatureSection()">✍️ + Firma / C.C.</button>
            <button class="btn btn-secondary" style="flex: 1; font-size: 12px; padding: 8px;"
              onclick="addPhotoSection()">📷 + Foto</button>
          </div>
          <div style="display: flex; gap: 8px; margin-top: 6px;">
            <button class="btn-sidebar-add-page" style="flex: 1;" onclick="addNewPage()">📄 + Agregar Hoja</button>
            <button class="btn-sidebar-del-page" style="flex: 1;" onclick="deleteLastPage()"
              title="Eliminar la última página">🗑️ Eliminar Hoja</button>
          </div>
          <div style="margin-top: 6px; display: flex; gap: 8px;">
            <button class="btn-sidebar-reorder" onclick="openReorderModal()" style="flex: 1;"
              title="Reordenar la secuencia de las hojas del documento">📑 Reordenar Hojas</button>
          </div>
          <div style="margin-top: 6px;">
            <button class="btn-sidebar-add-pdf" onclick="triggerPDFUpload()"
              title="Cargar un documento PDF y adjuntarlo a la cuenta de cobro">📎 + Adjuntar Documento PDF</button>
          </div>
        </div>
      </div>
    </div>
  </aside>

  <!-- ESPACIO DE TRABAJO -->
  <main class="workspace">
    <!-- Pestaña / Asa de agarre del Bottom Sheet en Móvil -->
    <div class="mobile-sheet-handle no-print" onclick="toggleMobilePreview()">
      <span class="mobile-sheet-circle-icon">▲</span>
      <span class="mobile-sheet-title">Vista Previa del Documento</span>
      <span class="mobile-sheet-circle-icon">▲</span>
    </div>

    <!-- Área de Desplazamiento Interna del Documento -->
    <div class="workspace-scroll-area">

    <!-- Banner de Advertencia de Exceso de Contenido (Dinámico) -->
    <div id="overflow-warning" class="warning-banner no-print" style="display: none;">
      <span class="warning-icon">⚠️</span>
      <span class="warning-text">El contenido excede una página Carta. Se truncará o creará una segunda página al
        imprimir. Intenta reducir el interlineado, los márgenes o el tamaño de letra.</span>
    </div>

    <div class="page-shadow-wrapper">
      <div class="page" id="page-1" data-page="1">
        <div class="page-watermark">formatounico.com</div>

        <div class="page-content">

          <!-- FECHA EN LA PARTE SUPERIOR -->
          <div class="resume-section" data-section-type="text" style="margin-bottom: 24px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <p id="doc-date-text" class="section-text" contenteditable="true" style="font-size: 10pt; color: #334155;">
              domingo, 9 de agosto de 2026
            </p>
          </div>

          <!-- TÍTULO: CUENTA DE COBRO -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 24px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <h1 class="section-title" style="font-size: 16pt; font-weight: 800; text-transform: uppercase; text-align: center; border-bottom: none; margin: 0;">
              <span contenteditable="true">CUENTA DE COBRO</span>
            </h1>
          </div>

          <!-- DATOS DEL CLIENTE / EMPRESA -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 24px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <div class="section-text" contenteditable="true" style="font-size: 10.5pt; line-height: 1.5; text-align: center;">
              <strong>EMPRESA LTDA</strong><br>
              NIT: 000.000.000-4<br>
              CALLE 41 # 1 - 152
            </div>
          </div>

          <!-- ETIQUETA: DEBE A: -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 20px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <h2 class="section-title" style="font-size: 11pt; font-weight: 800; text-transform: uppercase; text-align: center; border-bottom: none; margin: 0;">
              <span contenteditable="true">DEBE A:</span>
            </h2>
          </div>

          <!-- DATOS DEL PRESTADOR -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 28px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <div class="section-text" contenteditable="true" style="font-size: 10.5pt; line-height: 1.5; text-align: center;">
              <strong>JUAN ANDRES VERGARA LOPEZ</strong><br>
              C.C. 10.415.751 expedida en ciudad<br>
              CEL: 312 245 1515
            </div>
          </div>

          <!-- ETIQUETA: LA SUMA DE: -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 16px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <h2 class="section-title" style="font-size: 11pt; font-weight: 800; text-transform: uppercase; text-align: center; border-bottom: none; margin: 0;">
              <span contenteditable="true">LA SUMA DE:</span>
            </h2>
          </div>

          <!-- VALOR EN LETRAS Y NÚMEROS -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 28px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <p class="section-text" contenteditable="true" style="font-size: 11pt; font-weight: 700; text-align: center;">
              UN MILLÓN DOSCIENTOS MIL PESOS M/CTE ($1.200.000).
            </p>
          </div>

          <!-- ETIQUETA: POR CONCEPTO DE: -->
          <div class="resume-section" data-section-type="text" style="text-align: center; margin-bottom: 16px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <h2 class="section-title" style="font-size: 11pt; font-weight: 800; text-transform: uppercase; text-align: center; border-bottom: none; margin: 0;">
              <span contenteditable="true">POR CONCEPTO DE:</span>
            </h2>
          </div>

          <!-- CONCEPTO / VIÑETAS -->
          <section class="resume-section" data-section-type="list" style="margin-bottom: 24px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <ul class="item-bullets" style="font-size: 10.5pt; line-height: 1.5; list-style-type: disc;">
              <li contenteditable="true">Mantenimiento locativo en las instalaciones de la empresa EMPRESA LTDA</li>
            </ul>
            <div class="section-footer no-print">
              <button class="add-bullet-btn" onclick="addBullet(this)">+ Viñeta</button>
            </div>
          </section>

          <!-- INSTRUCCIONES DE PAGO DE CUENTA BANCARIA -->
          <div class="resume-section" data-section-type="text" style="margin-bottom: 40px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <p class="section-text" contenteditable="true" style="font-size: 10.5pt; line-height: 1.5;">
              Los cuales pueden ser pagados a la cuenta de ahorros número 2151651715 de Bancolombia.
            </p>
          </div>

          <!-- DESPEDIDA -->
          <div class="resume-section" data-section-type="text" style="margin-bottom: 50px;">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <p class="section-text" contenteditable="true" style="font-size: 10.5pt;">
              Atentamente,
            </p>
          </div>

          <!-- FIRMA Y DATOS DE EXPEDICIÓN -->
          <section class="resume-section signature-section" data-section-type="signature">
            <div class="section-controls no-print" contenteditable="false">
              <button class="ctrl-btn" onclick="moveSectionUp(this)" title="Subir Sección">▲</button>
              <button class="ctrl-btn" onclick="moveSectionDown(this)" title="Bajar Sección">▼</button>
              <button class="ctrl-btn delete" onclick="deleteSection(this)" title="Eliminar Sección">✕</button>
            </div>
            <div class="signature-block">
              <div class="signature-image-area no-print">
                <input type="file" id="default-sig-input" accept="image/*" style="display:none"
                  onchange="loadSignatureImage(this, 'default-sig')">
                <div id="default-sig-placeholder" class="signature-img-placeholder"
                  onclick="document.getElementById('default-sig-input').click()" title="Haz clic para subir tu firma">
                  ✍️ &nbsp;Subir imagen de firma
                </div>
              </div>
              <div id="default-sig-preview-wrapper" class="signature-preview-wrapper" style="display:none;">
                <button type="button" class="btn-remove-signature no-print" onclick="removeSignatureImage('default-sig')" title="Eliminar imagen de firma">
                  ✕ Eliminar firma
                </button>
                <img id="default-sig-preview" class="signature-img-preview" src="" alt="Firma" style="cursor:pointer;" onclick="document.getElementById('default-sig-input').click()" title="Haz clic para cambiar la imagen de firma">
              </div>
              <div class="signature-line"></div>
              <p class="signature-name" contenteditable="true">JUAN ANDRES VERGARA LOPEZ</p>
              <p class="signature-cc" contenteditable="true">C.C. 10.415.751 expedida en ciudad</p>
              <p class="signature-phone" contenteditable="true" style="font-size: 9pt; color: #475569; margin: 2px 0 0 0;">CEL: 312 245 1515</p>
            </div>
          </section>

        </div>
      </div>
    </div>

    <!-- Botones para añadir y eliminar hoja desde el área de trabajo -->
    <div class="workspace-add-page-container no-print">
      <!-- Acciones Rápidas: Añadir Secciones dentro del Documento -->
      <div class="workspace-add-sections-grid">
        <button class="btn-workspace-action" onclick="addNewSection('list')">
          <span>•</span> + Con Viñetas
        </button>
        <button class="btn-workspace-action" onclick="addNewSection('text')">
          <span>¶</span> + Solo Texto
        </button>
        <button class="btn-workspace-action" onclick="addSignatureSection()">
          <span>✍️</span> + Firma / C.C.
        </button>
        <button class="btn-workspace-action" onclick="addPhotoSection()">
          <span>📷</span> + Foto
        </button>
      </div>

      <button class="btn-workspace-preview" onclick="previewPDF(true)"
        title="Ver Vista Previa del Documento con marca de agua">
        <span>👁️</span> Vista Previa PDF
      </button>
      <button class="btn-workspace-add-page" onclick="addNewPage()">
        <span>📄</span> + Agregar Nueva Hoja
      </button>
      <button class="btn-workspace-reorder" onclick="openReorderModal()">
        <span>📑</span> Reordenar Hojas
      </button>
      <button class="btn-workspace-add-pdf" onclick="triggerPDFUpload()">
        <span>📎</span> Adjuntar PDF
      </button>
      <button id="btn-workspace-del-page" class="btn-workspace-del-page" onclick="deleteLastPage()">
        <span>🗑️</span> Eliminar Última Hoja
      </button>
    </div>
    </div>
  </main>

  <!-- Overlay de carga para generación de PDF -->
  <div id="pdf-loading-overlay">
    <div class="pdf-loading-card">
      <div class="pdf-spinner"></div>
      <p class="pdf-loading-title">Generando PDF</p>
      <p id="pdf-loading-msg" class="pdf-loading-sub">Iniciando...</p>
    </div>
  </div>

  <!-- Input oculto para cargar PDFs -->
  <input type="file" id="pdf-file-input" accept="application/pdf" style="display:none"
    onchange="loadPDFAttachment(this)">

  <!-- BARRA FLOTANTE CONTEXTUAL DE ACCIÓN UNIVERSAL (DESKTOP Y MÓVIL) -->
  <div id="context-bar" class="context-bar no-print">
    <div id="context-content" class="context-content"></div>
  </div>

  <!-- MODAL DE REORDENAMIENTO DE HOJAS (MOBILE-FIRST) -->
  <div id="reorder-modal" class="reorder-modal no-print" aria-hidden="true">
    <div class="reorder-backdrop" onclick="closeReorderModal()"></div>
    <div class="reorder-card-dialog">
      <header class="reorder-modal-header">
        <div class="reorder-modal-title">
          <span class="reorder-icon">📑</span>
          <h3>Reordenar Hojas</h3>
        </div>
        <button class="reorder-close-btn" onclick="closeReorderModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="reorder-modal-body">
        <p class="reorder-help-text">Usa los botones ▲/▼ para cambiar la secuencia de las páginas de tu documento:
        </p>
        <div id="reorder-list" class="reorder-list"></div>
      </div>

      <footer class="reorder-modal-footer">
        <button class="btn btn-secondary" onclick="closeReorderModal()">Cancelar</button>
        <button class="btn btn-primary" onclick="applyPageReorder()"
          style="background: linear-gradient(135deg, #10b981, #059669); border: none;">✓ Aplicar Cambios</button>
      </footer>
    </div>
  </div>

  <!-- MODAL DE VISTA PREVIA DEL DOCUMENTO EN PÁGINA (MOBILE-FIRST) -->
  <div id="pdf-preview-modal" class="pdf-preview-modal no-print" aria-hidden="true">
    <div class="pdf-preview-backdrop" onclick="closePDFPreviewModal()"></div>
    <div class="pdf-preview-card-dialog">
      <header class="pdf-preview-header">
        <div class="pdf-preview-title">
          <span class="pdf-preview-icon">👁️</span>
          <h3>Vista Previa del Documento</h3>
        </div>
        <button class="pdf-preview-close-btn" onclick="closePDFPreviewModal()"
          aria-label="Cerrar vista previa">✕</button>
      </header>

      <div class="pdf-preview-body">
        <p class="pdf-preview-help-text">Muestra con marca de agua de cómo se verá tu documento final:</p>
        <div id="pdf-preview-pages-container" class="pdf-preview-pages-container"></div>
      </div>

      <footer class="pdf-preview-footer">
        <button class="btn btn-secondary" onclick="closePDFPreviewModal()">Cerrar</button>
        <button class="btn btn-primary" onclick="closePDFPreviewModal(); processPaymentFlow();"
          style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>📥</span> Pagar y Descargar PDF Final
        </button>
      </footer>
    </div>
  </div>

  <!-- MODAL DE CÓDIGO DE RECUPERACIÓN Y PAGO WOMPI (MOBILE-FIRST) -->
  <div id="payment-code-modal" class="payment-modal no-print" aria-hidden="true">
    <div class="payment-backdrop" onclick="closePaymentCodeModal()"></div>
    <div class="payment-card-dialog">
      <header class="payment-modal-header">
        <div class="payment-modal-title">
          <span class="payment-icon">🔐</span>
          <h3>Código de Recuperación de tu Documento</h3>
        </div>
        <button class="payment-close-btn" onclick="closePaymentCodeModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="payment-modal-body">
        <p class="payment-instructions">
          Tu documento ha sido almacenado de forma segura. <strong>Copia y guarda tu código de recuperación</strong> antes de continuar:
        </p>

        <div class="recovery-code-box">
          <span id="display-recovery-code" class="recovery-code-text">--------</span>
          <button class="btn-copy-code" onclick="copyRecoveryCode()" title="Copiar código al portapapeles">
            <span>📋</span> <span id="copy-btn-label">Copiar Código</span>
          </button>
        </div>

        <div class="payment-info-box">
          <span class="info-badge">⚠️ IMPORTANTE</span>
          <p>
            <strong>Debes copiar este código:</strong> al momento de pagar en Wompi, el formulario de pago te lo va a pedir para asociar tu compra. Además, te permitirá recuperar tu PDF en caso de cerrar la página.
          </p>
          <p style="margin-top: 6px; font-size: 0.85rem; color: #cbd5e1;">
            ⏱️ <strong>Disponibilidad:</strong> Tu documento estará disponible para descargar durante <strong>24 horas</strong> luego de confirmado el pago.
          </p>
        </div>
      </div>

      <footer class="payment-modal-footer">
        <button class="btn btn-secondary" onclick="closePaymentCodeModal()">Guardar después</button>
        <button id="btn-continue-wompi" class="btn btn-primary" onclick="continueToWompiPayment()" style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>💳</span> Continuar al Pago
        </button>
      </footer>
    </div>
  </div>

  <!-- MODAL DE RECUPERACIÓN DE DOCUMENTO PAGADO -->
  <div id="document-recovery-modal" class="payment-modal no-print" aria-hidden="true">
    <div class="payment-backdrop" onclick="closeDocumentRecoveryModal()"></div>
    <div class="payment-card-dialog">
      <header class="payment-modal-header">
        <div class="payment-modal-title">
          <span class="payment-icon">🔍</span>
          <h3>Recuperar Documento Pagado</h3>
        </div>
        <button class="payment-close-btn" onclick="closeDocumentRecoveryModal()" aria-label="Cerrar modal">✕</button>
      </header>

      <div class="payment-modal-body">
        <p class="payment-instructions">
          Ingresa tu código único de recuperación para descargar tu documento final:
        </p>

        <div class="recovery-input-group">
          <input type="text" id="recovery-code-input" class="settings-control" placeholder="Ej. 8F4K9X2QW7" style="text-transform: uppercase; font-size: 16px; font-weight: 700; text-align: center; letter-spacing: 2px; width: 100%;">
        </div>
        <p id="recovery-error-msg" style="color: #f87171; font-size: 12.5px; margin-top: 10px; display: none; text-align: center;"></p>
      </div>

      <footer class="payment-modal-footer">
        <button class="btn btn-secondary" onclick="closeDocumentRecoveryModal()">Cancelar</button>
        <button class="btn btn-primary" onclick="lookupAndDownloadDocument()" style="background-color: #b0f2ae; color: #0f172a; border: 1px solid #86efac; font-weight: 800;">
          <span>📥</span> Descargar Documento
        </button>
      </footer>
    </div>
  </div>

  <!-- Scripts de Interacción y Almacenamiento -->
  <script src="/formatos/assets/editor/supabase-config.js"></script>
  <script src="/formatos/assets/editor/script.js"></script>
</body>

</html>]]></content><author><name></name></author><category term="Facturación &amp; Cobro" /><summary type="html"><![CDATA[Herramienta interactiva para diligenciar, calcular totales automáticos y generar tu Cuenta de Cobro en PDF.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://formatounico.com/formatos/assets/imgs/FORMATO-CUENTA-COBRO.webp" /><media:content medium="image" url="https://formatounico.com/formatos/assets/imgs/FORMATO-CUENTA-COBRO.webp" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>