const TRANSLATIONS = {
  en: {
    'nav.flavors': 'Flavors & cups', 'nav.story': 'Our story', 'nav.locations': 'Locations', 'nav.order': 'Order now',
    'nav.size': 'Text size',
    'nav.theme_toggle_dark': 'Use dark interface',
    'nav.theme_toggle_light': 'Use light interface',
    'a11y.size_minus': 'Smaller text', 'a11y.size_plus': 'Larger text',
    'a11y.size_titles': 'Compact,Default,Large,X-Large,2X large,3X large,Maximum',
    'hero.tag': "✦ Ice cream & yogurt · N'Djamena, Chad",
    'hero.title_1': 'Made in Chad',
    'hero.craft': 'with care,',
    'hero.title_2': 'ice cream & yogurt.',
    'hero.sub': "We make frozen desserts and set yogurt in N’Djamena—local milk, real fruit, no shortcuts, three walk-in shops, and a site at gelatohouse.app when you’re online.",
    'hero.cta_primary': 'See flavors & cups', 'hero.cta_secondary': 'Our story',
    'hero.art_label': "N’Djamena · home page",
    'stats.flavors': 'Gelato-style flavours', 'stats.natural': 'Natural ingredients', 'stats.locations': 'Shops in town', 'stats.customers': 'Happy customers',
    'stats.lines_n': '2', 'stats.lines_l': 'Ice cream & yogurt',
    'marquee': "N'Djamena · ice cream & yogurt · Chadian milk · set yogurt & cups · real fruit · made fresh daily ·",
    'flavors.eyebrow': 'Chilled treats', 'flavors.title_a': 'Favorites in', 'flavors.title_b': 'cones, cups,', 'flavors.title_c': 'and pots',
    'flavors.view_all': 'View the full list',
    'flavors.scoop_note': 'per scoop or cup',
    'story.eyebrow': 'Since 2023', 'story.quote': "We wanted cold craft that tastes like here—the mango at its ripest, the hibiscus at its deepest, milk from the herds we know, and yogurt you can take home. Nothing flown in to sound ‘imported’: just a clean recipe line from Chad.",
    'story.by': '— Khalid Hybah, Founder',
    'locations.eyebrow': 'Three shops',
    'footer.tagline': 'Laziz. لذيذ. Delicious.',
    'footer.rights': "© 2026 Gelato House · N'Djamena, Chad",
    'admin.enter': 'Enter admin portal', 'a11y.font_section': 'Text size (entire app)',
    'admin.dashboard': 'Dashboard', 'admin.production': 'Production', 'admin.inventory': 'Inventory',
    'admin.expenses': 'Daily expenses', 'admin.expenses_sub': 'Four shops + usine · petty cash · transfers · exports',
    'admin.login_title': 'Staff sign-in',
    'admin.login_hint': 'Use your work email from the directory.',
    'admin.login_email': 'Work email',
    'admin.login_pin': 'PIN',
    'admin.login_submit': 'Sign in',
    'admin.login_err_email': 'No account with that email.',
    'admin.login_err_pin': 'Incorrect PIN.',
    'admin.login_demo_note': 'Boss: PIN khalid26 · Staff: hybah26 (replace with Supabase Auth later).',
    'admin.boss_panel': 'Boss · approvals',
    'admin.logout': 'Log out',
    'admin.public_site': 'Public website',
    'admin.employees': 'Employees', 'admin.hr': 'HR & leave', 'admin.deposits': 'Bank deposits',
    'admin.analytics': 'Analytics', 'admin.users': 'User management', 'admin.audit': 'Audit log', 'admin.settings': 'Settings',
    'admin.overview': 'Overview', 'admin.people': 'People', 'admin.finance': 'Finance', 'admin.system': 'System',
    'admin.welcome': 'Good morning,', 'admin.welcome_sub': "Here's what’s happening at Gelato House today.",
    'access.denied_title': 'Feature not enabled', 'access.denied_message': "Your account doesn’t have access to this area yet. Request access from the boss.",
    'notifications.title': 'Notifications', 'notifications.mark_all_read': 'Mark all read', 'notifications.empty': "You’re all caught up.",
    'common.save': 'Save', 'common.cancel': 'Cancel', 'common.edit': 'Edit', 'common.delete': 'Delete', 'common.add': 'Add', 'common.export': 'Export', 'common.search': 'Search', 'common.filter': 'Filter', 'common.today': 'Today', 'common.week': 'This week', 'common.month': 'This month', 'common.view_all': 'View all',
    'nav.shop': 'Shop & order',
    'order.eyebrow': 'Order online', 'order.title': 'Menu, cart & checkout', 'order.sub': 'Ice cream by the scoop, frozen yogurt (small 250 F / big 500 F), and warm crêpes. All prices in FCFA — no VAT in Chad.',
    'order.tab_ice': 'Ice cream', 'order.tab_yog': 'Frozen yogurt', 'order.tab_crepe': 'Crêpes',
    'order.add': 'Add', 'order.per_scoop': 'scoop', 'order.yogurt_build': 'Build your yogurt cup', 'order.yogurt_hint': 'Choose size, then flavor. Some swirls add a small fee.',
    'order.size': 'Size', 'order.flavor': 'Flavor', 'order.add_yogurt': 'Add to cart',
    'order.crepe_intro': 'Thin round crêpes from the plancha — warm, folded, with chocolate, fruit, or honey. Customize extras in the cart.',
    'order.legal': 'Checkout sends your cart by WhatsApp to our team — we confirm before payment.',
    'order.cart': 'Cart', 'order.view_cart': 'View cart', 'order.lines': 'lines', 'order.empty': 'Your cart is empty.',
    'order.scoops': 'Scoops per line', 'order.customize': 'Toppings & syrups', 'order.less': 'Hide',
    'order.toppings': 'Toppings', 'order.syrups': 'Syrups', 'order.crepe_extras': 'Crêpe extras', 'order.line': 'Line total', 'order.remove': 'Remove',
    'order.subtotal': 'Total', 'order.no_tax': 'No tax in Chad — total due is shown.',
    'order.proceed': 'Checkout', 'order.checkout': 'Checkout', 'order.name': 'Your name', 'order.phone': 'Phone / WhatsApp',     'order.address': 'Delivery address',
    'order.addr_pickup': 'Pickup at shop — no address needed.',
    'order.fulfillment': 'How you get it',
    'order.pickup': 'Pickup at shop',
    'order.delivery': 'Delivery',
    'order.notes': 'Notes for the kitchen',
    'order.notes_placeholder': 'Allergies, time, landmark…',
    'order.payment': 'How you pay', 'order.submit': 'Send order via WhatsApp',
    'order.thank_body': 'Your WhatsApp should open with the full order. If it did not, use the button below.',
    'order.thank_ref': 'Order reference',
    'order.open_whatsapp': 'Open WhatsApp again',
    'order.copy_message': 'Copy order text',
    'order.copy_done': 'Copied',
    'order.msg_intro': 'New Gelato House order',
    'order.msg_total': 'Total',
    'order.msg_pay': 'Payment',
    'order.msg_notes': 'Notes',
    'order.msg_none': '—',
    'order.thank_back': 'Back to shopping',
    'admin.intro': 'Cup lines: set price × qty (FCFA). Transfer columns = rough value of cups sent from production to this point (250/500 presets).',
    'admin.export_exp': 'Expenses CSV',
    'admin.export_inc': 'Income / deposits CSV',
    'admin.export_sale': 'Sales CSV',
    'admin.export_full': 'Full export',
    'admin.exp_out_sales': 'Counter sales estimate (ice & yogurt)',
    'admin.exp_price': 'Price F',
    'admin.exp_qty': 'Qty',
    'admin.exp_add_line': 'Add cup line',
    'admin.exp_custom': 'Custom product',
    'admin.exp_counters_sub': 'Subtotal from cup lines',
    'admin.exp_transfer': 'Transfers received today (count of cups → value)',
    'admin.exp_transfer_value': 'Transfer value (FCFA)',
    'admin.exp_staff_day': 'Hourly / daily payroll this location',
    'admin.exp_people_hours': 'Who worked / hours note',
    'admin.exp_people_hours_ph': 'e.g. 3 people · morning shift',
    'admin.exp_payroll_total': 'Payroll total (FCFA)',
    'admin.exp_misc': 'Other expenses (text + amount)',
    'admin.exp_what': 'What it was for',
    'admin.exp_add_row': 'Add expense row',
    'admin.exp_location_sub': 'This location · expenses today',
    'admin.exp_day_all_exp': 'All locations · expenses today',
    'admin.exp_day_transfers_all': 'All locations · transfer value today',
    'admin.exp_week_title': 'Same location · rolling 7 days',
    'admin.exp_week_cup': 'Cup lines subtotal',
    'admin.exp_week_trans': 'Transfer value total',
  },
  fr: {
    'nav.flavors': 'Parfums & coupes', 'nav.story': 'Notre histoire', 'nav.locations': 'Adresses', 'nav.order': 'Commander',
    'nav.size': 'Taille du texte',
    'nav.theme_toggle_dark': 'Interface sombre',
    'nav.theme_toggle_light': 'Interface claire',
    'a11y.size_minus': 'Texte plus petit', 'a11y.size_plus': 'Texte plus grand',
    'a11y.size_titles': 'Compact,Défaut,Grand,Très grand,2×,3×,Maximum',
    'hero.tag': "✦ Glace & yaourt · N'Djamena, Tchad",
    'hero.title_1': 'Fabriqué au Tchad',
    'hero.craft': 'avec soin,',
    'hero.title_2': 'glaces & yaourts.',
    'hero.sub': "Glaces, frozen yogurt et yaourt à emporter à N’Djamena—lait local, vrais fruits, trois boutiques, et gelatohouse.app dès la connexion.",
    'hero.cta_primary': 'Voir les parfums', 'hero.cta_secondary': 'Notre histoire',
    'hero.art_label': "N’Djamena · accueil",
    'stats.flavors': 'Parfums maison', 'stats.natural': 'Ingrédients naturels', 'stats.locations': 'Boutiques', 'stats.customers': 'Clients heureux',
    'stats.lines_n': '2', 'stats.lines_l': 'Glace & yaourt',
    'marquee': "N’Djamena · glace & yaourt · lait tchadien · yaourt en pot · fruit réel · frais du jour ·",
    'flavors.eyebrow': 'Crèmes glacées & yaourts', 'flavors.title_a': 'Les plus', 'flavors.title_b': 'gourmands,', 'flavors.title_c': 'en coupe ou pot',
    'flavors.view_all': 'Voir toute la carte',
    'flavors.scoop_note': 'par boule / coupe / pot',
    'story.eyebrow': 'Depuis 2023', 'story.quote': "Nous voulions une offre froide qui goûte d’ici—mangue à point, bissap profond, lait de nos éleveurs, yaourt en pot pour le quotidien. Pas de bruit ‘import’ pour la forme: une vraie ligne tchadienne.",
    'story.by': '— Khalid Hybah, fondateur',
    'locations.eyebrow': 'Trois boutiques',
    'footer.tagline': 'Laziz. لذيذ. Délicieux.',
    'footer.rights': "© 2026 Gelato House · N’Djamena, Tchad",
    'admin.enter': 'Accéder au portail admin', 'a11y.font_section': 'Taille du texte (tout le site)',
    'admin.dashboard': 'Tableau de bord', 'admin.production': 'Production', 'admin.inventory': 'Inventaire',
    'admin.expenses': 'Dépenses quotidiennes', 'admin.expenses_sub': '4 boutiques + usine · caisse · transferts · exports',
    'admin.login_title': 'Connexion équipe',
    'admin.login_hint': 'Utilisez l’email professionnel.',
    'admin.login_email': 'Email',
    'admin.login_pin': 'Code PIN',
    'admin.login_submit': 'Se connecter',
    'admin.login_err_email': 'Email inconnu.',
    'admin.login_err_pin': 'PIN incorrect.',
    'admin.login_demo_note': 'Boss : PIN khalid26 · Équipe : hybah26.',
    'admin.boss_panel': 'Patron · validations',
    'admin.logout': 'Déconnexion',
    'admin.public_site': 'Site public',
    'admin.employees': 'Employés', 'admin.hr': 'RH & congés', 'admin.deposits': 'Dépôts bancaires',
    'admin.analytics': 'Analyses', 'admin.users': 'Utilisateurs', 'admin.audit': "Journal d'audit", 'admin.settings': 'Paramètres',
    'admin.overview': "Vue d'ensemble", 'admin.people': 'Personnel', 'admin.finance': 'Finance', 'admin.system': 'Système',
    'admin.welcome': 'Bonjour,', 'admin.welcome_sub': 'Voici ce qui se passe aujourd’hui à Gelato House.',
    'access.denied_title': 'Fonctionnalité non activée', 'access.denied_message': "Votre compte n’a pas encore accès. Demandez au boss.",
    'notifications.title': 'Notifications', 'notifications.mark_all_read': 'Tout marquer lu', 'notifications.empty': 'Tout est à jour.',
    'common.save': 'Enregistrer', 'common.cancel': 'Annuler', 'common.edit': 'Modifier', 'common.delete': 'Supprimer', 'common.add': 'Ajouter', 'common.export': 'Exporter', 'common.search': 'Rechercher', 'common.filter': 'Filtrer', 'common.today': "Aujourd'hui", 'common.week': 'Cette semaine', 'common.month': 'Ce mois', 'common.view_all': 'Tout voir',
    'nav.shop': 'Boutique',
    'order.eyebrow': 'Commander en ligne', 'order.title': 'Menu, panier, paiement', 'order.sub': 'Glace à la boule, yaourt glacé (petit 250 F / grand 500 F), crêpes chaudes. Prix en FCFA — pas de TVA au Tchad.',
    'order.tab_ice': 'Glace', 'order.tab_yog': 'Yaourt glacé', 'order.tab_crepe': 'Crêpes',
    'order.add': 'Ajouter', 'order.per_scoop': 'boule', 'order.yogurt_build': 'Composer votre pot', 'order.yogurt_hint': 'Taille puis parfum. Certains parfums ont un petit supplément.',
    'order.size': 'Taille', 'order.flavor': 'Parfum', 'order.add_yogurt': 'Ajouter au panier',
    'order.crepe_intro': 'Crêpes fines rondes — chaudes, pliées, chocolat ou miel. Extras dans le panier.',
    'order.legal': 'Le paiement ouvre WhatsApp avec votre commande — confirmation avant paiement.',
    'order.cart': 'Panier', 'order.view_cart': 'Voir le panier', 'order.lines': 'lignes', 'order.empty': 'Panier vide.',
    'order.scoops': 'Boules / ligne', 'order.customize': 'Garnitures & sirops', 'order.less': 'Masquer',
    'order.toppings': 'Garnitures', 'order.syrups': 'Sirops', 'order.crepe_extras': 'Extras crêpe', 'order.line': 'Sous-total ligne', 'order.remove': 'Retirer',
    'order.subtotal': 'Total', 'order.no_tax': 'Pas de TVA — le total affiché est dû.',
    'order.proceed': 'Paiement', 'order.checkout': 'Paiement', 'order.name': 'Nom', 'order.phone': 'Téléphone / WhatsApp',     'order.address': 'Adresse de livraison',
    'order.addr_pickup': 'Retrait en boutique — pas d’adresse.',
    'order.fulfillment': 'Mode de réception',
    'order.pickup': 'Retrait à la boutique',
    'order.delivery': 'Livraison',
    'order.notes': 'Notes pour la cuisine',
    'order.notes_placeholder': 'Allergies, horaire, repère…',
    'order.payment': 'Paiement', 'order.submit': 'Envoyer la commande par WhatsApp',
    'order.thank_body': 'WhatsApp doit s’ouvrir avec la commande complète. Sinon, utilisez le bouton ci-dessous.',
    'order.thank_ref': 'Référence commande',
    'order.open_whatsapp': 'Rouvrir WhatsApp',
    'order.copy_message': 'Copier le texte',
    'order.copy_done': 'Copié',
    'order.msg_intro': 'Nouvelle commande Gelato House',
    'order.msg_total': 'Total',
    'order.msg_pay': 'Paiement',
    'order.msg_notes': 'Notes',
    'order.msg_none': '—',
    'order.thank_back': 'Retour au menu',
    'admin.intro': 'Lignes coupe : prix × qté (FCFA). Transferts = valeur indicative des coupes reçues de la production.',
    'admin.export_exp': 'CSV dépenses',
    'admin.export_inc': 'CSV revenus / dépôts',
    'admin.export_sale': 'CSV ventes',
    'admin.export_full': 'Export complet',
    'admin.exp_out_sales': 'Ventes caisse (glace & yaourt)',
    'admin.exp_price': 'Prix F',
    'admin.exp_qty': 'Qté',
    'admin.exp_add_line': 'Ajouter ligne coupe',
    'admin.exp_custom': 'Produit perso',
    'admin.exp_counters_sub': 'Sous-total lignes',
    'admin.exp_transfer': 'Transferts reçus aujourd’hui',
    'admin.exp_transfer_value': 'Valeur transferts (FCFA)',
    'admin.exp_staff_day': 'Paie journalière / horaire (ce point)',
    'admin.exp_people_hours': 'Qui a travaillé / note',
    'admin.exp_people_hours_ph': 'ex. 3 pers. · matin',
    'admin.exp_payroll_total': 'Total paie (FCFA)',
    'admin.exp_misc': 'Autres dépenses (libellé + montant)',
    'admin.exp_what': 'Libellé',
    'admin.exp_add_row': 'Ajouter ligne',
    'admin.exp_location_sub': 'Ce point · dépenses du jour',
    'admin.exp_day_all_exp': 'Tous points · dépenses du jour',
    'admin.exp_day_transfers_all': 'Tous points · valeur transferts',
    'admin.exp_week_title': 'Même point · 7 jours glissants',
    'admin.exp_week_cup': 'Sous-total coupes',
    'admin.exp_week_trans': 'Total transferts',
  },
  ar: {
    'nav.flavors': 'نكهات وأكواب', 'nav.story': 'قصتنا', 'nav.locations': 'الفروع', 'nav.order': 'اطلب الآن',
    'nav.size': 'حجم النص',
    'nav.theme_toggle_dark': 'واجهة داكنة',
    'nav.theme_toggle_light': 'واجهة فاتحة',
    'a11y.size_minus': 'نص أصغر', 'a11y.size_plus': 'نص أكبر',
    'a11y.size_titles': 'صغير,عادي,كبير,كبير جدًا,2×,3×,أقصى',
    'hero.tag': '✦ مثلجات وروب · نجامينا، تشاد',
    'hero.title_1': 'صُنع في تشاد',
    'hero.craft': 'بعناية،',
    'hero.title_2': 'مثلجات وروب.',
    'hero.sub': "نصنع مثلجات وروبًا طازجًا في نجامينا—حليب محلي، فاكهة حقيقية، ثلاثة فروع، وموقعنا gelatohouse.app عند الاتصال.",
    'hero.cta_primary': 'النكهات والأكواب', 'hero.cta_secondary': 'قصتنا',
    'hero.art_label': 'نجامينا · الصفحة الرئيسية',
    'stats.flavors': 'نكهات مميزة', 'stats.natural': 'مكوّنات طبيعية', 'stats.locations': 'فروع', 'stats.customers': 'زبون سعيد',
    'stats.lines_n': '٢', 'stats.lines_l': 'مثلجات وروب',
    'marquee': 'نجامينا · مثلجات وروب · حليب محلي · روب بأوانٍ · فاكهة حقيقية · طازج يوميًا ·',
    'flavors.eyebrow': 'مثلجات وروب', 'flavors.title_a': 'مفضلات في', 'flavors.title_b': 'مخاريط وأكواب', 'flavors.title_c': 'وأوانٍ',
    'flavors.view_all': 'عرض القائمة',
    'flavors.scoop_note': 'للكوب أو الوعاء',
    'story.eyebrow': 'منذ 2023', 'story.quote': 'أردنا مذاقًا باردًا يعكس مكاننا—المانجا عند اكتمال نضجها، والكركديه بعمقه، والحليب من مربينا، والروب للبيت. لا شعارات استيراد فارغة: صناعة تشادية واضحة.',
    'story.by': '— خالد هيباه، المؤسس',
    'locations.eyebrow': 'ثلاثة فروع',
    'footer.tagline': 'Laziz. لذيذ.',
    'footer.rights': '© 2026 جيلاتو هاوس · نجامينا، تشاد',
    'admin.enter': 'دخول الإدارة', 'a11y.font_section': 'حجم النص (كل الموقع)',
    'admin.dashboard': 'الرئيسية', 'admin.production': 'الإنتاج', 'admin.inventory': 'المخزون',
    'admin.expenses': 'مصروفات يومية', 'admin.expenses_sub': '٤ نقاط + مصنع · صادرات CSV',
    'admin.login_title': 'دخول الموظفين',
    'admin.login_hint': 'البريد المسجل في الدليل.',
    'admin.login_email': 'البريد',
    'admin.login_pin': 'رمز PIN',
    'admin.login_submit': 'دخول',
    'admin.login_err_email': 'البريد غير معروف.',
    'admin.login_err_pin': 'الرمز غير صحيح.',
    'admin.login_demo_note': 'المدير: khalid26 · الفريق: hybah26.',
    'admin.boss_panel': 'المدير · الموافقات',
    'admin.logout': 'خروج',
    'admin.public_site': 'الموقع العام',
    'admin.employees': 'الموظفون', 'admin.hr': 'الموارد البشرية', 'admin.deposits': 'الإيداعات',
    'admin.analytics': 'التحليلات', 'admin.users': 'المستخدمون', 'admin.audit': 'سجل التدقيق', 'admin.settings': 'الإعدادات',
    'admin.overview': 'نظرة عامة', 'admin.people': 'الأشخاص', 'admin.finance': 'المالية', 'admin.system': 'النظام',
    'admin.welcome': 'صباح الخير،', 'admin.welcome_sub': 'هذا ما يحدث اليوم في جيلاتو هاوس.',
    'access.denied_title': 'الميزة غير مفعّلة', 'access.denied_message': 'حسابك لا يملك صلاحية. اطلب من المدير.',
    'notifications.title': 'الإشعارات', 'notifications.mark_all_read': 'تحديد الكل كمقروء', 'notifications.empty': 'لا جديد.',
    'common.save': 'حفظ', 'common.cancel': 'إلغاء', 'common.edit': 'تعديل', 'common.delete': 'حذف', 'common.add': 'إضافة', 'common.export': 'تصدير', 'common.search': 'بحث', 'common.filter': 'تصفية', 'common.today': 'اليوم', 'common.week': 'هذا الأسبوع', 'common.month': 'هذا الشهر', 'common.view_all': 'عرض الكل',
    'nav.shop': 'المتجر والطلب',
    'order.eyebrow': 'طلب عبر الموقع', 'order.title': 'قائمة وسلة ودفع', 'order.sub': 'مثلجات بالكوب، روب مجمّد (صغير 250 / كبير 500)، كريب ساخن. الأسعار بالفرنك — بدون ضريبة في تشاد.',
    'order.tab_ice': 'مثلجات', 'order.tab_yog': 'روب مجمّد', 'order.tab_crepe': 'كريب',
    'order.add': 'إضافة', 'order.per_scoop': 'كوب', 'order.yogurt_build': 'اصنع كوبك', 'order.yogurt_hint': 'اختر الحجم ثم النكهة. قد تُضاف رسوم بسيطة.',
    'order.size': 'الحجم', 'order.flavor': 'النكهة', 'order.add_yogurt': 'أضف للسلة',
    'order.crepe_intro': 'كريب رقيق دائري — ساخن، مع شوكولاتة أو فواكه. أضف الإضافات من السلة.',
    'order.legal': 'الدفع يفتح واتساب مع طلبك — نؤكد قبل الدفع.',
    'order.cart': 'السلة', 'order.view_cart': 'عرض السلة', 'order.lines': 'بنود', 'order.empty': 'السلة فارغة.',
    'order.scoops': 'كرات / سطر', 'order.customize': 'إضافات وشراب', 'order.less': 'إخفاء',
    'order.toppings': 'إضافات', 'order.syrups': 'شراب', 'order.crepe_extras': 'إضافات الكريب', 'order.line': 'المجموع', 'order.remove': 'حذف',
    'order.subtotal': 'الإجمالي', 'order.no_tax': 'بدون ضريبة — المبلغ المعروض هو المستحق.',
    'order.proceed': 'إتمام', 'order.checkout': 'الدفع', 'order.name': 'الاسم', 'order.phone': 'الهاتف / واتساب',     'order.address': 'عنوان التوصيل',
    'order.addr_pickup': 'استلام من المحل — لا حاجة للعنوان.',
    'order.fulfillment': 'طريقة الاستلام',
    'order.pickup': 'استلام من المحل',
    'order.delivery': 'توصيل',
    'order.notes': 'ملاحظات للمطبخ',
    'order.notes_placeholder': 'حساسية، وقت، علامة…',
    'order.payment': 'طريقة الدفع', 'order.submit': 'إرسال الطلب عبر واتساب',
    'order.thank_body': 'يجب أن يفتح واتساب مع الطلب كاملاً. إن لم يحدث، استخدم الزر أدناه.',
    'order.thank_ref': 'مرجع الطلب',
    'order.open_whatsapp': 'فتح واتساب مرة أخرى',
    'admin.intro': 'سطر السعر × الكمية. الأعمدة = تقدير لقيم الأكواب الواردة من الإنتاج.',
    'admin.export_exp': 'مصروفات CSV',
    'admin.export_inc': 'إيداعات CSV',
    'admin.export_sale': 'مبيعات CSV',
    'admin.export_full': 'تصدير كامل',
    'admin.exp_out_sales': 'تقدير كاش (آيس وروب)',
    'admin.exp_price': 'السعر',
    'admin.exp_qty': 'الكمية',
    'admin.exp_add_line': 'سطر جديد',
    'admin.exp_custom': 'صنف مخصص',
    'admin.exp_counters_sub': 'المجموع الفرعي',
    'admin.exp_transfer': 'تحويلات اليوم',
    'admin.exp_transfer_value': 'قيمة التحويلات',
    'admin.exp_staff_day': 'أجور يومية / بالساعة',
    'admin.exp_people_hours': 'من عمل / ملاحظة',
    'admin.exp_people_hours_ph': 'مثال: ٣ أشخاص',
    'admin.exp_payroll_total': 'إجمالي الأجور',
    'admin.exp_misc': 'مصروفات أخرى',
    'admin.exp_what': 'الوصف',
    'admin.exp_add_row': 'إضافة سطر',
    'admin.exp_location_sub': 'هذا الفرع · مصروف اليوم',
    'admin.exp_day_all_exp': 'كل الفروع · مصروف اليوم',
    'admin.exp_day_transfers_all': 'كل الفروع · قيمة التحويلات',
    'admin.exp_week_title': 'نفس الفرع · آخر ٧ أيام',
    'admin.exp_week_cup': 'مجموع الأكواب',
    'admin.exp_week_trans': 'مجموع التحويلات',
    'order.copy_message': 'نسخ نص الطلب',
    'order.copy_done': 'تم النسخ',
    'order.msg_intro': 'طلب جديد — جيلاتو هاوس',
    'order.msg_total': 'المجموع',
    'order.msg_pay': 'الدفع',
    'order.msg_notes': 'ملاحظات',
    'order.msg_none': '—',
    'order.thank_back': 'العودة للقائمة',
  },
};

function useT() {
  const [lang, setLangState] = React.useState(window.__lang || 'en');
  React.useEffect(() => {
    const handler = (e) => setLangState(e.detail);
    window.addEventListener('lang-change', handler);
    return () => window.removeEventListener('lang-change', handler);
  }, []);
  const t = React.useCallback((key) => {
    return (TRANSLATIONS[lang] && TRANSLATIONS[lang][key]) || TRANSLATIONS.en[key] || key;
  }, [lang]);
  return { t, lang };
}

function setLang(lang) {
  window.__lang = lang;
  document.documentElement.setAttribute('lang', lang);
  document.documentElement.setAttribute('dir', lang === 'ar' ? 'rtl' : 'ltr');
  document.body.classList.toggle('lang-ar', lang === 'ar');
  window.dispatchEvent(new CustomEvent('lang-change', { detail: lang }));
}

Object.assign(window, { useT, setLang, TRANSLATIONS });
