Like so many good heist movies, “Flawless” presents us with a seemingly unsolvable puzzle, lets us stew over it for a while, then solves it for us. The puzzle is of the “How did Person X manage to accomplish Task Y?” variety, and it is indeed a head-scratcher. I wish the film came up with an answer that was anywhere near as ingenious as the question, but it’s a generally satisfying story anyway.

The setting is a diamond company in London in 1960, where Laura Quinn (Demi Moore) is a senior negotiator with bruises on her head from constantly bumping into the glass ceiling. An American girl, she has lived in England since attending Oxford (and seems to have halfheartedly picked up a mild British accent along the way), she’s essentially married to her job, and she’s frustrated at being passed over for promotions.

She’s friendly with the night janitor, Mr. Hobbs (Michael Caine), a cheeky old widower. I don’t recall whether he ever calls anyone “guv’nor,” but he seems like the type. The fact that executives ignore him when he’s around makes him privy to a lot of delicate information, and he warns Laura after overhearing that the bosses plan to use her as a scapegoat. All her loyalty and hard work, and now she’s going to be hung out to dry.

But Hobbs has a plan. He wants to steal a small portion of diamonds from the company’s vault deep within the building. Not a lot — not even enough to be noticed, probably — but enough to make them both rich. Of course Laura is appalled at the idea, and of course Hobbs is persuasive, and of course she eventually agrees, reluctantly, to participate in the scheme. And a heist movie is born!

Up until the actual robbery, there isn’t much to distinguish the film from its numerous genre-mates, apart from its jazzy setting (London in the ’60s always feels so swingin’ to me). After the robbery, though, when that unsolvable puzzle emerges, we’re treated to about 30 minutes of highly entertaining mystery and intrigue as the missing diamonds ARE noticed and a massive investigation ensues. The diamond company’s head honcho (Joss Ackland) is apoplectic, while an insurance investigator, Finch (Lambert Wilson), maintains an Eliot Ness level of calm, steely dedication to rooting out the thieves — who continue to work right under his nose, of course.

Director Michael Radford (“Il Postino”) stages the robbery itself with great suspense, and his re-creation of the bygone era in which the film is set is nicely detailed. (Get a load of those giant, clunky surveillance cameras!) Unfortunately, he can’t overcome the weaknesses in Edward Anderson’s screenplay, which is hampered by an unnecessary framing story set in the present (complete with Demi Moore in old-age makeup) and a pedestrian climax. It’s very disappointing to watch an otherwise smart, engaging movie end with a scene where Person A says to the bad guy, “I’m going to tell everyone what you’ve done!,” and then Person B pulls out a gun and says, “I’m afraid I can’t let you do that.”

Really? “I’m afraid I can’t let you do that”? Isn’t that what people say in PARODIES of movies like this?

The film also takes a weak stab at a political message, with the unrest in South Africa — where all the company’s diamond mines are — serving as backdrop to the proceedings. That aspect ought to have been fleshed out more or abandoned altogether, not wedged in awkwardly at the beginning and end.

But it’s not a bad movie, and most of it is solid enough, despite resting on the not-strong-enough-to-have-things-resting-on-them shoulders of Demi Moore. Michael Caine and the rest of the mostly British cast are serious enough to pull the job off, and they make the flick eminently watchable.

B- (1 hr., 43 min.; PG-13, one F-word; the film is otherwise quite tame.)