<aside class="portal-sidebar" id="portalSidebar" aria-label="Main navigation">
    <div class="portal-sidebar-brand">
        <a href="<?php echo e(default_home_url()); ?>" class="portal-sidebar-logo">
            <span class="portal-sidebar-logo-mark">C</span>
            <span class="portal-sidebar-logo-text">CRM</span>
        </a>
        <button type="button" class="portal-sidebar-close d-lg-none" id="portalSidebarClose" aria-label="Close menu">
            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6L6 18M6 6l12 12"/></svg>
        </button>
    </div>

    <nav class="portal-sidebar-nav">
        <div class="portal-sidebar-section">
            <span class="portal-sidebar-label">Overview</span>
            <?php if(can_access_module('leads.dashboard')): ?>
                <a href="<?php echo e(route('leads.dashboard')); ?>"
                   class="portal-sidebar-link <?php echo e(request()->routeIs('leads.dashboard') ? 'active' : ''); ?>">
                    <span class="portal-sidebar-icon" aria-hidden="true">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
                    </span>
                    Dashboard
                </a>
            <?php endif; ?>
        </div>

        <div class="portal-sidebar-section">
            <span class="portal-sidebar-label">Leads</span>
            <?php if(can_access_module('leads.listing')): ?>
                <a href="<?php echo e(route('leads.listing')); ?>"
                   class="portal-sidebar-link <?php echo e(request()->routeIs('leads.listing', 'leads.show', 'leads.edit') && !request()->routeIs('leads.my-tasks', 'leads.design-tasks') ? 'active' : ''); ?>">
                    <span class="portal-sidebar-icon" aria-hidden="true">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg>
                    </span>
                    Lead listing
                </a>
            <?php endif; ?>
            <?php if(can_access_module('leads.my_tasks')): ?>
                <a href="<?php echo e(route('leads.my-tasks')); ?>"
                   class="portal-sidebar-link <?php echo e(request()->routeIs('leads.my-tasks') ? 'active' : ''); ?>">
                    <span class="portal-sidebar-icon" aria-hidden="true">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"/></svg>
                    </span>
                    My tasks
                </a>
            <?php endif; ?>
            <?php if(can_access_module('leads.design_tasks') || can_access_module('leads.listing') || can_access_module('leads.dashboard')): ?>
                <a href="<?php echo e(route('leads.design-tasks')); ?>"
                   class="portal-sidebar-link <?php echo e(request()->routeIs('leads.design-tasks') ? 'active' : ''); ?>">
                    <span class="portal-sidebar-icon" aria-hidden="true">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
                    </span>
                    <?php echo e(can_access_module('leads.design_tasks') && !can_access_module('leads.listing') ? 'My design tasks' : 'Design tracking'); ?>

                </a>
            <?php endif; ?>
            <?php if(can_access_module('leads.create')): ?>
                <a href="<?php echo e(route('leads.create')); ?>"
                   class="portal-sidebar-link <?php echo e(request()->routeIs('leads.create') ? 'active' : ''); ?>">
                    <span class="portal-sidebar-icon" aria-hidden="true">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 5v14M5 12h14"/></svg>
                    </span>
                    Add lead
                </a>
            <?php endif; ?>
        </div>

        <?php if(can_access_module('users.manage') || can_access_module('masters.roles') || can_access_module('masters.departments')): ?>
            <div class="portal-sidebar-section">
                <button class="portal-sidebar-group-toggle <?php echo e(request()->routeIs('users.*', 'roles.*', 'departments.master.*') ? '' : 'collapsed'); ?>"
                        type="button"
                        data-bs-toggle="collapse"
                        data-bs-target="#sidebarAdmin"
                        aria-expanded="<?php echo e(request()->routeIs('users.*', 'roles.*', 'departments.master.*') ? 'true' : 'false'); ?>">
                    <span class="portal-sidebar-label mb-0">Administration</span>
                    <svg class="portal-sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>
                </button>
                <div class="collapse <?php echo e(request()->routeIs('users.*', 'roles.*', 'departments.master.*') ? 'show' : ''); ?>" id="sidebarAdmin">
                    <div class="portal-sidebar-subnav">
                        <?php if(can_access_module('users.manage')): ?>
                            <a href="<?php echo e(route('users.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('users.*') ? 'active' : ''); ?>">Users</a>
                        <?php endif; ?>
                        <?php if(can_access_module('masters.roles')): ?>
                            <a href="<?php echo e(route('roles.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('roles.*') ? 'active' : ''); ?>">Roles</a>
                        <?php endif; ?>
                        <?php if(can_access_module('masters.departments')): ?>
                            <a href="<?php echo e(route('departments.master.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('departments.master.*') ? 'active' : ''); ?>">Departments</a>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        <?php endif; ?>

        <?php if(can_access_module('geography.continents') || can_access_module('geography.countries') || can_access_module('geography.cities') || can_access_module('tradefairs.manage')): ?>
            <div class="portal-sidebar-section">
                <button class="portal-sidebar-group-toggle <?php echo e(request()->routeIs('continents.*', 'countries.*', 'cities.*', 'tradefairs.*') ? '' : 'collapsed'); ?>"
                        type="button"
                        data-bs-toggle="collapse"
                        data-bs-target="#sidebarLocations"
                        aria-expanded="<?php echo e(request()->routeIs('continents.*', 'countries.*', 'cities.*', 'tradefairs.*') ? 'true' : 'false'); ?>">
                    <span class="portal-sidebar-label mb-0">Locations</span>
                    <svg class="portal-sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>
                </button>
                <div class="collapse <?php echo e(request()->routeIs('continents.*', 'countries.*', 'cities.*', 'tradefairs.*') ? 'show' : ''); ?>" id="sidebarLocations">
                    <div class="portal-sidebar-subnav">
                        <?php if(can_access_module('geography.continents')): ?>
                            <a href="<?php echo e(route('continents.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('continents.*') ? 'active' : ''); ?>">Continents</a>
                        <?php endif; ?>
                        <?php if(can_access_module('geography.countries')): ?>
                            <a href="<?php echo e(route('countries.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('countries.*') ? 'active' : ''); ?>">Countries</a>
                        <?php endif; ?>
                        <?php if(can_access_module('geography.cities')): ?>
                            <a href="<?php echo e(route('cities.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('cities.*') ? 'active' : ''); ?>">Cities</a>
                        <?php endif; ?>
                        <?php if(can_access_module('tradefairs.manage')): ?>
                            <a href="<?php echo e(route('tradefairs.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('tradefairs.*') ? 'active' : ''); ?>">Trade fairs</a>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        <?php endif; ?>

        <?php if(auth()->user()->isPlatformAdmin()): ?>
            <div class="portal-sidebar-section">
                <button class="portal-sidebar-group-toggle <?php echo e(request()->routeIs('visibility.*', 'visibility-modules.*') ? '' : 'collapsed'); ?>"
                        type="button"
                        data-bs-toggle="collapse"
                        data-bs-target="#sidebarAccess"
                        aria-expanded="<?php echo e(request()->routeIs('visibility.*', 'visibility-modules.*') ? 'true' : 'false'); ?>">
                    <span class="portal-sidebar-label mb-0">Access control</span>
                    <svg class="portal-sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>
                </button>
                <div class="collapse <?php echo e(request()->routeIs('visibility.*', 'visibility-modules.*') ? 'show' : ''); ?>" id="sidebarAccess">
                    <div class="portal-sidebar-subnav">
                        <a href="<?php echo e(route('visibility.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('visibility.index', 'visibility.departments.*', 'visibility.users.*') ? 'active' : ''); ?>">Visibility manager</a>
                        <a href="<?php echo e(route('visibility-modules.index')); ?>" class="portal-sidebar-sublink <?php echo e(request()->routeIs('visibility-modules.*') ? 'active' : ''); ?>">Permission modules</a>
                    </div>
                </div>
            </div>
        <?php endif; ?>
    </nav>

    <div class="portal-sidebar-footer d-none d-lg-block">
        <div class="portal-sidebar-user-mini">
            <span class="portal-sidebar-user-avatar"><?php echo e(strtoupper(substr(auth()->user()->name, 0, 1))); ?></span>
            <div class="portal-sidebar-user-meta">
                <span class="portal-sidebar-user-name"><?php echo e(auth()->user()->name); ?></span>
                <span class="portal-sidebar-user-role"><?php echo e(optional(auth()->user()->department)->name ?: 'Staff'); ?></span>
            </div>
        </div>
    </div>
</aside>
<?php /**PATH D:\laragon\www\lt\resources\views/layouts/partials/sidebar.blade.php ENDPATH**/ ?>