UNLIKE an earthquake, a demographic disaster does not strike without warning. Japan's population of 127m is predicted to fall to 90m by 2050. As recently as 1990, working-age Japanese outnumbered children and the elderly by seven to three. By 2050 the ratio will be one to one. As Japan grows old and feeble, where will its companies find dynamic, energetic workers?

For a company president pondering this question over a laboriously prepared breakfast of steamed rice, broiled salmon, miso soup and artistically presented pickles, the answer is literally staring him in the face. Half the talent in Japan is female. Outside the kitchen, those talents are woefully underemployed, as Sylvia Ann Hewlett and Laura Sherbin of the Centre for Work-Life Policy, an American think-tank, show in a new study called “Off-Ramps and On-Ramps: Japan”.

Nearly half of Japanese university graduates are female but only 67% of these women have jobs, many of which are part-time or involve serving tea. Japanese women with degrees are much more likely than Americans (74% to 31%) to quit their jobs voluntarily. Whereas most Western women who take time off do so to look after children, Japanese women are more likely to say that the strongest push came from employers who do not value them. A startling 49% of highly educated Japanese women who quit do so because they feel their careers have stalled.

The Japanese workplace is not quite as sexist as it used to be. Pictures of naked women, ubiquitous on salarymen's desks in the 1990s, have been removed. Most companies have rules against sexual discrimination. But educated women are often shunted into dead-end jobs. Old-fashioned bosses see their role as prettifying the office and forming a pool of potential marriage partners for male employees. And a traditional white-collar working day makes it hard to pick up the kids from school.

Even if the company rule book says that flexitime is allowed, those who work from home are seen as uncommitted to the team. Employees are expected to show their faces before 9am, typically after a long commute on a train so packed that the gropers cannot tell whom they are groping. Staff are also under pressure to stay late, regardless of whether they have work to do: nearly 80% of Japanese men get home after 7pm, and many attend semi-compulsory drinking binges in hostess bars until the small hours. Base salaries are low; salarymen are expected to fill their pay packets by putting in heroic amounts of overtime.

Besides finding these hours just a bit inconvenient, working mothers are unlikely to get much help at home from their husbands. Japanese working mums do four hours of child care and housework each day—eight times as much as their spouses. Thanks to restrictive immigration laws, they cannot hire cheap help. A Japanese working mother cannot sponsor a foreign nanny for a visa, though it is not hard for a nightclub owner to get “entertainer” visas for young Filipinas in short skirts. That says something about Japanese lawmakers' priorities. And it helps explain why Japanese women struggle to climb the career ladder: only 10% of Japanese managers are female, compared with 46% in America.

Japanese firms are careful to recycle paper but careless about wasting female talent. Some 66% of highly educated Japanese women who quit their jobs say they would not have done so if their employers had allowed flexible working arrangements. The vast majority (77%) of women who take time off work want to return. But only 43% find a job, compared with 73% in America. Of those who do go back to work, 44% are paid less than they were before they took time off, and 40% have to accept less responsibility or a less prestigious title. Goldman Sachs estimates that if Japan made better use of its educated women, it would add 8.2m brains to the workforce and expand the economy by 15%—equivalent to about twice the size of the country's motor industry.

Filthy foreigners are more female-friendly

What can be done? For Japanese women, the best bet is to work for a foreign company. Two-thirds of university-educated Japanese women see European or American firms as more female-friendly than Japanese ones. Foreign firms in Japan (and similarly sexist South Korea) see a wealth of undervalued clever women and make a point of hiring them. One woman who switched from a Japanese bank to a foreign one marvelled that: “The women here have opinions. They talk back. They are direct.”

Japanese companies have much to learn from the gaijin. IBM Japan encourages flexitime. BMKK, the Japanese arm of Bristol-Myers Squibb, a drug firm, has a programme to woo back women who have taken maternity leave. Why can't native Japanese firms do likewise? A few, such as Shiseido, a cosmetics firm, try hard. But apparently small concessions to work-life balance can require a big change in the local corporate mindset. Working from home should be easy: everyone has broadband. But Japanese bosses are not used to judging people by their performance, sighs Yoko Ishikura, an expert on business strategy at Keio University.

The firms that make the best use of female talent are often those where women can find sponsors. Most of the women interviewed for the study by Ms Hewlett and Ms Sherbin who got back on the career track after time off did so because a manager remembered how good they were and lobbied for them to be rehired. Eiko, one of the women interviewed, felt pressure from her male colleagues to quit when she became pregnant and announced that she was leaving to do an MBA. Her clear-sighted boss realised that this was not what she really wanted to do. He suggested leaving Tokyo and working at another branch with a more supportive atmosphere. Eiko transferred to Hong Kong, where career women are admired and nannies are cheap.

Economist.com/blogs/schumpeter