
<ul class="navbar-nav bg-primary sidebar sidebar-dark accordion" id="accordionSidebar">

    <!-- Brand -->
    <a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('dashboard') }}">
        <div class="sidebar-brand-icon">
            <img src="https://alumnos.sistemasecuiep.com/logo.png" alt="SECUIEP" style="width:100px;height:auto;">
        </div>
    </a>

    <hr class="sidebar-divider my-0">

    <!-- Dashboard -->
    <li class="nav-item active">
        <a class="nav-link" href="{{ route('dashboard') }}">
            <i class="fas fa-fw fa-tachometer-alt"></i>
            <span>Inicio</span>
        </a>
    </li>

    <hr class="sidebar-divider">
    <div class="sidebar-heading">Módulos</div>

    <!-- Herramientas del rol (collapse) -->
    <li class="nav-item">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#menuHerramientas"
           aria-expanded="false" aria-controls="menuHerramientas">
            <i class="fas fa-star" style="color:rgb(255,153,0)"></i>
            <span>{{ Auth::user()->getRoleNames()->first() }}</span>
        </a>
        <div id="menuHerramientas" class="collapse" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Herramientas:</h6>

                @can('plantel.index')
                    <a class="collapse-item" href="{{ route('plantel.index') }}">Planteles</a>
                @endcan

                @can('carrera.index')
                    <a class="collapse-item" href="{{ route('carrera.index') }}">Carreras</a>
                @endcan

                @can('duration.index')
                    <a class="collapse-item" href="{{ route('duration.index') }}">Duraciones</a>
                @endcan

                @can('plan.index')
                    <a class="collapse-item" href="{{ route('plan.index') }}">Planes de estudio</a>
                @endcan

                @can('nivel.index')
                    <a class="collapse-item" href="{{ route('nivel.index') }}">Niveles</a>
                @endcan

                @can('documentoTipo.index')
                    <a class="collapse-item" href="{{ route('documentoTipo.index') }}">Documentación</a>
                @endcan

                @can('permission.index')
                    <a class="collapse-item" href="{{ route('permission.index') }}">Permisos</a>
                @endcan

                @can('role.index')
                    <a class="collapse-item" href="{{ route('role.index') }}">Roles</a>
                @endcan

                @can('user.index')
                    <a class="collapse-item" href="{{ route('user.index') }}">Usuarios</a>
                @endcan

                @can('area.index')
                    <a class="collapse-item" href="{{ route('area.index') }}">Áreas</a>
                @endcan

                @can('campan.index')
                    <a class="collapse-item" href="{{ route('campan.index') }}">Campañas</a>
                @endcan

                @can('turno.index')
                    <a class="collapse-item" href="{{ route('turno.index') }}">Turnos</a>
                @endcan

                @can('medio.index')
                    <a class="collapse-item" href="{{ route('medio.index') }}">Medios de contacto</a>
                @endcan

                @can('plane.create')
                    <a class="collapse-item" href="{{ route('plane.index') }}">Planes de pago</a>
                @endcan

                @can('concepto.index')
                    <a class="collapse-item" href="{{ route('concepto.index') }}">Conceptos</a>
                @endcan

                @can('mail.index')
                    <a class="collapse-item" href="{{ route('mail.index') }}">Mail</a>
                @endcan

                @can('areacode.index')
                    <a class="collapse-item" href="{{ route('areacode.index') }}">Códigos QR</a>
                @endcan

                @can('horario.index')
                    <a class="collapse-item" href="{{ route('horario.index') }}">Horarios</a>
                @endcan

                @can('anuncios.index')
                    <a class="collapse-item" href="{{ route('anuncio.index') }}">Anuncios</a>
                @endcan

                @can('evaluaciones.index')
                    <a class="collapse-item" href="{{ route('evaluacion.index') }}">Evaluaciones</a>
                @endcan

                @can('alumno.index')
                    <a class="collapse-item" href="{{ route('alumno.index') }}">Alumnos</a>
                @endcan

                @can('grupo.index')
                    <a class="collapse-item" href="{{ route('grupo.index') }}">Grupos</a>
                @endcan

                @can('docente.index')
                    <a class="collapse-item" href="{{ route('docente.index') }}">Docentes</a>
                @endcan
            </div>
        </div>
    </li>

    <hr class="sidebar-divider">
    <div class="sidebar-heading">Adicionales</div>

    @can('pagar')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('pago.index') }}">
            <i class="fas fa-fw fa-money-bill-alt"></i>
            <span>Mis pagos</span>
        </a>
    </li>
    @endcan

    @can('tareas.entrega')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('mis.tareas') }}">
            <i class="fas fa-fw fa-tasks"></i>
            <span>Mis Tareas</span>
        </a>
    </li>
    @endcan

    @can('evaluaciones.responder')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('evaluacion.mis_evaluaciones') }}">
            <i class="fas fa-fw fa-clipboard-list"></i>
            <span>Encuestas</span>
        </a>
    </li>
    @endcan

    @can('comunidad')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('feed') }}">
            <i class="fas fa-fw fa-stream"></i>
            <span>Comunidad</span>
        </a>
    </li>
    @endcan

    @can('amigos')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('friendships.index') }}">
            <i class="fas fa-fw fa-user-friends"></i>
            <span>Amigos</span>
        </a>
    </li>
    @endcan

    @can('mensajes')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('chat.index') }}">
            <i class="fas fa-fw fa-comment-dots"></i>
            <span>Mensajes</span>
        </a>
    </li>
    @endcan

    @can('asistencia')
    <li class="nav-item">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseAsistencia"
           aria-expanded="false" aria-controls="collapseAsistencia">
            <i class="fas fa-fw fa-id-badge"></i>
            <span>Asistencia</span>
        </a>
        <div id="collapseAsistencia" class="collapse" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Herramientas:</h6>
                <a class="collapse-item" href="{{ route('code.index') }}">Escanear</a>
                <a class="collapse-item" href="{{ route('registros') }}">Registros</a>
            </div>
        </div>
    </li>
    @endcan

    @can('note.index')
    <li class="nav-item">
        <a class="nav-link" href="{{ route('note.index') }}">
            <i class="fas fa-fw fa-sticky-note"></i>
            <span>Notas</span>
        </a>
    </li>
    @endcan

    @can('promocion.index')
    <li class="nav-item">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseWhatsApp"
           aria-expanded="false" aria-controls="collapseWhatsApp">
            <i class="fab fa-fw fa-whatsapp" style="color:#25D366"></i>
            <span>WhatsApp
                <span class="badge badge-danger badge-counter ml-1 d-none" id="wa-badge-menu">0</span>
            </span>
        </a>
        <div id="collapseWhatsApp" class="collapse" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">Marketing:</h6>
                <a class="collapse-item" href="{{ route('promocion.index') }}">Promociones</a>
                @can('promocion.chat')
                <a class="collapse-item" href="{{ route('promocion.chat') }}">Chat</a>
                @endcan
                @can('promocion.analytics')
                <a class="collapse-item" href="{{ route('promocion.analytics') }}">Analytics</a>
                @endcan
            </div>
        </div>
    </li>
    @endcan

    <!-- Sidebar Toggler -->
    <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
    </div>

</ul>
