It's hard to top the classics in this lane, and for me, James Ellroy's 'L.A. Confidential' is essential. The moral murk isn't just personal for the detectives; it's systemic, baked into the entire corrupt LAPD of the 1950s. Bud White's brutal vigilantism, Jack Vincennes's Hollywood side-hustle, and Ed Exley's icy ambition all crash together in ways that leave every 'victory' feeling pyrrhic and stained.
A more contemporary pick I keep returning to is Denise Mina's Garnethill trilogy, starting with the first book of the same name. Maureen O'Donnell isn't a professional sleuth, just a traumatized woman trying to clear her own name, and her flaws are rooted in survival—alcoholism, a fractured family, mental health struggles. The dilemmas aren't about choosing good over evil, but about navigating a world where every institution has failed you.
Walter Mosley's Easy Rawlins books, like 'Devil in a Blue Dress,' also nail this. Easy's morality is constantly shifting based on what he needs to survive and provide in a racist 1940s/50s L.A. He's not a knight; he's a man making compromised choices, and the complexity comes from understanding exactly why he makes them.