<?php
  $user = $_SESSION['user'] ?? null;
?>

<?php if ($user): ?>

  <?php if ($user['level'] === 'Admin'): ?>
    <div class="col-12 col-md-3 px-0 bg-light">
      <div class="border-bottom d-flex bg-white border-end align-items-center gap-3 p-4">
        <img src="/assets/img/team1.jpg" alt class="img-fluid rounded-circle bg-light h-40">
        <div class="text-start">
          <p class="mb-0 fw-bold small"> Admin</p>
          <small class="text-muted">
            <i class="bi bi-card-checklist"></i> admin
          </small>
        </div>
        <span class="ms-auto" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Ubah Password">
          <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="text-decoration-none" href="#">
            <i class="bi bi-three-dots-vertical icon-sm"></i>
          </a>
        </span>
      </div>
      <div class="col-md-12 d-none d-md-block">
        <div class="nav p-4 ps-md-4 py-md-4 pe-md-0 bg-light flex-column delivery-tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
          <a id="menu-beranda-admin" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin" role="tab" >
            <i class="bi bi-list"></i> Beranda
          </a>
          <a id="menu-profile-admin" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin-profil" role="tab">
            <i class="bi bi-person-fill"></i> Profile
          </a>
          <a id="menu-mbr" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin-mbr" role="tab">
            <i class="bi bi-newspaper"></i> Mahasiswa Baru
          </a>
          <a id="menu-nim-mbr" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin-nim-mbr" role="tab">
            <i class="bi bi-key"></i> Input NIM MABA
          </a>          
          <a id="menu-khs" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin-khs" role="tab">
            <i class="bi bi-table"></i> Manage KHS
          </a>
          <a id="menu-ta-admin" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin-ta" role="tab">
            <i class="bi bi-person-workspace"></i> Pengaturan
          </a>
          <a id="menu-surat" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/admin-surat" role="tab">
            <i class="bi bi-envelope"></i> Surat-surat
          </a>
          <a href="/logout" class="nav-link py-3 text-danger text-decoration-none">
            <i class="bi bi-lock"></i> Logout
          </a>
        </div>
      </div>
    </div>

  <?php elseif ($user['level'] === 'Pegawai'): ?>
    <div class="col-12 col-md-3 px-0 bg-light">
      <div class="border-bottom d-flex bg-white border-end align-items-center gap-3 p-4">
        <img src="/assets/img/team1.jpg" alt class="img-fluid rounded-circle bg-light h-40">
        <div class="text-start">
          <p class="mb-0 fw-bold small"> Pegawai</p>
          <small class="text-muted">
            <i class="bi bi-card-checklist"></i> Pegawai
          </small>
        </div>
        <span class="ms-auto" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Ubah Password">
          <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="text-decoration-none" href="#">
            <i class="bi bi-three-dots-vertical icon-sm"></i>
          </a>
        </span>
      </div>
      <div class="col-md-12 d-none d-md-block">
        <div class="nav p-4 ps-md-4 py-md-4 pe-md-0 bg-light flex-column delivery-tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
		<a id="menu-beranda-pegawai" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai" role="tab">
		  <i class="bi bi-list"></i> Beranda
		</a>
		<a id="menu-profil-pegawai" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-profil" role="tab">
		  <i class="bi bi-person-fill"></i> Profile
		</a>
		<a id="menu-data-mhs" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-data-mhs" role="tab">
		  <i class="bi bi-people"></i> Data Mahasiswa
		</a>
		<a id="menu-jadwal-soal" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-in-jadwal" role="tab">
		  <i class="bi bi-calendar-date"></i> Jadwal/Seting Soal
		</a>
		<a id="menu-data-alumni" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-data-alumni" role="tab">
		  <i class="bi bi-mortarboard"></i> Data Alumni
		</a>
		<a id="menu-data-kip" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-data-kip" role="tab">
		  <i class="bi bi-binoculars"></i> Data Survey KIP
		</a>
		<a id="menu-transkip" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-transkip" role="tab">
		  <i class="bi bi-calculator"></i> Transkip Nilai
		</a>
		<a id="menu-mhs-akhir" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-mhs-akhir" role="tab">
		  <i class="bi bi-person-workspace"></i> Mahasiswa Akhir
		</a>
		<a id="menu-peg-manag" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-ta" role="tab">
		  <i class="bi bi-device-ssd"></i> Managemen Data
		</a>		
		<a href="/logout" class="nav-link py-3 text-danger text-decoration-none">
		<i class="bi bi-lock"></i> Logout
		</a>
        </div>
      </div>
    </div>	

  <?php elseif ($user['level'] === 'Staff'): ?>
    <div class="col-12 col-md-3 px-0 bg-light">
      <div class="border-bottom d-flex bg-white border-end align-items-center gap-3 p-4">
        <img src="/assets/img/team1.jpg" alt class="img-fluid rounded-circle bg-light h-40">
        <div class="text-start">
          <p class="mb-0 fw-bold small"> Staff</p>
          <small class="text-muted">
            <i class="bi bi-card-checklist"></i> Staff
          </small>
        </div>
        <span class="ms-auto" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Ubah Password">
          <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="text-decoration-none" href="#">
            <i class="bi bi-three-dots-vertical icon-sm"></i>
          </a>
        </span>
      </div>
      <div class="col-md-12 d-none d-md-block">
        <div class="nav p-4 ps-md-4 py-md-4 pe-md-0 bg-light flex-column delivery-tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
		<a id="menu-beranda-staff" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/staff" role="tab">
		  <i class="bi bi-list"></i> Beranda
		</a>
		<a id="menu-profil-pegawai" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/staff-profil" role="tab">
		  <i class="bi bi-person-fill"></i> Profile
		</a>
		<!--
		<a id="menu-data-mhs" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/staff-data-mhs" role="tab">
		  <i class="bi bi-people"></i> Data Mahasiswa
		</a>
		-->
		<a id="menu-data-mhs" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/staff-data-pplk" role="tab">
		  <i class="bi bi-currency-exchange"></i> Peserta PPLK 
		</a>
		<a id="menu-data-maba" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/staff-data-maba" role="tab">
		  <i class="bi bi-people icon-sm"></i> Data Mahasiswa Baru
		</a>
		<!--
		<a id="menu-jadwal-soal" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-in-jadwal" role="tab">
		  <i class="bi bi-calendar-date"></i> Jadwal/Seting Soal
		</a>
		<a id="menu-data-alumni" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-data-alumni" role="tab">
		  <i class="bi bi-mortarboard"></i> Data Alumni
		</a>
		<a id="menu-data-kip" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-data-kip" role="tab">
		  <i class="bi bi-binoculars"></i> Data Survey KIP
		</a>
		<a id="menu-transkip" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-transkip" role="tab">
		  <i class="bi bi-calculator"></i> Transkip Nilai
		</a>
		<a id="menu-mhs-akhir" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-mhs-akhir" role="tab">
		  <i class="bi bi-person-workspace"></i> Mahasiswa Akhir
		</a>
		<a id="menu-peg-manag" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/pegawai-ta" role="tab">
		  <i class="bi bi-device-ssd"></i> Managemen Data
		</a>
		-->
		<a href="/logout" class="nav-link py-3 text-danger text-decoration-none">
		<i class="bi bi-lock"></i> Logout
		</a>
		</br>
		</br>
		</br>
		</br>
		</br>
		</br>
		</br>
        </div>
      </div>
    </div>	
    
  <?php elseif ($user['level'] === 'Mahasiswa'): ?>       
    <div class="col-12 col-md-3 px-0 bg-light">
      <div class="border-bottom d-flex bg-white border-end align-items-center gap-3 p-4">
        <img src="/assets/img/team1.jpg" alt class="img-fluid rounded-circle bg-light h-40">
        <div class="text-start">
          <p class="mb-0 fw-bold small"><?= htmlspecialchars($user['nama']) ?></p>
          <small class="text-muted"><i class="bi bi-card-checklist"></i> <?= htmlspecialchars($user['nim']) ?></small>
        </div>
        <span class="ms-auto" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Ubah Password">
          <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="text-decoration-none" href="#">
            <i class="bi bi-three-dots-vertical icon-sm"></i>
          </a>
        </span>
      </div>

      <div class="col-md-12 d-none d-md-block">
        <div class="nav p-4 ps-md-4 py-md-4 pe-md-0 bg-light flex-column delivery-tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
          <a id="menu-beranda" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa" role="tab">
            <i class="bi bi-house"></i> Beranda
          </a>
          <a id="menu-profile" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa-profile" role="tab">
            <i class="bi bi-person-fill"></i> Profile
          </a>
          <a id="menu-krs-khs" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa-krs" role="tab">
            <i class="bi bi-newspaper"></i> KRS/KHS
          </a>
          <a id="menu-soal" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa-soal" role="tab">
            <i class="bi bi-pc-display"></i> UTS/UAS
          </a>
          <a id="menu-jadwal" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa-jadwal" role="tab">
            <i class="bi bi-calendar2-week"></i> Presensi & Jadwal
          </a>
          <a id="menu-ta" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa-ta" role="tab">
            <i class="bi bi-person-workspace"></i> Tugas akhir
          </a>
          <a id="menu-ajukan" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/mahasiswa-ajukan" role="tab">
            <i class="bi bi-send-plus"></i> Pengajuan
          </a>
          <a href="/logout" class="nav-link py-3 text-danger text-decoration-none">
            <i class="bi bi-lock"></i> Logout
          </a>
        </div>
      </div>
    </div>
  
  <?php elseif ($user['level'] === 'Maba'): ?> 
    <div class="col-12 col-md-3 px-0 bg-light">
      <div class="border-bottom d-flex bg-white border-end align-items-center gap-3 p-4">
        <img src="/assets/img/team1.jpg" alt class="img-fluid rounded-circle bg-light h-40">
        <div class="text-start">
          <p class="mb-0 fw-bold small"><?= htmlspecialchars($user['nama_camaba']) ?></p>
          <small class="text-muted"><i class="bi bi-card-checklist"></i> <?= htmlspecialchars($user['nisn']) ?></small>
        </div>
        <span class="ms-auto" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Ubah Password">
          <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="text-decoration-none" href="#">
            <i class="bi bi-three-dots-vertical icon-sm"></i>
          </a>
        </span>
      </div>

      <div class="col-md-12 d-none d-md-block">
        <div class="nav p-4 ps-md-4 py-md-4 pe-md-0 bg-light flex-column delivery-tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
          <a id="menu-beranda-maba" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/maba" role="tab">
            <i class="bi bi-house"></i> Beranda
          </a>
          
          <a id="menu-profile-maba" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/maba-profile" role="tab">
            <i class="bi bi-person"></i> Profile
          </a>
          <a id="menu-ortu-maba" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/maba-orangtua" role="tab">
            <i class="bi bi-people"></i> Data Orang Tua
          </a>
          <a id="menu-kelas-maba" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/maba-pilihkelas" role="tab">
            <i class="bi bi-columns"></i> Pilih Kelas
          </a>
          <a href="/logout" class="nav-link py-3 text-danger text-decoration-none">
            <i class="bi bi-lock"></i> Logout
          </a>
          </br>
          </br>
          </br>
          </br>
        </div>
      </div>
    </div>    

  <?php elseif ($user['level'] === 'Dosen' || $user['level'] === 'Dosen/Kaprodi'): ?>       
    <div class="col-12 col-md-3 px-0 bg-light">
      <div class="border-bottom d-flex bg-white border-end align-items-center gap-3 p-4">
        <img src="/assets/img/team1.jpg" alt class="img-fluid rounded-circle bg-light h-40">
        <div class="text-start">
          <p class="mb-0 fw-bold small"><?= htmlspecialchars($user['nama']) ?></p>
          <small class="text-muted"><i class="bi bi-card-checklist"></i> <?= htmlspecialchars($user['niy']) ?></small>
        </div>
        <span class="ms-auto" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Ubah Password">
          <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="text-decoration-none" href="#"><i class="bi bi-three-dots-vertical icon-sm"></i></a>
        </span>
      </div>
      <div class="col-md-12 d-none d-md-block">
        <div class="nav p-4 ps-md-4 py-md-4 pe-md-0 bg-light flex-column delivery-tabs" id="v-pills-tab" role="tablist" aria-orientation="vertical">
          <a id="menu-beranda-dosen" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen" role="tab">
            <i class="bi bi-list"></i> Beranda
          </a>
          <a id="menu-profile-dosen" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-profile" role="tab">
            <i class="bi bi-person-fill"></i> Profile
          </a>
          <a id="menu-absen" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-absen_mahasiswa" role="tab">
            <i class="bi bi-calendar"></i> Presensi Mahasiswa
          </a>
          <a id="menu-soal" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-upload-soal" role="tab">
            <i class="bi bi-patch-question"></i> Upload Soal
          </a>
          <a id="menu-koreksi" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-koreksi-soal" role="tab">
            <i class="bi bi-border-style"></i> Koreksi Jawaban
          </a>   
          <a id="menu-input-nilai" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-input-nilai" role="tab">
            <i class="bi bi-newspaper"></i> Input Nilai
          </a>
          <a id="menu-jadwal" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-jadwal" role="tab">
            <i class="bi bi-card-heading"></i> Jadwal Perkuliahan
          </a>

          <?php if ($user['level'] === 'Dosen/Kaprodi'): ?>
            <a id="menu-download-nilai" class="nav-link py-3 text-danger text-decoration-none" href="/dashboard/dosen-download-nilai" role="tab">
              <i class="bi bi-people"></i> Download Nilai 
            </a>
          <?php endif; ?>

          <a href="/logout" class="nav-link py-3 text-danger text-decoration-none">
            <i class="bi bi-lock"></i> Logout
          </a>
        </div>
      </div>
    </div>

  <?php endif; ?>

