fix(sinpe): acomodar texto de aprobacion manual en diseno horizontal espacioso y habilitar en panel admin

This commit is contained in:
unknown
2026-10-07 00:30:51 -06:00
parent 440e0f4edb
commit 451d27d7df
3 changed files with 297 additions and 21 deletions
+39 -3
View File
@@ -541,7 +541,8 @@
</button>
<button class="admin-tab-btn" id="btnTabAdminRecarga" onclick="switchAdminTab('recarga')">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="14" x="2" y="5" rx="2"/><line x1="2" x2="22" y1="10" y2="10"/></svg>
<span>Recarga Manual</span>
<span>Recargas & SINPE</span>
<span id="badgeAdminTabSinpeCount" style="background: #10b981; color: white; padding: 2px 7px; border-radius: 10px; font-size: 0.70rem; font-weight: 800; display: none; margin-left: 5px;">0</span>
</button>
<button class="admin-tab-btn" id="btnTabAdminMovimientos" onclick="switchAdminTab('movimientos')">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M16 22h2a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v3"/><path d="m3 12.5 3 3 6-6"/></svg>
@@ -595,8 +596,43 @@
</div>
</div>
<!-- TAB 3: CARGA MANUAL DE DINERO -->
<div id="adminTabContentRecarga" class="admin-card" style="display: none; max-width: 550px; margin: 0 auto;">
<!-- TAB 3: CARGA MANUAL DE DINERO Y APROBACIÓN SINPE -->
<div id="adminTabContentRecarga" class="admin-card" style="display: none; max-width: 820px; margin: 0 auto;">
<!-- SECCIÓN 1: SOLICITUDES SINPE PENDIENTES DE APROBACIÓN -->
<div id="adminSinpeRequestsBox" style="margin-bottom: 24px; background: #ffffff; border: 1.5px solid #86efac; border-radius: 16px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08);">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px;">
<div style="display: flex; align-items: center; gap: 10px;">
<div style="width: 40px; height: 40px; border-radius: 12px; background: #ecfdf5; color: #10b981; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; border: 1.5px solid #a7f3d0; flex-shrink: 0;">
📱
</div>
<div>
<h4 style="margin: 0; font-size: 1.05rem; font-weight: 900; color: #0f172a; display: flex; align-items: center; gap: 8px;">
<span>Aprobar Recargas SINPE Móvil</span>
<span id="adminSinpeCountBadge" style="background: #10b981; color: white; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 12px; display: none;">0</span>
</h4>
<p style="margin: 2px 0 0 0; font-size: 0.78rem; color: #64748b;">
Verifica las transferencias reportadas por los padres y acredita el saldo al instante.
</p>
</div>
</div>
<button type="button" onclick="loadAdminSinpeRequests()" class="btn-saas btn-saas-outline" style="height: 32px; padding: 0 12px; font-size: 0.78rem; font-weight: 700;">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: inline-block; vertical-align: middle; margin-right: 4px;"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M3 21v-5h5"/></svg>
<span>Refrescar</span>
</button>
</div>
<div id="adminSinpeRequestsList" style="display: flex; flex-direction: column; gap: 12px;">
<!-- Solicitudes SINPE pendientes cargadas dinámicamente -->
</div>
</div>
<!-- SEPARADOR CON RECARGA EN EFECTIVO -->
<div style="text-align: center; margin: 26px 0 20px 0; position: relative;">
<hr style="border: none; border-top: 1px solid #e2e8f0; margin: 0;">
<span style="position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--card-bg, #ffffff); padding: 0 14px; font-size: 0.78rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px;">O Recarga Manual en Efectivo</span>
</div>
<div style="text-align: center; margin-bottom: 18px;">
<div style="width: 48px; height: 48px; border-radius: 12px; background: rgba(2, 132, 199, 0.1); color: #0284c7; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px;">
<svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="14" x="2" y="5" rx="2"/><line x1="2" x2="22" y1="10" y2="10"/></svg>
+204
View File
@@ -2148,6 +2148,9 @@ function initStudentSSE() {
sse.addEventListener('solicitud_sinpe_procesada', (e) => {
try {
if (currentUser && ['admin', 'cajero', 'personal', 'dev', 'soda'].includes(currentUser.rol)) {
loadAdminSinpeRequests();
}
if (currentUser && currentUser.rol === 'padre') {
if (currentParentChild) {
loadParentSinpeRequests(currentParentChild.id);
@@ -2241,6 +2244,9 @@ function initStudentSSE() {
tag: `sinpe-${sol.id || Date.now()}`,
data: { url: '/pos.html?tab=sinpe' }
});
// 3. Refrescar solicitudes en panel admin si está abierto
loadAdminSinpeRequests();
}
if (currentUser && currentUser.rol === 'padre') {
@@ -3730,6 +3736,7 @@ function switchAdminTab(tabName) {
} else if (tabName === 'personal') {
loadAdminStaff();
} else if (tabName === 'recarga') {
loadAdminSinpeRequests();
if (!adminSelectedStudent) {
clearAdminSelectedStudent();
}
@@ -3769,6 +3776,9 @@ async function loadAdminData() {
categories = dataCat.categorias;
}
}
// 5. Cargar solicitudes SINPE pendientes para badge y sección
loadAdminSinpeRequests();
} catch (err) {
console.error('Error cargando datos de administración:', err);
}
@@ -4732,6 +4742,200 @@ async function submitAdminManualRecharge() {
}
}
// ==========================================
// APROBACIÓN MANUAL DE RECARGAS SINPE EN PANEL ADMIN
// ==========================================
async function loadAdminSinpeRequests() {
const list = document.getElementById('adminSinpeRequestsList');
const tabBadge = document.getElementById('badgeAdminTabSinpeCount');
const countBadge = document.getElementById('adminSinpeCountBadge');
if (!list) return;
try {
let url = '/api/sinpe/solicitudes?estado=pendiente';
if (currentUser && currentUser.escuela_id) {
url += `&escuela_id=${currentUser.escuela_id}`;
}
const res = await fetch(url);
const data = await res.json();
if (!res.ok) throw new Error(data.error);
const solicitudes = data.solicitudes || [];
if (tabBadge) {
if (solicitudes.length > 0) {
tabBadge.textContent = solicitudes.length;
tabBadge.style.display = 'inline-block';
} else {
tabBadge.style.display = 'none';
}
}
if (countBadge) {
if (solicitudes.length > 0) {
countBadge.textContent = solicitudes.length;
countBadge.style.display = 'inline-block';
} else {
countBadge.style.display = 'none';
}
}
if (solicitudes.length === 0) {
list.innerHTML = `
<div style="background: #f8fafc; border: 1.5px dashed #cbd5e1; border-radius: 14px; padding: 36px 20px; text-align: center; color: #64748b;">
<div style="font-size: 2.2rem; margin-bottom: 6px;">✨</div>
<strong style="color: #0f172a; font-size: 1rem; display: block; margin-bottom: 2px;">No hay recargas SINPE pendientes</strong>
<p style="font-size: 0.82rem; margin: 0; color: #94a3b8;">Todas las recargas reportadas por los padres han sido procesadas.</p>
</div>
`;
return;
}
list.innerHTML = solicitudes.map(s => {
const fecha = new Date(s.creado_en).toLocaleString('es-CR', {
day: '2-digit',
month: 'short',
hour: '2-digit',
minute: '2-digit'
});
return `
<div class="sinpe-admin-card" style="background: #ffffff; border: 1.5px solid #86efac; border-radius: 16px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08); display: flex; flex-direction: column; gap: 12px; width: 100%; box-sizing: border-box;">
<!-- FILA 1: ESTUDIANTE Y MONTO -->
<div style="display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; flex-wrap: wrap;">
<div style="display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;">
<div style="width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #0284c7, #0369a1); color: #ffffff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; border: 1.5px solid #bae6fd; flex-shrink: 0; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);">
${getStudentInitials(s.estudiante_nombre)}
</div>
<div style="min-width: 0; flex: 1;">
<div style="font-weight: 900; font-size: 1.05rem; color: #0f172a; line-height: 1.25; word-break: normal;">
${escapeHtml(s.estudiante_nombre)}
</div>
<div style="font-size: 0.78rem; color: #64748b; margin-top: 2px; font-weight: 600;">
${escapeHtml(s.estudiante_grado || 'Estudiante')} ${s.estudiante_seccion ? '• Sección ' + escapeHtml(s.estudiante_seccion) : ''}
</div>
</div>
</div>
<div style="text-align: right; flex-shrink: 0;">
<div style="font-size: 1.35rem; font-weight: 900; color: #16a34a; letter-spacing: -0.5px; line-height: 1;">
+₡${s.monto_colones.toLocaleString('es-CR')}
</div>
<div style="display: inline-block; font-size: 0.70rem; font-weight: 800; color: #b45309; background: #fef3c7; border: 1px solid #fde68a; padding: 2px 8px; border-radius: 6px; margin-top: 4px;">
⏳ Por Verificar
</div>
</div>
</div>
<!-- FILA 2: DATOS DEL COMPROBANTE Y DETALLE EN CAJA HORIZONTAL -->
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.82rem;">
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Código:</span>
<span style="font-family: monospace; font-size: 0.95rem; font-weight: 900; color: #16a34a; background: #dcfce7; padding: 2px 8px; border-radius: 6px; border: 1px solid #bbf7d0;">
${escapeHtml(s.codigo_detalle || '-')}
</span>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Comprobante:</span>
<span style="font-family: monospace; font-size: 0.88rem; font-weight: 800; color: #0369a1; background: #e0f2fe; padding: 2px 8px; border-radius: 6px; border: 1px solid #bae6fd;">
#${escapeHtml(s.comprobante_sinpe || '-')}
</span>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Reportado:</span>
<span style="color: #334155; font-weight: 700;">${fecha}</span>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Saldo Actual:</span>
<span style="color: #334155; font-weight: 800;">₡${(s.estudiante_saldo || 0).toLocaleString('es-CR')}</span>
</div>
</div>
${s.notas ? `
<div style="font-size: 0.75rem; color: #475569; background: #ffffff; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 6px 12px; display: flex; align-items: center; gap: 6px;">
<span>💬</span>
<span><strong>Detalle:</strong> ${escapeHtml(s.notas)}</span>
</div>
` : ''}
<!-- FILA 3: BOTONES DE ACCIÓN (RECHAZAR / APROBAR) -->
<div style="display: flex; gap: 10px; align-items: center; width: 100%; border-top: 1px solid #f1f5f9; padding-top: 10px; box-sizing: border-box;">
<button type="button" onclick="procesarSinpeAdmin(${s.id}, 'rechazar')" style="padding: 10px 16px; background: #fff1f2; color: #e11d48; border: 1.5px solid #fecdd3; border-radius: 10px; font-weight: 800; font-size: 0.84rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: all 0.15s;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
<span>Rechazar</span>
</button>
<button type="button" onclick="procesarSinpeAdmin(${s.id}, 'aprobar')" style="flex: 1; padding: 11px 18px; background: linear-gradient(135deg, #16a34a, #15803d); color: white; border: none; border-radius: 10px; font-weight: 900; font-size: 0.90rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25); white-space: nowrap; transition: all 0.15s;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
<span>Aprobar y Acreditar (+₡${s.monto_colones.toLocaleString('es-CR')})</span>
</button>
</div>
</div>
`;
}).join('');
} catch (err) {
console.error('Error cargando solicitudes SINPE en panel admin:', err);
}
}
async function procesarSinpeAdmin(solicitudId, accion) {
if (accion === 'aprobar') {
const ok = confirm('¿Confirmas que verificaste el comprobante y el dinero ya ingresó a la cuenta bancaria de la soda?');
if (!ok) return;
try {
const res = await fetch('/api/sinpe/procesar', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
solicitud_id: solicitudId,
accion: 'aprobar',
usuario_id: currentUser ? currentUser.id : null
})
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);
if (window.sounds) window.sounds.playCoin();
alert(`¡Recarga Aprobada!\nSe acreditaron ₡${data.resultado.monto.toLocaleString('es-CR')} al estudiante ${data.resultado.estudiante_nombre}.\nNuevo saldo: ₡${data.resultado.saldo_nuevo.toLocaleString('es-CR')}.`);
loadAdminSinpeRequests();
await loadAdminData();
} catch (err) {
if (window.sounds) window.sounds.playError();
alert(`Error al aprobar recarga: ${err.message}`);
}
} else if (accion === 'rechazar') {
const motivo = prompt('Motivo del rechazo de la recarga:', 'Comprobante no coincide o fondos no recibidos');
if (motivo === null) return;
try {
const res = await fetch('/api/sinpe/procesar', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
solicitud_id: solicitudId,
accion: 'rechazar',
motivo: motivo || 'Rechazado por la soda',
usuario_id: currentUser ? currentUser.id : null
})
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);
alert('La solicitud de recarga ha sido rechazada.');
loadAdminSinpeRequests();
await loadAdminData();
} catch (err) {
alert(`Error al rechazar recarga: ${err.message}`);
}
}
}
// ==========================================
// HISTORIAL DE MOVIMIENTOS Y REVERSIONES (ADMIN / CAJERO)
// ==========================================
+54 -18
View File
@@ -1738,41 +1738,77 @@ async function loadSinpeRequests() {
});
return `
<div style="background: #ffffff; border: 1.5px solid #86efac; border-radius: 16px; padding: 14px; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08); display: flex; flex-direction: column; gap: 12px; width: 100%; box-sizing: border-box;">
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box;">
<div style="display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;">
<div style="width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #0284c7, #0369a1); color: #ffffff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem; border: 1.5px solid #bae6fd; flex-shrink: 0; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);">
<div class="sinpe-admin-card" style="background: #ffffff; border: 1.5px solid #86efac; border-radius: 16px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08); display: flex; flex-direction: column; gap: 12px; width: 100%; box-sizing: border-box;">
<!-- FILA 1: ESTUDIANTE Y MONTO -->
<div style="display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; flex-wrap: wrap;">
<div style="display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;">
<div style="width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #0284c7, #0369a1); color: #ffffff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; border: 1.5px solid #bae6fd; flex-shrink: 0; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);">
${getStudentInitials(s.estudiante_nombre)}
</div>
<div style="min-width: 0; flex: 1;">
<div style="font-weight: 800; font-size: 0.95rem; color: #0f172a; word-break: break-word;">${s.estudiante_nombre}</div>
<div style="font-size: 0.74rem; color: #64748b; margin-top: 1px;">
${s.estudiante_grado || ''} ${s.estudiante_seccion ? '• Sec. ' + s.estudiante_seccion : ''}
<div style="font-weight: 900; font-size: 1.05rem; color: #0f172a; line-height: 1.25; word-break: normal;">
${s.estudiante_nombre}
</div>
<div style="font-size: 0.70rem; color: #94a3b8; margin-top: 2px;">
Reportado: ${fecha}
<div style="font-size: 0.78rem; color: #64748b; margin-top: 2px; font-weight: 600;">
${s.estudiante_grado || 'Estudiante'} ${s.estudiante_seccion ? '• Sección ' + s.estudiante_seccion : ''}
</div>
</div>
</div>
<div style="text-align: right; flex-shrink: 0;">
<div style="font-size: 1.25rem; font-weight: 900; color: #16a34a; letter-spacing: -0.5px;">
<div style="font-size: 1.35rem; font-weight: 900; color: #16a34a; letter-spacing: -0.5px; line-height: 1;">
+₡${s.monto_colones.toLocaleString('es-CR')}
</div>
<div style="font-size: 0.74rem; font-weight: 800; color: #1e293b; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 2px 7px; border-radius: 6px; margin-top: 2px;">
Comp: <strong style="font-family: monospace; color: #0284c7;">#${s.comprobante_sinpe}</strong>
<div style="display: inline-block; font-size: 0.70rem; font-weight: 800; color: #b45309; background: #fef3c7; border: 1px solid #fde68a; padding: 2px 8px; border-radius: 6px; margin-top: 4px;">
⏳ Por Verificar
</div>
</div>
</div>
<div style="display: flex; gap: 8px; align-items: center; width: 100%; border-top: 1px solid #f1f5f9; padding-top: 10px;">
<button onclick="procesarSinpePos(${s.id}, 'rechazar')" style="flex: 1; max-width: 120px; padding: 10px 10px; background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; border-radius: 10px; font-weight: 800; font-size: 0.82rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
<!-- FILA 2: DATOS DEL COMPROBANTE Y DETALLE EN CAJA HORIZONTAL -->
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.82rem;">
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Código:</span>
<span style="font-family: monospace; font-size: 0.95rem; font-weight: 900; color: #16a34a; background: #dcfce7; padding: 2px 8px; border-radius: 6px; border: 1px solid #bbf7d0;">
${s.codigo_detalle || '-'}
</span>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Comprobante:</span>
<span style="font-family: monospace; font-size: 0.88rem; font-weight: 800; color: #0369a1; background: #e0f2fe; padding: 2px 8px; border-radius: 6px; border: 1px solid #bae6fd;">
#${s.comprobante_sinpe || '-'}
</span>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Reportado:</span>
<span style="color: #334155; font-weight: 700;">${fecha}</span>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<span style="color: #64748b; font-weight: 700; font-size: 0.75rem; text-transform: uppercase;">Saldo Actual:</span>
<span style="color: #334155; font-weight: 800;">₡${(s.estudiante_saldo || 0).toLocaleString('es-CR')}</span>
</div>
</div>
${s.notas ? `
<div style="font-size: 0.75rem; color: #475569; background: #ffffff; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 6px 12px; display: flex; align-items: center; gap: 6px;">
<span>💬</span>
<span><strong>Detalle:</strong> ${s.notas}</span>
</div>
` : ''}
<!-- FILA 3: BOTONES DE ACCIÓN (RECHAZAR / APROBAR) -->
<div style="display: flex; gap: 10px; align-items: center; width: 100%; border-top: 1px solid #f1f5f9; padding-top: 10px; box-sizing: border-box;">
<button type="button" onclick="procesarSinpePos(${s.id}, 'rechazar')" style="padding: 10px 16px; background: #fff1f2; color: #e11d48; border: 1.5px solid #fecdd3; border-radius: 10px; font-weight: 800; font-size: 0.84rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: all 0.15s;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
<span>Rechazar</span>
</button>
<button onclick="procesarSinpePos(${s.id}, 'aprobar')" style="flex: 2; padding: 10px 16px; background: linear-gradient(135deg, #16a34a, #15803d); color: white; border: none; border-radius: 10px; font-weight: 800; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
<span>Aprobar y Acreditar</span>
<button type="button" onclick="procesarSinpePos(${s.id}, 'aprobar')" style="flex: 1; padding: 11px 18px; background: linear-gradient(135deg, #16a34a, #15803d); color: white; border: none; border-radius: 10px; font-weight: 900; font-size: 0.90rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25); white-space: nowrap; transition: all 0.15s;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
<span>Aprobar y Acreditar (+₡${s.monto_colones.toLocaleString('es-CR')})</span>
</button>
</div>
</div>