function toggleMenu() {
    event.preventDefault();
    document.querySelector(".nav-links").classList.toggle("show");
    document.querySelector(".nav-account").classList.toggle("show");
    document.querySelectorAll(".navbar-admin").forEach(el => el.classList.toggle("show"));
    }
document.addEventListener("DOMContentLoaded", function () {
    const dropdown = document.querySelector(".dropdown-nav");
    const menu = document.querySelector(".dropdown-menu-nav");

    dropdown.addEventListener("click", function (event) {
      event.stopPropagation(); // Empêche la propagation du clic
      menu.style.display = menu.style.display === "block" ? "none" : "block";
    });

    document.addEventListener("click", function (event) {
      if (!dropdown.contains(event.target)) {
        menu.style.display = "none";
      }
    });
  });
