// Shared data, translations, and small primitives used by both DUT variants.

const GUINEA_CITIES = [
  'Conakry', 'Kankan', 'Labé', 'Nzérékoré', 'Kindia', 'Boké',
  'Faranah', 'Mamou', 'Siguiri', 'Kamsar', 'Fria', 'Macenta',
  'Dabola', 'Forécariah', 'Télimélé', 'Kissidougou'
];

const ROUTES = [
  { from: 'Conakry', to: 'Kankan', km: 645, hours: 11 },
  { from: 'Conakry', to: 'Labé', km: 432, hours: 8 },
  { from: 'Kamsar', to: 'Conakry', km: 254, hours: 5 },
  { from: 'Conakry', to: 'Nzérékoré', km: 950, hours: 18 },
  { from: 'Boké', to: 'Conakry', km: 305, hours: 6 },
  { from: 'Kankan', to: 'Siguiri', km: 122, hours: 3 },
];

const GOODS = [
  { code: 'BAUX', label: 'Bauxite', unit: 'tonnes', cat: 'Minerai' },
  { code: 'RIZ',  label: 'Riz importé', unit: 'sacs 50kg', cat: 'Denrée' },
  { code: 'CIM',  label: 'Ciment', unit: 'sacs 50kg', cat: 'Construction' },
  { code: 'HUI',  label: 'Huile de palme', unit: 'fûts', cat: 'Denrée' },
  { code: 'CAR',  label: 'Carburant', unit: 'litres', cat: 'Hydrocarbure' },
  { code: 'POI',  label: 'Poisson séché', unit: 'caisses', cat: 'Denrée' },
  { code: 'OR',   label: 'Or brut', unit: 'kg', cat: 'Minerai' },
];

const CARRIER = {
  name: 'TRANSPORTS DIALLO & FRÈRES',
  short: 'Diallo & Frères',
  rccm: 'RCCM/CKY/2019/B/04812',
  nif: '7053219K',
  director: 'Mamadou Saliou Diallo',
  phone: '+224 622 14 88 03',
  email: 'contact@diallo-transports.gn',
  address: 'Km 36, Route de Kindia · Sonfonia, Conakry',
  fleet: 14,
  drivers: 22,
  since: 2007,
};

const VEHICLES = [
  { plate: 'RC-4821-AC', type: 'Camion-citerne', brand: 'Mercedes Actros', year: 2021, capacity: '32 t', driver: 'Ousmane Bah' },
  { plate: 'RC-3107-AB', type: 'Semi-remorque',  brand: 'Renault K460',    year: 2019, capacity: '40 t', driver: 'Sékou Camara' },
  { plate: 'RC-7715-AD', type: 'Plateau',         brand: 'MAN TGS',          year: 2022, capacity: '28 t', driver: 'Amadou Barry' },
  { plate: 'RC-9032-AB', type: 'Benne',           brand: 'Volvo FMX',        year: 2018, capacity: '34 t', driver: 'Ibrahima Sow' },
  { plate: 'RC-1244-AE', type: 'Frigorifique',    brand: 'Iveco Stralis',    year: 2023, capacity: '22 t', driver: 'Fatoumata Touré' },
];

const RECENT_DUTS = [
  { id: 'DUT-2026-04-08821', date: '28/04/2026', from: 'Kamsar', to: 'Conakry', goods: 'Bauxite · 32 t', vehicle: 'RC-4821-AC', amount: 425000, status: 'paid'    },
  { id: 'DUT-2026-04-08754', date: '24/04/2026', from: 'Conakry', to: 'Kankan', goods: 'Ciment · 1240 sacs', vehicle: 'RC-3107-AB', amount: 612000, status: 'paid' },
  { id: 'DUT-2026-04-08712', date: '22/04/2026', from: 'Conakry', to: 'Labé',   goods: 'Riz importé · 980 sacs', vehicle: 'RC-7715-AD', amount: 388000, status: 'paid' },
  { id: 'DUT-2026-04-08698', date: '21/04/2026', from: 'Boké',   to: 'Conakry', goods: 'Bauxite · 28 t', vehicle: 'RC-9032-AB', amount: 372000, status: 'pending' },
  { id: 'DUT-2026-04-08651', date: '18/04/2026', from: 'Conakry', to: 'Nzérékoré', goods: 'Carburant · 22 000 L', vehicle: 'RC-1244-AE', amount: 845000, status: 'paid' },
  { id: 'DUT-2026-04-08603', date: '15/04/2026', from: 'Kankan', to: 'Siguiri', goods: 'Ciment · 540 sacs', vehicle: 'RC-3107-AB', amount: 198000, status: 'expired' },
];

const ALERTS = [
  { kind: 'warn', label: 'Carte transporteur', detail: 'Expire dans 38 jours · 07/06/2026' },
  { kind: 'info', label: 'Nouveau tarif DUT', detail: 'Itinéraire Conakry→Nzérékoré · +4,2%' },
  { kind: 'ok',   label: 'Paiement reçu',     detail: 'DUT-2026-04-08821 · 425 000 GNF' },
];

