<div class="row">
    <div class="col-lg-6">
        <div class="card border-0 shadow-sm">
            <div class="card-body">
                <h1 class="h5 mb-3">Empresa activa</h1>
                <form action="<?= e(url('empresas/seleccionar')) ?>" method="post">
                    <?= csrf_field() ?>
                    <div class="mb-3">
                        <label class="form-label">Selecciona la empresa</label>
                        <select class="form-select" name="empresa_id" required>
                            <option value="">Seleccione...</option>
                            <?php foreach ($companies as $company): ?>
                                <option value="<?= e((string) $company['id']) ?>" <?= (int) $selected === (int) $company['id'] ? 'selected' : '' ?>>
                                    <?= e($company['nombre']) ?> (<?= e($company['estado']) ?>)
                                </option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                    <button class="btn btn-primary" type="submit">Cambiar empresa</button>
                </form>
            </div>
        </div>
    </div>
</div>
