</main>
</div>

<!-- Toast -->
<div id="toast" style="
  position:fixed;bottom:24px;right:24px;z-index:999;display:none;
  align-items:center;gap:8px;padding:11px 16px;border-radius:10px;
  font-size:13px;font-weight:500;font-family:'DM Sans',sans-serif;
  box-shadow:0 8px 32px rgba(20,30,78,.18);
  max-width:340px;color:#fff;border:1px solid rgba(255,255,255,.2);
"></div>

<script>
function showToast(msg, type) {
  var t = document.getElementById('toast');
  if(!type) type = 'success';
  t.innerHTML = msg;
  var bg = {
    success: 'linear-gradient(135deg,#16A34A,#22C55E)',
    error:   'linear-gradient(135deg,#DC2626,#F87171)',
    warning: 'linear-gradient(135deg,#D97706,#F59E0B)'
  };
  t.style.background = bg[type] || bg.success;
  t.style.display = 'flex'; t.style.opacity='1'; t.style.transform='translateY(0)';
  clearTimeout(t._t);
  t._t = setTimeout(function(){
    t.style.transition='opacity .3s,transform .3s';
    t.style.opacity='0'; t.style.transform='translateY(8px)';
    setTimeout(function(){ t.style.display='none'; t.style.transition=''; },320);
  }, 3400);
}
function openModal(id)  { var e=document.getElementById(id); if(e) e.classList.add('open'); }
function closeModal(id) { var e=document.getElementById(id); if(e) e.classList.remove('open'); }
document.querySelectorAll('.modal-overlay').forEach(function(o){
  o.addEventListener('click',function(e){ if(e.target===this) this.classList.remove('open'); });
});
function sbToggle(){
  document.getElementById('sidebar').classList.toggle('open');
  document.getElementById('sbOverlay').classList.toggle('open');
}
document.querySelectorAll('.nav-item').forEach(function(n){
  n.addEventListener('click',function(){
    if(window.innerWidth<=768){
      document.getElementById('sidebar').classList.remove('open');
      document.getElementById('sbOverlay').classList.remove('open');
    }
  });
});
</script>
</body>
</html>
<?php ob_end_flush(); ?>