<link href="{{ asset('vendor/bootstrap-icons/css/bootstrap-icons.css') }}" rel="stylesheet">
@php
    $superAdmin = auth()->user()->is_superadmin ?? false;
    $user = auth()->user();
    $can = fn(string $p) => $superAdmin || ($user && $user->hasPermission($p));
    $sidebarModules = config('tenant_modules.sidebar_module', []);
    $allowedMods = $allowedModules ?? null;
    $moduleAllowed = function(string $perm) use ($allowedMods, $sidebarModules) {
        if ($allowedMods === null) return true;
        $mod = $sidebarModules[$perm] ?? null;
        if ($mod === null) return true;
        return in_array($mod, $allowedMods, true);
    };
    $canShow = fn(string $p) => $can($p) && $moduleAllowed($p);
@endphp
<ul class="space-y-1 px-2 sidebar">
    @if (!$superAdmin)
    @if($canShow('dashboard_view'))
    <li>
        <div  class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 pt-4 text-sm font-medium">
            <span class="flex items-center gap-3">
            <svg class="h-5 w-5 shrink-0 text-slate-500" :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
              d="M3 13h8V3H3v10zm10 8h8V11h-8v10zM3 21h8v-6H3v6zm10-18v6h8V3h-8z"/>
    </svg>

                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">
        Overview
    </span>

