<div>
    <div class="form-group">
        <label>Nivel:</label>
        <select wire:model.live="selectedNivel" class="form-control" name="nivel">
            <option value="">Selecciona el nivel</option>
            @foreach($niveles as $nivel)
                <option value="{{ $nivel->id }}">{{ $nivel->name }}</option>
            @endforeach
        </select>
    </div>

    <div class="form-group mt-3">
        <label>Carrera:</label>
        {{-- wire:key evita problemas de re-renderizado --}}
        <select wire:model="selectedCarrera" class="form-control" wire:key="carreras-select" name="carrera">
            @foreach($carreras as $carrera)
                <option value="{{ $carrera->id }}">{{ $carrera->name }}</option>
            @endforeach
        </select>
    </div>

</div>
