

<?php $__env->startSection('title', 'Empresas'); ?>
<?php $__env->startSection('page-title', 'Gestión de Empresas'); ?>

<?php $__env->startSection('content'); ?>
<div class="row mb-4">
    <div class="col-12">
        <div class="d-flex justify-content-between align-items-center">
            <h2>Empresas</h2>
            <a href="<?php echo e(route('companies.create')); ?>" class="btn btn-primary">
                <i class="bi bi-plus-circle me-2"></i>Nueva Empresa
            </a>
        </div>
    </div>
</div>

<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
    <?php echo e(session('success')); ?>

    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
<?php endif; ?>

<?php if(session('error')): ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
    <?php echo e(session('error')); ?>

    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
<?php endif; ?>

<div class="row">
    <?php $__empty_1 = true; $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
    <div class="col-md-6 col-lg-4 mb-4">
        <div class="card h-100">
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-start mb-3">
                    <h5 class="card-title"><?php echo e($company->name); ?></h5>
                    <span class="badge <?php echo e($company->is_active ? 'bg-success' : 'bg-secondary'); ?>">
                        <?php echo e($company->is_active ? 'Activa' : 'Inactiva'); ?>

                    </span>
                </div>
                
                <div class="mb-2">
                    <i class="bi bi-envelope text-muted me-2"></i>
                    <small><?php echo e($company->contact_email ?? 'Sin email'); ?></small>
                </div>
                
                <div class="mb-2">
                    <i class="bi bi-telephone text-muted me-2"></i>
                    <small><?php echo e($company->contact_phone ?? 'Sin teléfono'); ?></small>
                </div>
                
                <div class="mb-3">
                    <i class="bi bi-geo-alt text-muted me-2"></i>
                    <small><?php echo e($company->address ?? 'Sin dirección'); ?></small>
                </div>
                
                <hr>
                
                <div class="row text-center mb-3">
                    <div class="col-4">
                        <div class="fw-bold text-primary"><?php echo e($company->projects_count); ?></div>
                        <small class="text-muted">Proyectos</small>
                    </div>
                    <div class="col-4">
                        <div class="fw-bold text-info"><?php echo e($company->users_count); ?></div>
                        <small class="text-muted">Usuarios</small>
                    </div>
                    <div class="col-4">
                        <div class="fw-bold text-warning"><?php echo e($company->tickets_count); ?></div>
                        <small class="text-muted">Tickets</small>
                    </div>
                </div>
                
                <div class="d-flex gap-2">
                    <a href="<?php echo e(route('companies.show', $company)); ?>" class="btn btn-sm btn-outline-primary flex-fill">
                        <i class="bi bi-eye"></i> Ver
                    </a>
                    <a href="<?php echo e(route('companies.edit', $company)); ?>" class="btn btn-sm btn-outline-secondary flex-fill">
                        <i class="bi bi-pencil"></i> Editar
                    </a>
                </div>
            </div>
        </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
    <div class="col-12">
        <div class="card">
            <div class="card-body text-center py-5">
                <i class="bi bi-building display-1 text-muted mb-3"></i>
                <h4>No hay empresas registradas</h4>
                <p class="text-muted">Comienza creando tu primera empresa</p>
                <a href="<?php echo e(route('companies.create')); ?>" class="btn btn-primary">
                    <i class="bi bi-plus-circle me-2"></i>Crear Primera Empresa
                </a>
            </div>
        </div>
    </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp_1\htdocs\Ticketera\resources\views/companies/index.blade.php ENDPATH**/ ?>