@php
    $user = Auth::user();
@endphp

<!-- Sidebar -->
<div class="sidebar">

   
    <!-- Sidebar Menu -->
    <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column"
            data-widget="treeview"
            role="menu"
            data-accordion="false">

            {{-- ===== TODOS VEN ===== --}}
            
            <li class="nav-item">
                <a href="{{ route('home') }}" class="nav-link">
                    <i class="nav-icon fas fa-th"></i>
                    <p>Tablero</p>
                </a>
            </li>

              @hasanyrole('super-admin|admin-empresa|vendedor|cotizador')
            <li class="nav-item">
                <a href="{{ route('cotizaciones.create') }}" class="nav-link">
                    <i class="nav-icon fas fa-file-invoice-dollar"></i>
                    <p>Nueva cotizacion</p>
                </a>
            </li>
             @endhasanyrole

             @hasanyrole('super-admin|admin-empresa|vendedor|cotizador')
            <li class="nav-item">
                <a href="{{ route('cotizaciones.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-file-invoice"></i>
                    <p>Cotizaciones</p>
                </a>
            </li>
             {{--
            @hasanyrole('super-admin|admin-empresa')
            <li class="nav-item">
                <a href="{{ route('clients.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-user-tie"></i>
                    <p>Clientes</p>
                </a>
            </li>

            <li class="nav-item">
                <a href="{{ route('products.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-box"></i>
                    <p>Productos</p>
                </a>
            </li>
            @endhasanyrole
            --}}


            @endhasanyrole
            {{-- ===== SOLO SUPER ADMIN ===== --}}
            @role('super-admin')
            <li class="nav-item">
                <a href="{{ route('companies.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-building"></i>
                    <p>Empresas</p>
                </a>
            </li>
            @endrole

            {{-- ===== ADMIN EMPRESA Y SUPER ADMIN ===== --}}
            @hasanyrole('super-admin|admin-empresa')
            <li class="nav-item">
                <a href="{{ route('users.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-users"></i>
                    <p>Usuarios</p>
                </a>
            </li>
            @endhasanyrole

            @role('super-admin')
            <li class="nav-item">
                <a href="{{ route('roles.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-user-shield"></i>
                    <p>Roles</p>
                </a>
            </li>
            @endrole

            @role('super-admin')
            <li class="nav-item">
                <a href="{{ route('permissions.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-key"></i>
                    <p>Permisos</p>
                </a>
            </li>
            @endrole

            {{-- 
                ===== MÓDULOS FUTUROS (DESACTIVADOS PARA EVITAR ERRORES) =====
                Los activamos cuando creemos las rutas:
                clients.index, products.index, quotes.index, quotes.create
            --}}

           
        
            @hasanyrole('super-admin|admin-empresa|vendedor')
            <li class="nav-item">
                <a href="{{ route('clients.index') }}" class="nav-link">
                    <i class="nav-icon fas fa-user-tie"></i>
                    <p>Clientes</p>
                </a>
            </li>

            @endhasanyrole

             @hasanyrole('super-admin|admin-empresa|vendedor')
            <li class="nav-item">
                <a href="{{ route('productos.index') }}" class="nav-link">
                      <i class="nav-icon fas fa-box"></i>
                    <p>Productos o Servicios</p>
                </a>
            </li>

            @endhasanyrole
      
        @hasanyrole('super-admin|admin-empresa')
        <li class="nav-item">
            <a href="{{ route('auditoria.index') }}" class="nav-link">
                <i class="nav-icon fas fa-history"></i>
                <p>Auditoría</p>
            </a>
        </li>
        @endhasanyrole

         @hasanyrole('super-admin|admin-empresa')
        <li class="nav-item">
            <a href="{{ route('reports.sales') }}" class="nav-link">
              <i class="nav-icon fas fa-chart-bar"></i>
                <p>Reportes</p>
            </a>
        </li>
        @endhasanyrole
        </ul>
    </nav>
</div>
<!-- /.sidebar -->
