In my last job I had to look fun and affluent. Tough balance. I wore loud hairstyles that my boss's boss didn't really like, but the manual read, "fashionable" and it was. One of my underlings was my stylist, and we consulted the boss and the manual before adding my fuscia highlights to what was a paige boy in the front, and a bob in the back, and later, what is now called oil slick coloring to a pin curled bob. It passed, and customers loved it.
I worked hard, pushed my team hard, and my record was above reproach. But my appearance was very important, and my boss made that very clear.
I dressed according to the manual which said I needed blue jeans or black slacks, a black belt, black polo shirt, or a black dress shirt with collar, that had to be tucked in unless the lower hem was scalloped and the bust had darts, and black shoes.
Unless I had to do a floor move, I wore a dress shirt with scalloped hem, black slacks, and black pumps, because I felt management should not dress casually there. I was specifically told management needed to look like we had money to burn, so I wore gemstones in my ears, and a fancy watch, and kept my hair, nails and shoes immaculate. I wore my sapphire engagement ring, Which was very unique in design, eye catching, and had a huge central stone. Many mistook it for a blue diamond and asked me about it. My clothes were tailored, and sometimes hand was made. I was told I had to look fun, thus the wild hair. I generally showed cleavage, which received zero complaints, and I assume also looked fun. Most of the customers were wealthy men from Central and south America who were only too happy to let me take them by the arm and point out everything I loved in the store, and generally paid for whatever I suggested, especially once they realized I'd be honest about items of poor quality, and things that were frequently returned.
The easiest job was at the front of the store flying toy helicopters and drones, or playing with other toys. My team quickly caught on that I only sent the most attractive and presentable to do that job, and aligned their appearances and demeanors accordingly. My underlings were fresh-faced kids, (not minors) and in deliberate contrast I wore expensive make up, full-face like date night every day. I was easily identifiable as in charge just by glance despite insane hair, so much so that people would stop me in other stores from other chains and fully expect they were speaking to a manager.
Since I'd send home anyone out of code, the dress code was strictly adhered to. I forgot a belt one day, and was also sent to Macy's to rectify the problem. I never forgot my belt again, and to this day detest that overpriced thing. My wardrobe cheat was a beloved pair of dark gray slacks which occasionally drew the ire of my boss. But... So comfy.
The only thing that was ever spoken of was the time I showed up without make-up on the day the CEO was coming. I had been running late, and figured I'd find time at work to do my face. My boss noticed and complained. My skin is decent enough it still looked like I was made up, but with inferior products. My boss said, "You don't look like you're wearing high end make up today." Her tone was very disapproving. I told her my plan and she immediately took over my job and sent me to put on the face. It was that important to her.
The guys working there, including other managers never had to do more than wash their faces and groom facial hair. They never wore slacks, always jeans. They usually wore sneakers. No one ever assumed the male managers were in charge unless they asked for a manager and one of them replied. This wasn't important to my boss. I don't know if it was because I'm black or because I'm female, but my boss was only pleased with my appearance when I was dressed up, and made up. She was similar with another female manager, but much more insistent with me. The other female manager kept to the dress code, but was usually casual, and wore fewer cosmetics and no jewelry.
It is entirely possible to enforce these dress codes literally, and still unfairly.