style: Diseno profesional SaaS para botones, carnés y bloqueos en PC
This commit is contained in:
@@ -2818,5 +2818,235 @@ body.dark-mode .carousel-nav-btn {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
SISTEMA DE DISEÑO SAAS PROFESIONAL PARA PC (ADMINISTRACIÓN)
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/* Botón base SaaS */
|
||||||
|
.btn-saas {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 12px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
white-space: nowrap;
|
||||||
|
user-select: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-saas svg {
|
||||||
|
flex-shrink: 0;
|
||||||
|
transition: transform 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-saas:hover svg {
|
||||||
|
transform: translateY(-0.5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-saas:active {
|
||||||
|
transform: scale(0.98);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Botón Primario SaaS (Abonar / Recargar) */
|
||||||
|
.btn-saas-primary {
|
||||||
|
background: #0f172a;
|
||||||
|
color: #ffffff;
|
||||||
|
border-color: #0f172a;
|
||||||
|
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
|
||||||
|
}
|
||||||
|
.btn-saas-primary:hover {
|
||||||
|
background: #1e293b;
|
||||||
|
border-color: #1e293b;
|
||||||
|
box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
|
||||||
|
}
|
||||||
|
body.dark-mode .btn-saas-primary {
|
||||||
|
background: #0284c7;
|
||||||
|
color: #ffffff;
|
||||||
|
border-color: #0284c7;
|
||||||
|
}
|
||||||
|
body.dark-mode .btn-saas-primary:hover {
|
||||||
|
background: #0369a1;
|
||||||
|
border-color: #0369a1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Botón Contorno / Neutro SaaS (Carné QR / Documentos) */
|
||||||
|
.btn-saas-outline {
|
||||||
|
background: var(--card-bg, #ffffff);
|
||||||
|
color: var(--text-main, #334155);
|
||||||
|
border-color: var(--border, #cbd5e1);
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
.btn-saas-outline:hover {
|
||||||
|
background: var(--bg-main, #f8fafc);
|
||||||
|
border-color: #94a3b8;
|
||||||
|
color: var(--text-main, #0f172a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Botón de Alerta / Bloqueo (Acción Destructiva Suave / Warning) */
|
||||||
|
.btn-saas-danger-subtle {
|
||||||
|
background: #fef2f2;
|
||||||
|
color: #991b1b;
|
||||||
|
border-color: #fecaca;
|
||||||
|
}
|
||||||
|
.btn-saas-danger-subtle:hover {
|
||||||
|
background: #fee2e2;
|
||||||
|
border-color: #f87171;
|
||||||
|
color: #7f1d1d;
|
||||||
|
}
|
||||||
|
body.dark-mode .btn-saas-danger-subtle {
|
||||||
|
background: rgba(239, 68, 68, 0.12);
|
||||||
|
color: #fca5a5;
|
||||||
|
border-color: rgba(239, 68, 68, 0.3);
|
||||||
|
}
|
||||||
|
body.dark-mode .btn-saas-danger-subtle:hover {
|
||||||
|
background: rgba(239, 68, 68, 0.22);
|
||||||
|
border-color: rgba(239, 68, 68, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Botón de Seguridad / Desbloqueo (Success Suave) */
|
||||||
|
.btn-saas-success-subtle {
|
||||||
|
background: #f0fdf4;
|
||||||
|
color: #166534;
|
||||||
|
border-color: #bbf7d0;
|
||||||
|
}
|
||||||
|
.btn-saas-success-subtle:hover {
|
||||||
|
background: #dcfce7;
|
||||||
|
border-color: #86efac;
|
||||||
|
color: #14532d;
|
||||||
|
}
|
||||||
|
body.dark-mode .btn-saas-success-subtle {
|
||||||
|
background: rgba(16, 185, 129, 0.12);
|
||||||
|
color: #86efac;
|
||||||
|
border-color: rgba(16, 185, 129, 0.3);
|
||||||
|
}
|
||||||
|
body.dark-mode .btn-saas-success-subtle:hover {
|
||||||
|
background: rgba(16, 185, 129, 0.22);
|
||||||
|
border-color: rgba(16, 185, 129, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Badges de estado modernos con punto indicador (Status Dot) */
|
||||||
|
.saas-status-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 0.72rem;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 3px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
line-height: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.saas-dot {
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.saas-status-active {
|
||||||
|
background: #f0fdf4;
|
||||||
|
color: #166534;
|
||||||
|
border: 1px solid #bbf7d0;
|
||||||
|
}
|
||||||
|
.saas-status-active .saas-dot {
|
||||||
|
background: #16a34a;
|
||||||
|
box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
|
||||||
|
}
|
||||||
|
body.dark-mode .saas-status-active {
|
||||||
|
background: rgba(22, 163, 74, 0.15);
|
||||||
|
color: #86efac;
|
||||||
|
border-color: rgba(22, 163, 74, 0.3);
|
||||||
|
}
|
||||||
|
body.dark-mode .saas-status-active .saas-dot {
|
||||||
|
background: #4ade80;
|
||||||
|
}
|
||||||
|
|
||||||
|
.saas-status-blocked {
|
||||||
|
background: #fef2f2;
|
||||||
|
color: #991b1b;
|
||||||
|
border: 1px solid #fecaca;
|
||||||
|
}
|
||||||
|
.saas-status-blocked .saas-dot {
|
||||||
|
background: #dc2626;
|
||||||
|
box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
|
||||||
|
}
|
||||||
|
body.dark-mode .saas-status-blocked {
|
||||||
|
background: rgba(220, 38, 38, 0.15);
|
||||||
|
color: #fca5a5;
|
||||||
|
border-color: rgba(220, 38, 38, 0.3);
|
||||||
|
}
|
||||||
|
body.dark-mode .saas-status-blocked .saas-dot {
|
||||||
|
background: #f87171;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fila de Estudiante Moderna para PC */
|
||||||
|
.admin-student-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
background: var(--card-bg, #ffffff);
|
||||||
|
border: 1px solid var(--border, #e2e8f0);
|
||||||
|
border-radius: 12px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-student-row:hover {
|
||||||
|
border-color: #cbd5e1;
|
||||||
|
box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.dark-mode .admin-student-row:hover {
|
||||||
|
border-color: #475569;
|
||||||
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-student-row.is-blocked {
|
||||||
|
background: #fffafa;
|
||||||
|
border-color: #fecaca;
|
||||||
|
}
|
||||||
|
body.dark-mode .admin-student-row.is-blocked {
|
||||||
|
background: rgba(239, 68, 68, 0.05);
|
||||||
|
border-color: rgba(239, 68, 68, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-student-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* En pantallas pequeñas se adapta ordenadamente */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.admin-student-row {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
.admin-student-actions {
|
||||||
|
justify-content: flex-end;
|
||||||
|
border-top: 1px dashed var(--border, #e2e8f0);
|
||||||
|
padding-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -442,9 +442,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; gap: 8px; align-items: center; flex-wrap: wrap;">
|
<div style="display: flex; gap: 8px; align-items: center; flex-wrap: wrap;">
|
||||||
<input type="text" id="adminSearchStudentsTab2" placeholder="🔍 Filtrar alumnos..." oninput="filterAdminStudentsTab2(this.value)" style="padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--border); font-size: 0.85rem; width: 190px;">
|
<input type="text" id="adminSearchStudentsTab2" placeholder="🔍 Filtrar alumnos..." oninput="filterAdminStudentsTab2(this.value)" style="padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 0.85rem; width: 190px; background: var(--card-bg); color: var(--text-main); outline: none;">
|
||||||
<button onclick="openNewStudentModal()" style="padding: 9px 16px; background: linear-gradient(135deg, #10b981, #059669); color: white; border: none; border-radius: 12px; font-size: 0.85rem; font-weight: 900; cursor: pointer; display: flex; align-items: center; gap: 6px;">
|
<button onclick="openNewStudentModal()" class="btn-saas btn-saas-primary" style="height: 36px; padding: 0 14px; font-size: 0.84rem;">
|
||||||
<span>➕</span> Nuevo Estudiante
|
<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="M5 12h14"/><path d="M12 5v14"/></svg>
|
||||||
|
<span>Nuevo Estudiante</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+40
-21
@@ -2730,41 +2730,60 @@ function renderAdminStudents(list) {
|
|||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
if (!list || list.length === 0) {
|
if (!list || list.length === 0) {
|
||||||
container.innerHTML = `<div style="text-align: center; padding: 20px; color: var(--text-muted);">No hay estudiantes registrados.</div>`;
|
container.innerHTML = `<div style="text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 0.9rem;">No se encontraron estudiantes registrados.</div>`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<div style="display: flex; flex-direction: column; gap: 10px;">
|
<div style="display: flex; flex-direction: column; gap: 8px;">
|
||||||
${list.map(s => {
|
${list.map(s => {
|
||||||
const isBlocked = s.tarjeta_bloqueada === 1;
|
const isBlocked = s.tarjeta_bloqueada === 1;
|
||||||
return `
|
return `
|
||||||
<div class="admin-student-card" style="display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; border: 1.5px solid ${isBlocked ? '#fca5a5' : 'var(--border)'}; background: ${isBlocked ? '#fff5f5' : 'var(--card-bg)'}; width: 100%; box-sizing: border-box;">
|
<div class="admin-student-row ${isBlocked ? 'is-blocked' : ''}">
|
||||||
<div style="display: flex; align-items: center; gap: 10px; width: 100%;">
|
<!-- DATOS PRINCIPALES DEL ESTUDIANTE -->
|
||||||
<img src="${s.foto_url || 'https://api.dicebear.com/7.x/bottts/svg?seed=est'}" style="width: 44px; height: 44px; border-radius: 50%; border: 2px solid ${isBlocked ? '#ef4444' : '#0284c7'}; background: white; flex-shrink: 0;">
|
<div style="display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;">
|
||||||
<div style="flex: 1; min-width: 0; word-break: break-word;">
|
<img src="${s.foto_url || 'https://api.dicebear.com/7.x/bottts/svg?seed=est'}" style="width: 42px; height: 42px; border-radius: 50%; border: 2px solid ${isBlocked ? '#fca5a5' : 'var(--border)'}; background: #ffffff; flex-shrink: 0; object-fit: cover;">
|
||||||
<div style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap;">
|
<div style="min-width: 0; flex: 1;">
|
||||||
<strong style="font-size: 0.95rem; color: var(--text-main);">${s.nombre_completo}</strong>
|
<div style="display: flex; align-items: center; gap: 8px; flex-wrap: wrap;">
|
||||||
${isBlocked ? '<span style="font-size: 0.68rem; font-weight: 900; background: #ef4444; color: white; padding: 2px 7px; border-radius: 5px;">⛔ SUSPENDIDA</span>' : '<span style="font-size: 0.68rem; font-weight: 800; background: #dcfce7; color: #166534; padding: 2px 7px; border-radius: 5px;">ACTIVA</span>'}
|
<strong style="font-size: 0.95rem; font-weight: 800; color: var(--text-main); line-height: 1.2;">${s.nombre_completo}</strong>
|
||||||
|
${isBlocked
|
||||||
|
? '<span class="saas-status-badge saas-status-blocked"><span class="saas-dot"></span>Suspendida</span>'
|
||||||
|
: '<span class="saas-status-badge saas-status-active"><span class="saas-dot"></span>Activa</span>'
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 0.74rem; color: var(--text-muted); margin-top: 2px;">
|
<div style="display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--text-muted); margin-top: 3px; flex-wrap: wrap;">
|
||||||
${s.grado} • Sección ${s.seccion} • Cód: <strong>${s.codigo_estudiante}</strong> • PIN: <strong>${s.pin_seguridad || '1234'}</strong>
|
<span style="background: rgba(148, 163, 184, 0.15); padding: 1px 7px; border-radius: 5px; font-weight: 700; color: var(--text-main);">${s.grado} • ${s.seccion}</span>
|
||||||
</div>
|
<span style="font-family: ui-monospace, SFMono-Regular, Menlo, monospace;">Cód: <strong style="color: var(--text-main);">${s.codigo_estudiante}</strong></span>
|
||||||
<div style="font-size: 0.76rem; font-weight: 800; color: #0284c7; margin-top: 3px;">
|
<span>PIN: <strong style="color: var(--text-main);">${s.pin_seguridad || '1234'}</strong></span>
|
||||||
Saldo: ₡${s.saldo_colones.toLocaleString('es-CR')} | Límite: ₡${s.limite_diario_colones.toLocaleString('es-CR')}/día
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display: flex; gap: 8px; align-items: center; justify-content: flex-end; border-top: 1px dashed var(--border); padding-top: 8px; width: 100%; flex-wrap: wrap;">
|
<!-- MÉTRICAS FINANCIERAS -->
|
||||||
<button type="button" onclick="quickGoToRecarga(${s.id})" style="padding: 7px 12px; background: #10b981; color: white; border: none; border-radius: 8px; font-size: 0.76rem; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 4px;" title="Cargar dinero en caja a este estudiante">
|
<div style="display: flex; flex-direction: column; align-items: flex-end; padding: 0 10px; flex-shrink: 0;">
|
||||||
💵 Cargar Dinero
|
<div style="font-size: 1.05rem; font-weight: 900; color: #10b981; line-height: 1.2;">₡${s.saldo_colones.toLocaleString('es-CR')}</div>
|
||||||
|
<div style="font-size: 0.7rem; color: var(--text-muted); font-weight: 600; margin-top: 2px;">Límite: ₡${s.limite_diario_colones.toLocaleString('es-CR')}/día</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- BARRA DE ACCIONES SAAS ELEGANTE -->
|
||||||
|
<div class="admin-student-actions">
|
||||||
|
<button type="button" class="btn-saas btn-saas-primary" onclick="quickGoToRecarga(${s.id})" title="Cargar saldo en caja a este estudiante">
|
||||||
|
<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>Abonar</span>
|
||||||
</button>
|
</button>
|
||||||
<a href="/carnet.html?id=${s.id}" target="_blank" style="padding: 7px 12px; background: #e0f2fe; color: #0369a1; border-radius: 8px; font-size: 0.76rem; font-weight: 800; text-decoration: none;" title="Ver e Imprimir Carné Físico">
|
|
||||||
🖨️ Carné
|
<a href="/carnet.html?id=${s.id}" target="_blank" class="btn-saas btn-saas-outline" title="Ver e imprimir carné físico escolar">
|
||||||
|
<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="18" height="18" x="3" y="3" rx="2"/><path d="M7 7h.01"/><path d="M11 7h6"/><path d="M7 11h.01"/><path d="M11 11h6"/><path d="M7 15h.01"/><path d="M11 15h6"/></svg>
|
||||||
|
<span>Carné QR</span>
|
||||||
</a>
|
</a>
|
||||||
<button type="button" onclick="toggleBlockCard(${s.id}, ${isBlocked ? 0 : 1})" style="padding: 7px 14px; background: ${isBlocked ? '#10b981' : '#ef4444'}; color: white; border: none; border-radius: 8px; font-size: 0.78rem; font-weight: 900; cursor: pointer;">
|
|
||||||
${isBlocked ? '✅ Desbloquear' : '⛔ Bloquear Tarjeta'}
|
<button type="button" class="btn-saas ${isBlocked ? 'btn-saas-success-subtle' : 'btn-saas-danger-subtle'}" onclick="toggleBlockCard(${s.id}, ${isBlocked ? 0 : 1})" title="${isBlocked ? 'Desbloquear y restablecer tarjeta' : 'Bloquear tarjeta por extravío o reporte'}">
|
||||||
|
${isBlocked
|
||||||
|
? `<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="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>
|
||||||
|
<span>Desbloquear</span>`
|
||||||
|
: `<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="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
|
||||||
|
<span>Bloquear</span>`
|
||||||
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user