</span>
        </div>

        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
                <a href="{{ route('dashboard') }}" class="flex items-center gap-2 rounded-lg ps-2 pe-2 pt-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                 {{ request()->routeIs('dashboard') ? 'bg-primary-light text-primary' : '' }}">
                    <svg class="h-5 w-5 shrink-0 text-slate-500"  fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2z"/></svg>
                    <span x-show="sidebarOpen || hovering" x-cloak>Dashboard</span>
                </a>
            </li>
        </ul>
    </li>
    @endif


    @if($canShow('users_view'))
    {{-- Employees --}}
    <li>
        <div  class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 pt-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500" :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">People</span>
            </span>
        </div>
        {{-- </button> --}}
        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li><a href="{{ route('employees.index') }}" title="Employees" class="flex items-center gap-2 rounded-lg ps-2 pe-2 pt-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                 {{ request()->routeIs('employees.*') ? 'bg-primary-light text-primary' : '' }}">
                  <i class="bi bi-people"></i>
                  <span x-show="sidebarOpen || hovering" x-cloak>Employees</span>
                </a>
            </li>
            <li><a href="{{ route('org-chart.index') }}" title="Org Chart" class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                 {{ request()->routeIs('org-chart.*') ? 'bg-primary-light text-primary' : '' }}">
                  <i class="bi bi-diagram-3"></i>
                  <span x-show="sidebarOpen || hovering" x-cloak>Org Chart</span>
                </a>
            </li>
        </ul>
    </li>
    @endif
    

    @if($canShow('attendances_view'))
    {{-- Attendance --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
    
            <a href="{{ route('attendance.index') }}" class="flex items-center gap-3">

                <svg class="h-5 w-5 shrink-0 text-slate-500"
                        :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'"
                        fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                            d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
                </svg>

                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">
                    Attendance
                </span>

            </a>

        </div>
        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
                <a href="{{ route('attendance.index') }}"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('attendance.index*') ? 'bg-primary-light text-primary' : '' }}">
                    <i class="bi bi-calendar-check"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Daily Attendance</span>
                </a>
            </li>

            <li>
                <a href="{{ route('attendance.reports') }}"
                    class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                    {{ request()->routeIs('attendance.reports') ? 'bg-primary-light text-primary' : '' }}">
                    <i class="bi bi-bar-chart"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Attendance Reports</span>
                </a>
            </li>

            <li>
                <a href="{{ route('attendance-regularizations.index') }}"class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('attendance-regularizations.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-pencil-square"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Regularizations</span>
                </a>
            </li>
        </ul>
    </li>
    @endif

    @if($canShow('leaves_view'))
    {{-- Leaves --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">

            <a href="{{ route('leaves.index') }}" class="flex items-center gap-3">

                <svg class="h-5 w-5 shrink-0 text-slate-500"
                    :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'"
                    fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                        d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                </svg>

                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">
                    Leaves
                </span>

            </a>
        </div>
        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
                <a href="{{ route('leaves.index') }}"
                title="Leave Requests"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('leaves.*') ? 'bg-primary-light text-primary' : '' }}">
                    <i class="bi bi-envelope-paper"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Leave Requests</span>
                </a>
            </li>
            @if(auth()->user()->isTenantManager())
            <li>
                <a href="{{ route('leave-types.manage') }}"
                title="Leave Rules"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('leave-types.manage') ? 'bg-primary-light text-primary' : '' }}">
                    <i class="bi bi-sliders"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Leave Rules</span>
                </a>
            </li>
            @endif
        </ul>
    </li>
    @endif

    {{-- Payroll (single link) --}}
    <li>
        <a href="{{ route('payroll.index') }}"
           class="flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium text-slate-900 hover:bg-slate-100 hover:text-slate-900 {{ request()->routeIs('payroll.*') ? 'bg-primary-light text-primary' : '' }}">
            <i class="bi bi-currency-dollar border"></i>
            <span x-show="sidebarOpen || hovering" x-cloak>Payroll</span>
        </a>
    </li>

    @if($canShow('assets_view'))
    {{-- Assets --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500":class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 0H5m14 0h2m2 0h-2M5 15H3m2 0H5m14 0h2m2 0h-2M9 5H7m2 0H9m6 0h2m2 0h-2M9 15H7m2 0H9m6 0h2m2 0h-2"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">Assets</span>
            </span>
        </div>
        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
                <a href="{{ route('assets.index') }}"
                title="Asset List"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
                hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('assets.*') ? 'bg-primary-light text-primary' : '' }}">

                    <i class="bi bi-box-seam"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Asset List</span>
                </a>
            </li>
        </ul>
    </li>
    @endif

    @if($canShow('finance_view'))
    {{-- Finance --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500":class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">Finance</span>
            </span>
        </div>
        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
                <a href="{{ route('accounts.index') }}"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
                hover:bg-slate-100 hover:text-slate-900
                {{ request( )->routeIs('accounts.*') ? 'bg-primary-light text-primary' : '' }}">

                    <i class="bi bi-wallet2"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Accounts</span>
                </a>
            </li>

            <li>
                <a href="{{ route('expenses.index') }}"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
                hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('expenses.*') ? 'bg-primary-light text-primary' : '' }}">

                    <i class="bi bi-cash-stack"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Expenses</span>
                </a>
            </li>

            <li>
                <a href="{{ route('deposits.index') }}"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
                hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('deposits.*') ? 'bg-primary-light text-primary' : '' }}">

                    <i class="bi bi-bank"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Deposits</span>
                </a>
            </li>
        </ul>
    </li>
    @endif

    @if($canShow('documents_view'))
    <li>
            <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500" :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'"fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">Documents</span>
            </span>
        </div>
        <ul class="space-y-1 border-slate-200" :class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
                <a href="{{ route('documents.index') }}"
                title="Documents"
                class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
                hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('documents.*') ? 'bg-primary-light text-primary' : '' }}">

                    <i class="bi bi-file-earmark-text"></i>
                    <span x-show="sidebarOpen || hovering" x-cloak>Documents</span>
                </a>
            </li>
        </ul>
    </li>
    @endif

    @if($canShow('hr_operations_view'))
    {{-- HR Operations --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500" :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">HR Operations</span>
            </span>
        </div>
        <ul class=" space-y-1  border-slate-200 ":class="sidebarOpen ? 'pl-4' : 'pl-2 ml-0'">
            <li>
            <a href="{{ route('warnings.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('warnings.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-exclamation-triangle"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Warnings</span>
            </a>
        </li>

        <li>
            <a href="{{ route('complaints.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('complaints.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-chat-left-text"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Complaints</span>
            </a>
        </li>

        <li>
            <a href="{{ route('promotions.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('promotions.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-arrow-up-circle"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Promotions</span>
            </a>
        </li>

        <li>
            <a href="{{ route('offboardings.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('offboardings.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-box-arrow-right"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Offboarding</span>
            </a>
        </li>

        <li>
            <a href="{{ route('resignations.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('resignations.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-person-dash"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Resignations</span>
            </a>
        </li>

        <li>
            <a href="{{ route('terminations.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('terminations.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-person-x"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Terminations</span>
            </a>
        </li>

        <li>
            <a href="{{ route('appreciations.index') }}"
            class="flex items-center gap-2 rounded-lg ps-2 pe-2 py-1.5 text-sm text-slate-800 
            hover:bg-slate-100 hover:text-slate-900
            {{ request()->routeIs('appreciations.*') ? 'bg-primary-light text-primary' : '' }}">
                <i class="bi bi-star"></i>
                <span x-show="sidebarOpen || hovering" x-cloak>Appreciations</span>
            </a>
        </li>
        </ul>
    </li>
    @endif

    @if($canShow('recruitment_view'))
    {{-- Recruitment --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500" :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V7a2 2 0 00-2-2h-3V3a1 1 0 00-1-1h-4a1 1 0 00-1 1v2H6a2 2 0 00-2 2v6m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0H4"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">Recruitment</span>
            </span>
        </div>
        <ul class="ml-4 mt-1 space-y-1 border-l border-slate-200 pl-3">
            <li>
                <a href="{{ route('job-postings.index') }}" title="Job Postings" class="flex items-center gap-2 rounded-lg ps-4 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900 
                {{ request()->routeIs('terminations.*') ? 'bg-primary-light text-primary' : '' }}">
                 <i class="bi bi-briefcase"></i><span>Job Postings</span>
                </a>
            </li>
            <li>
                <a href="{{ route('applicants.index') }}" title="Applicants" class="flex items-center gap-2 rounded-lg ps-4 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900 
                {{ request()->routeIs('terminations.*') ? 'bg-primary-light text-primary' : '' }}">
                 <i class="bi bi-person-lines-fill"></i><span>Applicants</span></a></li>
            <li>
                <a href="{{ route('interviews.index') }}" title="Interviews" class="flex items-center gap-2 rounded-lg ps-4 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900 
                {{ request()->routeIs('terminations.*') ? 'bg-primary-light text-primary' : '' }}">
                 <i class="bi bi-calendar2-week"></i><span>Interviews</span>
                </a>
            </li>
        </ul>
    </li>
    @endif

    @if($canShow('performance_view'))
    {{-- Performance --}}
    <li>
        <div class="flex w-full items-center justify-between gap-2 rounded-lg px-3 py-4 text-sm font-medium">
            <span class="flex items-center gap-3">
                <svg class="h-5 w-5 shrink-0 text-slate-500" :class="!sidebarOpen ? 'text-primary' : 'text-slate-500'" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 17a1 1 0 100 2 1 1 0 000-2zm7-13H6a2 2 0 00-2 2v12a2 2 0 002 2h3v-2H6V8h12v10h-3v2h3a2 2 0 002-2V6a2 2 0 00-2-2z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 14l2-2 2 2 4-4"/></svg>
                <span x-show="sidebarOpen || hovering" x-cloak class="text-slate-500">Performance</span>
            </span>
        </div>
        <ul class="ml-4 mt-1 space-y-1 border-l border-slate-200 pl-3">
            <li>
                <a href="{{ route('performance-reviews.index') }}" title="Reviews" class="flex items-center gap-2 rounded-lg ps-4 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900 
                {{ request()->routeIs('terminations.*') ? 'bg-primary-light text-primary' : '' }}">
                 <i class="bi bi-stars"></i><span>Reviews</span>
                </a>
            </li>
            <li>
                <a href="{{ route('goals.index') }}" title="Goals &amp; KPIs" class="flex items-center gap-2 rounded-lg ps-4 pe-2 py-1.5 text-sm text-slate-800 hover:bg-slate-100 hover:text-slate-900
                {{ request()->routeIs('terminations.*') ? 'bg-primary-light text-primary' : '' }}">
                 <i class="bi bi-bullseye"></i><span>Goals &amp; KPIs</span>
                </a>
            </li>
        </ul>
    </li>
    @endif

    @endif
    {{-- Close @if (!$superAdmin) --}}

    @if ($superAdmin)
    <li class="mt-4 border-t border-slate-200 pt-4">
        <span class="px-3 text-xs font-semibold uppercase tracking-wider text-slate-400" x-show="sidebarOpen || hovering" x-cloak>Super Admin</span>
    </li>
    <li><a href="{{ route('superadmin.dashboard') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-primary-light hover:text-primary {{ request()->routeIs('superadmin.dashboard') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Dashboard</span></a></li>
    <li><a href="{{ route('superadmin.companies.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.companies.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Companies</span></a></li>
    <li><a href="{{ route('superadmin.offline-requests.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.offline-requests.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Offline requests</span></a></li>
    <li><a href="{{ route('superadmin.subscriptions.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.subscriptions.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Subscriptions</span></a></li>
    <li><a href="{{ route('superadmin.plans.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.plans.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Plans</span></a></li>
    <li><a href="{{ route('superadmin.payments.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.payments.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2-4h10a2 2 0 002-2V7a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 002 2zm2-4h-2"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Payments</span></a></li>
    <li><a href="{{ route('superadmin.offline-payment-modes.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.offline-payment-modes.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Offline payment modes</span></a></li>
    <li><a href="{{ route('superadmin.payment-settings.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.payment-settings.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 2 0 00-2-2H6a2 2 2 0 00-2 2v6a2 2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Payment settings</span></a></li>
    <li><a href="{{ route('superadmin.income-tax-plans.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.income-tax-plans.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Income tax settings</span></a></li>
    <li><a href="{{ route('superadmin.deduction-sections.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.deduction-sections.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Deduction sections</span></a></li>
    <li><a href="{{ route('superadmin.analytics') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.analytics') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Analytics</span></a></li>
    <li><a href="{{ route('superadmin.settings.index') }}" class="flex items-center gap-3 rounded-lg px-3 py-4 text-sm font-medium text-slate-700 hover:bg-slate-100 {{ request()->routeIs('superadmin.settings.*') ? 'bg-primary-light text-primary' : '' }}"><svg class="h-5 w-5 shrink-0 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg><span x-show="sidebarOpen || hovering" x-cloak>Settings</span></a></li>
    @endif
</ul>