Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56492e1d18 | ||
|
|
ce37f50de2 | ||
|
|
60e75acd9b |
+97
-57
@@ -3264,14 +3264,14 @@ body.dark-mode .carousel-nav-btn {
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
DEVELOPER MASTER SUITE (#viewDeveloper)
|
||||
DEVELOPER MASTER SUITE (#viewDeveloper) - TEMA SIBOPAY LIMPIO
|
||||
========================================================================== */
|
||||
.dev-container {
|
||||
max-width: 980px;
|
||||
max-width: 1040px;
|
||||
margin: 0 auto;
|
||||
min-height: 100vh;
|
||||
background: var(--bg-main, #f8fafc);
|
||||
padding: calc(16px + var(--safe-top)) 16px calc(60px + var(--safe-bottom)) 16px;
|
||||
padding: calc(18px + var(--safe-top)) 18px calc(60px + var(--safe-bottom)) 18px;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -3281,29 +3281,30 @@ body.dark-mode .carousel-nav-btn {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: var(--card-bg, #ffffff);
|
||||
border: 1.5px solid #8b5cf6;
|
||||
border: 1px solid var(--border, #e2e8f0);
|
||||
border-radius: 18px;
|
||||
padding: 14px 18px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 4px 20px -2px rgba(139, 92, 246, 0.15);
|
||||
padding: 16px 20px;
|
||||
margin-bottom: 22px;
|
||||
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
|
||||
.dev-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.dev-icon {
|
||||
font-size: 2rem;
|
||||
background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(16, 185, 129, 0.2));
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
font-size: 1.4rem;
|
||||
background: #f0f9ff;
|
||||
color: #0284c7;
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 14px;
|
||||
border: 1px solid rgba(139, 92, 246, 0.4);
|
||||
border-radius: 12px;
|
||||
border: 1px solid #bae6fd;
|
||||
}
|
||||
|
||||
.dev-header-actions {
|
||||
@@ -3317,63 +3318,101 @@ body.dark-mode .carousel-nav-btn {
|
||||
padding: 8px 14px;
|
||||
border-radius: 10px;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 800;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--card-bg);
|
||||
color: var(--text-main);
|
||||
font-weight: 700;
|
||||
border: 1.5px solid var(--border, #e2e8f0);
|
||||
background: var(--card-bg, #ffffff);
|
||||
color: #334155;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.dev-action-btn:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: #8b5cf6;
|
||||
border-color: #0284c7;
|
||||
color: #0284c7;
|
||||
background: #f8fafc;
|
||||
box-shadow: 0 3px 8px rgba(2, 132, 199, 0.12);
|
||||
}
|
||||
|
||||
.dev-action-btn.active {
|
||||
background: #0284c7;
|
||||
color: #ffffff;
|
||||
border-color: #0284c7;
|
||||
}
|
||||
|
||||
.dev-action-btn-primary {
|
||||
background: linear-gradient(135deg, #8b5cf6, #7c3aed);
|
||||
color: white;
|
||||
border-color: #7c3aed;
|
||||
background: #0284c7;
|
||||
color: #ffffff;
|
||||
border: 1.5px solid #0284c7;
|
||||
box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
|
||||
}
|
||||
|
||||
.dev-action-btn-primary:hover {
|
||||
background: #0369a1;
|
||||
border-color: #0369a1;
|
||||
color: #ffffff;
|
||||
box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
|
||||
}
|
||||
|
||||
.dev-action-btn-danger {
|
||||
background: var(--card-bg, #ffffff);
|
||||
color: #ef4444;
|
||||
border: 1.5px solid #fecaca;
|
||||
}
|
||||
|
||||
.dev-action-btn-danger:hover {
|
||||
background: #fef2f2;
|
||||
border-color: #f87171;
|
||||
color: #dc2626;
|
||||
box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
|
||||
}
|
||||
|
||||
.dev-tabs-nav {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
overflow-x: auto;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 22px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.dev-tab-btn {
|
||||
padding: 10px 18px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.88rem;
|
||||
font-weight: 800;
|
||||
border: 1.5px solid var(--border);
|
||||
background: var(--card-bg);
|
||||
color: var(--text-muted);
|
||||
font-size: 0.86rem;
|
||||
font-weight: 700;
|
||||
border: 1.5px solid var(--border, #e2e8f0);
|
||||
background: var(--card-bg, #ffffff);
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
transition: all 0.2s;
|
||||
transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.dev-tab-btn:hover {
|
||||
color: #0284c7;
|
||||
border-color: #cbd5e1;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.dev-tab-btn.active {
|
||||
background: #8b5cf6;
|
||||
color: white;
|
||||
border-color: #7c3aed;
|
||||
box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
|
||||
background: #0284c7;
|
||||
color: #ffffff;
|
||||
border-color: #0284c7;
|
||||
box-shadow: 0 3px 12px rgba(2, 132, 199, 0.25);
|
||||
}
|
||||
|
||||
.dev-card-uploader-box {
|
||||
background: var(--card-bg);
|
||||
border: 2px dashed #8b5cf6;
|
||||
background: #f8fafc;
|
||||
border: 2px dashed #cbd5e1;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
@@ -3383,55 +3422,56 @@ body.dark-mode .carousel-nav-btn {
|
||||
}
|
||||
|
||||
.dev-card-uploader-box:hover {
|
||||
background: rgba(139, 92, 246, 0.05);
|
||||
border-color: #7c3aed;
|
||||
background: #f0f9ff;
|
||||
border-color: #0284c7;
|
||||
}
|
||||
|
||||
.dev-role-badge {
|
||||
font-size: 0.72rem;
|
||||
font-weight: 800;
|
||||
font-weight: 700;
|
||||
padding: 3px 8px;
|
||||
border-radius: 6px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
|
||||
.role-developer {
|
||||
background: #fdf2f8;
|
||||
color: #db2777;
|
||||
border: 1px solid #f472b6;
|
||||
background: #f0f9ff;
|
||||
color: #0284c7;
|
||||
border: 1px solid #bae6fd;
|
||||
}
|
||||
|
||||
.role-admin {
|
||||
background: #f5f3ff;
|
||||
color: #7c3aed;
|
||||
border: 1px solid #c4b5fd;
|
||||
background: #f8fafc;
|
||||
color: #1e293b;
|
||||
border: 1px solid #cbd5e1;
|
||||
}
|
||||
|
||||
.role-cajero {
|
||||
background: #e0f2fe;
|
||||
color: #0284c7;
|
||||
border: 1px solid #7dd3fc;
|
||||
background: #f0fdf4;
|
||||
color: #166534;
|
||||
border: 1px solid #bbf7d0;
|
||||
}
|
||||
|
||||
.role-vendedor {
|
||||
background: #fef3c7;
|
||||
color: #d97706;
|
||||
border: 1px solid #fcd34d;
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.role-padre {
|
||||
background: #dcfce7;
|
||||
color: #166534;
|
||||
border: 1px solid #86efac;
|
||||
background: #f0f9ff;
|
||||
color: #0369a1;
|
||||
border: 1px solid #bae6fd;
|
||||
}
|
||||
|
||||
.role-estudiante {
|
||||
background: #f3f4f6;
|
||||
color: #4b5563;
|
||||
border: 1px solid #d1d5db;
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
/* Soporte de contraste dinámico para fondos de tarjetas en vivo */
|
||||
|
||||
+25
-21
@@ -157,9 +157,9 @@
|
||||
<div class="login-demo-box">
|
||||
<div class="login-demo-title">Accesos Rápidos de Prueba:</div>
|
||||
<div class="login-demo-btns">
|
||||
<button type="button" class="login-demo-btn" onclick="quickFillLogin('dev', 'dev123')" style="border: 1.5px solid #8b5cf6; background: rgba(139, 92, 246, 0.08);">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
|
||||
<span style="color: #8b5cf6; font-weight: 800;">Developer</span>
|
||||
<button type="button" class="login-demo-btn" onclick="quickFillLogin('dev', 'dev123')" style="border: 1.5px solid #0284c7; background: #f0f9ff;">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#0284c7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
|
||||
<span style="color: #0284c7; font-weight: 800;">Developer</span>
|
||||
</button>
|
||||
<button type="button" class="login-demo-btn" onclick="quickFillLogin('admin', 'admin123')">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
|
||||
@@ -183,7 +183,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div style="text-align: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid #f1f5f9;">
|
||||
<a href="/desktop-preview.html" style="display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 800; color: #0284c7; text-decoration: none; padding: 6px 14px; border-radius: 9999px; background: #e0f2fe; transition: all 0.2s;">
|
||||
<a href="/" style="display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 800; color: #0284c7; text-decoration: none; padding: 6px 14px; border-radius: 9999px; background: #e0f2fe; transition: all 0.2s;">
|
||||
<span>🌐 Ver Presentación Web de SiboPay ↗</span>
|
||||
</a>
|
||||
<p style="font-size: 0.72rem; color: #64748b; margin-top: 14px; line-height: 1.45;">
|
||||
@@ -208,9 +208,9 @@
|
||||
<div>
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<h2 style="font-size: 1.18rem; font-weight: 900; margin: 0; color: var(--text-main);">Developer Master Suite</h2>
|
||||
<span style="background: #fdf2f8; color: #db2777; border: 1px solid #f472b6; font-size: 0.68rem; font-weight: 800; padding: 2px 7px; border-radius: 6px;">ROOT MASTER</span>
|
||||
<span style="background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; font-size: 0.68rem; font-weight: 800; padding: 2px 8px; border-radius: 6px;">ROOT MASTER</span>
|
||||
</div>
|
||||
<span id="devLoggedName" style="font-size: 0.78rem; color: #8b5cf6; font-weight: 700;">Master Developer (dev)</span>
|
||||
<span id="devLoggedName" style="font-size: 0.78rem; color: #64748b; font-weight: 700;">Master Developer (dev)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
<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>App Alumno</span>
|
||||
</button>
|
||||
<button onclick="logout(true)" class="dev-action-btn" style="color: #ef4444; border-color: rgba(239, 68, 68, 0.3); display: inline-flex; align-items: center; gap: 6px;" title="Cerrar Sesión">
|
||||
<button onclick="logout(true)" class="dev-action-btn dev-action-btn-danger" style="display: inline-flex; align-items: center; gap: 6px;" title="Cerrar Sesión">
|
||||
<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="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/></svg>
|
||||
<span>Salir</span>
|
||||
</button>
|
||||
@@ -318,7 +318,7 @@
|
||||
</h3>
|
||||
<p style="font-size: 0.84rem; color: var(--text-muted); margin: 3px 0 0;">Sube una imagen personalizada. Quedará disponible inmediatamente para que los estudiantes la elijan.</p>
|
||||
</div>
|
||||
<span style="font-size: 0.78rem; font-weight: 800; background: rgba(139, 92, 246, 0.15); color: #8b5cf6; padding: 4px 10px; border-radius: 8px;">Recomendado: 1200x756 (3:2)</span>
|
||||
<span style="font-size: 0.78rem; font-weight: 800; background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; padding: 4px 10px; border-radius: 8px;">Recomendado: 1200x756 (3:2)</span>
|
||||
</div>
|
||||
|
||||
<form id="formDevCardDesign" onsubmit="saveDevCardDesign(event)" style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||
@@ -388,7 +388,7 @@
|
||||
<div class="card-emv-chip" style="width: 34px; height: 25px; margin: 0;">
|
||||
<div class="chip-inner-circuit"></div>
|
||||
</div>
|
||||
<span id="devLiveCardBrand" style="font-weight: 900; font-size: 0.85rem; letter-spacing: 0.5px; text-transform: uppercase; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.8);">⚡ SIBOPAY</span>
|
||||
<span id="devLiveCardBrand" style="font-weight: 900; font-size: 0.85rem; letter-spacing: 0.5px; text-transform: uppercase; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.8); display: inline-flex; align-items: center; gap: 5px;"><span style="color: #38bdf8; font-size: 0.65rem;">●</span> SIBOPAY</span>
|
||||
</div>
|
||||
<div style="margin-top: auto; margin-bottom: 6px;">
|
||||
<div id="devLiveCardName" style="font-size: 1.05rem; font-weight: 900; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.9);">MATEO ALVARADO CASTRO</div>
|
||||
@@ -482,7 +482,7 @@
|
||||
<button onclick="toggleTheme()" class="btn-saas btn-saas-outline" style="width: 34px; height: 34px; padding: 0;" title="Alternar Modo Oscuro / Modo Claro">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/></svg>
|
||||
</button>
|
||||
<button id="btnAdminDevPanel" onclick="switchAdminToDev()" class="btn-saas btn-saas-outline" style="display: none; border-color: #8b5cf6; color: #8b5cf6; height: 34px;" title="Volver al Panel Developer Master">
|
||||
<button id="btnAdminDevPanel" onclick="switchAdminToDev()" class="btn-saas btn-saas-outline" style="display: none; border-color: #0284c7; color: #0284c7; height: 34px;" title="Volver al Panel Developer Master">
|
||||
<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="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
|
||||
<span class="admin-btn-text">Panel Dev</span>
|
||||
</button>
|
||||
@@ -1231,7 +1231,7 @@
|
||||
<span>Estás en HTTP. Para activar la cámara y pagos QR, tu celular requiere HTTPS:</span>
|
||||
</span>
|
||||
<div style="margin-top: 6px;">
|
||||
<a id="linkHttpsRedirect" href="https://recreopay.gammapos.app" style="display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; background: white; color: #b45309; border-radius: 20px; font-weight: 900; text-decoration: none; font-size: 0.8rem; box-shadow: 0 2px 5px rgba(0,0,0,0.15);">
|
||||
<a id="linkHttpsRedirect" href="#" onclick="window.location.protocol = 'https:'; return false;" style="display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; background: white; color: #b45309; border-radius: 20px; font-weight: 900; text-decoration: none; font-size: 0.8rem; box-shadow: 0 2px 5px rgba(0,0,0,0.15);">
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" x2="21" y1="14" y2="3"/></svg>
|
||||
<span>Abrir en HTTPS Seguro</span>
|
||||
</a>
|
||||
@@ -2106,8 +2106,10 @@
|
||||
<div class="modal-qr-backdrop" id="modalDevUser" style="display: none;" onclick="closeModalDevUser(event)">
|
||||
<div class="modal-qr-card" onclick="event.stopPropagation()" style="max-width: 500px; text-align: left; padding: 22px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--border); padding-bottom: 12px; margin-bottom: 16px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 38px; height: 38px; border-radius: 10px; background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<h3 id="modalDevUserTitle" style="margin: 0; font-size: 1.15rem; font-weight: 900; color: var(--text-main);">Crear Nuevo Usuario</h3>
|
||||
<span style="font-size: 0.76rem; color: var(--text-muted); font-weight: 600;">Control total de cuentas y permisos</span>
|
||||
@@ -2175,11 +2177,13 @@
|
||||
<div class="modal-qr-backdrop" id="modalDevPassword" style="display: none;" onclick="closeModalDevPassword(event)">
|
||||
<div class="modal-qr-card" onclick="event.stopPropagation()" style="max-width: 420px; text-align: left; padding: 22px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--border); padding-bottom: 12px; margin-bottom: 16px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="7.5" cy="15.5" r="5.5"/><path d="m21 2-9.6 9.6"/><path d="m15.5 7.5 3 3L22 7l-3-3"/></svg>
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 38px; height: 38px; border-radius: 10px; background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="7.5" cy="15.5" r="5.5"/><path d="m21 2-9.6 9.6"/><path d="m15.5 7.5 3 3L22 7l-3-3"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin: 0; font-size: 1.15rem; font-weight: 900; color: var(--text-main);">Cambiar Contraseña</h3>
|
||||
<span id="devPwdTargetUser" style="font-size: 0.78rem; color: #8b5cf6; font-weight: 700;">Usuario</span>
|
||||
<span id="devPwdTargetUser" style="font-size: 0.78rem; color: #0284c7; font-weight: 700;">Usuario</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" onclick="closeModalDevPassword()" style="background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); padding: 4px;">✕</button>
|
||||
@@ -2210,12 +2214,12 @@
|
||||
<div class="modal-qr-card" onclick="event.stopPropagation()" style="max-width: 540px; text-align: left; padding: 24px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--border); padding-bottom: 12px; margin-bottom: 16px;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 38px; height: 38px; border-radius: 10px; background: rgba(139, 92, 246, 0.12); color: #8b5cf6; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21h18"/><path d="M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16"/><path d="M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4"/><line x1="9" y1="9" x2="9" y2="9.01"/><line x1="15" y1="9" x2="15" y2="9.01"/></svg>
|
||||
<div style="width: 38px; height: 38px; border-radius: 10px; background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21h18"/><path d="M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16"/><path d="M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4"/><line x1="9" y1="9" x2="9" y2="9.01"/><line x1="15" y1="9" x2="15" y2="9.01"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin: 0; font-size: 1.18rem; font-weight: 900; color: var(--text-main);">Alta de Nueva Sede Escolar</h3>
|
||||
<span style="font-size: 0.76rem; color: #8b5cf6; font-weight: 700;">Multi-Tenant & Soda Independiente</span>
|
||||
<span style="font-size: 0.76rem; color: #0284c7; font-weight: 700;">Multi-Tenant & Soda Independiente</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" onclick="closeModalDevEscuela()" style="background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); padding: 4px;">✕</button>
|
||||
@@ -2251,8 +2255,8 @@
|
||||
<input type="text" id="devEscuelaConcesionario" placeholder="Ej: Servicios Alimentarios Gómez S.A." style="width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg-main); color: var(--text-main); font-weight: 700; box-sizing: border-box;">
|
||||
</div>
|
||||
|
||||
<div style="background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.25); border-radius: 12px; padding: 12px; margin-bottom: 18px; font-size: 0.78rem; color: var(--text-main); line-height: 1.45;">
|
||||
⚡ <strong>Automatización Instantánea:</strong> Al registrar la sede, el sistema clonará de forma automática el menú base de productos saludables MEP y creará sus credenciales operativas (<code>cajero_codigo</code> y <code>admin_codigo</code>, clave temporal <code>123456</code>).
|
||||
<div style="background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 12px; padding: 12px; margin-bottom: 18px; font-size: 0.78rem; color: var(--text-main); line-height: 1.45;">
|
||||
<span style="display:inline-flex; align-items:center; gap:5px; color:#0284c7; font-weight:800;"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg> Automatización Instantánea:</span> Al registrar la sede, el sistema clonará de forma automática el menú base de productos saludables MEP y creará sus credenciales operativas (<code>cajero_codigo</code> y <code>admin_codigo</code>, clave temporal <code>123456</code>).
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; gap: 10px; border-top: 1.5px solid var(--border); padding-top: 14px;">
|
||||
|
||||
+162
-107
@@ -4258,15 +4258,15 @@ function renderAdminMovimientos() {
|
||||
// Determinar badge de tipo
|
||||
let tipoBadge = '';
|
||||
if (m.tipo === 'recarga_manual') {
|
||||
tipoBadge = `<span style="background: #dcfce7; color: #166534; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="6" width="20" height="12" rx="2"/><circle cx="12" cy="12" r="2"/></svg> Recarga Efectivo</span>`;
|
||||
tipoBadge = `<span style="background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="6" width="20" height="12" rx="2"/><circle cx="12" cy="12" r="2"/></svg> Recarga Efectivo</span>`;
|
||||
} else if (m.tipo === 'recarga_sinpe') {
|
||||
tipoBadge = `<span style="background: #e0f2fe; color: #0369a1; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg> Recarga SINPE</span>`;
|
||||
tipoBadge = `<span style="background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg> Recarga SINPE</span>`;
|
||||
} else if (m.tipo === 'compra_mostrador' || m.tipo === 'preorden') {
|
||||
tipoBadge = `<span style="background: #fef3c7; color: #92400e; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg> Cobro Soda</span>`;
|
||||
tipoBadge = `<span style="background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg> Cobro Soda</span>`;
|
||||
} else if (m.tipo === 'reversion_recarga') {
|
||||
tipoBadge = `<span style="background: #f3e8ff; color: #6b21a8; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"/></svg> Reversión Recarga</span>`;
|
||||
tipoBadge = `<span style="background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"/></svg> Reversión Recarga (Eliminación)</span>`;
|
||||
} else if (m.tipo === 'reembolso') {
|
||||
tipoBadge = `<span style="background: #f3e8ff; color: #6b21a8; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"/></svg> Reembolso Compra</span>`;
|
||||
tipoBadge = `<span style="background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11"/></svg> Reembolso Compra</span>`;
|
||||
} else {
|
||||
tipoBadge = `<span style="background: #f1f5f9; color: #475569; font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px;">${m.tipo.toUpperCase()}</span>`;
|
||||
}
|
||||
@@ -4278,10 +4278,15 @@ function renderAdminMovimientos() {
|
||||
fechaHoraStr = d.toLocaleTimeString('es-CR', { hour: '2-digit', minute: '2-digit' }) + ' • ' + d.toLocaleDateString('es-CR', { day: '2-digit', month: 'short' });
|
||||
} catch (e) {}
|
||||
|
||||
// Monto formateado
|
||||
// Monto formateado: Verde al cargar (+), Rojo al cobrar o eliminar (-)
|
||||
const absMonto = Math.abs(m.monto_colones);
|
||||
const montoDisplay = isPositive ? `+₡${absMonto.toLocaleString('es-CR')}` : `-₡${absMonto.toLocaleString('es-CR')}`;
|
||||
const montoColor = isPositive ? '#16a34a' : '#d97706';
|
||||
const montoColor = isPositive ? '#16a34a' : '#dc2626';
|
||||
const montoBg = isPositive ? 'rgba(22, 163, 74, 0.08)' : 'rgba(220, 38, 38, 0.08)';
|
||||
const montoBorder = isPositive ? '#bbf7d0' : '#fecaca';
|
||||
const montoIcon = isPositive
|
||||
? '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>'
|
||||
: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><polyline points="19 12 12 19 5 12"/></svg>';
|
||||
|
||||
// Regla de 10 min para Cajero
|
||||
const minutos = parseFloat(m.minutos_transcurridos) || 0;
|
||||
@@ -4320,6 +4325,23 @@ function renderAdminMovimientos() {
|
||||
`;
|
||||
}
|
||||
|
||||
// Avatar o círculo con iniciales: SIEMPRE celeste según requerimiento
|
||||
const initials = getStudentInitials(m.estudiante_nombre);
|
||||
let avatarHtml = '';
|
||||
if (m.estudiante_foto && m.estudiante_foto.trim() !== '' && !m.estudiante_foto.includes('avatar_default.png')) {
|
||||
avatarHtml = `
|
||||
<div style="width: 44px; height: 44px; border-radius: 50%; border: 2px solid #0284c7; overflow: hidden; flex-shrink: 0; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);">
|
||||
<img src="${m.estudiante_foto}" alt="${m.estudiante_nombre}" style="width: 100%; height: 100%; object-fit: cover;" onerror="this.parentElement.outerHTML='<div style=\\\'width: 44px; height: 44px; border-radius: 50%; border: 2px solid #bae6fd; background: linear-gradient(135deg, #0284c7, #0ea5e9); color: #ffffff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2); letter-spacing: 0.5px;\\\'>${initials}</div>'">
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
avatarHtml = `
|
||||
<div style="width: 44px; height: 44px; border-radius: 50%; border: 2px solid #bae6fd; background: linear-gradient(135deg, #0284c7, #0ea5e9); color: #ffffff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2); letter-spacing: 0.5px;">
|
||||
${initials}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
return `
|
||||
<div class="admin-mov-card" style="background: ${isRevertida ? 'rgba(254, 242, 242, 0.45)' : 'var(--card-bg)'}; border: 1.5px solid ${isRevertida ? '#fecaca' : 'var(--border)'}; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; opacity: ${isRevertida ? '0.85' : '1'}; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
|
||||
@@ -4336,9 +4358,7 @@ function renderAdminMovimientos() {
|
||||
|
||||
<!-- FILA CENTRAL: ALUMNO Y DETALLES -->
|
||||
<div style="display: flex; align-items: center; gap: 12px; min-width: 0;">
|
||||
<div style="width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid ${isPositive ? '#10b981' : '#0284c7'}; background: ${isPositive ? 'linear-gradient(135deg, #10b981, #059669)' : 'linear-gradient(135deg, #0284c7, #0369a1)'}; color: #ffffff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(0,0,0,0.08);">
|
||||
${getStudentInitials(m.estudiante_nombre)}
|
||||
</div>
|
||||
${avatarHtml}
|
||||
<div style="min-width: 0; flex: 1;">
|
||||
<strong style="font-size: 0.98rem; color: var(--text-main); font-weight: 900; line-height: 1.25; display: block; word-break: normal; white-space: normal;">
|
||||
${m.estudiante_nombre}
|
||||
@@ -4358,12 +4378,14 @@ function renderAdminMovimientos() {
|
||||
|
||||
<!-- FILA INFERIOR: MONTO, SALDO POSTERIOR Y BOTÓN DE ACCIÓN -->
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(148, 163, 184, 0.07); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; flex-wrap: wrap;">
|
||||
<div style="display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;">
|
||||
<span style="font-size: 1.15rem; font-weight: 900; color: ${montoColor}; line-height: 1.1;">
|
||||
${montoDisplay}
|
||||
</span>
|
||||
<span style="font-size: 0.72rem; color: var(--text-muted); font-weight: 700;">
|
||||
Saldo posterior: <strong style="color: var(--text-main);">₡${(m.saldo_posterior || 0).toLocaleString('es-CR')}</strong>
|
||||
<div style="display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;">
|
||||
<div style="display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; background: ${montoBg}; border: 1px solid ${montoBorder};">
|
||||
<span style="font-size: 1.15rem; font-weight: 900; color: ${montoColor}; line-height: 1; display: inline-flex; align-items: center; gap: 3px; ${isRevertida ? 'text-decoration: line-through; opacity: 0.6;' : ''}">
|
||||
${montoIcon} ${montoDisplay}
|
||||
</span>
|
||||
</div>
|
||||
<span style="font-size: 0.74rem; color: var(--text-muted); font-weight: 700;">
|
||||
Saldo posterior: <strong style="color: var(--text-main); font-weight: 800;">₡${(m.saldo_posterior || 0).toLocaleString('es-CR')}</strong>
|
||||
</span>
|
||||
</div>
|
||||
<div style="flex-shrink: 0;">
|
||||
@@ -5256,23 +5278,23 @@ function renderDevUserStats(users) {
|
||||
});
|
||||
|
||||
strip.innerHTML = `
|
||||
<div style="background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;">
|
||||
Total: <span style="color: #0284c7;">${counts.total}</span>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; padding: 7px 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
Total: <span style="color: #0284c7; font-weight: 800;">${counts.total}</span>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;">
|
||||
Admins: <span style="color: #3b82f6;">${counts.admin}</span>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; padding: 7px 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
Admins: <span style="color: #0f172a; font-weight: 800;">${counts.admin}</span>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;">
|
||||
Devs: <span style="color: #8b5cf6;">${counts.developer}</span>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; padding: 7px 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
Devs: <span style="color: #0284c7; font-weight: 800;">${counts.developer}</span>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;">
|
||||
Cajeros: <span style="color: #10b981;">${counts.cajero}</span>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; padding: 7px 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
Cajeros: <span style="color: #475569; font-weight: 800;">${counts.cajero}</span>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;">
|
||||
Padres: <span style="color: #f59e0b;">${counts.padre}</span>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; padding: 7px 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
Padres: <span style="color: #0284c7; font-weight: 800;">${counts.padre}</span>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;">
|
||||
Estudiantes: <span style="color: #ec4899;">${counts.estudiante}</span>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; padding: 7px 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
Estudiantes: <span style="color: #64748b; font-weight: 800;">${counts.estudiante}</span>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -5306,7 +5328,7 @@ function renderDevUsuarios(users) {
|
||||
|
||||
tbody.innerHTML = users.map(u => {
|
||||
let roleBadge = '';
|
||||
if (u.rol === 'developer') roleBadge = '<span class="dev-role-badge role-dev">Developer</span>';
|
||||
if (u.rol === 'developer') roleBadge = '<span class="dev-role-badge role-developer">Developer</span>';
|
||||
else if (u.rol === 'admin') roleBadge = '<span class="dev-role-badge role-admin">Admin Soda</span>';
|
||||
else if (u.rol === 'cajero') roleBadge = '<span class="dev-role-badge role-cajero">Cajero</span>';
|
||||
else if (u.rol === 'vendedor') roleBadge = '<span class="dev-role-badge role-vendedor">Vendedor</span>';
|
||||
@@ -5315,14 +5337,14 @@ function renderDevUsuarios(users) {
|
||||
else roleBadge = `<span class="dev-role-badge">${escapeHtml(u.rol)}</span>`;
|
||||
|
||||
const statusBadge = u.activo ?
|
||||
`<span style="color: #10b981; font-weight: 800; background: rgba(16, 185, 129, 0.1); padding: 3px 8px; border-radius: 6px; font-size: 0.72rem;">● Activo</span>` :
|
||||
`<span style="color: #ef4444; font-weight: 800; background: rgba(239, 68, 68, 0.1); padding: 3px 8px; border-radius: 6px; font-size: 0.72rem;">Bloqueado</span>`;
|
||||
`<span style="color: #16a34a; font-weight: 700; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 3px 8px; border-radius: 6px; font-size: 0.72rem;">● Activo</span>` :
|
||||
`<span style="color: #64748b; font-weight: 700; background: #f8fafc; border: 1px solid #e2e8f0; padding: 3px 8px; border-radius: 6px; font-size: 0.72rem;">Inactivo</span>`;
|
||||
|
||||
let extraInfo = '';
|
||||
if (u.rol === 'estudiante' && u.estudiante_codigo) {
|
||||
extraInfo = `<div style="font-size: 0.72rem; color: #0284c7; font-weight: 700;">Carné: ${escapeHtml(u.estudiante_codigo)} · ${escapeHtml(u.estudiante_grado || '')}</div>`;
|
||||
} else if (u.rol === 'padre' && u.hijos_vinculados) {
|
||||
extraInfo = `<div style="font-size: 0.72rem; color: #f59e0b; font-weight: 700;">Hijos: ${escapeHtml(u.hijos_vinculados)}</div>`;
|
||||
extraInfo = `<div style="font-size: 0.72rem; color: #64748b; font-weight: 700;">Hijos: ${escapeHtml(u.hijos_vinculados)}</div>`;
|
||||
}
|
||||
|
||||
return `
|
||||
@@ -5341,16 +5363,16 @@ function renderDevUsuarios(users) {
|
||||
<td style="padding: 10px 14px;">${statusBadge}</td>
|
||||
<td style="padding: 10px 14px; text-align: right; white-space: nowrap;">
|
||||
<div style="display: inline-flex; gap: 4px;">
|
||||
<button onclick="openModalDevUser(${u.id})" class="dev-action-btn" style="padding: 4px 8px; font-size: 0.75rem; display: inline-flex; align-items: center; gap: 4px;" title="Modificar datos del usuario">
|
||||
<button onclick="openModalDevUser(${u.id})" class="dev-action-btn" style="padding: 5px 9px; font-size: 0.75rem; display: inline-flex; align-items: center; gap: 4px;" title="Modificar datos del usuario">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg> Editar
|
||||
</button>
|
||||
<button onclick="openModalDevPassword(${u.id}, '${escapeHtml(u.username)}')" class="dev-action-btn" style="padding: 4px 8px; font-size: 0.75rem; color: #8b5cf6; display: inline-flex; align-items: center; gap: 4px;" title="Cambiar contraseña directamente">
|
||||
<button onclick="openModalDevPassword(${u.id}, '${escapeHtml(u.username)}')" class="dev-action-btn" style="padding: 5px 9px; font-size: 0.75rem; color: #0284c7; display: inline-flex; align-items: center; gap: 4px;" title="Cambiar contraseña">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="7.5" cy="15.5" r="5.5"/><path d="m21 2-9.6 9.6"/><path d="m15.5 7.5 3 3L22 7l-3-3"/></svg> Clave
|
||||
</button>
|
||||
<button onclick="toggleDevUserStatus(${u.id}, ${u.activo ? 0 : 1})" class="dev-action-btn" style="padding: 4px 8px; font-size: 0.75rem; color: ${u.activo ? '#eab308' : '#10b981'}; display: inline-flex; align-items: center; gap: 4px;" title="${u.activo ? 'Bloquear usuario' : 'Desbloquear usuario'}">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg> ${u.activo ? 'Bloquear' : 'Desbloquear'}
|
||||
<button onclick="toggleDevUserStatus(${u.id}, ${u.activo ? 0 : 1})" class="dev-action-btn" style="padding: 5px 9px; font-size: 0.75rem; color: #475569; display: inline-flex; align-items: center; gap: 4px;" title="${u.activo ? 'Desactivar usuario' : 'Activar usuario'}">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg> ${u.activo ? 'Bloquear' : 'Activar'}
|
||||
</button>
|
||||
<button onclick="deleteDevUser(${u.id}, '${escapeHtml(u.username)}')" class="dev-action-btn dev-action-btn-danger" style="padding: 4px 8px; font-size: 0.75rem; display: inline-flex; align-items: center;" title="Eliminar usuario">
|
||||
<button onclick="deleteDevUser(${u.id}, '${escapeHtml(u.username)}')" class="dev-action-btn dev-action-btn-danger" style="padding: 5px 9px; font-size: 0.75rem; display: inline-flex; align-items: center;" title="Eliminar usuario">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -5690,37 +5712,37 @@ function renderDevDisenosGrid(disenos) {
|
||||
if (d.categoria === 'masc') catLabel = 'Masculino';
|
||||
|
||||
const statusBadge = d.activo ?
|
||||
`<span style="color: #10b981; font-weight: 800; font-size: 0.72rem; background: rgba(16, 185, 129, 0.1); padding: 2px 7px; border-radius: 6px;">● Activo</span>` :
|
||||
`<span style="color: #ef4444; font-weight: 800; font-size: 0.72rem; background: rgba(239, 68, 68, 0.1); padding: 2px 7px; border-radius: 6px;">Inactivo</span>`;
|
||||
`<span style="color: #16a34a; font-weight: 700; font-size: 0.72rem; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 2px 7px; border-radius: 6px;">● Activo</span>` :
|
||||
`<span style="color: #64748b; font-weight: 700; font-size: 0.72rem; background: #f8fafc; border: 1px solid #e2e8f0; padding: 2px 7px; border-radius: 6px;">Inactivo</span>`;
|
||||
|
||||
const textColorLabel = (d.estilo_texto === 'light') ? 'Texto Oscuro' : 'Texto Blanco';
|
||||
|
||||
return `
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.06); display: flex; flex-direction: column;">
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); display: flex; flex-direction: column;">
|
||||
<div style="position: relative; aspect-ratio: 1.586; overflow: hidden; background: #0f172a;">
|
||||
<img src="${escapeHtml(d.imagen_url)}" alt="${escapeHtml(d.nombre)}" style="width: 100%; height: 100%; object-fit: cover; display: block;" onerror="this.src='/img/cards/card_robo_lab.jpg'">
|
||||
<div style="position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); color: white; font-size: 0.68rem; font-weight: 800; padding: 2px 6px; border-radius: 5px; backdrop-filter: blur(4px);">
|
||||
<div style="position: absolute; top: 8px; left: 8px; background: rgba(15, 23, 42, 0.75); color: white; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; backdrop-filter: blur(4px);">
|
||||
${catLabel}
|
||||
</div>
|
||||
<div style="position: absolute; top: 8px; right: 8px;">
|
||||
${statusBadge}
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between;">
|
||||
<div style="padding: 14px; flex: 1; display: flex; flex-direction: column; justify-content: space-between;">
|
||||
<div>
|
||||
<div style="font-weight: 900; font-size: 0.92rem; color: var(--text-main); margin-bottom: 3px;">
|
||||
<div style="font-weight: 800; font-size: 0.92rem; color: var(--text-main); margin-bottom: 4px;">
|
||||
${escapeHtml(d.nombre)}
|
||||
</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); display: flex; gap: 8px;">
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px;">
|
||||
<span>${textColorLabel}</span>
|
||||
${d.es_predeterminado ? '<span style="color: #8b5cf6; font-weight: 800;">Predeterminado</span>' : ''}
|
||||
${d.es_predeterminado ? '<span style="color: #0284c7; font-weight: 700; background: #f0f9ff; border: 1px solid #bae6fd; padding: 1px 6px; border-radius: 4px;">Predeterminado</span>' : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px; display: flex; gap: 6px; justify-content: flex-end;">
|
||||
<button onclick="toggleDevCardStatus(${d.id}, ${d.activo ? 0 : 1})" class="dev-action-btn" style="padding: 5px 9px; font-size: 0.74rem;">
|
||||
<div style="margin-top: 12px; display: flex; gap: 6px; justify-content: flex-end;">
|
||||
<button onclick="toggleDevCardStatus(${d.id}, ${d.activo ? 0 : 1})" class="dev-action-btn" style="padding: 5px 10px; font-size: 0.75rem;">
|
||||
${d.activo ? 'Desactivar' : 'Activar'}
|
||||
</button>
|
||||
<button onclick="deleteDevCardDesign(${d.id}, '${escapeHtml(d.nombre)}')" class="dev-action-btn dev-action-btn-danger" style="padding: 5px 9px; font-size: 0.74rem; display: inline-flex; align-items: center;" title="Eliminar diseño">
|
||||
<button onclick="deleteDevCardDesign(${d.id}, '${escapeHtml(d.nombre)}')" class="dev-action-btn dev-action-btn-danger" style="padding: 5px 9px; font-size: 0.75rem; display: inline-flex; align-items: center;" title="Eliminar diseño">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -5779,35 +5801,65 @@ async function loadDevStats() {
|
||||
const uptimeStr = hrs > 0 ? `${hrs}h ${mins}m` : `${mins} min (${sec % 60}s)`;
|
||||
|
||||
container.innerHTML = `
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px;">
|
||||
<div style="font-size: 0.74rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Tiempo Activo (Uptime)</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 6px;">${uptimeStr}</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;">Node.js ${escapeHtml(s.sistema?.node_version || '')}</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;">Tiempo Activo</span>
|
||||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #f0f9ff; color: #0284c7; display: flex; align-items: center; justify-content: center;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 8px;">${uptimeStr}</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 3px;">Node.js ${escapeHtml(s.sistema?.node_version || '')}</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px;">
|
||||
<div style="font-size: 0.74rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Memoria RAM (Heap)</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #8b5cf6; margin-top: 6px;">${s.sistema?.memoria_mb || 0} MB</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;">Consumo de Proceso Node</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;">Memoria RAM</span>
|
||||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #f8fafc; color: #475569; display: flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect width="16" height="16" x="4" y="4" rx="2"/><rect width="6" height="6" x="9" y="9" rx="1"/><path d="M15 2v2"/><path d="M15 20v2"/><path d="M2 15h2"/><path d="M2 9h2"/><path d="M20 15h2"/><path d="M20 9h2"/><path d="M9 2v2"/><path d="M9 20v2"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0f172a; margin-top: 8px;">${s.sistema?.memoria_mb || 0} MB</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 3px;">Consumo de Proceso Node</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px;">
|
||||
<div style="font-size: 0.74rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Base de Datos ${escapeHtml(s.sistema?.db_tipo || 'PostgreSQL')}</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #10b981; margin-top: 6px;">${escapeHtml(s.sistema?.db_size_formatted || (s.sistema?.db_size_kb ? s.sistema.db_size_kb + ' KB' : '9.5 MB'))}</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;">${escapeHtml(s.sistema?.db_detalle || 'Conexión Estable')}</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;">Base de Datos</span>
|
||||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #f0fdf4; color: #16a34a; display: flex; align-items: center; justify-content: center; border: 1px solid #bbf7d0;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/><path d="M3 12c0 1.66 4 3 9 3s9-1.34 9-3"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0f172a; margin-top: 8px;">${escapeHtml(s.sistema?.db_size_formatted || (s.sistema?.db_size_kb ? s.sistema.db_size_kb + ' KB' : '9.5 MB'))}</div>
|
||||
<div style="font-size: 0.72rem; color: #16a34a; font-weight: 700; margin-top: 3px;">● ${escapeHtml(s.sistema?.db_tipo || 'PostgreSQL')} (Estable)</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px;">
|
||||
<div style="font-size: 0.74rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Usuarios Registrados</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #f59e0b; margin-top: 6px;">${s.usuarios?.total || 0} Cuentas</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;">${s.estudiantes?.total || 0} Alumnos vinculados</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;">Usuarios Registrados</span>
|
||||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #f0f9ff; color: #0284c7; display: flex; align-items: center; justify-content: center; border: 1px solid #bae6fd;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 8px;">${s.usuarios?.total || 0} Cuentas</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 3px;">${s.estudiantes?.total || 0} Alumnos vinculados</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px;">
|
||||
<div style="font-size: 0.74rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Diseños de Tarjetas</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #ec4899; margin-top: 6px;">${s.negocio?.disenos_tarjetas_activas || 0} Activos</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;">Disponibles para alumnos</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;">Diseños de Tarjetas</span>
|
||||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #f8fafc; color: #475569; display: flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect width="20" height="14" x="2" y="5" rx="2"/><line x1="2" x2="22" y1="10" y2="10"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0f172a; margin-top: 8px;">${s.negocio?.disenos_tarjetas_activas || 0} Activos</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 3px;">Disponibles para alumnos</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px;">
|
||||
<div style="font-size: 0.74rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Pedidos en Soda</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #06b6d4; margin-top: 6px;">${s.negocio?.ordenes_totales || 0} Órdenes</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;">${s.negocio?.transacciones_totales || 0} Transacciones totales</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 0.74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px;">Pedidos en Soda</span>
|
||||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #f0f9ff; color: #0284c7; display: flex; align-items: center; justify-content: center; border: 1px solid #bae6fd;">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"/><path d="M3 6h18"/><path d="M16 10a4 4 0 0 1-8 0"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 8px;">${s.negocio?.ordenes_totales || 0} Órdenes</div>
|
||||
<div style="font-size: 0.72rem; color: var(--text-muted); margin-top: 3px;">${s.negocio?.transacciones_totales || 0} Transacciones totales</div>
|
||||
</div>
|
||||
`;
|
||||
} catch (err) {
|
||||
@@ -5849,21 +5901,21 @@ function renderDevEscuelasSummary(escuelas) {
|
||||
const totalVentas = escuelas.reduce((sum, e) => sum + (parseFloat(e.ventas_totales) || 0), 0);
|
||||
|
||||
strip.innerHTML = `
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px;">
|
||||
<span style="font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Sedes Activas</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #8b5cf6; margin-top: 4px;">${totalSedes}</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
<span style="font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;">Sedes Activas</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 4px;">${totalSedes}</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px;">
|
||||
<span style="font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Total Estudiantes</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 4px;">${totalAlumnos}</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
<span style="font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;">Total Estudiantes</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0f172a; margin-top: 4px;">${totalAlumnos}</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px;">
|
||||
<span style="font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Platillos en Catálogos</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #10b981; margin-top: 4px;">${totalProds}</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
<span style="font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;">Platillos en Catálogos</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0284c7; margin-top: 4px;">${totalProds}</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px;">
|
||||
<span style="font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase;">Facturación Global</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #f59e0b; margin-top: 4px;">₡${totalVentas.toLocaleString('es-CR')}</div>
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; padding: 12px 16px; flex: 1; min-width: 150px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
|
||||
<span style="font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;">Facturación Global</span>
|
||||
<div style="font-size: 1.35rem; font-weight: 900; color: #0f172a; margin-top: 4px;">₡${totalVentas.toLocaleString('es-CR')}</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -5885,62 +5937,65 @@ function renderDevEscuelas(escuelas) {
|
||||
const ords = parseInt(e.total_ordenes, 10) || 0;
|
||||
|
||||
return `
|
||||
<div style="background: var(--card-bg); border: 1.5px solid ${isActivo ? 'var(--border)' : '#fca5a5'}; border-radius: 16px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); display: flex; flex-direction: column; justify-content: space-between; transition: all 0.2s;">
|
||||
<div style="background: var(--card-bg, #ffffff); border: 1.5px solid ${isActivo ? 'var(--border, #e2e8f0)' : '#fecaca'}; border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); display: flex; flex-direction: column; justify-content: space-between; transition: all 0.2s;">
|
||||
<div>
|
||||
<!-- Cabecera de la Sede -->
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 44px; height: 44px; border-radius: 12px; background: rgba(139, 92, 246, 0.12); color: #8b5cf6; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;">
|
||||
🏫
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px;">
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<div style="width: 44px; height: 44px; border-radius: 12px; background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21h18"/><path d="M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16"/><path d="M9 21v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4"/><line x1="9" y1="9" x2="9" y2="9.01"/><line x1="15" y1="9" x2="15" y2="9.01"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<h4 style="margin: 0; font-size: 1.05rem; font-weight: 900; color: var(--text-main);">${escapeHtml(e.nombre)}</h4>
|
||||
<div style="display: flex; gap: 6px; align-items: center; margin-top: 2px;">
|
||||
<span style="font-size: 0.72rem; font-weight: 900; background: #e0e7ff; color: #4338ca; padding: 2px 8px; border-radius: 6px;">CÓD: ${escapeHtml(e.codigo)}</span>
|
||||
<span style="font-size: 0.72rem; font-weight: 800; color: var(--text-muted);">ID #${e.id}</span>
|
||||
<h4 style="margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--text-main);">${escapeHtml(e.nombre)}</h4>
|
||||
<div style="display: flex; gap: 6px; align-items: center; margin-top: 3px;">
|
||||
<span style="font-size: 0.72rem; font-weight: 700; background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; padding: 2px 8px; border-radius: 6px;">CÓD: ${escapeHtml(e.codigo)}</span>
|
||||
<span style="font-size: 0.72rem; font-weight: 700; color: var(--text-muted);">ID #${e.id}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span style="font-size: 0.70rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: ${isActivo ? '#dcfce7' : '#fee2e2'}; color: ${isActivo ? '#166534' : '#dc2626'};">
|
||||
${isActivo ? '● ACTIVA' : '⏸ EN PAUSA'}
|
||||
<span style="font-size: 0.70rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: ${isActivo ? '#f0fdf4' : '#f8fafc'}; color: ${isActivo ? '#166534' : '#64748b'}; border: 1px solid ${isActivo ? '#bbf7d0' : '#e2e8f0'};">
|
||||
${isActivo ? '● ACTIVA' : 'PAUSADA'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Datos de Operación y SINPE -->
|
||||
<div style="background: var(--bg-main); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 0.8rem; line-height: 1.5;">
|
||||
<div><strong>SINPE Móvil:</strong> <span style="color: #16a34a; font-weight: 800;">${escapeHtml(e.telefono_sinpe || 'No configurado')}</span> (${escapeHtml(e.nombre_sinpe || e.nombre)})</div>
|
||||
<div style="background: var(--bg-main, #f8fafc); border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 0.8rem; line-height: 1.5;">
|
||||
<div><strong>SINPE Móvil:</strong> <span style="color: #0284c7; font-weight: 800;">${escapeHtml(e.telefono_sinpe || 'No configurado')}</span> (${escapeHtml(e.nombre_sinpe || e.nombre)})</div>
|
||||
<div style="margin-top: 3px; color: var(--text-muted);"><strong>Operador:</strong> ${escapeHtml(e.concesionario || 'Administración de la Soda')}</div>
|
||||
</div>
|
||||
|
||||
<!-- Métricas de la Sede -->
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px;">
|
||||
<div style="background: var(--bg-main); border-radius: 8px; padding: 8px 10px;">
|
||||
<div style="background: var(--bg-main, #f8fafc); border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0);">
|
||||
<span style="font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase;">Alumnos</span>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #0284c7;">${ests}</div>
|
||||
</div>
|
||||
<div style="background: var(--bg-main); border-radius: 8px; padding: 8px 10px;">
|
||||
<div style="background: var(--bg-main, #f8fafc); border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0);">
|
||||
<span style="font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase;">Catálogo</span>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #10b981;">${prods} prods</div>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #0f172a;">${prods} prods</div>
|
||||
</div>
|
||||
<div style="background: var(--bg-main); border-radius: 8px; padding: 8px 10px;">
|
||||
<div style="background: var(--bg-main, #f8fafc); border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0);">
|
||||
<span style="font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase;">Órdenes</span>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #8b5cf6;">${ords}</div>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #0284c7;">${ords}</div>
|
||||
</div>
|
||||
<div style="background: var(--bg-main); border-radius: 8px; padding: 8px 10px;">
|
||||
<div style="background: var(--bg-main, #f8fafc); border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0);">
|
||||
<span style="font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase;">Ventas Totales</span>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #f59e0b;">₡${ventas.toLocaleString('es-CR')}</div>
|
||||
<div style="font-size: 1.05rem; font-weight: 900; color: #0f172a;">₡${ventas.toLocaleString('es-CR')}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Acciones Operativas -->
|
||||
<div style="display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; justify-content: space-between; align-items: center;">
|
||||
<div style="display: flex; gap: 8px; border-top: 1px solid var(--border, #e2e8f0); padding-top: 12px; justify-content: space-between; align-items: center;">
|
||||
<button onclick="verCredencialesEscuela('${escapeHtml(e.codigo)}', '${escapeHtml(e.nombre)}')" class="dev-action-btn" style="padding: 6px 12px; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 5px;">
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg> Cuentas
|
||||
</button>
|
||||
|
||||
<button onclick="toggleDevEscuelaEstado(${e.id}, ${isActivo ? 0 : 1})" class="dev-action-btn" style="padding: 6px 12px; font-size: 0.78rem; color: ${isActivo ? '#dc2626' : '#16a34a'}; border-color: ${isActivo ? 'rgba(220,38,38,0.3)' : 'rgba(22,163,74,0.3)'};">
|
||||
${isActivo ? '⏸ Pausar Sede' : '▶ Activar Sede'}
|
||||
<button onclick="toggleDevEscuelaEstado(${e.id}, ${isActivo ? 0 : 1})" class="dev-action-btn ${isActivo ? '' : 'dev-action-btn-primary'}" style="padding: 6px 12px; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 5px;">
|
||||
${isActivo ?
|
||||
`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><rect width="4" height="16" x="6" y="4" rx="1"/><rect width="4" height="16" x="14" y="4" rx="1"/></svg> Pausar Sede` :
|
||||
`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polygon points="5 3 19 12 5 21 5 3"/></svg> Activar Sede`
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
<!-- BANNER DE ADVERTENCIA HTTPS PARA TERMINALES REMOTAS -->
|
||||
<div id="posBannerHttpsWarning" style="display: none; background: #b45309; color: white; padding: 10px 14px; font-size: 0.8rem; font-weight: 700; text-align: center;">
|
||||
🔒 Terminal en HTTP. Para activar la cámara en vivo del dispositivo, se requiere conexión HTTPS:
|
||||
<a id="posLinkHttpsRedirect" href="https://somewhat-ships-looksmart-optical.trycloudflare.com/pos.html" style="margin-left: 8px; color: white; text-decoration: underline; font-weight: 900;">
|
||||
<a id="posLinkHttpsRedirect" href="#" onclick="window.location.protocol = 'https:'; return false;" style="margin-left: 8px; color: white; text-decoration: underline; font-weight: 900;">
|
||||
🚀 Abrir en HTTPS Seguro ↗
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -84,6 +84,22 @@ initDatabase();
|
||||
app.use(cors());
|
||||
app.use(express.json({ limit: '25mb' }));
|
||||
app.use(express.urlencoded({ extended: true, limit: '25mb' }));
|
||||
|
||||
// Limpieza de URL: redirige /desktop-preview.html a la raíz limpia /
|
||||
app.get('/desktop-preview.html', (req, res) => {
|
||||
res.redirect(301, '/');
|
||||
});
|
||||
|
||||
// Página principal / Landing Page oficial de SiboPay (URL limpia)
|
||||
app.get('/', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, '../public/desktop-preview.html'));
|
||||
});
|
||||
|
||||
// Alias amigable para la app de estudiantes y padres
|
||||
app.get('/app', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, '../public/index.html'));
|
||||
});
|
||||
|
||||
app.use(express.static(path.join(__dirname, '../public'), {
|
||||
etag: false,
|
||||
setHeaders: (res, filePath) => {
|
||||
|
||||
Reference in New Issue
Block a user