<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

// ══════════════════════════════════════════════════════════════════
//  InPractice — Marketing Generic Case Seeder [13]
//  Topic: Customer Acquisition & Retention (MG-CAR-07 to MG-CAR-11)
//  Hub: Marketing | Layer: Generic
//  Run: php artisan db:seed --class=MarketingGenericCaseSeeder_13
// ══════════════════════════════════════════════════════════════════

class MarketingGenericCaseSeeder_13 extends Seeder
{
    public function run(): void
    {
        $this->command->info('📢 [13] Customer Acquisition & Retention — Cases 7-11 (MG-CAR-07 to MG-CAR-11)');

        $hub   = DB::table('hubs')->where('slug', 'marketing')->first();
        $admin = DB::table('users')->where('role', 'admin')->first();

        if (! $hub || ! $admin) {
            $this->command->error('Hub or admin not found. Run HubSeeder and AdminSeeder first.');
            return;
        }

        $hubId   = $hub->id;
        $adminId = $admin->id;
        $now     = now();

        $cases = [

            // ── MG-CAR-07 ──────────────────────────────────────────
            [
                'hub_id'            => $hubId,
                'created_by'        => $adminId,
                'topic_slug'        => 'customer_acquisition_retention',
                'topic_name_en'     => 'Customer Acquisition & Retention',
                'topic_name_ar'     => 'اكتساب العملاء والاحتفاظ بهم',
                'difficulty'        => 'beginner',
                'sort_order'        => 707,
                'status'            => 'published',
                'published_at'      => $now,
                'read_time_minutes' => 11,
                'title_en'    => 'The First Purchase That Never Led to a Second',
                'subtitle_en' => 'When your acquisition engine is working but your retention is broken from day one',
                'situation_en' => "You are a marketing executive at **Raha Wellness**, an Egyptian subscription box company delivering monthly curated wellness products. The business is 18 months old and averaging 320 new subscribers per month.\n\nBut a cohort analysis reveals a troubling pattern:\n\n| Cohort | Month 1 | Month 2 | Month 3 | Month 6 |\n|---|---|---|---|---|\n| January (n=280) | 100% | 41% | 28% | 14% |\n| February (n=305) | 100% | 39% | 25% | 12% |\n| March (n=340) | 100% | 38% | 24% | — |\n\nBy month 3, you retain less than 30% of every cohort. By month 6, less than 15%.\n\nYour CEO: *'We spend EGP 85,000 a month on acquisition and lose most customers within 90 days. What is going wrong?'*",
                'challenge_questions_en' => json_encode([
                    "The biggest drop is Month 1 to Month 2 — roughly 60% cancel after their first box. What are the three most likely reasons for first-box cancellation in a subscription wellness business?",
                    "Calculate CLV at current retention rates assuming EGP 250/month box price. Compare to a scenario where Month 2 retention improves from 40% to 65%.",
                    "Design a 'first box experience' strategy for the first 30 days after a customer subscribes. What happens at Day 0, Day 7, Day 14, and Day 28?",
                    "Your CEO wants to cut acquisition spend and invest in retention. What is the right acquisition-to-retention investment ratio for a subscription business at this stage?",
                ]),
                'solution_en' => "## The Subscription Retention Problem: Why the First Box Matters Most\n\n### Three Most Likely Reasons for First-Box Cancellation\n\n**Reason 1 — Expectation mismatch:**\nCustomers subscribe based on the promise in the ad — beautiful imagery, curated for you. When the box arrives with products that feel generic or misaligned with the ad promise, disappointment drives immediate cancellation. The gap between the promise and the product is the most common cancellation driver.\n\n**Reason 2 — No onboarding or engagement:**\nMost subscription boxes ship the product and send a confirmation email — nothing more. No welcome to the community, no education on how to use the products, no communication between box 1 and box 2 that builds anticipation. The experience is transactional, not relational.\n\n**Reason 3 — Cancellation is too easy with no intervention:**\nA subscriber who is mildly disappointed clicks cancel in 15 seconds. Most subscriptions that are saved are saved by a single intervention: a discount offer, a personalised message, or a human response to a cancellation attempt.\n\n### CLV Calculation\n\n**Current (40% Month 2 retention):**\nAverage subscription length: approximately 2.8 months\nCLV = 2.8 × EGP 250 = **EGP 700**\n\n**Improved (65% Month 2 retention):**\nAverage subscription length: approximately 4.6 months\nCLV = 4.6 × EGP 250 = **EGP 1,150**\n\nImproving Month 2 retention from 40% to 65% increases CLV by 64%.\nOn 320 new subscribers per month, annual revenue impact:\n320 × (EGP 1,150 − EGP 700) × 12 = **EGP 1,728,000 additional annual revenue** — from the same acquisition spend.\n\n### First 30 Days Experience Strategy\n\n**Day 0 — Welcome email (not a receipt):**\nPersonalised message: what to expect, how products were selected, founder story. Frame it as joining a community, not completing a transaction.\n\n**Day 7 — Pre-arrival preview:**\nEmail with a teaser of one product from the box with a usage tip. Build anticipation before the box arrives.\n\n**Day 12-14 — Arrival + usage guide:**\nEmail with a how-to guide for every product in the box. Addresses the 'I received things I do not know how to use' problem directly.\n\n**Day 20 — Check-in survey:**\nThree questions: 'Which product surprised you?', 'What would you like more of?', 'Rate your first box 1-5.' Shows you care — and gives you personalisation data.\n\n**Day 28 — Pre-cancel intervention:**\nFor subscribers with low engagement (no email opens, no social sharing), proactive outreach: '20% off your next box if you continue.' Catches the ambivalent subscriber before they cancel.\n\n### Acquisition to Retention Investment Ratio\n\nCurrent: EGP 85,000 acquisition / 320 subscribers = EGP 266 cost per acquisition = 38% of CLV. Too high.\n\nRecommended: Reduce acquisition to EGP 60,000 (225 higher-intent subscribers) and redirect EGP 25,000 to retention automation and intervention. The retention investment generates EGP 1,728,000+ in additional annual revenue. ROI on retention vastly exceeds acquisition at this stage.",
                'bigger_lesson_en' => "**In subscription businesses, the first 30 days determine whether you have a customer or a one-time purchaser.** Acquisition gets them in the door. The first experience determines whether they stay. Most subscription businesses under-invest in the experience between confirmation and second delivery — and pay for it with churn that no acquisition budget can outpace.",
                'skills_taught_en' => json_encode([
                    'Subscription cohort retention analysis',
                    'Customer Lifetime Value calculation',
                    'First 30-day onboarding experience design',
                    'Cancellation intervention strategy',
                    'Acquisition vs. retention budget reallocation',
                ]),
                'title_ar'    => 'أول شراء لم يُفضِ لثانٍ',
                'subtitle_ar' => 'حين محرك اكتسابك يعمل لكن الاحتفاظ مكسور من اليوم الأول',
                'situation_ar' => "أنت منفذ تسويق في **راحة ويلنس**، شركة صناديق اشتراك شهرية للعناية الصحية. الاكتساب قوي — 320 مشترك جديد شهرياً بإنفاق 85,000 جنيه.\n\nلكن تحليل الشرائح يكشف:\n\n| الشريحة | الشهر 1 | الشهر 2 | الشهر 3 | الشهر 6 |\n|---|---|---|---|---|\n| يناير (280) | 100% | 41% | 28% | 14% |\n| فبراير (305) | 100% | 39% | 25% | 12% |\n\nبحلول الشهر 3 تحتفظ بأقل من 30% من كل شريحة.",
                'challenge_questions_ar' => json_encode([
                    "أكبر تساقط من الشهر 1 للشهر 2. ما الأسباب الثلاثة الأكثر احتمالاً للإلغاء بعد أول صندوق؟",
                    "احسب CLV بمعدلات الاحتفاظ الحالية بسعر 250 جنيه شهرياً. قارنها بسيناريو يرتفع فيه احتفاظ الشهر 2 من 40% إلى 65%.",
                    "صمّم استراتيجية 'تجربة أول صندوق' لأول 30 يوماً. ما الذي يحدث في اليوم 0 و7 و14 و28؟",
                    "رئيسك يريد تقليص الإنفاق على الاكتساب والاستثمار في الاحتفاظ. ما النسبة الصحيحة لهذه المرحلة؟",
                ]),
                'solution_ar' => "## مشكلة احتفاظ الاشتراك: لماذا أول صندوق هو الأهم\n\n### الأسباب الثلاثة الأكثر احتمالاً\n\n**الأول — عدم تطابق التوقعات:** فجوة وعد الإعلان والمنتج الفعلي هي الأكثر شيوعاً.\n\n**الثاني — لا إعداد أو تفاعل:** التجربة معاملاتية لا علائقية.\n\n**الثالث — الإلغاء سهل بدون تدخل:** المشترك غير الملتزم يضغط إلغاء في 15 ثانية.\n\n### حساب CLV\n\n**الحالي (40% شهر 2):** متوسط 2.8 شهر → CLV = **700 جنيه**\n\n**محسّن (65% شهر 2):** متوسط 4.6 شهر → CLV = **1,150 جنيه** (+64%)\n\nعلى 320 مشترك شهرياً: **1,728,000 جنيه إيراد سنوي إضافي** من نفس الإنفاق على الاكتساب.\n\n### استراتيجية أول 30 يوم\n\n- **اليوم 0:** بريد ترحيب شخصي (لا إيصال استلام)\n- **اليوم 7:** معاينة منتج من الصندوق قبل الوصول\n- **اليوم 12-14:** دليل استخدام لكل منتج في الصندوق\n- **اليوم 20:** استطلاع تحقق 3 أسئلة\n- **اليوم 28:** تدخل استباقي للمشتركين ذوي التفاعل المنخفض (خصم 20%)",
                'bigger_lesson_ar' => "**في شركات الاشتراك، أول 30 يوماً تُحدد إن كان لديك عميل أم مشترٍ مرة واحدة.** معظم شركات الاشتراك تستثمر بشكل ناقص في التجربة بين التأكيد والتسليم الثاني — وتدفع ثمن ذلك بتسرب لا يلحق به أي ميزانية اكتساب.",
                'skills_taught_ar' => json_encode([
                    'تحليل احتفاظ شرائح الاشتراك',
                    'حساب قيمة العميل الدائمة CLV',
                    'تصميم تجربة الإعداد في أول 30 يوماً',
                    'استراتيجية التدخل لمنع الإلغاء',
                    'إعادة توزيع ميزانية الاكتساب والاحتفاظ',
                ]),
                'created_at' => $now,
                'updated_at' => $now,
            ],

            // ── MG-CAR-08 ──────────────────────────────────────────
            [
                'hub_id'            => $hubId,
                'created_by'        => $adminId,
                'topic_slug'        => 'customer_acquisition_retention',
                'topic_name_en'     => 'Customer Acquisition & Retention',
                'topic_name_ar'     => 'اكتساب العملاء والاحتفاظ بهم',
                'difficulty'        => 'intermediate',
                'sort_order'        => 708,
                'status'            => 'published',
                'published_at'      => $now,
                'read_time_minutes' => 12,
                'title_en'    => 'The Discount Ladder That Trained Customers to Wait',
                'subtitle_en' => 'When your promotions strategy teaches customers never to pay full price',
                'situation_en' => "You are the marketing manager at **Nile Fashion**, an Egyptian mid-market fashion retail chain with 22 branches. Annual revenue: EGP 85 million.\n\nOver three years, under pressure to hit monthly targets, your team ran promotions in a predictable pattern — a major sale every 6-8 weeks, discounts ranging from 20% to 60%.\n\nYour CFO flags a worrying trend:\n- Full-price sales declined 34% over three years\n- Average gross margin fell from 54% to 41%\n- Customer survey: 67% say they 'always wait for a sale before buying from Nile Fashion'\n- New customer acquisition is strong but repeat purchase rate at full price is near zero",
                'challenge_questions_en' => json_encode([
                    "Diagnose the strategic damage the promotions calendar caused. What specific customer behaviour was trained — and why is it now structural rather than reversible with a single decision?",
                    "67% of customers wait for a sale. Calculate the revenue loss this represents compared to a scenario where only 30% wait. Use EGP 85 million as your base.",
                    "Design a 12-month transition plan that gradually reduces promotional depth while maintaining revenue. What are the key quarterly interventions?",
                    "What is a price architecture strategy — and how would implementing Good/Better/Best tiers reduce Nile Fashion's dependence on promotions?",
                ]),
                'solution_en' => "## The Discount Trap: When Promotions Become the Price\n\n### The Strategic Damage\n\nThree years of predictable deep promotions trained customers in **conditional purchasing**: 'I want to buy from Nile Fashion, but I will not pay full price because a sale is always coming.'\n\nThis is structural because it is rational (full price IS a bad deal when 50% off is reliably available), habitual (67% report it as deliberate strategy), and social (customers share this advice with each other).\n\nBreaking this behaviour requires 12-18 months of consistent brand behaviour change — not a single decision.\n\n### Revenue Loss Calculation\n\nAssume promotional sales happen at an average 35% discount.\n\n**Current (67% wait for sale):**\n67% × EGP 85M = EGP 56.95M generated at discounted prices\nRevenue lost to discounting: EGP 56.95M ÷ 0.65 × 0.35 = **EGP 30.6M per year**\n\n**Target (30% wait):**\n30% × EGP 85M = EGP 25.5M at discount\nRevenue lost: EGP 25.5M ÷ 0.65 × 0.35 = **EGP 13.7M per year**\n\nReducing 'wait for sale' behaviour from 67% to 30% recovers approximately **EGP 17M per year** in margin.\n\n### 12-Month Transition Plan\n\n**Quarter 1 — Reduce frequency:**\nEliminate two promotional events. Replace with 'new arrival launch' that communicates exclusivity — no discount attached. Expect a short-term dip in those months. This is the cost of breaking the habit.\n\n**Quarter 2 — Reduce depth:**\nFor remaining sales, reduce by 10 percentage points: 50% off becomes 40% off. Compensate with stronger storytelling about value.\n\n**Quarter 3 — Introduce full-price incentive:**\nLoyalty programme rewarding full-price purchases: double points, early access to new collections. Creates a full-price behaviour incentive without a discount.\n\n**Quarter 4 — Evaluate:**\nMeasure full-price volume, average transaction value, gross margin. Continue reducing depth in Year 2 if metrics improve.\n\n### Price Architecture Strategy\n\nStructure the range into three clear tiers — so customers choose based on value, not on waiting for the next discount:\n\n- **Entry (EGP 150-250):** Basics, essentials — always available, price-sensitive\n- **Mid (EGP 300-500):** Seasonal fashion — core range, never deeply discounted\n- **Premium (EGP 600-1,200):** Statement pieces, limited edition — never on sale\n\nWhen the comparison is about value at different price points rather than 'full price vs. discounted price,' conditional purchasing loses its logic.",
                'bigger_lesson_en' => "**Promotions are a short-term revenue tool that, when overused, permanently damage price integrity.** The customer who waits for a sale is not disloyal — they are rational. They have learned that waiting is the optimal strategy. Unlearning this requires consistent, patient behaviour change from the brand — not a single decision to stop discounting.",
                'skills_taught_en' => json_encode([
                    'Promotional cannibalisation diagnosis',
                    'Conditional purchasing behaviour analysis',
                    'Revenue loss quantification from discount dependency',
                    'Promotional calendar reduction strategy',
                    'Price architecture design for fashion retail',
                ]),
                'title_ar'    => 'سلّم الخصومات الذي علّم العملاء الانتظار',
                'subtitle_ar' => 'حين تُعلّم استراتيجية عروضك العملاء ألا يدفعوا السعر الكامل أبداً',
                'situation_ar' => "أنت مدير تسويق في **نايل فاشون**، سلسلة أزياء بـ22 فرعاً وإيراد سنوي 85 مليون جنيه.\n\nعلى مدى ثلاث سنوات، أجريت عروضاً بنمط يمكن التنبؤ به — تخفيض كبير كل 6-8 أسابيع.\n\nالمدير المالي يُشير:\n- المبيعات بالسعر الكامل انخفضت 34%\n- الهامش الإجمالي من 54% إلى 41%\n- 67% من العملاء يقولون 'أنتظر دائماً عرضاً'",
                'challenge_questions_ar' => json_encode([
                    "شخّص الضرر الاستراتيجي. ما سلوك العميل الذي تم تدريبه ولماذا هو الآن هيكلي؟",
                    "احسب خسارة الإيراد التي يمثلها سلوك 67% مقارنةً بسيناريو 30% فقط ينتظرون.",
                    "صمّم خطة انتقال 12 شهراً تُقلّص عمق العروض تدريجياً مع الحفاظ على الإيراد.",
                    "ما استراتيجية بنية السعر وكيف تُقلّص الاعتماد على العروض؟",
                ]),
                'solution_ar' => "## فخ الخصم: حين تُصبح العروض هي السعر\n\n### الضرر الاستراتيجي\n\nالشراء المشروط هيكلي لأنه عقلاني وعادة واجتماعي. كسره يتطلب 12-18 شهراً من تغيير سلوك العلامة المتسق.\n\n### حساب خسارة الإيراد\n\n**الحالي (67%):** الإيراد المفقود ~**30.6 مليون جنيه سنوياً**\n**المستهدف (30%):** الإيراد المفقود ~**13.7 مليون جنيه سنوياً**\n\nالاسترداد المحتمل: ~**17 مليون جنيه سنوياً**\n\n### خطة الانتقال 12 شهراً\n\n**الربع 1:** إلغاء حدثَين ترويجيَّين → إطلاق 'وصول أول' بدون خصم\n\n**الربع 2:** تقليص عمق العروض 10 نقاط مئوية\n\n**الربع 3:** برنامج ولاء يكافئ المشتريات بالسعر الكامل تحديداً\n\n**الربع 4:** قياس وإعادة معايرة\n\n### بنية السعر\n\nثلاثة مستويات واضحة تحوّل المقارنة من 'سعر كامل مقابل مخفّض' إلى 'قيمة عند مستويات سعرية مختلفة.'",
                'bigger_lesson_ar' => "**العروض أداة إيراد قصيرة المدى تُضرّ بنزاهة السعر حين تُفرِط في استخدامها.** العميل الذي ينتظر عقلاني لا غير وفي. كسر هذا السلوك يتطلب تغييراً صبوراً ومتسقاً من العلامة.",
                'skills_taught_ar' => json_encode([
                    'تشخيص استهلاك العروض الذاتي',
                    'تحليل سلوك الشراء المشروط',
                    'تحديد خسارة الإيراد من الاعتماد على الخصومات',
                    'استراتيجية تقليص التقويم الترويجي',
                    'تصميم بنية السعر لتجزئة الأزياء',
                ]),
                'created_at' => $now,
                'updated_at' => $now,
            ],

            // ── MG-CAR-09 ──────────────────────────────────────────
            [
                'hub_id'            => $hubId,
                'created_by'        => $adminId,
                'topic_slug'        => 'customer_acquisition_retention',
                'topic_name_en'     => 'Customer Acquisition & Retention',
                'topic_name_ar'     => 'اكتساب العملاء والاحتفاظ بهم',
                'difficulty'        => 'intermediate',
                'sort_order'        => 709,
                'status'            => 'published',
                'published_at'      => $now,
                'read_time_minutes' => 13,
                'title_en'    => 'The Customers You Acquired but Never Met',
                'subtitle_en' => 'When digital acquisition produces a customer base with no real relationship — and what it costs you',
                'situation_en' => "You are the CRM manager at **Shams Insurance**, a mid-sized Egyptian insurance company that expanded aggressively into digital direct sales over three years.\n\n| Metric | 3 Years Ago | Today |\n|---|---|---|\n| Total policyholders | 28,000 | 67,000 |\n| Agent-sold policies | 90% | 38% |\n| Digital direct policies | 10% | 62% |\n| Annual renewal rate (agent-sold) | 87% | 89% |\n| Annual renewal rate (digital direct) | 71% | 54% |\n| Average policies per customer | 1.8 | 1.2 |\n| Customer complaints | 340/year | 1,240/year |\n\nThe business grew but quality deteriorated. Your CEO: *'We have 67,000 customers but we do not know most of them. Digital customers are not renewing and not buying second policies. What do we do?'*",
                'challenge_questions_en' => json_encode([
                    "Calculate the annual revenue gap caused by the renewal rate difference between agent-sold (89%) and digital direct (54%) customers. Assume average annual premium of EGP 3,200.",
                    "Why do digital direct insurance customers renew less and buy fewer policies? What is structurally different about agent-sold vs. digital direct acquisition?",
                    "Design a relationship-building programme for digital direct customers that closes the renewal gap without reverting to full agent model. What are the key touchpoints?",
                    "Your CEO considers stopping digital acquisition and returning to agent-only. Make the case for why a hybrid model is correct — and what it looks like.",
                ]),
                'solution_en' => "## The Relationship Deficit: When Scale Comes Without Connection\n\n### Annual Revenue Gap\n\nAgent customers: 25,460 × 89% × EGP 3,200 = **EGP 72.4M**\nDigital customers (actual): 41,540 × 54% × EGP 3,200 = **EGP 71.8M**\nDigital customers (at agent renewal rate): 41,540 × 89% × EGP 3,200 = **EGP 118.2M**\n\nRevenue gap from digital renewal deficit: **EGP 46.4M per year**\n\n### Why Digital Customers Renew Less\n\n**Trust layer missing:** An agent-sold policy is backed by a human relationship — a name, a face, a phone number. When renewal comes, the agent calls, reminds, handles objections. The relationship removes friction.\n\nA digital direct customer has no relationship. Renewal is an email they may ignore. There is no one to call when something is unclear.\n\n**No cross-sell conversation:** Agents naturally identify additional coverage needs during relationship conversations. Digital customers only see what they actively search for.\n\n**Complaint escalation:** 1,240 complaints vs. 340 — mostly because digital customers have no named contact to resolve issues. Unresolved complaints drive non-renewal.\n\n### Relationship-Building Programme for Digital Customers\n\n**Month 1 — Welcome and orientation:**\nPersonalised welcome call from a named account manager (can be a team of 5-6 people covering all digital accounts). Not a sales call — a 'here is your policy, here is your contact, here is what to do if you need anything' call.\n\n**Month 3 — Policy review:**\nEmail + optional call: 'Are you happy with your coverage? Has anything changed in your situation?' Two purposes: it catches coverage gaps before they become complaints, and it opens a natural cross-sell conversation.\n\n**Month 9 — Pre-renewal engagement:**\nProactive outreach 90 days before renewal: summary of the year's coverage, any claims handled, what has changed in the market. Frame renewal as a continuation of the relationship, not a transaction.\n\n**Month 12 — Renewal conversation:**\nDo not send a renewal invoice alone. Call or personalised email: 'Your policy renews next month. Here is what you are covered for. Do you want to discuss any changes?'\n\n### The Case for Hybrid, Not Agent-Only\n\nDigital acquisition costs approximately 40% less per new policyholder than agent acquisition. The problem is not the acquisition channel — it is the absence of relationship post-acquisition.\n\nThe hybrid model: acquire digitally, retain relationally.\n- Digital channel handles top-of-funnel (awareness, comparison, initial quote)\n- A small customer success team (not traditional agents) handles onboarding, annual reviews, and renewal conversations for digital accounts\n- Agents focus on complex, high-value policies where relationship and advice are the primary value\n\nThis recovers the renewal rate benefit of the agent model without abandoning the cost efficiency of digital acquisition.",
                'bigger_lesson_en' => "**Acquisition channel and retention mechanism are not the same thing.** You can acquire a customer digitally and retain them relationally. The mistake is assuming the acquisition channel determines the retention approach. Insurance is a relationship product regardless of how the first sale happened. Building the relationship post-sale is not optional — it is the business model.",
                'skills_taught_en' => json_encode([
                    'Renewal rate gap quantification',
                    'Agent vs. digital channel retention comparison',
                    'Post-acquisition relationship programme design',
                    'Hybrid acquisition-retention model strategy',
                    'CRM touchpoint design for insurance customers',
                ]),
                'title_ar'    => 'العملاء الذين اكتسبتهم لكن لم تلتقِ بهم',
                'subtitle_ar' => 'حين يُنتج الاكتساب الرقمي قاعدة عملاء بدون علاقة حقيقية — وما يكلّفك ذلك',
                'situation_ar' => "أنت مدير CRM في **شمس للتأمين**، شركة تأمين مصرية توسعت بقوة في المبيعات الرقمية المباشرة.\n\n| المقياس | قبل 3 سنوات | اليوم |\n|---|---|---|\n| إجمالي المؤمَّنين | 28,000 | 67,000 |\n| معدل تجديد الوكلاء | 87% | 89% |\n| معدل تجديد الرقمي المباشر | 71% | 54% |\n| شكاوى العملاء | 340/سنة | 1,240/سنة |",
                'challenge_questions_ar' => json_encode([
                    "احسب فجوة الإيراد السنوية الناجمة عن فرق معدل التجديد بين عملاء الوكلاء (89%) والرقمي المباشر (54%) بقسط متوسط 3,200 جنيه.",
                    "لماذا يُجدّد عملاء التأمين الرقميون المباشرون بمعدل أقل ويشترون وثائق أقل؟ ما الفرق الهيكلي بين قناتَي الاكتساب؟",
                    "صمّم برنامجاً لبناء العلاقة مع العملاء الرقميين يُغلق فجوة التجديد دون العودة لنموذج الوكلاء الكامل.",
                    "رئيسك يفكر في إيقاف الاكتساب الرقمي. قدّم الحجة لنموذج هجين — وما شكله؟",
                ]),
                'solution_ar' => "## عجز العلاقة: حين يأتي النمو بدون تواصل\n\n### فجوة الإيراد السنوية\n\nعملاء الوكلاء: 25,460 × 89% × 3,200 = **72.4 مليون**\nعملاء رقميون (فعلي): 41,540 × 54% × 3,200 = **71.8 مليون**\nعملاء رقميون (بمعدل الوكلاء): 41,540 × 89% × 3,200 = **118.2 مليون**\n\nفجوة الإيراد: **46.4 مليون جنيه سنوياً**\n\n### لماذا العملاء الرقميون يُجدّدون أقل\n\n**غياب طبقة الثقة:** وثيقة الوكيل مدعومة بعلاقة إنسانية. العميل الرقمي ليس له جهة اتصال مسماة.\n\n**لا محادثة بيع مشترك:** الوكلاء يُحدّدون طبيعياً احتياجات تغطية إضافية. العملاء الرقميون يرون فقط ما يبحثون عنه بنشاط.\n\n### برنامج بناء العلاقة\n\n- **الشهر 1:** مكالمة ترحيب شخصية من مدير حساب مسمى (فريق 5-6 أشخاص يغطون جميع الحسابات الرقمية)\n- **الشهر 3:** مراجعة وثيقة — 'هل أنت راضٍ عن تغطيتك؟'\n- **الشهر 9:** تواصل استباقي قبل 90 يوماً من التجديد\n- **الشهر 12:** محادثة تجديد لا فاتورة مجردة\n\n### الحجة للنموذج الهجين\n\nالاكتساب الرقمي أقل تكلفةً بـ40% من الوكلاء. المشكلة ليست في قناة الاكتساب — بل في غياب العلاقة بعد الاكتساب. النموذج الهجين: اكتسب رقمياً، احتفظ بشكل علائقي.",
                'bigger_lesson_ar' => "**قناة الاكتساب وآلية الاحتفاظ ليستا نفس الشيء.** يمكنك اكتساب عميل رقمياً والاحتفاظ به بشكل علائقي. التأمين منتج علاقة بصرف النظر عن كيفية حدوث أول عملية بيع. بناء العلاقة بعد البيع ليس اختيارياً — إنه نموذج العمل.",
                'skills_taught_ar' => json_encode([
                    'تحديد فجوة معدل التجديد',
                    'مقارنة احتفاظ قناة الوكلاء مقابل الرقمي',
                    'تصميم برنامج علاقة ما بعد الاكتساب',
                    'استراتيجية نموذج الاكتساب-الاحتفاظ الهجين',
                    'تصميم نقاط تواصل CRM لعملاء التأمين',
                ]),
                'created_at' => $now,
                'updated_at' => $now,
            ],

            // ── MG-CAR-10 ──────────────────────────────────────────
            [
                'hub_id'            => $hubId,
                'created_by'        => $adminId,
                'topic_slug'        => 'customer_acquisition_retention',
                'topic_name_en'     => 'Customer Acquisition & Retention',
                'topic_name_ar'     => 'اكتساب العملاء والاحتفاظ بهم',
                'difficulty'        => 'advanced',
                'sort_order'        => 710,
                'status'            => 'published',
                'published_at'      => $now,
                'read_time_minutes' => 14,
                'title_en'    => 'The High-Value Customers You Did Not Know You Were Losing',
                'subtitle_en' => 'Building an early warning system for customer churn before it shows up in the revenue numbers',
                'situation_en' => "You are the head of customer strategy at **Dar Al-Kitab**, an Egyptian online bookstore and educational content platform with 180,000 registered users. The platform sells books, e-books, online courses, and study guides.\n\nYour revenue has been stable at approximately EGP 28 million per year for the past two years. Your CEO is satisfied — revenue is flat but the business is profitable.\n\nYou pull a customer segmentation analysis and find something alarming:\n\n| Segment | Users | % of Users | Revenue | % of Revenue | Avg Orders/Year |\n|---|---|---|---|---|---|\n| Champions (5+ orders/year) | 4,200 | 2.3% | EGP 16.8M | 60% | 7.8 |\n| Loyal (3-4 orders/year) | 12,600 | 7% | EGP 7.6M | 27% | 3.4 |\n| At-Risk (was active, now 6+ months silent) | 28,400 | 15.8% | EGP 2.8M | 10% | 1.1 |\n| Dormant (12+ months silent) | 41,000 | 22.8% | EGP 0.6M | 2% | 0.2 |\n| One-time only | 93,800 | 52.1% | EGP 0.2M | 1% | 1.0 |\n\nThe top 2.3% of customers generate 60% of revenue. And the 'at-risk' segment — 28,400 customers who were previously active — is almost completely silent.\n\nYou show this to your CEO. He is no longer satisfied.",
                'challenge_questions_en' => json_encode([
                    "Revenue has been stable, but what is actually happening underneath the surface? Explain the dynamic that makes stable revenue a dangerous signal rather than a reassuring one in this situation.",
                    "The 4,200 Champions generate 60% of revenue. Design an early warning system that identifies when a Champion is beginning to disengage — before they move to At-Risk. What are the leading indicators?",
                    "The 28,400 At-Risk customers represent EGP 2.8M in recent revenue and significant future potential. Design a reactivation campaign. What is your message, channel, offer, and success metric?",
                    "What is RFM segmentation — and how would implementing it give Dar Al-Kitab an ongoing view of customer health that the current revenue tracking does not provide?",
                ]),
                'solution_en' => "## The Hidden Churn: When Stable Revenue Conceals a Collapsing Customer Base\n\n### Why Stable Revenue Is a Dangerous Signal\n\nStable revenue at EGP 28M masks a dangerous dynamic: the Champions (4,200 customers generating EGP 16.8M) are carrying the entire business. If Champion retention drops by just 15%, revenue drops by EGP 2.5M — a 9% revenue decline — without any change in total customer count.\n\nThe pattern visible in the data:\n- One-time buyers (52% of users) generate only 1% of revenue — a massive acquisition efficiency problem\n- At-Risk segment has grown — these were likely Loyal customers who started disengaging 12+ months ago, and nobody noticed because revenue stayed flat as new customers replaced their spend\n- Dormant segment (41,000 users) represents historical customer equity that has been completely lost\n\nStable revenue in this context means: the business is successfully replacing lost customer value with new customer acquisition — a treadmill, not growth. And treadmills stop the moment acquisition slows.\n\n### Early Warning System for Champion Disengagement\n\nLeading indicators that a Champion is beginning to disengage (visible 30-90 days before they go silent):\n\n| Signal | Normal Champion | Early Warning |\n|---|---|---|\n| Days since last purchase | 45 days | 90+ days |\n| Email open rate | >35% | <15% |\n| App/website visits | 2-3/week | <1/month |\n| Category breadth | Buys across 3+ categories | Narrowed to 1 category |\n| Average order value | EGP 280 | Dropped below EGP 150 |\n\nAutomate an alert: when a Champion triggers 3 or more of these signals, flag them for personalised outreach within 7 days.\n\nOutreach for at-risk Champions is not a discount — it is a relationship conversation: 'We noticed you have not been in for a while. We added 340 new titles in your favourite categories this month — here are the ones we think you would enjoy.' The message should feel like it comes from a knowledgeable bookstore staff member, not a CRM system.\n\n### At-Risk Reactivation Campaign\n\n**Segment further before messaging:** Within the 28,400 at-risk users, some were Loyal (3-4 orders) and some were Champions (5+) before going silent. Treat these differently.\n\n**Former Champions (higher value, higher reactivation probability):**\nPersonalised email with specific book recommendations based on their purchase history. Subject line: 'We have been saving something for you.' Offer: a personalised reading list curated from their category history. No generic discount — the personalisation IS the offer.\n\n**Former Loyal customers:**\nEmail with a 'We miss you' message + a genuine time-limited offer: 15% off their next order for the next 14 days. Simple, clear, low friction.\n\n**Success metrics:**\n- Reactivation rate (at-risk customer makes a purchase within 30 days): target 8-12%\n- Average order value from reactivated customers vs. control\n- 90-day retention rate of reactivated customers (do they buy again after reactivation?)\n\n### RFM Segmentation\n\nRFM stands for Recency, Frequency, Monetary value — three dimensions that together describe the health of a customer relationship:\n\n- **Recency:** When did they last buy? (Recent = healthy signal)\n- **Frequency:** How often do they buy? (High frequency = habit formed)\n- **Monetary:** How much do they spend? (High monetary = high value)\n\nEach customer receives a score of 1-5 on each dimension. A customer scored 5-5-5 is your best Champion. A customer scored 1-1-1 is fully dormant.\n\nThe value of RFM for Dar Al-Kitab is that it gives a **real-time health score for every customer** — not just a snapshot of who is active or inactive, but a directional signal of whether each customer is becoming more or less engaged. A Champion moving from 5-5-5 to 4-4-5 over three months is a warning signal that revenue tracking will never surface until the decline is already significant.",
                'bigger_lesson_en' => "**Revenue stability is not the same as customer base health.** A business can maintain flat revenue while its most valuable customers are quietly disengaging — replaced by new customers who will also eventually disengage if retention is not addressed. The early warning system for customer health is not the revenue line. It is the RFM score of your top segments, tracked weekly. By the time declining customer health shows up in the revenue line, the damage is already 12-18 months old.",
                'skills_taught_en' => json_encode([
                    'Customer segmentation and revenue concentration analysis',
                    'RFM segmentation framework',
                    'Champion early warning system design',
                    'At-risk customer reactivation campaign design',
                    'Leading vs. lagging indicators of customer health',
                ]),
                'title_ar'    => 'العملاء ذوو القيمة العالية الذين كنت تخسرهم دون أن تعلم',
                'subtitle_ar' => 'بناء نظام إنذار مبكر لتسرب العملاء قبل ظهوره في أرقام الإيراد',
                'situation_ar' => "أنت رئيس استراتيجية العملاء في **دار الكتاب**، متجر كتب إلكتروني مصري بـ180,000 مستخدم مسجّل. الإيراد مستقر بحوالي 28 مليون جنيه سنوياً لعامَين. رئيسك راضٍ.\n\nتجري تحليلاً لتقسيم العملاء:\n\n| الشريحة | المستخدمون | % الإيراد |\n|---|---|---|\n| أبطال (5+ طلبات/سنة) | 4,200 (2.3%) | 60% |\n| مخلصون (3-4 طلبات) | 12,600 (7%) | 27% |\n| في خطر (6+ أشهر صامت) | 28,400 (15.8%) | 10% |\n| خامدون (12+ شهر) | 41,000 (22.8%) | 2% |\n| مرة واحدة فقط | 93,800 (52.1%) | 1% |\n\n2.3% من العملاء يولّدون 60% من الإيراد. الآن رئيسك لم يعد راضياً.",
                'challenge_questions_ar' => json_encode([
                    "الإيراد مستقر لكن ماذا يحدث تحت السطح؟ اشرح الديناميكية التي تجعل الإيراد المستقر إشارة خطر لا طمأنينة في هذا الوضع.",
                    "4,200 بطل يولّدون 60% من الإيراد. صمّم نظام إنذار مبكر يُحدّد حين يبدأ البطل في الابتعاد — قبل أن ينتقل لـ'في خطر'. ما المؤشرات القيادية؟",
                    "28,400 عميل في خطر يمثلون إمكانات مستقبلية. صمّم حملة إعادة تفعيل. ما رسالتك وقناتك وعرضك ومؤشر نجاحك؟",
                    "ما تقسيم RFM — وكيف سيمنح دار الكتاب نظرة مستمرة على صحة العملاء لا تُوفّرها المتابعة الحالية للإيراد؟",
                ]),
                'solution_ar' => "## التسرب الخفي: حين يُخفي الإيراد المستقر قاعدة عملاء آيلة للانهيار\n\n### لماذا الإيراد المستقر إشارة خطر\n\n28 مليون مستقرة تُخفي ديناميكية خطيرة: الأبطال (4,200 عميل بـ16.8 مليون) يحملون الشركة بأكملها. انخفاض الاحتفاظ بالأبطال 15% فقط يعني تراجع الإيراد 2.5 مليون دون تغيير في عدد العملاء الكلي.\n\nالإيراد المستقر هنا يعني: الشركة تُعوّض قيمة العملاء المفقودة باكتساب جديد — جهاز مشي لا نمو. يتوقف حين يتباطأ الاكتساب.\n\n### نظام الإنذار المبكر لابتعاد الأبطال\n\nمؤشرات قيادية مرئية 30-90 يوماً قبل الصمت:\n\n| الإشارة | البطل الطبيعي | إنذار مبكر |\n|---|---|---|\n| أيام منذ آخر شراء | 45 يوماً | 90+ يوماً |\n| معدل فتح البريد | >35% | <15% |\n| زيارات الموقع | 2-3/أسبوع | <1/شهر |\n\nأتمتة تنبيه: حين يُطلق بطل 3 إشارات أو أكثر، علّم للتواصل الشخصي خلال 7 أيام. الرسالة ليست خصماً — بل محادثة علاقة: 'لاحظنا غيابك. أضفنا 340 عنواناً جديداً في فئاتك المفضلة هذا الشهر.'\n\n### حملة إعادة تفعيل العملاء في خطر\n\n**أبطال سابقون:** بريد شخصي بتوصيات كتب بناءً على تاريخ الشراء. الخط: 'كنا نحتفظ بشيء لك.' التخصيص هو العرض.\n\n**مخلصون سابقون:** 'اشتقنا إليك' + 15% خصم للـ14 يوماً القادمة.\n\n**مؤشر النجاح:** معدل إعادة التفعيل (مشتريات في 30 يوماً): هدف 8-12%.\n\n### تقسيم RFM\n\nثلاثة أبعاد لصحة العلاقة:\n- **الحداثة (R):** متى آخر شراء؟\n- **التكرار (F):** كم مرة يشترون؟\n- **القيمة النقدية (M):** كم ينفقون؟\n\nكل عميل يحصل على درجة 1-5 في كل بُعد. قيمة RFM: **درجة صحة في الوقت الفعلي لكل عميل** — ليس لقطة بل إشارة اتجاهية. بطل ينزل من 5-5-5 إلى 4-4-5 خلال ثلاثة أشهر إشارة تحذير لن تُظهرها متابعة الإيراد أبداً حتى يصبح التراجع ملحوظاً.",
                'bigger_lesson_ar' => "**استقرار الإيراد ليس نفس صحة قاعدة العملاء.** يمكن للشركة الحفاظ على إيراد مستقر بينما عملاؤها الأكثر قيمة يبتعدون بهدوء. نظام الإنذار المبكر لصحة العملاء ليس سطر الإيراد — بل درجة RFM لشرائحك الأعلى قيمة. بحلول وقت ظهور تراجع صحة العملاء في الإيراد، يكون الضرر قد تراكم 12-18 شهراً.",
                'skills_taught_ar' => json_encode([
                    'تحليل تركيز الإيراد وتقسيم العملاء',
                    'إطار تقسيم RFM',
                    'تصميم نظام الإنذار المبكر للأبطال',
                    'تصميم حملة إعادة تفعيل العملاء في خطر',
                    'المؤشرات القيادية مقابل المتأخرة لصحة العملاء',
                ]),
                'created_at' => $now,
                'updated_at' => $now,
            ],

            // ── MG-CAR-11 ──────────────────────────────────────────
            [
                'hub_id'            => $hubId,
                'created_by'        => $adminId,
                'topic_slug'        => 'customer_acquisition_retention',
                'topic_name_en'     => 'Customer Acquisition & Retention',
                'topic_name_ar'     => 'اكتساب العملاء والاحتفاظ بهم',
                'difficulty'        => 'advanced',
                'sort_order'        => 711,
                'status'            => 'published',
                'published_at'      => $now,
                'read_time_minutes' => 14,
                'title_en'    => 'The B2B Account That Was Profitable Until It Was Not',
                'subtitle_en' => 'Managing key account retention when your most important client starts showing exit signals',
                'situation_en' => "You are the commercial director at **Apex Packaging Solutions**, an Egyptian manufacturer of custom packaging for food and beverage companies. Your single largest client is **Misr Beverages Group**, which represents EGP 14.2 million — 31% of your annual revenue.\n\nMisr Beverages has been a client for seven years. The relationship was built by your founder personally with their previous procurement director.\n\nIn the past six months, you have noticed a shift:\n\n| Signal | Before | Now |\n|---|---|---|\n| Procurement contact | Director (senior) | Coordinator (junior) |\n| Meeting frequency | Monthly strategic review | Quarterly operations only |\n| Contract renewal | Automatic, multi-year | Requesting annual with price review |\n| RFQ participation | Sole-sourced to Apex | Invited 3 competitors to tender |\n| Payment terms | 45 days (honoured) | 60 days (delayed to 75 avg) |\n| Volume | 100% of packaging spend | 100% but with 'pilot' orders to 2 competitors |\n\nNo complaint has been raised. No official change has been announced. But every signal points in one direction.\n\nYour CEO: *'We have not done anything wrong. Why is our biggest client pulling away?'*",
                'challenge_questions_en' => json_encode([
                    "Decode the six signals in the table. What does each one tell you — and collectively, what stage of the exit process is Misr Beverages at?",
                    "Your CEO says you have not done anything wrong. Is that the right framing — and what are the three most common reasons a long-standing B2B client begins to exit even without a specific complaint or failure?",
                    "Design an account recovery strategy for the next 90 days. What conversations do you need to have, with whom, and in what sequence?",
                    "What structural changes to the account management model would have caught these signals 12 months earlier — and what does best-practice key account management look like for a client representing 31% of revenue?",
                ]),
                'solution_en' => "## The Silent Exit: Reading the Signals Before the Contract Is Lost\n\n### Decoding the Six Signals\n\n**Signal 1 — Contact demotion (Director → Coordinator):**\nThe most significant signal. When a client demotes your point of contact from senior to junior, it means two things: the senior person has mentally moved on from the relationship, and your account has been reclassified from 'strategic partner' to 'vendor to be managed.' This does not happen overnight — it reflects a decision made weeks or months earlier.\n\n**Signal 2 — Meeting frequency reduction:**\nMonthly strategic reviews to quarterly operations. You have been moved from the strategic agenda to the operational one. You are now in the same category as utilities and other routine suppliers.\n\n**Signal 3 — Contract structure change:**\nFrom automatic multi-year to annual with price review. This is an explicit reduction of commitment. They are keeping options open deliberately.\n\n**Signal 4 — Competitive tender:**\nThis is the clearest signal. Inviting 3 competitors after seven years of sole-source means they are actively pricing the market. They have already decided they want an alternative — they are now deciding whether the alternative is better enough to switch.\n\n**Signal 5 — Payment delay:**\nPayment delays from a healthy company (Misr Beverages is profitable) are often a relationship signal, not a cash signal. When a supplier is strategic, payments are prioritised. When they become a vendor, payment terms become negotiating currency.\n\n**Signal 6 — Competitor pilots:**\nThis is the most actionable signal. They are testing alternatives. The pilots are not exploratory — they are evaluation events. At least one competitor has already supplied them and is being assessed.\n\n**Collective reading:** Misr Beverages is approximately 60-70% through an exit process. They have not decided to leave — but they have decided to explore leaving, and they are building the evidence they need to justify a switch.\n\n### Why 'We Have Not Done Anything Wrong' Is the Wrong Framing\n\nB2B client exits rarely happen because of a specific failure. The three most common causes:\n\n**1. Relationship entropy:** Seven years of a relationship built by the founder with a procurement director who is now gone. The new procurement team has no personal loyalty — they inherited a supplier, they did not choose one. From their perspective, re-evaluating Apex is not disloyal — it is normal professional practice.\n\n**2. The premium without the perceived value:** Over time, suppliers who were once clearly differentiated become commoditised in the client's perception. Misr Beverages may now see packaging as a category where the gap between Apex and a cheaper competitor has closed — even if it has not. The value story has not been refreshed.\n\n**3. Internal champion loss:** The procurement director who championed Apex is gone. No one in Misr Beverages is actively defending the relationship internally. The new team has no reason to resist a competitive tender.\n\n### 90-Day Account Recovery Strategy\n\n**Week 1-2 — Intelligence gathering:**\nBefore any conversation with the client, gather intelligence internally. Talk to every Apex employee who has contact with Misr Beverages — delivery drivers, quality team, account coordinators. What have they heard? What has changed? Are the pilot orders with competitors receiving positive feedback?\n\n**Week 3 — Executive re-engagement:**\nYour CEO or founder calls the Misr Beverages commercial director or VP Operations — not the procurement coordinator. Frame it as a strategic relationship check-in: 'We have been working together for seven years and I want to make sure we are delivering the value you need as your business evolves.'\n\nThis call has one purpose: to re-establish a senior relationship and to get an honest read on where you stand. Do not pitch. Listen.\n\n**Week 4-6 — Value restatement:**\nPrepare a formal account review presentation for the senior contact:\n- Seven years of delivery metrics (on-time rate, defect rate, emergency responses)\n- Total cost of ownership analysis (Apex price vs. competitor price, factoring in quality, reliability, and switching cost)\n- New capabilities or investments made specifically for Misr Beverages\n- A roadmap of what Apex is investing in for the next 3 years\n\n**Week 7-10 — Structural proposal:**\nPropose a revised partnership structure: a 3-year volume commitment from Misr Beverages in exchange for a volume discount, a dedicated production line, and a joint product development programme. This offers them financial benefit while increasing switching cost.\n\n**Week 11-13 — Decision and contingency:**\nIf the recovery strategy is working: formalise the new agreement.\nIf Misr Beverages decides to split the business with a competitor: negotiate to retain at least 70% of the volume rather than losing the account entirely. A split is recoverable. A complete loss at 31% of revenue is an existential event.\n\n### Best-Practice Key Account Management\n\nFor an account representing 31% of revenue, best practice requires:\n\n1. **Dedicated account manager** (not shared with other accounts) who is present at the client's facilities monthly\n2. **Multi-level relationship map** — contacts at procurement, operations, finance, and executive level. The relationship cannot be dependent on a single contact.\n3. **Quarterly business reviews** with senior leadership from both sides — not operational check-ins but strategic sessions\n4. **Annual value audit** — documented proof of what Apex has delivered and invested, shared with the client formally\n5. **Early warning dashboard** — the six signals in this case should have been visible and flagged 12 months ago. A 30-day payment delay and a meeting demotion would have triggered an account review if the system existed.",
                'bigger_lesson_en' => "**In B2B, losing a major account is almost always visible 12-18 months before the contract is cancelled — if you know what to look for.** The signals are behavioural, not declarative. Clients rarely say they are leaving — they show it through contact demotion, meeting frequency reduction, payment behaviour changes, and competitive tendering. Key account management is not relationship maintenance — it is ongoing signal detection, value demonstration, and structural commitment deepening. Accounts that represent 30%+ of revenue require a level of attention that goes far beyond 'we have a good relationship.'",
                'skills_taught_en' => json_encode([
                    'B2B client exit signal diagnosis',
                    'Relationship entropy in long-standing accounts',
                    'Key account recovery strategy design',
                    'Multi-level relationship mapping',
                    'Structural commitment tools for key accounts',
                ]),
                'title_ar'    => 'الحساب B2B الذي كان مربحاً حتى لم يعد كذلك',
                'subtitle_ar' => 'إدارة الاحتفاظ بالحسابات الرئيسية حين يبدأ أهم عملائك في إرسال إشارات المغادرة',
                'situation_ar' => "أنت المدير التجاري في **أبيكس لحلول التغليف**، شركة تصنيع تغليف مخصص. عميلك الأكبر **مجموعة مصر للمشروبات** يمثل 14.2 مليون جنيه — 31% من إيرادك السنوي.\n\nفي الأشهر الستة الماضية لاحظت تحولاً:\n\n| الإشارة | قبل | الآن |\n|---|---|---|\n| جهة الاتصال | مدير مشتريات (أقدم) | منسّق (أصغر) |\n| تكرار الاجتماعات | مراجعة استراتيجية شهرية | تشغيلية ربع سنوية |\n| هيكل العقد | تلقائي متعدد السنوات | سنوي مع مراجعة أسعار |\n| المناقصات | مصدر وحيد لأبيكس | دعوة 3 منافسين |\n| الدفع | 45 يوماً (مُلتزَم) | 60 يوماً (متأخر فعلياً لـ75) |\n\nلا شكوى رُفعت. لا تغيير رسمي أُعلن. لكن كل إشارة تشير في اتجاه واحد.",
                'challenge_questions_ar' => json_encode([
                    "فكّ شفرة الإشارات الستة في الجدول. ما الذي تُخبرك به كل منها — وجماعياً في أي مرحلة من عملية المغادرة توجد مجموعة مصر للمشروبات؟",
                    "يقول رئيسك 'لم نفعل شيئاً خاطئاً'. هل هذا التأطير الصحيح — وما الأسباب الثلاثة الأكثر شيوعاً لمغادرة عميل B2B قديم دون شكوى أو إخفاق محدد؟",
                    "صمّم استراتيجية استعادة الحساب للـ90 يوماً القادمة. ما المحادثات التي تحتاجها مع من وبأي تسلسل؟",
                    "ما التغييرات الهيكلية في نموذج إدارة الحساب التي كانت ستُظهر هذه الإشارات قبل 12 شهراً؟",
                ]),
                'solution_ar' => "## المغادرة الصامتة: قراءة الإشارات قبل خسارة العقد\n\n### فكّ شفرة الإشارات الستة\n\n**تراجع جهة الاتصال:** الأكثر أهمية. حين يُخفّض العميل جهة اتصالك من أقدم لأصغر، هذا يعني أن الشخص الأقدم انتقل ذهنياً من العلاقة، وحسابك أُعيد تصنيفه من 'شريك استراتيجي' إلى 'مورّد للإدارة.'\n\n**المناقصة التنافسية:** الإشارة الأوضح. دعوة 3 منافسين بعد سبع سنوات كمصدر وحيد تعني أنهم يسعّرون السوق بنشاط. لقد قرروا بالفعل أنهم يريدون بديلاً.\n\n**القراءة الجماعية:** مجموعة مصر للمشروبات في مرحلة 60-70% من عملية مغادرة. لم تقرر المغادرة — لكنها قررت استكشافها.\n\n### لماذا 'لم نفعل شيئاً خاطئاً' التأطير الخاطئ\n\nأكثر ثلاثة أسباب شيوعاً لمغادرة عميل B2B قديم:\n\n1. **تآكل العلاقة:** سبع سنوات مبنية على علاقة المؤسس مع مدير مشتريات ذهب الآن. الفريق الجديد ليس لديه ولاء شخصي.\n2. **العلاوة بدون قيمة مُدرَكة:** بمرور الوقت، الموردون المتميّزون يتحولون لسلعة في إدراك العميل.\n3. **فقدان البطل الداخلي:** لا أحد في مجموعة مصر يدافع عن العلاقة داخلياً.\n\n### استراتيجية استعادة الحساب في 90 يوماً\n\n**الأسبوع 1-2:** جمع المعلومات الاستخباراتية داخلياً قبل أي محادثة مع العميل.\n\n**الأسبوع 3:** إعادة تفاعل تنفيذي — رئيسك يتصل بمدير مجموعة مصر التجاري (لا منسّق المشتريات). الهدف: إعادة إنشاء علاقة أقدم والحصول على قراءة صادقة.\n\n**الأسبوع 4-6:** تقديم رسمي لمراجعة الحساب: مقاييس التسليم على مدى سبع سنوات + تحليل التكلفة الكلية للملكية + خارطة طريق الاستثمار القادم.\n\n**الأسبوع 7-10:** اقتراح هيكلي: التزام حجم 3 سنوات من مجموعة مصر مقابل خصم حجم وخط إنتاج مخصص وبرنامج تطوير مشترك.\n\n**الأسبوع 11-13:** إن نجح المسار اعتمد الاتفاق الجديد. إن قررت تقسيم الأعمال مع منافس — تفاوض للاحتفاظ بـ70%+ من الحجم. التقسيم قابل للتعافي. الخسارة الكاملة بـ31% من الإيراد حدث وجودي.",
                'bigger_lesson_ar' => "**في B2B، خسارة حساب رئيسي مرئية دائماً تقريباً 12-18 شهراً قبل إلغاء العقد — إن كنت تعرف ما تبحث عنه.** الإشارات سلوكية لا تصريحية. العملاء نادراً ما يقولون إنهم يغادرون — يُظهرون ذلك عبر تراجع جهة الاتصال وتقليص تكرار الاجتماعات وتغيير سلوك الدفع والمناقصة التنافسية. إدارة الحسابات الرئيسية ليست صيانة علاقة — بل كشف مستمر للإشارات وإثبات القيمة وتعميق الالتزام الهيكلي.",
                'skills_taught_ar' => json_encode([
                    'تشخيص إشارات مغادرة عملاء B2B',
                    'تآكل العلاقة في الحسابات القديمة',
                    'تصميم استراتيجية استعادة الحسابات الرئيسية',
                    'رسم خريطة العلاقات متعددة المستويات',
                    'أدوات الالتزام الهيكلي للحسابات الرئيسية',
                ]),
                'created_at' => $now,
                'updated_at' => $now,
            ],

        ]; // end $cases

        DB::table('cases')->insert($cases);
        $this->command->info('  ✅ Customer Acquisition & Retention: 5 cases inserted (MG-CAR-07 to MG-CAR-11)');
    }
}
