prepare("SELECT COUNT(*) FROM notificaciones WHERE usuario_id=? AND leida=0"); $stmt->execute([$_SESSION['usuario_id'] ?? 0]); $notifCount = (int)$stmt->fetchColumn(); // Iniciales del usuario $iniciales = implode('', array_map(fn($p) => strtoupper($p[0]), array_slice(explode(' ', $usuarioNombre), 0, 2))); function navItem(string $href, string $icon, string $label, string $active, string $badge = ''): string { $cls = $active ? ' active' : ''; $b = $badge ? ''.$badge.'' : ''; return "$label$b"; } $nav = $activeNav ?? ''; ?>