    </div><!-- /p-4 -->
  </div><!-- /main-content -->
</div><!-- /app-wrapper -->

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap5.min.js"></script>
<script src="<?= htmlspecialchars($assetBase ?? dirname(dirname($scriptDir))) ?>/Common/assets/js/savit-tables.js?v=3"></script>
<script>
(function() {
  const sidebar = document.getElementById('sidebar');
  const toggle  = document.getElementById('sidebar-toggle');

  // Create mobile overlay
  const overlay = document.createElement('div');
  overlay.id = 'sidebar-overlay';
  overlay.style.cssText = 'display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:999;';
  document.body.appendChild(overlay);

  toggle?.addEventListener('click', () => {
    const isMobile = window.innerWidth < 768;
    if (isMobile) {
      sidebar?.classList.toggle('mobile-open');
      overlay.style.display = sidebar?.classList.contains('mobile-open') ? 'block' : 'none';
    } else {
      sidebar?.classList.toggle('collapsed');
    }
  });
  overlay.addEventListener('click', () => {
    sidebar?.classList.remove('mobile-open');
    overlay.style.display = 'none';
  });
})();
// Init Bootstrap tooltips
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => new bootstrap.Tooltip(el));
</script>
</body>
</html>
