<aside class="main-sidebar elevation-4" style="background-color: #000;">
    <a href="{{ route('dashboard') }}" class="brand-link text-white d-flex align-items-center justify-content-center" style="gap: 10px;">
        <img src="{{ asset('images/logo-masjid.jpg') }}" alt="Logo Masjid" style="height: 30px; width: 30px;" class="img-circle elevation-2">
        <span class="brand-text font-weight-light">Kas Masjid</span>
    </a>

    <div class="sidebar">
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu">
                @auth
                    @php
                        $role = Auth::user()->tipe_pengguna;
                    @endphp

                    {{-- SUPERADMIN --}}
                    @if($role === 'superadmin')
                        <li class="nav-item mb-3">
                            <a href="{{ route('dashboard') }}" class="nav-link {{ Request::is('dashboard*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard</p>
                            </a>
                        </li>

                        <!-- {{-- Manajemen Admin --}}
                        <li class="nav-item mb-3">
                            <a href="{{ route('admin.index') }}" class="nav-link {{ Request::is('admin*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-user-cog"></i>
                                <p>Kelola Admin</p>
                            </a>
                        </li> -->

                        {{-- Data Pengurus --}}
                        <li class="nav-item mb-3">
                            <a href="{{ route('pengurusmasjid.index') }}" class="nav-link {{ Request::is('pengurusmasjid*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-users"></i>
                                <p>Data Pengurus</p>
                            </a>
                        </li>

                        {{-- Transaksi --}}
                        <li class="nav-item has-treeview mb-3 {{ Request::is('pemasukan*') || Request::is('pengeluaran*') ? 'menu-open' : '' }}">
                            <a href="#" class="nav-link {{ Request::is('pemasukan*') || Request::is('pengeluaran*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-exchange-alt"></i>
                                <p>
                                    Transaksi
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('pemasukan.index') }}" class="nav-link {{ Request::is('pemasukan*') ? 'active' : '' }}">
                                        <i class="fas fa-arrow-down nav-icon"></i>
                                        <p>Pemasukan</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('pengeluaran.index') }}" class="nav-link {{ Request::is('pengeluaran*') ? 'active' : '' }}">
                                        <i class="fas fa-arrow-up nav-icon"></i>
                                        <p>Pengeluaran</p>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        {{-- Data Kas --}}
                        <li class="nav-item mb-3">
                            <a href="{{ route('data-kas.index') }}" class="nav-link {{ Request::is('data-kas*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-wallet"></i>
                                <p>Data Kas</p>
                            </a>
                        </li>

                        {{-- Cetak Laporan --}}
                        <li class="nav-item has-treeview mb-3 {{ Request::is('laporan/review') || Request::is('laporan/semua') ? 'menu-open' : '' }}">
                            <a href="#" class="nav-link {{ Request::is('laporan/review') || Request::is('laporan/semua') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-file-export"></i>
                                <p>
                                    Cetak Laporan
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('laporan.review') }}" class="nav-link {{ Request::is('laporan/review') ? 'active' : '' }}">
                                        <i class="fas fa-eye nav-icon"></i>
                                        <p>Review</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('laporan.semua') }}" class="nav-link {{ Request::is('laporan/semua') ? 'active' : '' }}">
                                        <i class="fas fa-print nav-icon"></i>
                                        <p>Semua</p>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        {{-- Jadwal Jumat --}}
                        <li class="nav-item mb-3">
                            <a href="{{ route('jadwal.index') }}" class="nav-link {{ Request::is('jadwal*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-calendar-alt"></i>
                                <p>Jadwal Jumat</p>
                            </a>
                        </li>

                        {{-- Jadwal Harian --}}
                        <li class="nav-item mb-3">
                            <a href="{{ route('jadwalharian.index') }}" class="nav-link {{ Request::is('jadwalharian*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-calendar-day"></i>
                                <p>Jadwal Harian</p>
                            </a>
                        </li>                                               

                    {{-- KETUA --}}
                    @elseif($role === 'ketua')
                        <li class="nav-item mb-3">
                            <a href="{{ route('dashboard') }}" class="nav-link {{ Request::is('dashboard*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard Ketua</p>
                            </a>
                        </li>
                        {{-- Cetak Laporan --}}
                        <li class="nav-item has-treeview mb-3 {{ Request::is('laporan/review') || Request::is('laporan/semua') ? 'menu-open' : '' }}">
                            <a href="#" class="nav-link {{ Request::is('laporan/review') || Request::is('laporan/semua') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-file-export"></i>
                                <p>
                                    Cetak Laporan
                                    <i class="right fas fa-angle-left"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('laporan.review') }}" class="nav-link {{ Request::is('laporan/review') ? 'active' : '' }}">
                                        <i class="fas fa-eye nav-icon"></i>
                                        <p>Review</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('laporan.semua') }}" class="nav-link {{ Request::is('laporan/semua') ? 'active' : '' }}">
                                        <i class="fas fa-print nav-icon"></i>
                                        <p>Semua</p>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        {{-- Data Kas --}}
                        <li class="nav-item mb-3">
                            <a href="{{ route('data-kas.index') }}" class="nav-link {{ Request::is('data-kas*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-wallet"></i>
                                <p>Data Kas</p>
                            </a>
                        </li>

                    {{-- BENDAHARA --}}
                    @elseif($role === 'bendahara')
                    <!-- Transaksi -->
                    <li class="nav-item mb-3">
                            <a href="{{ route('dashboard') }}" class="nav-link {{ Request::is('dashboard*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard</p>
                            </a>
                        </li>
                    <li class="nav-item has-treeview mb-3 {{ Request::is('pemasukan*') || Request::is('pengeluaran*') ? 'menu-open' : '' }}">
                        <a href="#" class="nav-link {{ Request::is('pemasukan*') || Request::is('pengeluaran*') ? 'active' : '' }}">
                            <i class="nav-icon fas fa-exchange-alt"></i>
                            <p>
                                Transaksi
                                <i class="right fas fa-angle-left"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a href="{{ route('pemasukan.index') }}" class="nav-link {{ Request::is('pemasukan*') ? 'active' : '' }}">
                                    <i class="fas fa-arrow-down nav-icon"></i>
                                    <p>Pemasukan</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="{{ route('pengeluaran.index') }}" class="nav-link {{ Request::is('pengeluaran*') ? 'active' : '' }}">
                                    <i class="fas fa-arrow-up nav-icon"></i>
                                    <p>Pengeluaran</p>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <!-- Data Kas -->
                    <li class="nav-item mb-3">
                        <a href="{{ route('data-kas.index') }}" class="nav-link {{ Request::is('data-kas*') ? 'active' : '' }}">
                            <i class="nav-icon fas fa-wallet"></i>
                            <p>Data Kas</p>
                        </a>
                    </li>

                    {{-- Cetak Laporan --}}
                    <li class="nav-item has-treeview mb-3 {{ Request::is('laporan/review') || Request::is('laporan/semua') ? 'menu-open' : '' }}">
                        <a href="#" class="nav-link {{ Request::is('laporan/review') || Request::is('laporan/semua') ? 'active' : '' }}">
                            <i class="nav-icon fas fa-file-export"></i>
                            <p>
                                Cetak Laporan
                                <i class="right fas fa-angle-left"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a href="{{ route('laporan.review') }}" class="nav-link {{ Request::is('laporan/review') ? 'active' : '' }}">
                                    <i class="fas fa-eye nav-icon"></i>
                                    <p>Review</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="{{ route('laporan.semua') }}" class="nav-link {{ Request::is('laporan/semua') ? 'active' : '' }}">
                                    <i class="fas fa-print nav-icon"></i>
                                    <p>Semua</p>
                                </a>
                            </li>
                        </ul>
                    </li>

                    {{-- SEKRETARIS --}}
                    @elseif($role === 'sekretaris')
                    <li class="nav-item mb-3">
                            <a href="{{ route('dashboard') }}" class="nav-link {{ Request::is('dashboard*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard</p>
                            </a>
                        </li>
                        <li class="nav-item mb-3">
                            <a href="{{ route('jadwal.index') }}" class="nav-link {{ Request::is('jadwal*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-calendar-alt"></i>
                                <p>Jadwal Jumat</p>
                            </a>
                        </li>
                        <li class="nav-item mb-3">
                            <a href="{{ route('jadwalharian.index') }}" class="nav-link {{ Request::is('jadwalharian*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-calendar-day"></i>
                                <p>Jadwal Harian</p>
                            </a>
                        </li>

                    {{-- ANGGOTA --}}
                    @elseif($role === 'anggota')
                    <li class="nav-item mb-3">
                            <a href="{{ route('dashboard') }}" class="nav-link {{ Request::is('dashboard*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard</p>
                            </a>
                        </li>
                        <li class="nav-item mb-3">
                            <a href="{{ route('pengurusmasjid.index') }}" class="nav-link {{ Request::is('pengurusmasjid*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-users"></i>
                                <p>Struktur Pengurus</p>
                            </a>
                        </li>
                        <li class="nav-item mb-3">
                            <a href="{{ route('jadwal.index') }}" class="nav-link {{ Request::is('jadwal*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-calendar-alt"></i>
                                <p>Jadwal Jumat</p>
                            </a>
                        </li>
                        <li class="nav-item mb-3">
                            <a href="{{ route('jadwalharian.index') }}" class="nav-link {{ Request::is('jadwalharian*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-calendar-day"></i>
                                <p>Jadwal Harian</p>
                            </a>
                        </li>
                        <!-- Data Kas -->
                        <li class="nav-item mb-3">
                            <a href="{{ route('data-kas.index') }}" class="nav-link {{ Request::is('data-kas*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-wallet"></i>
                                <p>Data Kas</p>
                            </a>
                        </li>

                        {{-- USER --}}
                        @elseif($role === 'user')
                        <li class="nav-item mb-3">
                            <a href="{{ route('dashboard') }}" class="nav-link {{ Request::is('dashboard*') ? 'active' : '' }}">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard</p>
                            </a>
                        </li>
                            <li class="nav-item mb-3">
                                <a href="{{ route('pengurusmasjid.index') }}" class="nav-link {{ Request::is('pengurusmasjid*') ? 'active' : '' }}">
                                    <i class="nav-icon fas fa-users"></i>
                                    <p>Struktur Pengurus</p>
                                </a>
                            </li>
                            <li class="nav-item mb-3">
                                <a href="{{ route('jadwal.index') }}" class="nav-link {{ Request::is('jadwal*') ? 'active' : '' }}">
                                    <i class="nav-icon fas fa-calendar-alt"></i>
                                    <p>Jadwal Jumat</p>
                                </a>
                            </li>
                            <li class="nav-item mb-3">
                                <a href="{{ route('jadwalharian.index') }}" class="nav-link {{ Request::is('jadwalharian*') ? 'active' : '' }}">
                                    <i class="nav-icon fas fa-calendar-day"></i>
                                    <p>Jadwal Harian</p>
                                </a>
                            </li>
                            <li class="nav-item mb-3">
                                <a href="{{ route('data-kas.index') }}" class="nav-link {{ Request::is('data-kas*') ? 'active' : '' }}">
                                    <i class="nav-icon fas fa-wallet"></i>
                                    <p>Data Kas</p>
                                </a>
                            </li>

                    @endif
                @endauth
            </ul>
        </nav>
    </div>
</aside>