// FR / EN / Soussou / Pular / Malinké — translations for visible labels.
// Keys are stable; FR is the canonical source. English provides full coverage;
// Soussou / Pular / Malinké cover all UI strings (some technical terms are kept
// in French as is common in Guinean usage).
const I18N = {
  fr: {
    // Brand / shell
    appName: 'Document Unique de Transport',
    short: 'DUT',
    portal: 'Plateforme officielle de la République de Guinée',
    republic: 'République de Guinée',
    ministry: 'Ministère des Transports · DGTT',
    dntt: 'Direction Nationale du Transports Terrestre',
    // Nav
    dashboard: 'Tableau de bord',
    newDut: 'Générer un DUT',
    newDutShort: 'Nouveau DUT',
    history: 'Historique',
    fleet: 'Flotte',
    drivers: 'Conducteurs',
    payments: 'Paiements',
    settings: 'Paramètres',
    support: 'Support',
    profile: 'Profil',
    home: 'Accueil',
    // Dashboard
    overview: 'Aperçu',
    welcome: 'Bonjour',
    welcomeBack: 'Bon retour',
    carrierSpace: 'Espace transporteur',
    issued: 'DUT émis · avril',
    pending: 'En attente de paiement',
    paid: 'Payé',
    paidPlural: 'Payés',
    expired: 'Expiré',
    expiredPlural: 'Expirés',
    overdue: 'Paiement en retard',
    overdueDetail: 'à régler sous 48 h',
    amountDue: 'Total versé · avril',
    distance: 'Distance parcourue',
    trips: 'trajets',
    documentsIssued: 'Documents émis',
    versusLastMonth: 'vs mars 2026',
    recentDocs: 'Documents récents',
    seeAll: 'Voir tout',
    notifications: 'Notifications',
    compliance: 'Conformité',
    legalDocs: 'Documents légaux',
    allUpToDate: 'Tous à jour',
    quickActions: 'Actions rapides',
    // Status
    statusPaid: 'Payé',
    statusPending: 'En attente',
    statusExpired: 'Expiré',
    // Form steps
    route: 'Itinéraire',
    cargo: 'Marchandise',
    vehicle: 'Véhicule',
    summary: 'Récapitulatif',
    summaryConfirm: 'Récapitulatif & confirmation',
    stepOf: 'Étape {n} sur {total}',
    fromCity: 'Ville de départ',
    toCity: 'Ville d\u2019arrivée',
    departure: 'Date de départ',
    arrival: 'Date prévue d\u2019arrivée',
    estimatedDistance: 'Distance estimée',
    estimatedTime: 'Durée estimée',
    cargoCategory: 'Catégorie de marchandise',
    cargoNature: 'Nature de la marchandise',
    quantity: 'Quantité',
    unit: 'Unité',
    declaredValue: 'Valeur déclarée (GNF)',
    chooseVehicle: 'Choisir le véhicule',
    primaryDriver: 'Conducteur principal',
    licenseNumber: 'N° permis de conduire',
    technicalInspection: 'Visite technique',
    insurance: 'Assurance',
    transportCard: 'Carte transporteur',
    validUntil: 'Valide jusqu\u2019au',
    estimate: 'Estimation',
    fee: 'Redevance',
    stamp: 'Timbre',
    dnttShare: 'Quote-part DNTT',
    total: 'Total',
    totalDue: 'Total à régler',
    totalPaid: 'Total réglé',
    next: 'Suivant',
    back: 'Retour',
    previous: 'Précédent',
    cancel: 'Annuler',
    confirm: 'Confirmer',
    submit: 'Soumettre',
    saveDraft: 'Enregistrer brouillon',
    // Payment
    pay: 'Payer maintenant',
    payAmount: 'Payer {amount}',
    paymentMethod: 'Moyen de paiement',
    chooseMethod: 'Choisissez un moyen de paiement',
    orangeMoney: 'Orange Money',
    mtnMoMo: 'MTN Mobile Money',
    bankCard: 'Carte bancaire',
    bankTransfer: 'Virement bancaire',
    securedBy: 'Sécurisé par KKiaPay · TLS 1.3 · PCI-DSS',
    paymentSent: 'Demande envoyée — composez *144#',
    paymentSuccess: 'Paiement validé',
    paymentReceived: 'Paiement reçu',
    // PDF / receipt
    documentReady: 'Document prêt',
    download: 'Télécharger PDF',
    sendSms: 'Envoyer par SMS',
    print: 'Imprimer',
    scanToVerify: 'Scannez pour vérifier ce document',
    decree: 'Arrêté 2025/MTI/DNTT',
    carrier: 'Transporteur',
    transporter: 'Transporteur',
    driver: 'Conducteur',
    issuedOn: 'Émis le',
    docNumber: 'N°',
    paidStamp: 'PAYÉ',
    // Profile
    myFleet: 'Ma flotte',
    activeDrivers: 'actifs',
    myPayments: 'Mes paiements',
    transactions: 'transactions',
    helpSupport: 'Aide & support',
    languageNotifs: 'Langue · Notifications',
    // Misc
    filters: 'Filtres',
    all: 'Tous',
    documents: 'documents',
    search: 'Rechercher',
  },
  en: {
    appName: 'Single Transport Document',
    short: 'STD',
    portal: 'Official Platform · Republic of Guinea',
    republic: 'Republic of Guinea',
    ministry: 'Ministry of Transport · DGTT',
    dntt: 'Direction Nationale du Transports Terrestre',
    dashboard: 'Dashboard',
    newDut: 'Generate STD',
    newDutShort: 'New STD',
    history: 'History',
    fleet: 'Fleet',
    drivers: 'Drivers',
    payments: 'Payments',
    settings: 'Settings',
    support: 'Support',
    profile: 'Profile',
    home: 'Home',
    overview: 'Overview',
    welcome: 'Hello',
    welcomeBack: 'Welcome back',
    carrierSpace: 'Carrier portal',
    issued: 'STDs issued · April',
    pending: 'Awaiting payment',
    paid: 'Paid',
    paidPlural: 'Paid',
    expired: 'Expired',
    expiredPlural: 'Expired',
    overdue: 'Payment overdue',
    overdueDetail: 'due within 48 h',
    amountDue: 'Total paid · April',
    distance: 'Distance covered',
    trips: 'trips',
    documentsIssued: 'Documents issued',
    versusLastMonth: 'vs March 2026',
    recentDocs: 'Recent documents',
    seeAll: 'See all',
    notifications: 'Notifications',
    compliance: 'Compliance',
    legalDocs: 'Legal documents',
    allUpToDate: 'All up to date',
    quickActions: 'Quick actions',
    statusPaid: 'Paid',
    statusPending: 'Pending',
    statusExpired: 'Expired',
    route: 'Route',
    cargo: 'Cargo',
    vehicle: 'Vehicle',
    summary: 'Summary',
    summaryConfirm: 'Summary & confirmation',
    stepOf: 'Step {n} of {total}',
    fromCity: 'Departure city',
    toCity: 'Arrival city',
    departure: 'Departure date',
    arrival: 'Arrival date',
    estimatedDistance: 'Estimated distance',
    estimatedTime: 'Estimated duration',
    cargoCategory: 'Cargo category',
    cargoNature: 'Nature of cargo',
    quantity: 'Quantity',
    unit: 'Unit',
    declaredValue: 'Declared value (GNF)',
    chooseVehicle: 'Choose vehicle',
    primaryDriver: 'Primary driver',
    licenseNumber: 'Driver licence #',
    technicalInspection: 'Technical inspection',
    insurance: 'Insurance',
    transportCard: 'Carrier card',
    validUntil: 'Valid until',
    estimate: 'Estimate',
    fee: 'Toll fee',
    stamp: 'Stamp duty',
    dnttShare: 'DNTT share',
    total: 'Total',
    totalDue: 'Total due',
    totalPaid: 'Total paid',
    next: 'Next',
    back: 'Back',
    previous: 'Previous',
    cancel: 'Cancel',
    confirm: 'Confirm',
    submit: 'Submit',
    saveDraft: 'Save draft',
    pay: 'Pay now',
    payAmount: 'Pay {amount}',
    paymentMethod: 'Payment method',
    chooseMethod: 'Choose a payment method',
    orangeMoney: 'Orange Money',
    mtnMoMo: 'MTN Mobile Money',
    bankCard: 'Bank card',
    bankTransfer: 'Bank transfer',
    securedBy: 'Secured by KKiaPay · TLS 1.3 · PCI-DSS',
    paymentSent: 'Request sent — dial *144#',
    paymentSuccess: 'Payment confirmed',
    paymentReceived: 'Payment received',
    documentReady: 'Document ready',
    download: 'Download PDF',
    sendSms: 'Send by SMS',
    print: 'Print',
    scanToVerify: 'Scan to verify this document',
    decree: 'Decree 2025/MTI/DNTT',
    carrier: 'Carrier',
    transporter: 'Carrier',
    driver: 'Driver',
    issuedOn: 'Issued on',
    docNumber: '#',
    paidStamp: 'PAID',
    myFleet: 'My fleet',
    activeDrivers: 'active',
    myPayments: 'My payments',
    transactions: 'transactions',
    helpSupport: 'Help & support',
    languageNotifs: 'Language · Notifications',
    filters: 'Filters',
    all: 'All',
    documents: 'documents',
    search: 'Search',
  },
  sus: { // Soussou
    appName: 'Findɛ Wonta nan Ratɛyɛ',
    short: 'DUT',
    portal: 'Gine Bofe Mangɛya — Sɛbɛ Yɛrɛ',
    republic: 'Gine Bofe',
    ministry: 'Ratɛyɛ Mangɛya · DGTT',
    dntt: 'Direction Nationale du Transports Terrestre',
    dashboard: 'Tofan',
    newDut: 'DUT raɲɔngɔ',
    newDutShort: 'DUT kura',
    history: 'Sɛbɛ kɔrɔlen',
    fleet: 'Mobili birin',
    drivers: 'Mobili kanyi',
    payments: 'Saren',
    settings: 'Tɛrɛnna',
    support: 'Mali',
    profile: 'N profili',
    home: 'Tofan',
    overview: 'Yi tofan',
    welcome: 'I ni sa',
    welcomeBack: 'I dangi tan',
    carrierSpace: 'Ratɛyɛ kanyi yɛrɛ',
    issued: 'DUT bara raɲɔngɔ',
    pending: 'Saren ma sɔrɔ',
    paid: 'Saren bara di',
    paidPlural: 'Saren bara di',
    expired: 'Bara dangi',
    expiredPlural: 'Bara dangi',
    overdue: 'Saren ma sɔrɔ tɛmuyi',
    overdueDetail: 'sɔrɔ 48 wati i',
    amountDue: 'Saren bɛɛ · awurili',
    distance: 'Kira fɔrɔn',
    trips: 'taamasen',
    documentsIssued: 'Sɛbɛ bara raɲɔngɔ',
    versusLastMonth: 'maarisi 2026',
    recentDocs: 'Sɛbɛ kɔrɔlen',
    seeAll: 'Bɛɛ to',
    notifications: 'Lalile',
    compliance: 'Sariya',
    legalDocs: 'Sariya sɛbɛ',
    allUpToDate: 'Bɛɛ a kɛndɛ',
    quickActions: 'Wali tagi',
    statusPaid: 'Bara di',
    statusPending: 'Ma sɔrɔ',
    statusExpired: 'Dangi',
    route: 'Kira',
    cargo: 'Marfayi',
    vehicle: 'Mobili',
    summary: 'Tofan kɔrɔ',
    summaryConfirm: 'Tofan & sondɔ',
    stepOf: 'Tɛmui {n} / {total}',
    fromCity: 'Tagia taa',
    toCity: 'Sigia taa',
    departure: 'Tagia lɔxɛ',
    arrival: 'Sigia lɔxɛ',
    estimatedDistance: 'Kira ɲun',
    estimatedTime: 'Wati ɲun',
    cargoCategory: 'Marfayi sigi',
    cargoNature: 'Marfayi ratɛyɛ',
    quantity: 'A wo yi',
    unit: 'Sigi',
    declaredValue: 'A sɔngɔ (GNF)',
    chooseVehicle: 'Mobili sugandi',
    primaryDriver: 'Mobili kanyi',
    licenseNumber: 'Permi nimɛrɔ',
    technicalInspection: 'Mobili matoli',
    insurance: 'Asuransi',
    transportCard: 'Ratɛyɛ kati',
    validUntil: 'A kɛndɛ ha',
    estimate: 'Ɲun',
    fee: 'Sara',
    stamp: 'Tɛnbɛrɛ',
    dnttShare: 'DNTT ki',
    total: 'Hayi',
    totalDue: 'Hayi sɔrɔnde',
    totalPaid: 'Hayi diande',
    next: 'Ɲɔngɔ',
    back: 'Gbilen',
    previous: 'Sani',
    cancel: 'Bɔ',
    confirm: 'Tɔlɔ',
    submit: 'Yi rasiga',
    saveDraft: 'Mara dɔnɔ',
    pay: 'Sare yi',
    payAmount: '{amount} di',
    paymentMethod: 'Saren kira',
    chooseMethod: 'Saren kira sugandi',
    orangeMoney: 'Orange Money',
    mtnMoMo: 'MTN Mobile Money',
    bankCard: 'Banki kati',
    bankTransfer: 'Banki ratɛyɛ',
    securedBy: 'KKiaPay a kanta · TLS 1.3 · PCI-DSS',
    paymentSent: 'Yi rasiga — *144# kompose',
    paymentSuccess: 'Saren bara sɔrɔ',
    paymentReceived: 'Saren bara sɔrɔ',
    documentReady: 'Sɛbɛ a sɔrɔ',
    download: 'PDF goro',
    sendSms: 'SMS ki rasiga',
    print: 'Yi sɔbɔ',
    scanToVerify: 'Skani sɛbɛ ki gbɛlɛya',
    decree: 'Sariya 2025/MTI/DNTT',
    carrier: 'Ratɛyɛ kanyi',
    transporter: 'Ratɛyɛ kanyi',
    driver: 'Mobili kanyi',
    issuedOn: 'A raɲɔngɔ',
    docNumber: 'N°',
    paidStamp: 'BARA DI',
    myFleet: 'N mobili',
    activeDrivers: 'wali bɛɛ',
    myPayments: 'N saren',
    transactions: 'saren',
    helpSupport: 'Mali',
    languageNotifs: 'Xui · Lalile',
    filters: 'Sigife',
    all: 'Bɛɛ',
    documents: 'sɛbɛ',
    search: 'Fen',
  },
  ful: { // Pular
    appName: 'Ɓataake Goote Ronnde',
    short: 'DUT',
    portal: 'Hilifaaɓe Ronnde — Hubbinde Gineya',
    republic: 'Hubbinde Gineya',
    ministry: 'Wuro Ronnde · DGTT',
    dntt: 'Direction Nationale du Transports Terrestre',
    dashboard: 'Hollirde',
    newDut: 'DUT keso',
    newDutShort: 'DUT keso',
    history: 'Ɓe ɓennuɓe',
    fleet: 'Otooji am',
    drivers: 'Awtooɓe',
    payments: 'Yoɓle',
    settings: 'Defraali',
    support: 'Wallitorde',
    profile: 'Profil',
    home: 'Galle',
    overview: 'Ƴeewo',
    welcome: 'Jam tan',
    welcomeBack: 'Jam waaltii',
    carrierSpace: 'Galle ronnoowo',
    issued: 'DUT ɗi mbaylanaa',
    pending: 'Yoɓle ñawi',
    paid: 'Yoɓaaɗo',
    paidPlural: 'Ɓe njoɓaa',
    expired: 'Mo timmi',
    expiredPlural: 'Ɓe mbeli',
    overdue: 'Yoɓle ñawi sanne',
    overdueDetail: 'yoɓ nder 48 w',
    amountDue: 'Ko yoɓaa · seeɗto',
    distance: 'Yaadu',
    trips: 'jahɗi',
    documentsIssued: 'Ɓataaɗe mbaylaaɗe',
    versusLastMonth: 'kontiri lewru saawiyee 2026',
    recentDocs: 'Ɓataaɗe ɓennooje',
    seeAll: 'Yi\u02B9 fof',
    notifications: 'Habaruuji',
    compliance: 'Sariya',
    legalDocs: 'Ɓataaɗe sariya',
    allUpToDate: 'Fof ina moƴƴi',
    quickActions: 'Golle yaaccu',
    statusPaid: 'Yoɓaaɗo',
    statusPending: 'Ñawi',
    statusExpired: 'Timmii',
    route: 'Laawol',
    cargo: 'Marse',
    vehicle: 'Otoo',
    summary: 'Hollirde',
    summaryConfirm: 'Hollirde & teeŋtinde',
    stepOf: 'Daawal {n} e {total}',
    fromCity: 'Wuro ummorde',
    toCity: 'Wuro yettorde',
    departure: 'Ñalnde ummorde',
    arrival: 'Ñalnde yettorde',
    estimatedDistance: 'Yaadu hiisaande',
    estimatedTime: 'Saawu hiisaande',
    cargoCategory: 'Sifaa marse',
    cargoNature: 'Mbayka marse',
    quantity: 'Limoore',
    unit: 'Sifaa',
    declaredValue: 'Coggu (GNF)',
    chooseVehicle: 'Suɓo otoo',
    primaryDriver: 'Awtoowo gardiiɗo',
    licenseNumber: 'Permi nimero',
    technicalInspection: 'Ƴeewndo otoo',
    insurance: 'Asiransi',
    transportCard: 'Karte ronnoowo',
    validUntil: 'Moƴƴa haa',
    estimate: 'Hiisa',
    fee: 'Yoɓdu',
    stamp: 'Tembre',
    dnttShare: 'Geɗal DNTT',
    total: 'Fof',
    totalDue: 'Fof yoɓ',
    totalPaid: 'Fof yoɓaa',
    next: 'Jokku',
    back: 'Yiltu',
    previous: 'Ko adii',
    cancel: 'Soonte',
    confirm: 'Teeŋtin',
    submit: 'Neld',
    saveDraft: 'Reen mbayka',
    pay: 'Yoɓ jooni',
    payAmount: 'Yoɓ {amount}',
    paymentMethod: 'Mbayka yoɓdu',
    chooseMethod: 'Suɓo mbayka yoɓdu',
    orangeMoney: 'Orange Money',
    mtnMoMo: 'MTN Mobile Money',
    bankCard: 'Karte banke',
    bankTransfer: 'Neldugol banke',
    securedBy: 'Reenaa e KKiaPay · TLS 1.3 · PCI-DSS',
    paymentSent: 'Ñaagunde nelaama — yiilo *144#',
    paymentSuccess: 'Yoɓle laaɓi',
    paymentReceived: 'Yoɓle ƴetta',
    documentReady: 'Ɓataake heɓii',
    download: 'Ronnu PDF',
    sendSms: 'Neld e SMS',
    print: 'Winnd',
    scanToVerify: 'Skanno ngam ƴeewde',
    decree: 'Yamiroore 2025/MTI/DNTT',
    carrier: 'Ronnoowo',
    transporter: 'Ronnoowo',
    driver: 'Awtoowo',
    issuedOn: 'Yaltunde',
    docNumber: 'No',
    paidStamp: 'YOƁAAƊO',
    myFleet: 'Otooji am',
    activeDrivers: 'gollooɓe',
    myPayments: 'Yoɓle am',
    transactions: 'gollol',
    helpSupport: 'Ballal',
    languageNotifs: 'Ɗemngal · Habaruuji',
    filters: 'Suɓorɗe',
    all: 'Fof',
    documents: 'ɓataaɗe',
    search: 'Yiyloore',
  },
  man: { // Malinké
    appName: 'Bolokurunin Sɛbɛn Kelen Tigɛlilan',
    short: 'DUT',
    portal: 'Gine Faso Bolokurunin Tigɛlilan',
    republic: 'Gine Faso',
    ministry: 'Tigɛli Minisɛri · DGTT',
    dntt: 'Direction Nationale du Transports Terrestre',
    dashboard: 'Sigida',
    newDut: 'DUT kura dilan',
    newDutShort: 'DUT kura',
    history: 'Sɛbɛ kɔrɔw',
    fleet: 'Mobili tɔn',
    drivers: 'Mobili tigi',
    payments: 'Sara',
    settings: 'Labɛnniw',
    support: 'Dɛmɛ',
    profile: 'Profili',
    home: 'Sigida',
    overview: 'Ye ye',
    welcome: 'I ni sɔgɔma',
    welcomeBack: 'I ni segin',
    carrierSpace: 'Tigɛlilaw ka yɔrɔ',
    issued: 'DUT bɔlen · awurili',
    pending: 'Sara ma di',
    paid: 'Sara dilen',
    paidPlural: 'Sara dilen',
    expired: 'Bana',
    expiredPlural: 'Bana',
    overdue: 'Sara ma di lɛrɛ la',
    overdueDetail: 'a ka di 48 lɛrɛ kɔnɔ',
    amountDue: 'Sara bɛɛ · awurili',
    distance: 'Sira janya',
    trips: 'taama',
    documentsIssued: 'Sɛbɛ dilenw',
    versusLastMonth: 'marisi 2026',
    recentDocs: 'Sɛbɛ kura',
    seeAll: 'Bɛɛ ye',
    notifications: 'Kibaruyaw',
    compliance: 'Sariya',
    legalDocs: 'Sariya sɛbɛw',
    allUpToDate: 'Bɛɛ ka ɲi',
    quickActions: 'Baara teliman',
    statusPaid: 'Dilen',
    statusPending: 'Ma di',
    statusExpired: 'Bana',
    route: 'Sira',
    cargo: 'Marafali',
    vehicle: 'Mobili',
    summary: 'Sigida',
    summaryConfirm: 'Sigida & sɛmɛntiya',
    stepOf: 'Sennasigi {n} / {total}',
    fromCity: 'Bɔyɔrɔ',
    toCity: 'Taayɔrɔ',
    departure: 'Bɔdon',
    arrival: 'Seyon',
    estimatedDistance: 'Sira hakɛ',
    estimatedTime: 'Waati hakɛ',
    cargoCategory: 'Marafali suguya',
    cargoNature: 'Marafali ɲɔgɔn',
    quantity: 'Hakɛ',
    unit: 'Sigida',
    declaredValue: 'A sɔngɔ (GNF)',
    chooseVehicle: 'Mobili sugandi',
    primaryDriver: 'Mobili tigi',
    licenseNumber: 'Permi nimɔrɔ',
    technicalInspection: 'Mobili lajɛ',
    insurance: 'Asiransi',
    transportCard: 'Tigɛlila ka kati',
    validUntil: 'A bɛna ban',
    estimate: 'Hakɛ',
    fee: 'Sara',
    stamp: 'Tɛnbɛrɛ',
    dnttShare: 'DNTT niyɔrɔ',
    total: 'Bɛɛ',
    totalDue: 'Bɛɛ ka di',
    totalPaid: 'Bɛɛ dilen',
    next: 'Taa',
    back: 'Segin',
    previous: 'Kɔfɛ',
    cancel: 'Tigɛ',
    confirm: 'Sɛmɛntiya',
    submit: 'Ci',
    saveDraft: 'A mara',
    pay: 'Sara di',
    payAmount: '{amount} di',
    paymentMethod: 'Sara di cogo',
    chooseMethod: 'Sara di cogo sugandi',
    orangeMoney: 'Orange Money',
    mtnMoMo: 'MTN Mobile Money',
    bankCard: 'Banki kati',
    bankTransfer: 'Banki ci',
    securedBy: 'KKiaPay y\u2019a lakana · TLS 1.3 · PCI-DSS',
    paymentSent: 'Cikan cilen — *144# wele',
    paymentSuccess: 'Sara dilen',
    paymentReceived: 'Sara sɔrɔlen',
    documentReady: 'Sɛbɛ labɛnnen',
    download: 'PDF jigi',
    sendSms: 'SMS ci',
    print: 'A bɔ',
    scanToVerify: 'Sɛbɛ skani ka a sɛgɛsɛgɛ',
    decree: 'Sariya 2025/MTI/DNTT',
    carrier: 'Tigɛlila',
    transporter: 'Tigɛlila',
    driver: 'Mobili tigi',
    issuedOn: 'A bɔdon',
    docNumber: 'N°',
    paidStamp: 'DILEN',
    myFleet: 'N ka mobili',
    activeDrivers: 'baarakɛla',
    myPayments: 'N ka sara',
    transactions: 'sara',
    helpSupport: 'Dɛmɛ',
    languageNotifs: 'Kan · Kibaruya',
    filters: 'Sugandi',
    all: 'Bɛɛ',
    documents: 'sɛbɛ',
    search: 'Ɲini',
  },
};

