                                .forEach(perm => visiblePermissions.add(perm));
                        }
                    }
                });

                document.getElementById('stats').innerText = `Applications: ${visibleAppsCount} / Unique MS Graph permissions: ${visiblePermissions.size}`;
            }

            document.getElementById('search').addEventListener('input', filterApps);
            document.getElementById('authFlowFilter').addEventListener('change', filterApps);
            d