<body class=" hold-transition sidebar-mini">
  <div class="wrapper">

    <!-- Navbar -->
    <nav class="main-header navbar navbar-expand navbar-white navbar-light">
      <!-- Left navbar links -->
      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
        </li>
      </ul>

      <!-- Right navbar links -->
      <ul class="navbar-nav ml-auto">

        <!-- Nav Item - User Information -->
        <li class="nav-item dropdown no-arrow">
          <a class="nav-link dropdown-toggle mb-2" href="#" id="userDropdown" role="button"
            data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <span class="mr-2 d-none d-lg-inline text-black-610"><?= $admin['name']; ?></span>
            <img class="img-profile rounded-circle"
              src="<?= base_url('assets/img/profile/') . $admin['image']; ?>" style="width: 40px; height: 40px;">
          </a>
          <!-- Dropdown - User Information -->
          <!-- <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
            aria-labelledby="userDropdown">
            <a class="dropdown-item" href="<?= base_url('admin'); ?>">
              <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
              Profil Saya
            </a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" href="<?= base_url('auth/logout'); ?>" data-toggle="modal" data-target="#logoutModal">
              <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
              Keluar
            </a>
          </div> -->
        </li>
        <div class="topbar-divider d-none d-sm-block"></div>
      </ul>
    </nav>
    <!-- /.navbar -->

    <!-- Main Sidebar Container -->
    <aside class="main-sidebar sidebar-dark-primary elevation-4">
      <!-- Brand Logo -->
      <a href="dashboard" class="brand-link mt-2">
        <img src="<?= base_url('assets/') ?>img/profile/logo.jpg" alt="Nufaku Logo" class="brand-image img-circle elevation-3"
          style="opacity: .8;">
        <span class="brand-text font-weight-bold ml-1">ADMIN NUFAKU</span>
      </a>

      <!-- Sidebar -->
      <div class="sidebar">

        <!-- Sidebar Menu -->
        <nav class="mt-2">
          <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
            <li class="nav-item">
              <a href="<?= base_url('dashboard') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'dashboard') echo 'active' ?> ">
                <i class="nav-icon fas fa-tachometer-alt"></i>
                <p>
                  Dashboard
                  <!-- <i class="right fas fa-angle-left"></i> -->
                </p>
              </a>
            </li>
            <li class="nav-item <?= ($this->uri->segment(1) == 'admin') ? 'menu-open' : '' ?>">
              <a href="#" class="nav-link">
                <i class="nav-icon fas fa-image-portrait"></i>
                <p>
                  Admin
                  <i class="right fas fa-angle-left" style="position: relative; top: 3px; float: right;"></i>
                </p>
              </a>
              <ul class="nav nav-treeview">
                <li class="nav-item">
                  <a href="<?= base_url('admin') ?>" class="nav-link <?= ($this->uri->segment(1) == 'admin' && $this->uri->segment(2) == '') ? 'active' : '' ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Profil</p>
                  </a>
                </li>
                <li class="nav-item">
                  <a href="<?= base_url('admin/edit') ?>" class="nav-link <?= ($this->uri->segment(1) == 'admin' && $this->uri->segment(2) == 'edit') ? 'active' : '' ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Edit Profil</p>
                  </a>
                </li>
                <!-- <li class="nav-item">
                  <a href="<?= base_url('admin/ubahkatasandi') ?>" class="nav-link <?= ($this->uri->segment(1) == 'admin' && $this->uri->segment(2) == 'ubahkatasandi') ? 'active' : '' ?>">
                    <i class="far fa-circle nav-icon"></i>
                    <p>Ubah Kata Sandi</p>
                  </a>
                </li> -->
              </ul>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('santri') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'santri') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-user-graduate"></i>
                <p>Santri</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('walisantri') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'walisantri') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-people-group"></i>
                <p>Wali Santri</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('kegiatansantri') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'kegiatansantri') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-address-book"></i>
                <p>Kegiatan Santri</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('prestasisantri') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'prestasisantri') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-award"></i>
                <p>Prestasi</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('pelanggaransantri') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'pelanggaransantri') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-user-xmark"></i>
                <p>Pelanggaran</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('informasisppsantri') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'informasisppsantri') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-sack-dollar"></i>
                <p>SPP</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('berita') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'berita') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-newspaper"></i>
                <p>Berita</p>
              </a>
            </li>
            <li class="nav-item">
              <a href="<?= base_url('sejarah') ?>" class="nav-link <?php if ($this->uri->segment(1) == 'sejarah') echo 'active' ?> ">
                <i class="nav-icon fas fa-solid fa-mosque"></i>
                <p>Sejarah</p>
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="<?= base_url('auth/logout') ?>">
                <i class="nav-icon fas fa-sign-out-alt"></i>
                <p>Keluar</p>
              </a>
            </li>
          </ul>
        </nav>
        <!-- /.sidebar-menu -->
      </div>
      <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6">
              <h1 class="m-0"><?= $title ?></h1>
            </div><!-- /.col -->
            <div class="col-sm-6">
              <!-- <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="#">Home</a></li>
                <li class="breadcrumb-item active"><?= $title ?></li>
              </ol> -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </div><!-- /.container-fluid -->
      </div>
      <!-- /.content-header -->

      <!-- Main content -->
      <div class="content">
        <div class="container-fluid">

          <!-- Tambahkan CSS untuk memastikan warna teks putih pada sidebar -->
          <style>
            .main-sidebar {
              background-color: #347928;
            }

            /* Warna teks sidebar, termasuk ikon, nama brand, dan link */
            .main-sidebar .nav-link,
            .main-sidebar .brand-text,
            .main-sidebar .user-panel .info a,
            .main-sidebar .nav-icon {
              color: white !important;
              /* Menambahkan !important untuk meng-override default */
            }

            /* Pastikan teks pada item aktif juga berwarna putih */
            .main-sidebar .nav-link.active {
              background-color: rgba(255, 255, 255, 0.1);
              /* Latar belakang sedikit transparan */
              color: white !important;
            }

            /* Atur warna teks saat di-hover (juga tetap putih) */
            .main-sidebar .nav-link:hover {
              color: white !important;
            }

            /* Untuk memastikan user image border tetap terlihat putih */
            .main-sidebar .user-panel img {
              border: 2px solid white;
            }

            /* Mengubah warna background dan teks saat active */
            .nav-sidebar .nav-link.active {
              background-color: #28a745 !important;
              /* Warna hijau muda untuk background */
              color: #fff !important;
              /* Warna putih untuk teks */
            }
          </style>