// Lightweight {placeholder} interpolation.
const tFmt = (s, vars) => {
  if (!vars || !s) return s;
  return s.replace(/\{(\w+)\}/g, (_, k) => (vars[k] != null ? vars[k] : `{${k}}`));
};

const t = (key, lang = 'fr') => (I18N[lang] && I18N[lang][key]) || I18N.fr[key] || key;

// Simple currency formatter for GNF (Guinean franc)
const fmtGNF = (n) => new Intl.NumberFormat('fr-FR').format(n) + ' GNF';

// ─────────────────────────────────────────────
// Tiny inline icon set (24x24, currentColor stroke)
// ─────────────────────────────────────────────
const Icon = ({ name, size = 20, stroke = 1.6, style }) => {
  const paths = {
    truck:    <><path d="M3 7h11v9H3z"/><path d="M14 10h4l3 3v3h-7z"/><circle cx="7" cy="17" r="1.6"/><circle cx="17" cy="17" r="1.6"/></>,
    doc:      <><path d="M6 3h8l4 4v14H6z"/><path d="M14 3v4h4"/><path d="M9 12h6M9 15h6M9 18h4"/></>,
    plus:     <><path d="M12 5v14M5 12h14"/></>,
    home:     <><path d="M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-7h-6v7H4a1 1 0 0 1-1-1z"/></>,
    coin:     <><circle cx="12" cy="12" r="8"/><path d="M9 10h5a1.5 1.5 0 0 1 0 3H9a1.5 1.5 0 0 0 0 3h6"/></>,
    bell:     <><path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20a2 2 0 0 0 4 0"/></>,
    user:     <><circle cx="12" cy="8" r="3.5"/><path d="M5 20c1-3.5 4-5 7-5s6 1.5 7 5"/></>,
    users:    <><circle cx="9" cy="8" r="3"/><path d="M3 19c0.8-2.8 3-4 6-4s5.2 1.2 6 4"/><circle cx="17" cy="9" r="2.5"/><path d="M16 14c2 0 4 1 4.5 3"/></>,
    chev:     <><path d="M9 6l6 6-6 6"/></>,
    chevDown: <><path d="M6 9l6 6 6-6"/></>,
    check:    <><path d="M5 12l4 4 10-10"/></>,
    upload:   <><path d="M12 16V4"/><path d="M7 9l5-5 5 5"/><path d="M4 17v3h16v-3"/></>,
    download: <><path d="M12 4v12"/><path d="M7 11l5 5 5-5"/><path d="M4 20h16"/></>,
    help:     <><circle cx="12" cy="12" r="9"/><path d="M9.5 9a2.5 2.5 0 0 1 4.8 1c0 1.5-2.3 1.7-2.3 3.5"/><circle cx="12" cy="17" r="0.6" fill="currentColor"/></>,
    search:   <><circle cx="11" cy="11" r="6"/><path d="M20 20l-4-4"/></>,
    pin:      <><path d="M12 21s7-7 7-12a7 7 0 1 0-14 0c0 5 7 12 7 12z"/><circle cx="12" cy="9" r="2.5"/></>,
    cal:      <><rect x="4" y="5" width="16" height="16" rx="1.5"/><path d="M4 9h16M9 3v4M15 3v4"/></>,
    shield:   <><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/></>,
    chat:     <><path d="M4 5h16v11H8l-4 4z"/></>,
    gear:     <><circle cx="12" cy="12" r="3"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4"/></>,
    arrow:    <><path d="M5 12h14M13 6l6 6-6 6"/></>,
    flag:     <><path d="M5 21V4M5 4h12l-2 4 2 4H5"/></>,
    qr:       <><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><path d="M14 14h3v3M20 14v3M14 20h3M17 17v4M20 20v1"/></>,
    phone:    <><path d="M5 4h4l2 5-3 2a11 11 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z"/></>,
    chip:     <><rect x="5" y="5" width="14" height="14" rx="2"/><path d="M9 5V3M15 5V3M9 21v-2M15 21v-2M5 9H3M5 15H3M21 9h-2M21 15h-2"/><rect x="9" y="9" width="6" height="6"/></>,
    ship:     <><path d="M3 17l1.5 4h15L21 17"/><path d="M5 17l1-7h12l1 7"/><path d="M9 10V5h6v5"/><path d="M12 5V3"/></>,
    car:      <><path d="M5 13l1.4-4.2A2 2 0 0 1 8.3 7.5h7.4a2 2 0 0 1 1.9 1.3L19 13"/><path d="M3 13h18v5H3z"/><circle cx="7" cy="18" r="1.4"/><circle cx="17" cy="18" r="1.4"/></>,
    x:        <><path d="M6 6l12 12M18 6L6 18"/></>,
    list:     <><path d="M4 6h16M4 12h16M4 18h10"/></>,
    grid:     <><rect x="4" y="4" width="7" height="7"/><rect x="13" y="4" width="7" height="7"/><rect x="4" y="13" width="7" height="7"/><rect x="13" y="13" width="7" height="7"/></>,
    spark:    <><path d="M3 17l5-6 4 3 5-7 4 6"/></>,
    reload:   <><path d="M21 12a9 9 0 1 1-3-6.7"/><path d="M21 4v5h-5"/></>,
    alert:    <><path d="M12 9v4M12 17v.01"/><path d="M10.3 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/></>,
    camera:   <><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></>,
    clock:    <><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></>,
    image:    <><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-5-5L5 21"/></>,
  };
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
         stroke="currentColor" strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round"
         style={{ flexShrink: 0, ...style }}>
      {paths[name]}
    </svg>
  );
};

