{
  "_doc": "Every value the dashboard must expose so the invoice/PDF/messages are fully dynamic (nothing hard-coded in the PDF renderer). 'snapshot' = copied into each document at issue time (changing it affects NEW documents only). 'live' = read at render/send time. Roles follow the existing dashboard roles (OrderManager < Admin < SuperAdmin).",
  "settings": [
    { "key": "invoice.seller.legal_name_ar", "group": "seller", "label_ar": "اسم الشركة (عربي)", "type": "text", "default": "TNG للصناعات التجميلية", "max": 80, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.seller.legal_name_en", "group": "seller", "label_ar": "اسم الشركة (إنجليزي)", "type": "text", "default": "TNG for Cosmetic Industries", "max": 80, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.seller.address_ar", "group": "seller", "label_ar": "العنوان (عربي)", "type": "textarea", "default": "270 حدائق الأهرام، الجيزة، مصر", "max": 160, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.seller.address_en", "group": "seller", "label_ar": "العنوان (إنجليزي)", "type": "textarea", "default": "270 Hadayek El-Ahram, Giza, Egypt", "max": 160, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.seller.phone", "group": "seller", "label_ar": "تليفون الشركة", "type": "phone", "default": "+20 100 604 6943", "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.seller.email", "group": "seller", "label_ar": "إيميل الشركة", "type": "email", "default": "info@lotusorganics.store", "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.seller.tax_registration_no", "group": "seller", "label_ar": "الرقم الضريبي", "type": "text", "default": null, "required": true, "pattern": "^\\d{3}-\\d{3}-\\d{3}$", "help": "بيتحط من محاسب العميل. ماينفعش تتصدر فاتورة من غيره.", "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "invoice.seller.commercial_register_no", "group": "seller", "label_ar": "السجل التجاري (اختياري)", "type": "text", "default": null, "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "invoice.brand.logo", "group": "brand", "label_ar": "اللوجو على الفاتورة", "type": "image", "default": "assets/logo/tng-logo.jpg", "min_size": "372x206", "help": "JPG/PNG بنسبة 16:9 تقريبًا", "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.brand.primary_color", "group": "brand", "label_ar": "اللون الأساسي", "type": "color", "default": "#F4A04B", "help": "بيتطبق على الشريط واللوجو. ألوان الحالة (أخضر/برتقالي/ليلك) ثابتة.", "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.number.prefix", "group": "numbering", "label_ar": "بادئة الفاتورة", "type": "text", "default": "INV", "pattern": "^[A-Z]{2,5}$", "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "creditnote.number.prefix", "group": "numbering", "label_ar": "بادئة إشعار الدائن", "type": "text", "default": "CN", "pattern": "^[A-Z]{2,5}$", "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "proforma.number.prefix", "group": "numbering", "label_ar": "بادئة الفاتورة المبدئية", "type": "text", "default": "PF", "pattern": "^[A-Z]{2,5}$", "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "invoice.number.sequence_padding", "group": "numbering", "label_ar": "عدد خانات الرقم التسلسلي", "type": "int", "default": 6, "min": 4, "max": 9, "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "tax.vat_percent", "group": "tax", "label_ar": "نسبة ضريبة القيمة المضافة %", "type": "decimal", "default": 14, "min": 0, "max": 30, "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "tax.prices_include_vat", "group": "tax", "label_ar": "الأسعار شاملة الضريبة", "type": "bool", "default": true, "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "invoice.content.footer_note_ar", "group": "content", "label_ar": "ملاحظة آخر الفاتورة (عربي)", "type": "textarea", "default": "الاسترجاع خلال 7 أيام من الاستلام للمنتجات المقفولة. للاستفسار كلمينا على واتساب.", "max": 220, "scope": "snapshot", "role": "OrderManager" },
    { "key": "invoice.content.footer_note_en", "group": "content", "label_ar": "ملاحظة آخر الفاتورة (إنجليزي)", "type": "textarea", "default": "Unopened items can be returned within 7 days of delivery. Questions? Message us on WhatsApp.", "max": 220, "scope": "snapshot", "role": "OrderManager" },
    { "key": "invoice.content.thank_you_ar", "group": "content", "label_ar": "جملة الشكر (عربي)", "type": "text", "default": "شكرًا إنك اخترتي TNG", "max": 60, "scope": "snapshot", "role": "OrderManager" },
    { "key": "invoice.content.thank_you_en", "group": "content", "label_ar": "جملة الشكر (إنجليزي)", "type": "text", "default": "Thank you for choosing TNG", "max": 60, "scope": "snapshot", "role": "OrderManager" },
    { "key": "invoice.show.sku", "group": "content", "label_ar": "إظهار كود المنتج (SKU)", "type": "bool", "default": true, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.show.list_price", "group": "content", "label_ar": "إظهار السعر قبل الخصم (مشطوب)", "type": "bool", "default": true, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.show.images", "group": "content", "label_ar": "إظهار صور المنتجات", "type": "bool", "default": true, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.show.payment_details", "group": "content", "label_ar": "إظهار كارت تفاصيل الدفع", "type": "bool", "default": true, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.show.qr", "group": "content", "label_ar": "إظهار QR للتحقق", "type": "bool", "default": true, "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.digits", "group": "content", "label_ar": "شكل الأرقام", "type": "enum", "options": ["latin", "arabic_indic"], "default": "latin", "scope": "snapshot", "role": "Admin" },
    { "key": "invoice.language.default", "group": "language", "label_ar": "لغة الفاتورة الافتراضية", "type": "enum", "options": ["ar", "en", "customer"], "default": "customer", "help": "customer = لغة الموقع/التطبيق وقت الشراء", "scope": "live", "role": "Admin" },
    { "key": "invoice.language.customer_can_download_other", "group": "language", "label_ar": "العميلة تقدر تحمّل النسخة التانية (EN/AR)", "type": "bool", "default": true, "scope": "live", "role": "Admin" },
    { "key": "invoice.qr.verify_base_url", "group": "qr", "label_ar": "رابط صفحة التحقق", "type": "url", "default": "https://lotusorganics.store/v", "help": "الدومين مؤقت. الكود بيتولّد من الرابط ده + رقم المستند + التوقيع.", "scope": "snapshot", "role": "SuperAdmin" },
    { "key": "invoice.qr.signing_secret", "group": "qr", "label_ar": "مفتاح التوقيع", "type": "secret", "default": null, "help": "سرّي، يتخزن في الـ secrets مش في الإعدادات العادية. تغييره يبطل الأكواد القديمة إلا لو اتحفظت نسخة قديمة.", "scope": "live", "role": "SuperAdmin" },
    { "key": "delivery.whatsapp.enabled", "group": "delivery", "label_ar": "إرسال الفاتورة على واتساب تلقائيًا", "type": "bool", "default": true, "scope": "live", "role": "Admin" },
    { "key": "delivery.whatsapp.template_invoice", "group": "delivery", "label_ar": "اسم قالب واتساب للفاتورة", "type": "text", "default": "order_invoice_ar", "help": "لازم يكون معتمد من Meta وفيه header من نوع document", "scope": "live", "role": "SuperAdmin" },
    { "key": "delivery.email.enabled", "group": "delivery", "label_ar": "إرسال الفاتورة على الإيميل (لو موجود)", "type": "bool", "default": true, "scope": "live", "role": "Admin" },
    { "key": "delivery.email.subject_ar", "group": "delivery", "label_ar": "عنوان الإيميل", "type": "text", "default": "فاتورتك من TNG — {order_number}", "scope": "live", "role": "OrderManager" },
    { "key": "delivery.cod.issue_at", "group": "delivery", "label_ar": "فاتورة الكاش عند الاستلام تتصدر", "type": "enum", "options": ["order_confirmed", "delivered"], "default": "order_confirmed", "scope": "live", "role": "Admin" },
    { "key": "delivery.failed_payment_reminder.enabled", "group": "delivery", "label_ar": "رسالة تذكير بعد فشل الدفع", "type": "bool", "default": true, "scope": "live", "role": "Admin" },
    { "key": "delivery.failed_payment_reminder.delay_minutes", "group": "delivery", "label_ar": "التذكير بعد (دقيقة)", "type": "int", "default": 60, "min": 15, "max": 1440, "scope": "live", "role": "Admin" },
    { "key": "invoice.company_copy.enabled", "group": "customer", "label_ar": "السماح بفاتورة باسم شركة", "type": "bool", "default": true, "scope": "live", "role": "Admin" },
    { "key": "invoice.company_copy.window_days", "group": "customer", "label_ar": "المدة المسموحة بعد الاستلام (يوم)", "type": "int", "default": 14, "min": 1, "max": 90, "scope": "live", "role": "Admin" },
    { "key": "payment.cart_hold_minutes", "group": "payment", "label_ar": "مدة حجز الشنطة بعد فشل الدفع (دقيقة)", "type": "int", "default": 30, "min": 5, "max": 240, "scope": "live", "role": "Admin" },
    { "key": "payment.instapay.handle", "group": "payment", "label_ar": "عنوان InstaPay", "type": "text", "default": "tngcosmetics@instapay", "scope": "live", "role": "Admin" },
    { "key": "payment.instapay.hold_minutes", "group": "payment", "label_ar": "مدة حجز أوردر InstaPay (دقيقة)", "type": "int", "default": 120, "min": 15, "max": 1440, "scope": "live", "role": "Admin" },
    { "key": "payment.wallet.request_ttl_minutes", "group": "payment", "label_ar": "صلاحية طلب المحفظة (دقيقة)", "type": "int", "default": 5, "min": 1, "max": 15, "scope": "live", "role": "Admin" },
    { "key": "payment.review.followup_minutes", "group": "payment", "label_ar": "مهلة المراجعة اليدوية قبل الاسترداد (دقيقة)", "type": "int", "default": 60, "min": 15, "max": 1440, "scope": "live", "role": "Admin" },
    { "key": "payment.refund.eta_text_ar", "group": "payment", "label_ar": "نص مدة الاسترداد", "type": "text", "default": "3–7 أيام شغل", "scope": "live", "role": "OrderManager" },
    { "key": "support.whatsapp", "group": "support", "label_ar": "واتساب الدعم (زرار «كلمينا»)", "type": "phone", "default": "+20 100 604 6943", "scope": "live", "role": "Admin" }
  ]
}
