Every codebase has debt. Complaining about it is a Senior Dev trait; managing it is a Tech Lead trait.
Growing into leadership means moving away from the "we should rewrite everything" mindset toward incremental improvement. To lead through debt, you must master the art of negotiation:
* Translate "Clean Code" into "Business Value": Managers don't care about "messy code," but they do care about velocity.
* The pitch:"If we spend two days refactoring this module, we will deliver the next three features 20% faster."
If you can't justify the refactor in terms of time or risk, it's not high-priority debt.