There is a room called the combat information center, that's where the ship is run from during combat, and that is behind armor, even in modern warships.
Additionally ships are separated into semi independent zones, that can take control of the ship, and continue fighting even if the rest of the ship is on fire.
The real liabilities are the radars, and the rest of the sensors in surface combat ships and the airplanes on deck in the case of aircraft carriers. Aircraft carriers in general are heavily armored compared to other modern warships and it takes a significant amount of firepower to even disable them much less sink them.