<?php $__env->startSection('title', 'Dashboard | Veltrix v2'); ?>

<?php $__env->startSection('content'); ?>
    <div class="card border-0 shadow-sm mb-3">
        <div class="card-body">
            <div class="vx-dashboard-hero-head">
                <div>
                    <h2 class="h5 mb-1">Pulso operativo</h2>
                    <p class="text-muted mb-0">Resumen rápido del usuario, contexto tenant y accesos del sistema.</p>
                </div>
            </div>
        </div>
    </div>

    <div class="vx-kpi-grid mb-3">
        <article class="card vx-kpi-card">
            <div class="card-body">
                <div class="vx-kpi-head">
                    <span class="vx-kpi-icon"><i class="bx bx-user"></i></span>
                    <span class="vx-kpi-title">Usuario</span>
                    <span class="vx-kpi-trend is-neutral">Activo</span>
                </div>
                <p class="vx-kpi-value mb-0"><?php echo e(auth_user()?->nombre ?? 'N/A'); ?></p>
                <small class="text-muted"><?php echo e(auth_user()?->email ?? 'Sin correo'); ?></small>
            </div>
        </article>

        <article class="card vx-kpi-card">
            <div class="card-body">
                <div class="vx-kpi-head">
                    <span class="vx-kpi-icon"><i class="bx bxs-buildings"></i></span>
                    <span class="vx-kpi-title">Empresa</span>
                    <span class="vx-kpi-trend is-neutral">Tenant</span>
                </div>
                <p class="vx-kpi-value mb-0"><?php echo e($tenantSwitcher['current_empresa_nombre'] ?? 'N/A'); ?></p>
                <small class="text-muted">Sucursal: <?php echo e($tenantSwitcher['current_sucursal_nombre'] ?? 'N/A'); ?></small>
            </div>
        </article>

        <article class="card vx-kpi-card">
            <div class="card-body">
                <div class="vx-kpi-head">
                    <span class="vx-kpi-icon"><i class="bx bx-shield-quarter"></i></span>
                    <span class="vx-kpi-title">Rol</span>
                    <span class="vx-kpi-trend is-neutral">Seguridad</span>
                </div>
                <p class="vx-kpi-value mb-0"><?php echo e(auth_user()?->rol?->nombre ?? 'Sin rol'); ?></p>
                <small class="text-muted">Permisos: <?php echo e(auth_user()?->rol?->permisos()?->count() ?? 0); ?></small>
            </div>
        </article>

        <article class="card vx-kpi-card">
            <div class="card-body">
                <div class="vx-kpi-head">
                    <span class="vx-kpi-icon"><i class="bx bx-transfer-alt"></i></span>
                    <span class="vx-kpi-title">Contexto</span>
                    <span class="vx-kpi-trend is-neutral">Sesión</span>
                </div>
                <p class="vx-kpi-value mb-0"><?php echo e(($tenantSwitcher['can_switch'] ?? false) ? 'Múltiple' : 'Único'); ?></p>
                <small class="text-muted">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($tenantSwitcher['can_switch'] ?? false): ?>
                        Contexto multiempresa habilitado.
                    <?php else: ?>
                        Contexto fijo para este usuario.
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </small>
            </div>
        </article>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-body">
            <div class="d-flex flex-wrap justify-content-between align-items-center gap-2 mb-3">
                <h2 class="h6 mb-0">Módulos disponibles</h2>
            </div>

            <div class="d-flex gap-2 flex-wrap">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('dashboard.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('dashboard')); ?>">Dashboard</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('empresas.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('empresas.index')); ?>">Empresas</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('sucursales.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('sucursales.index')); ?>">Sucursales</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('usuarios.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('usuarios.index')); ?>">Usuarios</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('categorias.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('categorias.index')); ?>">Categorias</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('clientes.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('clientes.index')); ?>">Clientes</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('proveedores.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('proveedores.index')); ?>">Proveedores</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('productos.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('productos.index')); ?>">Productos</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('inventario.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('inventario.index')); ?>">Inventario</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('pos.vender')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('pos.index')); ?>">POS</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('caja.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('caja.index')); ?>">Caja</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('compras.ver')): ?>
                    <a class="btn btn-light border" href="<?php echo e(route('compras.index')); ?>">Compras</a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/veltrix-v2/resources/views/dashboard.blade.php ENDPATH**/ ?>