                
<div class="vertical-menu" style="background-color: #e6efe2;">
    <!-- User Email at Top -->
    @if(Auth::check())
    <div style="padding: 1.2rem 1rem 0.5rem 1rem; display: flex; align-items: center; gap: 0.7rem; border-bottom: 1px solid #e0e0e0; background: #e6efe2;">
        <div style="background: #6F8E6A; color: #fff; border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.1rem;">
            {{ strtoupper(substr(Auth::user()->name,0,1)) }}
        </div>
        <div style="display: flex; flex-direction: column;">
            <span style="font-size: 0.98rem; color: #48773D; font-weight: bold;">{{ Auth::user()->name }}</span>
            <span style="font-size: 0.92rem; color: #48773D; opacity: 0.85;">{{ Auth::user()->email }}</span>
        </div>
    </div>
    @endif
    <div data-simplebar class="h-100">
        <!--- Sidemenu -->
        <div id="sidebar-menu">
            <!-- Left Menu Start -->
            <ul class="metismenu list-unstyled" id="side-menu">
                <li class="menu-title"></li> @can('Access Dashboard')
                <li>
                    <a href="{{ route('dashboard') }}" class="waves-effect">
                        <i class="ri-home-4-line"></i>
                        <span>Dashboard</span>
                    </a>
                </li>               
                @endcan

                @can('Access Shared Folders')
                <li>
                    <a href="{{ route('folders.my') }}" class="waves-effect">
                        <i class="ri-folder-3-line"></i>
                        <span>My Folders</span>
                    </a>      
                </li>
                @endcan
 @can('My Workflows')
                        <li>
                            <a href="{{ route('workflow.myworkflow') }}">
                                <i class="ri-user-settings-line"></i>
                                My Workflows
                            </a>
                        </li>
                        @endcan

                @can('View Workflows')
                <li>
                    <a href="javascript: void(0);" class="has-arrow waves-effect" data-title="Workflows">
                        <i class="ri-git-merge-line"></i>
                        <span>Workflows</span>
                    </a>
                    <ul class="sub-menu" aria-expanded="false">
                       
                        <li>
                            <a href="{{ route('workflow.index') }}">
                                <i class="ri-list-check-2"></i>
                                All Workflows
                            </a>
                        </li>
                    </ul>
                </li>
                @endcan

           

                 @can('View Folder')
                 <li>
                    <a href="{{ route('folders.index') }}" class="waves-effect" data-title="Folders & Files">
                        <i class="ri-folders-line"></i>
                        <span>Folder Mgt</span>
                    </a>
                </li>
                @endcan

                @canany(['View Users', 'View Roles'])
                <li>
                    <a href="javascript: void(0);" class="has-arrow waves-effect" data-title="User Management">
                        <i class="ri-group-line"></i>
                        <span>User Management</span>
                    </a>

                 <ul class="sub-menu" aria-expanded="false">
                    @can('View Users')
                    <li>
                        <a href="{{ route('users.index') }}">
                            <i class="ri-user-line"></i>
                            Users
                        </a>
                    </li>
                    @endcan
                    @can('View Roles')
                    <li>
                        <a href="{{ route('roles.index') }}">
                            <i class="ri-shield-user-line"></i>
                            User Roles
                        </a>
                    </li>
                    @endcan
                </ul>   
                </li>
                @endcanany

                @can('View Reports')
                <li>
                    <a href="javascript: void(0);" class="has-arrow waves-effect{{ request()->routeIs('reports.*') ? ' active' : '' }}" data-title="Reports">
                        <i class="ri-file-chart-line"></i>
                        <span>Reports</span>
                    </a>
                    <ul class="sub-menu" aria-expanded="false">
                        <li>
                            <a href="{{ route('reports.workflow-report') }}">
                                <i class="ri-bar-chart-line"></i>
                                WF Summary
                            </a>
                        </li>
                        <li>
                            <a href="{{ route('reports.task-report') }}">
                                <i class="ri-time-line"></i>
                                Task Status
                            </a>
                        </li>
                        <li>
                            <a href="{{ route('reports.user-report') }}">
                                <i class="ri-user-line"></i>
                                User Activity
                            </a>
                        </li>
                        <li>
                            <a href="{{ route('reports.folder-file-stats') }}">
                                <i class="ri-archive-line"></i>
                                Folder & File Stats
                            </a>
                        </li>
                    </ul>
                </li>
                @endcan

                @can('View System Logs')
    <li>
                    <a href="javascript: void(0);" class="has-arrow waves-effect" data-title="Workflows">
                         <i class="ri-file-warning-line"></i>
                        <span>System Logs</span>
                    </a>
                    <ul class="sub-menu" aria-expanded="false">
                       
                        <li>
                            <a href="{{ route('workflow.audit') }}">
                                <i class="ri-file-warning-line"></i>
                               Activity Logs
                            </a>
                        </li>
                      
                    </ul>
                </li>
                @endcan
            </ul>
        </div>
        <!-- Sidebar -->
    </div>
</div>