// ─────────────────────────────────────────────
// Guinean coat-of-arms-ish emblem (NOT the real one — original abstraction:
// a circular seal with three horizontal bands echoing the flag, framed by a rope)
// Used as a "République de Guinée" mark on the sober variant.
// ─────────────────────────────────────────────
// Guinean flag is VERTICAL: red | yellow | green (hoist → fly).
const SealEmblem = ({ size = 56 }) => (
  <svg width={size} height={size} viewBox="0 0 64 64" fill="none">
    <circle cx="32" cy="32" r="30" stroke="currentColor" strokeWidth="1" opacity=".4"/>
    <circle cx="32" cy="32" r="26" stroke="currentColor" strokeWidth=".7" opacity=".25" strokeDasharray="2 2"/>
    <g transform="translate(14 16)">
      <rect x="0"  y="0" width="12" height="30" fill="#CE1126"/>
      <rect x="12" y="0" width="12" height="30" fill="#FCD116"/>
      <rect x="24" y="0" width="12" height="30" fill="#009460"/>
      <rect x="0"  y="0" width="36" height="30" fill="none" stroke="currentColor" strokeWidth=".5" opacity=".5"/>
    </g>
    <text x="32" y="56" textAnchor="middle" fontSize="5.5" fontFamily="Georgia, serif"
          letterSpacing="1" fill="currentColor" opacity=".7">RÉPUBLIQUE DE GUINÉE</text>
  </svg>
);

