<div>
    <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:1.75rem;flex-wrap:wrap;gap:1rem;">
        <div>
            <h1 style="font-size:1.5rem;font-weight:700;color:#0f172a;margin:0;">Gestión de usuarios</h1>
            <p style="font-size:13px;color:#64748b;margin:4px 0 0;">Crea y administra los usuarios del sistema</p>
        </div>
    </div>

    <div style="display:grid;grid-template-columns:1fr 1.5fr;gap:1.5rem;align-items:start;">

        
        <div style="background:#fff;border-radius:1rem;border:1px solid #e8ecf4;padding:1.5rem;box-shadow:0 1px 4px rgba(0,0,0,0.04);">
            <h2 style="font-size:14px;font-weight:700;color:#0f172a;margin:0 0 1.25rem;padding-bottom:0.75rem;border-bottom:1px solid #f1f5f9;">
                Nuevo usuario
            </h2>
            <div style="display:flex;flex-direction:column;gap:0.875rem;">
                <div>
                    <label style="display:block;font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;margin-bottom:0.35rem;">Nombre completo</label>
                    <input wire:model="nuevoNombre" type="text"
                        style="width:100%;border:1.5px solid #e2e8f0;border-radius:0.625rem;padding:0.65rem 0.875rem;font-size:13.5px;outline:none;"
                        placeholder="Nombre completo">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['nuevoNombre'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p style="color:#dc2626;font-size:11.5px;margin:3px 0 0;"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div>
                    <label style="display:block;font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;margin-bottom:0.35rem;">Correo electrónico</label>
                    <input wire:model="nuevoEmail" type="email"
                        style="width:100%;border:1.5px solid #e2e8f0;border-radius:0.625rem;padding:0.65rem 0.875rem;font-size:13.5px;outline:none;"
                        placeholder="correo@fempha.com.co">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['nuevoEmail'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p style="color:#dc2626;font-size:11.5px;margin:3px 0 0;"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div>
                    <label style="display:block;font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;margin-bottom:0.35rem;">Contraseña</label>
                    <input wire:model="nuevoPassword" type="password"
                        style="width:100%;border:1.5px solid #e2e8f0;border-radius:0.625rem;padding:0.65rem 0.875rem;font-size:13.5px;outline:none;"
                        placeholder="Mínimo 8 caracteres">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['nuevoPassword'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p style="color:#dc2626;font-size:11.5px;margin:3px 0 0;"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div>
                    <label style="display:block;font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;margin-bottom:0.35rem;">Rol</label>
                    <select wire:model="nuevoRol"
                        style="width:100%;border:1.5px solid #e2e8f0;border-radius:0.625rem;padding:0.65rem 0.875rem;font-size:13.5px;outline:none;background:#fff;color:#374151;">
                        <option value="">Seleccionar rol...</option>
                        <option value="asociado">👤 Asociado</option>
                        <option value="evaluador">🔍 Evaluador</option>
                        <option value="junta">⚖️ Junta Directiva</option>
                        <option value="admin">🛡️ Administrador</option>
                    </select>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['nuevoRol'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p style="color:#dc2626;font-size:11.5px;margin:3px 0 0;"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <button wire:click="crearUsuario"
                    style="background:#002d6b;color:#fff;border:none;border-radius:0.625rem;padding:0.7rem;font-size:13.5px;font-weight:600;cursor:pointer;width:100%;margin-top:0.25rem;">
                    Crear usuario
                </button>
            </div>
        </div>

        
        <div style="background:#fff;border-radius:1rem;border:1px solid #e8ecf4;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,0.04);">
            <div style="padding:1rem 1.25rem;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between;gap:1rem;">
                <span style="font-size:14px;font-weight:700;color:#0f172a;">Usuarios registrados</span>
                <div style="position:relative;">
                    <svg style="position:absolute;left:0.65rem;top:50%;transform:translateY(-50%);width:14px;height:14px;color:#94a3b8;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                    </svg>
                    <input wire:model.live.debounce.300ms="busqueda" type="text"
                        style="border:1.5px solid #e2e8f0;border-radius:0.5rem;padding:0.5rem 0.75rem 0.5rem 2rem;font-size:13px;outline:none;width:200px;"
                        placeholder="Buscar...">
                </div>
            </div>
            <div style="overflow-x:auto;">
                <table style="width:100%;border-collapse:collapse;font-size:13px;">
                    <thead>
                        <tr style="background:#f8fafc;">
                            <th style="padding:0.75rem 1rem;text-align:left;font-size:10.5px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;">Usuario</th>
                            <th style="padding:0.75rem 1rem;text-align:center;font-size:10.5px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;">Rol</th>
                            <th style="padding:0.75rem 1rem;text-align:center;font-size:10.5px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;">Estado</th>
                            <th style="padding:0.75rem 1rem;text-align:center;font-size:10.5px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.07em;">Acción</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $usuarios; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr style="border-top:1px solid #f1f5f9;" onmouseover="this.style.background='#fafbff'" onmouseout="this.style.background=''">
                            <td style="padding:0.75rem 1rem;">
                                <div style="display:flex;align-items:center;gap:0.625rem;">
                                    <div style="width:32px;height:32px;border-radius:50%;background:#eef3fc;color:#002d6b;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0;">
                                        <?php echo e(strtoupper(substr($u->name, 0, 2))); ?>

                                    </div>
                                    <div>
                                        <div style="font-weight:600;color:#1e293b;"><?php echo e($u->name); ?></div>
                                        <div style="font-size:11.5px;color:#94a3b8;"><?php echo e($u->email); ?></div>
                                    </div>
                                </div>
                            </td>
                            <td style="padding:0.75rem 1rem;text-align:center;">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $u->getRoleNames(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rol): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <span style="display:inline-block;padding:2px 9px;border-radius:999px;font-size:11px;font-weight:700;
                                    <?php if($rol==='admin'): ?> background:#fee2e2;color:#b91c1c;
                                    <?php elseif($rol==='evaluador'): ?> background:#f3e8ff;color:#7e22ce;
                                    <?php elseif($rol==='junta'): ?> background:#ccfbf1;color:#0f766e;
                                    <?php else: ?> background:#dbeafe;color:#1d4ed8; <?php endif; ?>">
                                    <?php echo e(ucfirst($rol)); ?>

                                </span>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </td>
                            <td style="padding:0.75rem 1rem;text-align:center;">
                                <span style="display:inline-block;padding:2px 9px;border-radius:999px;font-size:11px;font-weight:700;
                                    <?php echo e(($u->estado ?? 'activo') === 'activo' ? 'background:#dcfce7;color:#15803d;' : 'background:#f1f5f9;color:#64748b;'); ?>">
                                    <?php echo e(ucfirst($u->estado ?? 'activo')); ?>

                                </span>
                            </td>
                            <td style="padding:0.75rem 1rem;text-align:center;">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($u->id !== auth()->id()): ?>
                                <button wire:click="toggleEstado(<?php echo e($u->id); ?>)"
                                    style="font-size:11.5px;font-weight:600;background:none;border:1.5px solid;border-radius:0.375rem;padding:0.25rem 0.625rem;cursor:pointer;
                                        <?php echo e(($u->estado ?? 'activo') === 'activo' ? 'color:#dc2626;border-color:#fecaca;' : 'color:#15803d;border-color:#bbf7d0;'); ?>">
                                    <?php echo e(($u->estado ?? 'activo') === 'activo' ? 'Desactivar' : 'Activar'); ?>

                                </button>
                                <?php else: ?>
                                <span style="color:#cbd5e1;font-size:12px;">—</span>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div><?php /**PATH /home/evolucionamos/public_html/csfemphahf/csemillafpha/resources/views/admin/gestion-usuarios.blade.php ENDPATH**/ ?>