diff --git a/public/css/styles.css b/public/css/styles.css
index 47b065d..36cf643 100644
--- a/public/css/styles.css
+++ b/public/css/styles.css
@@ -2311,15 +2311,75 @@ body.dark-mode .login-tab-btn.active {
box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}
+.parent-child-card.active,
.parent-child-card.selected {
- border-color: #0284c7;
- background: #f0f9ff;
- box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
+ border: 2.5px solid #0284c7 !important;
+ background: #f0f9ff !important;
+ box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 6px 16px rgba(2, 132, 199, 0.16) !important;
}
+body.dark-mode .parent-child-card.active,
body.dark-mode .parent-child-card.selected {
- background: rgba(2, 132, 199, 0.15);
+ background: rgba(2, 132, 199, 0.18) !important;
+ border: 2.5px solid #38bdf8 !important;
+ box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28), 0 6px 16px rgba(0, 0, 0, 0.3) !important;
+}
+
+.child-initials-badge {
+ width: 44px;
+ height: 44px;
+ border-radius: 50%;
+ background: #e0f2fe;
+ color: #0369a1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: 900;
+ font-size: 1rem;
+ letter-spacing: 0.5px;
+ flex-shrink: 0;
+ border: 2px solid transparent;
+ transition: all 0.2s ease;
+}
+
+.parent-child-card.active .child-initials-badge,
+.parent-child-card.selected .child-initials-badge {
+ background: linear-gradient(135deg, #0284c7, #0369a1);
+ color: #ffffff;
border-color: #38bdf8;
+ box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35);
+}
+
+.parent-active-child-avatar-badge {
+ width: 42px;
+ height: 42px;
+ border-radius: 50%;
+ background: linear-gradient(135deg, #0284c7, #0369a1);
+ color: #ffffff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: 900;
+ font-size: 1rem;
+ letter-spacing: 0.5px;
+ flex-shrink: 0;
+ box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
+ border: 2px solid #ffffff;
+}
+
+.parentSubViewChildAvatarBadge {
+ width: 26px;
+ height: 26px;
+ border-radius: 50%;
+ background: linear-gradient(135deg, #0284c7, #0369a1);
+ color: #ffffff;
+ font-size: 0.72rem;
+ font-weight: 900;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ letter-spacing: 0.3px;
+ flex-shrink: 0;
}
/* Buscador Inteligente en Admin Carga */
diff --git a/public/index.html b/public/index.html
index b0932ae..4f04a40 100644
--- a/public/index.html
+++ b/public/index.html
@@ -836,7 +836,7 @@
@@ -1168,7 +1168,7 @@
Volver
-
![Hijo]()
+
ES
Estudiante
diff --git a/public/js/app.js b/public/js/app.js
index b24d873..739a5d3 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -2134,6 +2134,17 @@ setInterval(async () => {
// FUNCIONES DEL PORTAL DEDICADO DE PADRES
// ==========================================
+// Helper para obtener iniciales del primer nombre y primer apellido (ej. Mateo Alvarado -> MA, Sofía Jiménez -> SJ)
+function getStudentInitials(fullName) {
+ if (!fullName || typeof fullName !== 'string') return 'ES';
+ const clean = fullName.trim().replace(/\s+/g, ' ');
+ const parts = clean.split(' ');
+ if (parts.length === 1) {
+ return parts[0].substring(0, 2).toUpperCase();
+ }
+ return (parts[0].charAt(0) + parts[1].charAt(0)).toUpperCase();
+}
+
async function loadParentDashboard() {
if (!currentUser || currentUser.rol !== 'padre') return;
@@ -2161,18 +2172,22 @@ function renderParentDashboardView() {
const sectionHijos = document.getElementById('parentChildrenSection');
const containerActive = document.getElementById('parentSelectedChildContainer');
const grid = document.getElementById('parentChildrenGrid');
+ const mainDash = document.getElementById('parentChildDashboardMain');
const hijos = (currentUser && currentUser.hijos) ? currentUser.hijos : [];
if (hijos.length === 0) {
if (bannerNoHijos) bannerNoHijos.style.display = 'block';
+ if (sectionHijos) sectionHijos.style.display = 'none';
if (containerActive) containerActive.style.display = 'none';
if (grid) grid.innerHTML = '';
return;
}
if (bannerNoHijos) bannerNoHijos.style.display = 'none';
+ if (sectionHijos) sectionHijos.style.display = 'block';
if (containerActive) containerActive.style.display = 'block';
+ if (mainDash) mainDash.style.display = 'block';
// Si no hay hijo seleccionado o el seleccionado ya no existe en la lista, seleccionar el primero
if (!currentParentChild || !hijos.some(h => h.id === currentParentChild.id)) {
@@ -2182,15 +2197,18 @@ function renderParentDashboardView() {
currentParentChild = hijos.find(h => h.id === currentParentChild.id) || hijos[0];
}
- // Renderizar tarjetas de hijos en la cuadrícula
+ // Renderizar tarjetas de hijos en la cuadrícula con monograma de iniciales y borde celeste activo
if (grid) {
grid.innerHTML = hijos.map(h => {
const isSelected = currentParentChild && currentParentChild.id === h.id;
const isBlocked = !!h.tarjeta_bloqueada;
+ const initials = getStudentInitials(h.nombre_completo);
return `
-
+
-

+
+ ${initials}
+
${h.nombre_completo}
@@ -2228,7 +2246,9 @@ function selectParentChild(childId) {
function openParentSubView(viewKey) {
const mainDash = document.getElementById('parentChildDashboardMain');
+ const childrenSection = document.getElementById('parentChildrenSection');
if (mainDash) mainDash.style.display = 'none';
+ if (childrenSection) childrenSection.style.display = 'none';
const subViews = [
'parentSubViewSinpe',
@@ -2243,8 +2263,9 @@ function openParentSubView(viewKey) {
});
if (currentParentChild) {
- document.querySelectorAll('.parentSubViewChildAvatar').forEach(img => {
- img.src = currentParentChild.foto_url || '/img/avatar_default.png';
+ const initials = getStudentInitials(currentParentChild.nombre_completo);
+ document.querySelectorAll('.parentSubViewChildAvatarBadge').forEach(badge => {
+ badge.textContent = initials;
});
document.querySelectorAll('.parentSubViewChildName').forEach(span => {
span.textContent = `${currentParentChild.nombre_completo} (${currentParentChild.grado})`;
@@ -2275,7 +2296,9 @@ function openParentSubView(viewKey) {
function closeParentSubView() {
const mainDash = document.getElementById('parentChildDashboardMain');
+ const childrenSection = document.getElementById('parentChildrenSection');
if (mainDash) mainDash.style.display = 'block';
+ if (childrenSection) childrenSection.style.display = 'block';
const subViews = [
'parentSubViewSinpe',
@@ -2309,7 +2332,13 @@ function renderActiveChildDetails(child) {
const rangeLimit = document.getElementById('rangeParentLimit');
const chkTransfer = document.getElementById('chkParentAllowTransferDirect');
- if (avatar) avatar.src = child.foto_url || '/img/avatar_default.png';
+ if (avatar) {
+ if (avatar.tagName === 'IMG') {
+ avatar.src = child.foto_url || '/img/avatar_default.png';
+ } else {
+ avatar.textContent = getStudentInitials(child.nombre_completo);
+ }
+ }
if (name) name.textContent = child.nombre_completo;
if (meta) meta.textContent = `${child.grado} - Sección ${child.seccion} • Cód: ${child.codigo_estudiante}`;
if (balance) balance.textContent = `₡${(child.saldo_colones || 0).toLocaleString('es-CR')}`;