Designing a UI for nested and dependent content with logic?

Context: This is a configuration screen for the following points:

  • Department
  • Room
  • Bed Logic is as follows: A department can contain rooms, rooms with beds, just beds (without rooms). The current design is table form, and it was implemented horribly for the latter two (room, bedroom). Department is set a vertical object orientation.

Granular secondary call to action items include:

  • Edit
  • Remove Of course if I remove the Room with Beds, the beds are removed with it, same with Department, if removed, all is removed.

My current iteration has moved toward a card presentation with a horizontal tab separation for Rooms with beds, and Beds.

Anyone have this type of data flow design? I would appreciate some insights. Thank you. JC