<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
  <div class="container-fluid">

    <!-- Logo / Title -->
    <a class="navbar-brand fw-bold" href="<?= base_url('dashboard') ?>">
      HSE SYSTEM
    </a>

    <!-- Toggle button -->
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNavbar">
      <span class="navbar-toggler-icon"></span>
    </button>

    <!-- Menu -->
    <div class="collapse navbar-collapse" id="mainNavbar">

      <!-- LEFT MENU -->
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">

        <li class="nav-item">
          <a class="nav-link" href="<?= base_url('dashboard') ?>">Dashboard</a>
        </li>

        <!-- DROPDOWN MASTER DATA -->
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">
            Master Data
          </a>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="<?= base_url('master/kendaraan') ?>">Kendaraan</a></li>
            <li><a class="dropdown-item" href="<?= base_url('master/gudang') ?>">Gudang</a></li>
            <li><a class="dropdown-item" href="<?= base_url('master/sparepart') ?>">Sparepart</a></li>
          </ul>
        </li>

        <!-- TRANSAKSI -->
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">
            Transaksi
          </a>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="<?= base_url('transactions/work_order') ?>">Work Order</a></li>
            <li><a class="dropdown-item" href="<?= base_url('transactions/pr_order') ?>">PR Order</a></li>
            <li><a class="dropdown-item" href="<?= base_url('transactions/store_entry') ?>">Store Entry</a></li>
          </ul>
        </li>

      </ul>

      <!-- RIGHT MENU -->
      <ul class="navbar-nav">

        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">
            <?= session('username') ?? 'User' ?>
          </a>
          <ul class="dropdown-menu dropdown-menu-end">
            <li><a class="dropdown-item" href="<?= base_url('profile') ?>">Profile</a></li>
            <li><hr class="dropdown-divider"></li>
            <li><a class="dropdown-item text-danger" href="<?= base_url('logout') ?>">Logout</a></li>
          </ul>
        </li>

      </ul>

    </div>
  </div>
</nav>