// ─── Officer (DNTT agent) profile ─────────────────────────────────
const OFFICER = {
  name: 'Fatoumata Camara',
  role: 'Inspecteur principal · DNTT Conakry',
  badge: 'DNTT-INS-0418',
  office: 'DNTT Conakry · Direction Générale des Transports',
  email: 'f.camara@transports.gov.gn',
};

// ─── Other transporters (officer-side referential) ───────────────
// kind: 'company' (personne morale, RCCM) | 'individual' (personne physique, CNI/NIF)
const TRANSPORTERS = [
  { id: 'TRP-04812', kind: 'company',    short: 'Diallo & Frères',         contact: 'Mamadou Saliou Diallo',  rccm: 'RCCM/CKY/B/2009/00482', city: 'Conakry',     fleet: 14 },
  { id: 'TRP-08231', kind: 'company',    short: 'SAGECO Logistique',       contact: 'Aïssatou Bah',           rccm: 'RCCM/CKY/B/2014/01173', city: 'Conakry',     fleet: 32 },
  { id: 'TRP-02194', kind: 'company',    short: 'Trans-Fouta',             contact: 'Thierno Hassan Bah',     rccm: 'RCCM/LBE/B/2011/00921', city: 'Labé',        fleet: 8 },
  { id: 'TRP-09317', kind: 'company',    short: 'Bauxite Express',         contact: 'Ibrahim Sory Touré',     rccm: 'RCCM/BKE/B/2017/02041', city: 'Boké',        fleet: 47 },
  { id: 'TRP-05126', kind: 'company',    short: 'Sahel Cargo SA',          contact: 'Aboubacar Camara',       rccm: 'RCCM/KIN/B/2012/00738', city: 'Kindia',      fleet: 19 },
  { id: 'TRP-07744', kind: 'company',    short: 'Forêt-Trans Nzérékoré',   contact: 'Pé Mamy Kourouma',       rccm: 'RCCM/NZK/B/2015/00284', city: 'Nzérékoré',   fleet: 11 },
  { id: 'IND-44218', kind: 'individual', short: 'Sékou Soumah',            contact: 'Sékou Soumah',           rccm: 'CNI 094-2018-0044218',  city: 'Coyah',       fleet: 1 },
  { id: 'IND-31907', kind: 'individual', short: 'Fatoumata Camara',        contact: 'Fatoumata Camara',       rccm: 'CNI 071-2020-0031907',  city: 'Mamou',       fleet: 2 },
];

