A gasoline shortage in OPEC member Venezuela was exacerbated by an increase in fuel exports to foreign allies such as Cuba and Nicaragua and an exodus of crucial personnel from state-run energy company PDVSA, according to internal PDVSA documents and sources familiar with its operations. Leftist-run Venezuela sells its citizens the world's cheapest gasoline. Fuel supplies have continued flowing despite a domestic oil industry in turmoil and a deepening economic crisis under President Nicolas Maduro that has left the South American country with scant supplies of many basic necessities. That changed on Wednesday, when Venezuelans faced their first nationwide shortage of motor fuel since an explosion ripped through one of the world's largest refineries five years ago. At the time, the government of then-President Hugo Chavez curbed exports to guarantee there was enough fuel at home. This week's shortage was also mainly due to problems at refineries, as a mix of plant glitches and maintenance cut fuel production in half. Unlike five years ago, Caracas has continued exporting fuel to political allies and even raised the volume of shipments last month despite warnings within the government-run company that doing so could trigger a domestic supply crunch. Shipments from refineries to the domestic market needed to be redirected to meet those export commitments, the internal documents showed. "Should this additional volume ... be exported, it would impact a cargo scheduled for the local market," read one email sent from an official in the company's domestic marketing department to its international trade unit. Venezuela last month exported 88,000 barrels per day (bpd) of fuels - equivalent to a fifth of its domestic consumption - to Cuba, Nicaragua and other countries, according to internal PDVSA documents seen by Reuters. That was up 22,000 bpd on the volumes Venezuela had been shipping to those two countries under accords struck by Chavez to expand his diplomatic clout by lowering their fuel costs through cheap supplies of crude and fuel. The order to increase exports came from PDVSA's top executives, according to the internal emails seen by Reuters. Venezuela's oil ministry and state-run PDVSA, formally known as Petroleos de Venezuela SA, did not reply to requests for comment for this story. FUEL STRAIN, BRAIN DRAIN The strain on the country's fuel system has been worsened by the departure of staff in PDVSA's trade and supply unit who are key to ensuring fuel gets to where it is needed and making payments for imports, three sources close to the company said. The unit has seen around a dozen key staffers depart since Maduro shook up PDVSA's top management in January. Among those who left was the head of budget and payments, two sources said. "Every week someone leaves for one reason or another," said a PDVSA source familiar with the unit's operations. Some have been fired, while others have left since the shake-up inserted political and military officials into top positions and bolstered Maduro's grip on the company that powers the nation's economy. The imposition of leaders with little or no experience in the industry has further disillusioned some of the company's experienced professionals and accelerated an exodus that had already taken hold as economic and social conditions in Venezuela worsened. A recent internal PDVSA report seen by Reuters mentioned "a low capacity to retain key personnel," amid salaries of a few dozen dollars a month at the black market rate. UNPAID BILLS The departure of staff responsible for paying suppliers, as well as a cash crunch in the company and the country, have led to an accumulation of unpaid bills for fuel imports into Venezuela. Had those bills been paid, the supply crunch would have been less acute, the company sources said. About 10 tankers are waiting near PDVSA ports in Venezuela and the Caribbean to discharge fuel for domestic consumption and for oil blending. Only one vessel bringing fuel imports has been discharged since the beginning of the week, shipping data showed. PDVSA ordered some of the cargoes as it prepared alternative supplies while refineries undergo maintenance. The tankers sitting offshore will not unload until PDVSA pays for their cargoes, said shippers and the company sources. Should PDVSA pay - up to $20 million per cargo - shortages could blow over relatively soon. The cash-strapped company has struggled since the global oil price crash that began in 2014 cut revenue for its crude exports. PDVSA is tight on cash as it prepares for some $2.5 billion in bond payments due next month. While the vessels sit offshore, lines of dozens of cars waited at gas stations in central Venezuela on Wednesday and Thursday. The shortages angered Venezuelans who already face long lines for scarce food and drugs. PDVSA blamed the supply crunch on unspecified problems for shipping fuel from domestic refineries to distribution centers. The company said it was working hard to solve the gasoline situation by boosting deliveries to the worst-hit regions. A shortage of trucks to move refined products has also caused bottlenecks, oil workers told PDVSA President Eulogio Del Pino during a visit to a fuel facility this week, asking for help. Trucks are in short supply because the country does not have enough funds to pay for imports of spare parts. It was unclear when fuel supplies would return to normal, although by late Thursday PDVSA appeared to have distributed some fuel from storage to Caracas and the eastern city of Puerto Ordaz. Lines to fill up at gasoline stations shortened in both cities, according to Reuters witnesses. Workers at the 335,000-bpd Isla refinery on the nearby island of Curacao operated by PDVSA said on Friday that the refinery had begun restarting its catalytic cracking unit, which could boost fuel supplies in the coming days.