<?php $__env->startSection('titulo','Usuarios'); ?>
<?php $__env->startSection('contenido'); ?>
<div class="d-flex flex-wrap justify-content-between align-items-center mb-3">
  <h4><i class="fa fa-users"></i> Usuarios</h4>
  <a href="<?php echo e(route('usuarios.create')); ?>" class="btn btn-primario"><i class="fa fa-plus"></i> Nuevo</a>
</div>
<form method="GET" class="mb-3">
  <div class="input-group"><input name="q" value="<?php echo e($busqueda); ?>" class="form-control" placeholder="Buscar...">
    <button class="btn btn-outline-primary"><i class="fa fa-search"></i></button></div>
</form>
<div class="card"><div class="table-responsive"><table class="table table-hover mb-0">
<thead><tr><th>Usuario</th><th>Nombre</th><th>Cargo</th><th>Rol</th><th>Activo</th><th>Último acceso</th><th></th></tr></thead><tbody>
<?php $__empty_1 = true; $__currentLoopData = $registros; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
  <td><strong><?php echo e($u->usuario); ?></strong></td>
  <td><?php echo e($u->nombre_completo); ?></td>
  <td><?php echo e($u->cargo); ?></td>
  <td><?php $__currentLoopData = $u->roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><span class="badge text-bg-info"><?php echo e($r->name); ?></span><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></td>
  <td><span class="badge text-bg-<?php echo e($u->activo?'success':'secondary'); ?>"><?php echo e($u->activo?'Sí':'No'); ?></span></td>
  <td><small><?php echo e($u->ultimo_acceso?->format('d/m/Y H:i') ?? '—'); ?></small></td>
  <td class="text-end">
    <a href="<?php echo e(route('usuarios.edit',$u)); ?>" class="btn btn-sm btn-outline-primary"><i class="fa fa-pen"></i></a>
    <form method="POST" action="<?php echo e(route('usuarios.destroy',$u)); ?>" class="d-inline" onsubmit="return confirm('¿Eliminar?');">
      <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="btn btn-sm btn-outline-danger"><i class="fa fa-trash"></i></button></form>
  </td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?> <tr><td colspan="7" class="text-muted text-center py-4">Sin usuarios</td></tr> <?php endif; ?>
</tbody></table></div></div>
<div class="mt-2"><?php echo e($registros->links()); ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\mto\resources\views/usuarios/index.blade.php ENDPATH**/ ?>