// ─── Bills queue (officer side) ──────────────────────────────────
const BILLS = [
  { id: 'DUT-2026-04-08821', transporterId: 'TRP-04812', transporter: 'Diallo & Frères',   from: 'Kamsar',   to: 'Conakry',     goods: 'Bauxite',          amount: 338000,  status: 'paid',    issued: '28/04/2026', officer: 'F. Camara' },
  { id: 'DUT-2026-04-08820', transporterId: 'TRP-08231', transporter: 'SAGECO',            from: 'Boffa',    to: 'Conakry',     goods: 'Ciment',           amount: 198500,  status: 'pending', issued: '28/04/2026', officer: 'F. Camara' },
  { id: 'DUT-2026-04-08818', transporterId: 'TRP-09317', transporter: 'Bauxite Express',   from: 'Sangarédi',to: 'Kamsar',      goods: 'Bauxite',          amount: 412500,  status: 'paid',    issued: '27/04/2026', officer: 'M. Sylla' },
  { id: 'DUT-2026-04-08817', transporterId: 'TRP-02194', transporter: 'Trans-Fouta',       from: 'Labé',     to: 'Mamou',       goods: 'Produits du cru',  amount: 87400,   status: 'paid',    issued: '27/04/2026', officer: 'F. Camara' },
  { id: 'DUT-2026-04-08815', transporterId: 'TRP-04812', transporter: 'Diallo & Frères',   from: 'Conakry',  to: 'Nzérékoré',   goods: 'Marchandises',     amount: 1240000, status: 'paid',    issued: '26/04/2026', officer: 'F. Camara' },
  { id: 'DUT-2026-04-08812', transporterId: 'TRP-05126', transporter: 'Sahel Cargo',       from: 'Kindia',   to: 'Conakry',     goods: 'Hydrocarbures',    amount: 524800,  status: 'pending', issued: '26/04/2026', officer: 'F. Camara' },
  { id: 'DUT-2026-04-08810', transporterId: 'TRP-07744', transporter: 'Forêt-Trans',       from: 'Nzérékoré',to: 'Kankan',      goods: 'Café-Cacao',       amount: 156200,  status: 'paid',    issued: '25/04/2026', officer: 'M. Sylla' },
  { id: 'DUT-2026-04-08807', transporterId: 'TRP-08231', transporter: 'SAGECO',            from: 'Conakry',  to: 'Faranah',     goods: 'Marchandises',     amount: 287900,  status: 'expired', issued: '23/04/2026', officer: 'F. Camara' },
  { id: 'DUT-2026-04-08819', transporterId: 'IND-44218', transporter: 'Sékou Soumah',      from: 'Coyah',    to: 'Conakry',     goods: 'Produits maraîchers', amount: 64200, status: 'paid',    issued: '28/04/2026', officer: 'F. Camara', payerKind: 'individual' },
  { id: 'DUT-2026-04-08816', transporterId: 'IND-31907', transporter: 'Fatoumata Camara',  from: 'Mamou',    to: 'Kindia',      goods: 'Produits du cru',  amount: 92800,   status: 'pending', issued: '27/04/2026', officer: 'F. Camara', payerKind: 'individual' },
];

Object.assign(window, { OFFICER, TRANSPORTERS, BILLS });

// Vertical three-stripe flag bar — red | yellow | green (hoist → fly).
// Used as a hairline accent strip.
const FlagBar = ({ height = 3, style }) => (
  <div style={{ display: 'flex', height, width: '100%', ...style }}>
    <div style={{ flex: 1, background: '#CE1126' }} />
    <div style={{ flex: 1, background: '#FCD116' }} />
    <div style={{ flex: 1, background: '#009460' }} />
  </div>
);

Object.assign(window, {
  GUINEA_CITIES, ROUTES, GOODS, CARRIER, VEHICLES, RECENT_DUTS, ALERTS,
  I18N, t, tFmt, fmtGNF, Icon, SealEmblem, FlagBar,
});
