Why do the streets look sketchy?

The short answer

They're centuries old, not dangerous.

Narrow, unlit, no signage, peeling walls, cats everywhere, wires overhead. It looks like somewhere you shouldn't be. But the medina isn't zoned the way Western cities are — there's no separation between residential, commercial, and pedestrian. A dark alley with a rusted door might open into someone's home with a marble courtyard. Streets that look abandoned at 10pm are full of schoolchildren at 8am. The infrastructure looks rough because it's centuries old, not because it's dangerous.