<?php endif; ?>

<script>
  window.addEventListener('DOMContentLoaded', () => {
    let currentPath = window.location.pathname.replace(/\/$/, ''); // hapus slash akhir
    console.log('Current path:', currentPath); // DEBUGGING

    const menuMap = {
      // ===================== MAHASISWA =====================
      '/dashboard/mahasiswa': 'menu-beranda',
      '/dashboard/mahasiswa-profile': 'menu-profile',
      '/dashboard/mahasiswa-krs': 'menu-krs-khs',
      '/dashboard/mahasiswa-khs/detail': 'menu-krs-khs',
      '/dashboard/mahasiswa-soal': 'menu-soal',
      '/dashboard/mahasiswa-jadwal': 'menu-jadwal',
      '/dashboard/mahasiswa-ta': 'menu-ta',
      '/dashboard/mahasiswa-ajukan': 'menu-ajukan',
      '/dashboard/mahasiswa-daftarwisuda': 'menu-ajukan',
      '/dashboard/mahasiswa-daftaryudisium': 'menu-ajukan',
      '/dashboard/mahasiswa-kompre': 'menu-kompre',
      '/dashboard/mahasiswa-sidang': 'menu-sidang',
      '/dashboard/mahasiswa-yudisium': 'menu-yudisium',
      '/dashboard/mahasiswa-reg-kompre': 'menu-ta',

      // ===================== MABA =====================
      '/dashboard/maba': 'menu-beranda-maba',
      '/dashboard/maba-profile':     'menu-profile-maba',
      '/dashboard/maba-orangtua':    'menu-ortu-maba',
      '/dashboard/maba-pilihkelas':  'menu-kelas-maba',

      // ===================== DOSEN =====================
      '/dashboard/dosen': 'menu-beranda-dosen',
      '/dashboard/dosen-profile': 'menu-profile-dosen',
      '/dashboard/dosen-absen_mahasiswa': 'menu-absen',
      '/dashboard/dosen-editabsen_mahasiswa': 'menu-absen',
      '/dashboard/dosen-upload-soal': 'menu-soal',
      '/dashboard/dosen-upload-soal-excel': 'menu-soal',
      '/dashboard/dosen-lihatsoal': 'menu-soal',
      '/dashboard/dosen-koreksi-soal': 'menu-koreksi',
      '/dashboard/dosen-koreksi-jawaban': 'menu-koreksi',
      '/dashboard/dosen-input-nilai': 'menu-input-nilai',
      '/dashboard/dosen-dosen-view-nilaikelas': 'menu-input-nilai',
      '/dashboard/dosen-view-utsuas': 'menu-input-nilai',
      '/dashboard/dosen-input-uasuts': 'menu-input-nilai',
      '/dashboard/dosen-download-nilai': 'menu-download-nilai',
      '/dashboard/dosen-jadwal': 'menu-jadwal',

      // ===================== ADMIN =====================
      '/dashboard/admin': 'menu-beranda-admin',
      '/dashboard/admin-user': 'menu-user',
      '/dashboard/admin-mahasiswa': 'menu-mahasiswa',
      '/dashboard/admin-dosen': 'menu-dosen',
      '/dashboard/admin-matkul': 'menu-matkul',
      '/dashboard/admin-ta': 'menu-ta-admin',
      '/dashboard/admin-manage_pmb': 'menu-ta-admin',
      '/dashboard/admin-data_pmb': 'menu-ta-admin',
      '/dashboard/admin-kompre': 'menu-kompre-admin',
      '/dashboard/admin-sidang': 'menu-sidang-admin',
      '/dashboard/admin-yudisium': 'menu-yudisium-admin',
      '/dashboard/admin-setting': 'menu-setting',
      '/dashboard/admin-upload_nilai': 'menu-ta-admin',
      '/dashboard/admin-naik_smt': 'menu-ta-admin',
      '/dashboard/admin-admin-set_ta': 'menu-ta-admin',
      '/dashboard/admin-add_mahasiswa': 'menu-ta-admin',
      '/dashboard/admin-add_dosen': 'menu-ta-admin',
      '/dashboard/admin-ubah_pw_mahasiswa': 'menu-ta-admin',
      '/dashboard/admin-ubah_pw_dosen': 'menu-ta-admin',
      '/dashboard/admin-upload_dosen_mk': 'menu-ta-admin',
      '/dashboard/admin-upload_token': 'menu-ta-admin',
      '/dashboard/admin-admin-buka-krs': 'menu-ta-admin',
      '/dashboard/admin-upload_jadwal': 'menu-ta-admin',
      '/dashboard/admin-manage_pmb': 'menu-ta-admin',
      '/dashboard/admin-validasi_krs': 'menu-ta-admin',
      '/dashboard/admin-validasi_khs': 'menu-ta-admin',
      '/dashboard/admin-manage_kompre': 'menu-ta-admin',
      '/dashboard/admin-monitoring_kip': 'menu-ta-admin',
      '/dashboard/admin-khs': 'menu-khs',
      '/dashboard/admin-mbr': 'menu-mbr',
      '/dashboard/admin-nim-mbr': 'menu-nim-mbr',
      

      // ===================== PEGAWAI =====================
      '/dashboard/pegawai': 'menu-beranda-pegawai',
      '/dashboard/pegawai-profil': 'menu-profil-pegawai',
      '/dashboard/pegawai-data-mhs': 'menu-data-mhs',
      '/dashboard/pegawai-in-jadwal': 'menu-jadwal-soal',
      '/dashboard/pegawai-jadwal-ujian': 'menu-jadwal-soal',
      '/dashboard/pegawai-set_ujian': 'menu-jadwal-soal',
      '/dashboard/pegawai-uploadssoal': 'menu-jadwal-soal',
      '/dashboard/pegawai-staff_up_dmk': 'menu-jadwal-soal',
      '/dashboard/pegawai-unduh-soal': 'menu-jadwal-soal',
      '/dashboard/pegawai-uploadstaftoken': 'menu-jadwal-soal',
      '/dashboard/pegawai-data-alumni': 'menu-data-alumni',
      '/dashboard/pegawai-data-kip': 'menu-data-kip',
      '/dashboard/pegawai-transkip': 'menu-transkip',
      '/dashboard/pegawai-mhs-akhir': 'menu-mhs-akhir',
      '/dashboard/pegawai-ta': 'menu-peg-manag',
	  '/dashboard/pegawai-manage_pmb': 'menu-peg-manag',
	  '/dashboard/pegawai-data_pmb': 'menu-peg-manag',
	  '/dashboard/pegawai-manage_kkn': 'menu-peg-manag',
	  '/dashboard/pegawai-manage_skripsi': 'menu-peg-manag',
	  '/dashboard/pegawai-up_nilai': 'menu-peg-manag',
	  '/dashboard/pegawai-presen-kegiatan': 'menu-peg-manag',
	  '/dashboard/pegawai-ips-ipk': 'menu-peg-manag',
	  '/dashboard/pegawai-data-maba': 'menu-peg-manag',
	  '/dashboard/pegawai-view-nilaikelas': 'menu-peg-manag',
	  '/dashboard/pegawai-input-nilai': 'menu-peg-manag',
	  '/dashboard/pegawai-ubah_gel_mhs': 'menu-peg-manag',

      // ===================== STAFF =====================
      '/dashboard/staff': 'menu-beranda-staff',
      '/dashboard/staff-profil': 'menu-profil-pegawai',
      '/dashboard/staff-data-mhs': 'menu-data-mhs',
      '/dashboard/staff-data-maba': 'menu-data-maba',

    };

    const menuId = menuMap[currentPath];
    if (menuId) {
      const menuElement = document.getElementById(menuId);
      if (menuElement) {
        menuElement.classList.add('active');
      } else {
        console.warn('Elemen dengan ID', menuId, 'tidak ditemukan di halaman.');
      }
    } else {
      console.warn('Tidak ditemukan menu untuk path:', currentPath);
    }
  });
</script>
