(function(){
  const btn=document.getElementById('menuToggle'),
        overlay=document.getElementById('overlay');
  if(btn){
    btn.addEventListener('click', ()=>{
      if(window.innerWidth>768){
        document.body.classList.toggle('sidebar-expanded'); // desktop expand/collapse
      }else{
        document.body.classList.toggle('sidebar-open'); // mobile slide
      }
    });
  }
  if(overlay){
    overlay.addEventListener('click', ()=> document.body.classList.remove('sidebar-open'));
  }
})();
