
<nav class="main-navbar">
    
    <button class="navbar-toggle" id="sidebarToggle" type="button">
        <i class="fas fa-bars"></i>
    </button>

    
    <div class="navbar-breadcrumb">
        <h1><?php echo $__env->yieldContent('page-title', 'Dashboard'); ?></h1>
        <?php if (! empty(trim($__env->yieldContent('breadcrumb')))): ?>
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Inicio</a></li>
                    <?php echo $__env->yieldContent('breadcrumb'); ?>
                </ol>
            </nav>
        <?php endif; ?>
    </div>

    
    <div class="navbar-actions">
        
        <div class="dropdown">
            <button class="btn-icon" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                <i class="fas fa-bell"></i>
                <?php
                    $notificaciones = \App\Models\Alerta::where('estado', 'ACTIVA')
                        ->orderBy('fecha_genera', 'desc')
                        ->limit(5)
                        ->get();
                    $totalNotif = $notificaciones->count();
                ?>
                <?php if($totalNotif > 0): ?>
                <span class="badge rounded-pill"><?php echo e($totalNotif); ?></span>
                <?php endif; ?>
            </button>
            <div class="dropdown-menu dropdown-menu-end" style="width: 320px;">
                <h6 class="dropdown-header">Notificaciones</h6>
                <?php $__empty_1 = true; $__currentLoopData = $notificaciones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notif): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <a class="dropdown-item" href="<?php echo e(route('web.alertas.show', $notif->alerta_id)); ?>">
                    <i class="fas fa-exclamation-triangle text-<?php echo e($notif->prioridad == 'ALTA' ? 'danger' : ($notif->prioridad == 'MEDIA' ? 'warning' : 'info')); ?>"></i>
                    <div class="flex-grow-1">
                        <div class="small text-truncate"><?php echo e($notif->titulo); ?></div>
                        <small class="text-muted"><?php echo e($notif->fecha_genera?->diffForHumans() ?? '-'); ?></small>
                    </div>
                </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="dropdown-item text-muted text-center py-3">
                    <i class="fas fa-check-circle d-block mb-2" style="font-size: 1.5rem;"></i>
                    Sin alertas pendientes
                </div>
                <?php endif; ?>
                <?php if($totalNotif > 0): ?>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item text-center text-primary" href="<?php echo e(route('web.alertas.index')); ?>">
                    Ver todas las alertas
                </a>
                <?php endif; ?>
            </div>
        </div>

        
        <div class="dropdown">
            <button class="btn-icon" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                <i class="fas fa-user-circle"></i>
            </button>
            <div class="dropdown-menu dropdown-menu-end">
                <div class="px-3 py-2 border-bottom">
                    <div class="fw-semibold"><?php echo e(auth()->user()->name); ?></div>
                    <small class="text-muted"><?php echo e(auth()->user()->email); ?></small>
                </div>
                <a class="dropdown-item" href="<?php echo e(route('web.perfil')); ?>">
                    <i class="fas fa-user"></i>
                    Mi Perfil
                </a>
                <a class="dropdown-item" href="<?php echo e(route('web.cambiar-password')); ?>">
                    <i class="fas fa-key"></i>
                    Cambiar Contraseña
                </a>
                <div class="dropdown-divider"></div>
                <form action="<?php echo e(route('web.logout')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="dropdown-item text-danger">
                        <i class="fas fa-sign-out-alt"></i>
                        Cerrar Sesión
                    </button>
                </form>
            </div>
        </div>
    </div>
</nav>
<?php /**PATH /Users/oscarcornejo/Desktop/MACROGRAM/PROYECTOS_DESARROLLO/EXTERNOS/sistema_mantenimiento/resources/views/layouts/partials/navbar.blade.php ENDPATH**/ ?>