<div class="main-nav">
    <!-- Sidebar Logo -->
    <div class="logo-box">
        <a href="{{ config('app.url') }}/admin" class="logo-dark">
            <img src="{{ asset('metor/images/logo-sm.png') }}" class="logo-sm" alt="logo sm">
            <img src="{{ asset('metor/images/logo-dark.png') }}" class="logo-lg" alt="logo dark">
        </a>

        <a href="{{ config('app.url') }}/admin" class="logo-light">
            <img src="{{ asset('metor/images/logo-sm.png') }}" class="logo-sm" alt="logo sm">
            <img src="{{ asset('metor/images/logo-white.png') }}" class="logo-lg" alt="logo light">
        </a>
    </div>

    <div class="h-100" data-simplebar>
        <ul class="navbar-nav" id="navbar-nav">
            <li class="menu-item pt-2">
                <a class="menu-link {{ Request::is('admin') || Request::is('admin/dashboard') ? 'active' : '' }}" href="{{ url('/admin') }}">
                    <span class="nav-icon">
                        <i class="ri-dashboard-2-line"></i>
                    </span>
                    <span class="nav-text"> Dashboard </span>
                </a>
            </li>

            @can("users-list")
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/users*') ? 'active' : '' }}" href="{{ url('/admin/users') }}">
                    <span class="nav-icon">
                        <i class="ri-user-line"></i>
                    </span>
                    <span class="nav-text"> Users </span>
                </a>
            </li>
            @endcan

            

            @can("attendances-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/attendances*') ? 'active' : '' }}" href="{{ url('/admin/attendances') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Attendances </span>
                </a>
            </li>
@endcan 
@can("clients-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/clients*') ? 'active' : '' }}" href="{{ url('/admin/clients') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Clients </span>
                </a>
            </li>
@endcan 
@can("dashboard-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/dashboard*') ? 'active' : '' }}" href="{{ url('/admin/dashboard') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Dashboard </span>
                </a>
            </li>
@endcan 
@can("departments-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/departments*') ? 'active' : '' }}" href="{{ url('/admin/departments') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Departments </span>
                </a>
            </li>
@endcan 
@can("designations-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/designations*') ? 'active' : '' }}" href="{{ url('/admin/designations') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Designations </span>
                </a>
            </li>
@endcan 
@can("employees-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/employees*') ? 'active' : '' }}" href="{{ url('/admin/employees') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Employees </span>
                </a>
            </li>
@endcan 
@can("leave-types-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/leave-types*') ? 'active' : '' }}" href="{{ url('/admin/leave-types') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Leave Types </span>
                </a>
            </li>
@endcan 
@can("leaves-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/leaves*') ? 'active' : '' }}" href="{{ url('/admin/leaves') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Leaves </span>
                </a>
            </li>
@endcan 
@can("loans-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/loans*') ? 'active' : '' }}" href="{{ url('/admin/loans') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Loans </span>
                </a>
            </li>
@endcan 
@can("payroll-items-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/payroll-items*') ? 'active' : '' }}" href="{{ url('/admin/payroll-items') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Payroll Items </span>
                </a>
            </li>
@endcan 
@can("payrolls-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/payrolls*') ? 'active' : '' }}" href="{{ url('/admin/payrolls') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Payrolls </span>
                </a>
            </li>
@endcan 
@can("salary-structures-list") 
            <li class="menu-item">
                <a class="menu-link {{ Request::is('admin/salary-structures*') ? 'active' : '' }}" href="{{ url('/admin/salary-structures') }}">
                    <span class="nav-icon">
                        <i class="ri-file-list-line"></i>
                    </span>
                    <span class="nav-text"> Salary Structures </span>
                </a>
            </li>
@endcan 


            <li class="menu-item mt-auto">
                <a class="menu-link" href="{{route('logout')}}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
                    <span class="nav-icon">
                        <i class="ri-logout-box-line"></i>
                    </span>
                    <span class="nav-text"> Logout </span>
                </a>
            </li>

            <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
                @csrf
            </form>
        </ul>
    </div>
</div>
