</div> <!-- End main-content -->
</div> <!-- End layout-wrapper -->

<footer style="text-align:center;padding:15px;font-size:12px;color:#777;">
    © <?php echo date('Y'); ?> <?php echo SYSTEM_NAME; ?> • <?php echo SYSTEM_TAGLINE; ?>
</footer>

<script>
document.addEventListener('DOMContentLoaded', function () {

  // Collapsible submenu
  document.querySelectorAll('.menu-toggle').forEach(function (toggle) {
    toggle.addEventListener('click', function () {
      this.parentElement.classList.toggle('open');
    });
  });

  // Sidebar toggle + overlay
  var btn = document.getElementById('sidebarToggle');
  var sidebar = document.getElementById('sidebar');
  var overlay = document.getElementById('sidebarOverlay');

  function closeMenu(){
    sidebar.classList.remove('open');
    overlay.classList.remove('active');
    document.body.classList.remove('sidebar-open');
  }

  if (btn && sidebar && overlay) {
    btn.addEventListener('click', function () {
      sidebar.classList.toggle('open');
      overlay.classList.toggle('active');
      document.body.classList.toggle('sidebar-open');
    });

    overlay.addEventListener('click', closeMenu);
  }

});
</script>

<script>
document.addEventListener("DOMContentLoaded", function () {
    var loader = document.getElementById("preloader");
    if (loader) {
        loader.remove();
    }
});
</script>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

<script src="/core/assets/activity.js"></script>

</body>
</html>
