<?php $__env->startSection('title', 'Family Groups & Household Management'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-6" x-data="{ modal: false }">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-xl font-bold text-slate-900 dark:text-white">Family Household Groups</h1>
            <p class="text-xs text-slate-500">Group sponsors, spouses, and child dependents for renewal sales and family services.</p>
        </div>
        <button @click="modal = true" class="px-4 py-2 bg-sky-600 text-white font-bold text-xs rounded-xl shadow-sm">+ Create Family Group</button>
    </div>

    <!-- Family Groups List (Requirements 32-38) -->
    <div class="grid grid-cols-1 md:grid-cols-2 gap-6 text-xs">
        <?php $__currentLoopData = $families; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $family): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="bg-white dark:bg-slate-800 rounded-3xl p-6 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-4">
                <div class="flex items-center justify-between border-b border-slate-100 dark:border-slate-700 pb-3">
                    <h3 class="font-bold text-slate-900 dark:text-white text-sm"><?php echo e($family->family_name); ?></h3>
                    <span class="font-mono text-slate-400 font-bold text-[10px]"><?php echo e($family->family_code); ?></span>
                </div>

                <div class="space-y-2">
                    <div class="font-bold text-slate-700 dark:text-slate-300">Family Members (<?php echo e($family->members->count()); ?>):</div>
                    <?php $__currentLoopData = $family->members; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mb): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="flex items-center justify-between p-2.5 rounded-xl bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700">
                            <span class="font-bold text-slate-900 dark:text-white"><?php echo e($mb->customer->full_name_en); ?></span>
                            <span class="uppercase text-[10px] font-extrabold text-sky-600"><?php echo e($mb->relationship); ?></span>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    <!-- Create Family Modal -->
    <div x-show="modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 flex items-center justify-center p-4" x-cloak>
        <div class="bg-white dark:bg-slate-800 rounded-3xl max-w-md w-full p-6 border border-slate-200 dark:border-slate-700 shadow-2xl space-y-4 text-xs">
            <h3 class="text-sm font-bold text-slate-900 dark:text-white uppercase tracking-wider">Create Family Household Group</h3>
            <form action="<?php echo e(route('app.customers.families.store')); ?>" method="POST" class="space-y-3">
                <?php echo csrf_field(); ?>
                <div>
                    <label class="block font-semibold mb-1">Family Group Name *</label>
                    <input type="text" name="family_name" required placeholder="Al Shamsi Household" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
                <div class="flex justify-end space-x-2 rtl:space-x-reverse pt-2">
                    <button type="button" @click="modal = false" class="px-4 py-2 bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-200 font-bold rounded-xl">Cancel</button>
                    <button type="submit" class="px-5 py-2 bg-sky-600 text-white font-bold rounded-xl">Create Group</button>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\typingcenter\resources\views\tenant\customers\families\index.blade.php ENDPATH**/ ?>