<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <div class="flex items-center justify-between w-full">
            <div>
                <h1 class="text-lg font-semibold text-gray-800">Super Admin Control Center</h1>
                <p class="text-xs text-gray-400 mt-0.5">Manage portals, subscriptions, database configurations, and roles</p>
            </div>
        </div>
     <?php $__env->endSlot(); ?>

    <?php if(session('success')): ?>
        <div class="bg-emerald-50 border border-emerald-100 rounded-xl p-4 mb-6 flex items-center gap-3">
            <span class="w-8 h-8 rounded-full bg-emerald-100 flex items-center justify-center text-emerald-600">
                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4" /></svg>
            </span>
            <p class="text-xs font-semibold text-emerald-800"><?php echo e(session('success')); ?></p>
        </div>
    <?php endif; ?>

    <div x-data="{ tab: 'businesses', editBusinessModal: false, selectedBusiness: {} }" class="space-y-6">
        
        <!-- Bento Statistics Grid -->
        <div class="grid grid-cols-2 lg:grid-cols-4 gap-5">
            <div class="bg-white rounded-xl border border-gray-100 p-5 shadow-sm">
                <span class="text-xs font-medium text-gray-400 uppercase tracking-wider block">Total Businesses</span>
                <span class="text-2xl font-bold text-gray-800 mt-1 block"><?php echo e($stats['total_businesses']); ?></span>
            </div>
            <div class="bg-white rounded-xl border border-gray-100 p-5 shadow-sm">
                <span class="text-xs font-medium text-gray-400 uppercase tracking-wider block">Active Portals</span>
                <span class="text-2xl font-bold text-gray-800 mt-1 block"><?php echo e($stats['active_businesses']); ?></span>
            </div>
            <div class="bg-white rounded-xl border border-gray-100 p-5 shadow-sm">
                <span class="text-xs font-medium text-gray-400 uppercase tracking-wider block">Registered Users</span>
                <span class="text-2xl font-bold text-gray-800 mt-1 block"><?php echo e($stats['total_users']); ?></span>
            </div>
            <div class="bg-white rounded-xl border border-gray-100 p-5 shadow-sm">
                <span class="text-xs font-medium text-gray-400 uppercase tracking-wider block">Total Invoices</span>
                <span class="text-2xl font-bold text-gray-800 mt-1 block"><?php echo e($stats['total_invoices']); ?></span>
            </div>
        </div>

        <!-- Tab Links -->
        <div class="flex items-center gap-2 border-b border-gray-100">
            <button @click="tab = 'businesses'" :class="tab === 'businesses' ? 'border-indigo-600 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700'" class="py-2.5 px-4 text-xs font-semibold border-b-2 transition">Businesses</button>
            <button @click="tab = 'users'" :class="tab === 'users' ? 'border-indigo-600 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700'" class="py-2.5 px-4 text-xs font-semibold border-b-2 transition">Users & Impersonation</button>
            <button @click="tab = 'roles'" :class="tab === 'roles' ? 'border-indigo-600 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700'" class="py-2.5 px-4 text-xs font-semibold border-b-2 transition">Spatie Permissions</button>
            <button @click="tab = 'plans'" :class="tab === 'plans' ? 'border-indigo-600 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700'" class="py-2.5 px-4 text-xs font-semibold border-b-2 transition">Subscription Plans</button>
            <button @click="tab = 'maintenance'" :class="tab === 'maintenance' ? 'border-indigo-600 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-700'" class="py-2.5 px-4 text-xs font-semibold border-b-2 transition">Settings & Database</button>
        </div>

        <!-- Tab Panels -->
        <div>
            <!-- TAB: Businesses -->
            <div x-show="tab === 'businesses'" class="bg-white rounded-xl border border-gray-100 shadow-sm overflow-hidden">
                <table class="w-full text-left border-collapse text-xs">
                    <thead>
                        <tr class="bg-gray-50 border-b border-gray-100 text-gray-400 uppercase tracking-wider font-semibold">
                            <th class="px-6 py-3.5">Business Name</th>
                            <th class="px-6 py-3.5">NTN/CNIC</th>
                            <th class="px-6 py-3.5">Subscription Plan</th>
                            <th class="px-6 py-3.5">Expires At</th>
                            <th class="px-6 py-3.5">Status</th>
                            <th class="px-6 py-3.5 text-right">Actions</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-50">
                        <?php $__currentLoopData = $businesses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $b): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="hover:bg-gray-50 transition">
                                <td class="px-6 py-3.5 font-medium text-gray-800"><?php echo e($b->name); ?></td>
                                <td class="px-6 py-3.5 font-mono text-gray-500"><?php echo e($b->ntn_cnic ?: '—'); ?></td>
                                <td class="px-6 py-3.5">
                                    <span class="px-2 py-0.5 rounded-lg bg-indigo-50 text-indigo-600 font-semibold text-[10px]">
                                        <?php echo e($b->subscriptionPlan?->name ?: 'No Active Plan'); ?>

                                    </span>
                                </td>
                                <td class="px-6 py-3.5 text-gray-500">
                                    <?php echo e($b->subscription_expires_at ? \Carbon\Carbon::parse($b->subscription_expires_at)->format('Y-m-d') : 'Lifetime'); ?>

                                </td>
                                <td class="px-6 py-3.5">
                                    <span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold <?php echo e($b->is_active ? 'bg-emerald-50 text-emerald-600' : 'bg-red-50 text-red-600'); ?>">
                                        <?php echo e($b->is_active ? 'Active' : 'Deactivated'); ?>

                                    </span>
                                </td>
                                <td class="px-6 py-3.5 text-right flex items-center justify-end gap-3">
                                    <a href="<?php echo e(route('super-admin.businesses.manage', $b->id)); ?>" class="text-indigo-600 hover:underline font-semibold">Manage</a>
                                    <button @click="selectedBusiness = { id: <?php echo e($b->id); ?>, name: '<?php echo e($b->name); ?>', is_active: <?php echo e($b->is_active ? 'true' : 'false'); ?>, subscription_plan_id: '<?php echo e($b->subscription_plan_id); ?>', subscription_expires_at: '<?php echo e($b->subscription_expires_at ? substr($b->subscription_expires_at, 0, 10) : ''); ?>' }; editBusinessModal = true" class="text-indigo-600 hover:underline font-semibold">Edit</button>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>

            <!-- TAB: Users -->
            <div x-show="tab === 'users'" class="bg-white rounded-xl border border-gray-100 shadow-sm overflow-hidden">
                <table class="w-full text-left border-collapse text-xs">
                    <thead>
                        <tr class="bg-gray-50 border-b border-gray-100 text-gray-400 uppercase tracking-wider font-semibold">
                            <th class="px-6 py-3.5">Name</th>
                            <th class="px-6 py-3.5">Email</th>
                            <th class="px-6 py-3.5">Active Role</th>
                            <th class="px-6 py-3.5">Impersonate</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-50">
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="hover:bg-gray-50 transition">
                                <td class="px-6 py-3.5 font-medium text-gray-800"><?php echo e($u->name); ?></td>
                                <td class="px-6 py-3.5 text-gray-500 font-mono"><?php echo e($u->email); ?></td>
                                <td class="px-6 py-3.5">
                                    <span class="px-2 py-0.5 rounded-lg bg-gray-100 text-gray-600 font-medium">
                                        <?php echo e($u->roles->pluck('name')->first() ?: 'User'); ?>

                                    </span>
                                </td>
                                <td class="px-6 py-3.5">
                                    <?php if(Auth::id() !== $u->id): ?>
                                        <a href="<?php echo e(route('super-admin.impersonate', $u->id)); ?>" class="inline-flex items-center gap-1.5 px-3 py-1 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 rounded-lg font-semibold transition">
                                            <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M11 16l-4-4m0 0l4-4m-4 4h14" /></svg>
                                            Login As
                                        </a>
                                    <?php else: ?>
                                        <span class="text-gray-400">Current User</span>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>

            <!-- TAB: Spatie Roles & Permissions -->
            <div x-show="tab === 'roles'" class="space-y-6">
                <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="bg-white border border-gray-100 rounded-xl p-5 shadow-sm space-y-3">
                        <div class="flex justify-between items-center pb-2 border-b border-gray-50">
                            <h3 class="text-xs font-bold text-gray-800 uppercase tracking-wide">Role: <span class="text-indigo-600"><?php echo e($role->name); ?></span></h3>
                        </div>
                        <form method="POST" action="<?php echo e(route('super-admin.role-permissions.update')); ?>" class="space-y-4">
                            <?php echo csrf_field(); ?>
                            <input type="hidden" name="role_id" value="<?php echo e($role->id); ?>">
                            <?php
                                $groupedPermissions = $permissions->groupBy(function($perm) {
                                    if (str_contains($perm->name, 'invoice')) return 'Invoices';
                                    if (str_contains($perm->name, 'note') || str_contains($perm->name, 'credit-debit')) return 'Credit / Debit Notes';
                                    if (str_contains($perm->name, 'customer')) return 'Customers';
                                    if (str_contains($perm->name, 'item')) return 'Items';
                                    return 'System & Settings';
                                });
                            ?>
                            <div class="space-y-4">
                                <?php $__currentLoopData = $groupedPermissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $groupName => $groupPerms): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="bg-gray-50/60 p-3.5 rounded-xl border border-gray-100 space-y-2">
                                        <h4 class="text-[9px] font-bold text-indigo-600 uppercase tracking-wider border-b border-gray-200/50 pb-0.5"><?php echo e($groupName); ?></h4>
                                        <div class="grid grid-cols-2 sm:grid-cols-4 gap-2">
                                            <?php $__currentLoopData = $groupPerms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $perm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <label class="flex items-center gap-2 text-[11px] text-gray-600 cursor-pointer">
                                                    <input type="checkbox" name="permissions[]" value="<?php echo e($perm->name); ?>"
                                                           <?php echo e($role->hasPermissionTo($perm->name) ? 'checked' : ''); ?>

                                                           class="rounded border-gray-300 text-indigo-600 focus:ring-indigo-500">
                                                    <span><?php echo e($perm->name); ?></span>
                                                </label>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                            <div class="flex justify-end pt-2 border-t border-gray-50">
                                <button type="submit" class="px-3.5 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-semibold transition">Save Permissions Map</button>
                            </div>
                        </form>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>

            <!-- TAB: Subscription Plans -->
            <div x-show="tab === 'plans'" class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                <!-- Create Plan Card -->
                <div class="bg-white border border-gray-100 rounded-xl p-6 shadow-sm space-y-4 h-fit">
                    <h3 class="text-xs font-bold text-gray-400 uppercase tracking-wider">Create Subscription Plan</h3>
                    <form method="POST" action="<?php echo e(route('super-admin.plans.store')); ?>" class="space-y-4">
                        <?php echo csrf_field(); ?>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Plan Name</label>
                            <input type="text" name="name" required class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                        </div>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Price (Rs.)</label>
                            <input type="number" step="0.01" name="price" required class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                        </div>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Duration (Months)</label>
                            <input type="number" name="duration_months" required class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                        </div>
                        <div class="grid grid-cols-2 gap-3 pt-2 border-t border-gray-50">
                            <div>
                                <label class="block text-[10px] font-medium text-gray-500 mb-1">Max Users</label>
                                <input type="number" name="max_users" placeholder="Unlimited" class="w-full rounded-xl border-gray-200 text-[11px] focus:border-indigo-400 focus:ring-indigo-400">
                            </div>
                            <div>
                                <label class="block text-[10px] font-medium text-gray-500 mb-1">Max Locations</label>
                                <input type="number" name="max_locations" placeholder="Unlimited" class="w-full rounded-xl border-gray-200 text-[11px] focus:border-indigo-400 focus:ring-indigo-400">
                            </div>
                            <div>
                                <label class="block text-[10px] font-medium text-gray-500 mb-1">Max Invoices</label>
                                <input type="number" name="max_invoices" placeholder="Unlimited" class="w-full rounded-xl border-gray-200 text-[11px] focus:border-indigo-400 focus:ring-indigo-400">
                            </div>
                            <div>
                                <label class="block text-[10px] font-medium text-gray-500 mb-1">Max Customers</label>
                                <input type="number" name="max_customers" placeholder="Unlimited" class="w-full rounded-xl border-gray-200 text-[11px] focus:border-indigo-400 focus:ring-indigo-400">
                            </div>
                        </div>
                        <button type="submit" class="w-full py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-semibold transition">Save Plan</button>
                    </form>
                </div>

                <!-- Plans List -->
                <div class="lg:col-span-2 bg-white rounded-xl border border-gray-100 shadow-sm overflow-hidden">
                    <table class="w-full text-left border-collapse text-xs">
                        <thead>
                            <tr class="bg-gray-50 border-b border-gray-100 text-gray-400 uppercase tracking-wider font-semibold">
                                <th class="px-6 py-3.5">Plan Name</th>
                                <th class="px-6 py-3.5">Price</th>
                                <th class="px-6 py-3.5">Duration</th>
                                <th class="px-6 py-3.5">Status</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-50">
                            <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr class="hover:bg-gray-50 transition">
                                    <td class="px-6 py-3.5">
                                        <div class="font-medium text-gray-800"><?php echo e($plan->name); ?></div>
                                        <div class="text-[10px] text-gray-400 mt-0.5">
                                            <?php
                                                $features = $plan->features;
                                                if (!is_array($features)) {
                                                    $features = json_decode($features, true) ?: [];
                                                }
                                            ?>
                                            Users: <?php echo e((!empty($features['max_users']) && $features['max_users'] != -1) ? $features['max_users'] : 'Unlimited'); ?> | 
                                            Locations: <?php echo e((!empty($features['max_locations']) && $features['max_locations'] != -1) ? $features['max_locations'] : 'Unlimited'); ?> | 
                                            Invoices: <?php echo e((!empty($features['max_invoices']) && $features['max_invoices'] != -1) ? $features['max_invoices'] : 'Unlimited'); ?> | 
                                            Customers: <?php echo e((!empty($features['max_customers']) && $features['max_customers'] != -1) ? $features['max_customers'] : 'Unlimited'); ?>

                                        </div>
                                    </td>
                                    <td class="px-6 py-3.5 font-semibold text-indigo-600">Rs. <?php echo e(number_format($plan->price, 2)); ?></td>
                                    <td class="px-6 py-3.5 text-gray-500"><?php echo e($plan->duration_months); ?> Month(s)</td>
                                    <td class="px-6 py-3.5">
                                        <span class="px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-600">Active</span>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>

            <!-- TAB: Maintenance -->
            <div x-show="tab === 'maintenance'" class="grid grid-cols-1 lg:grid-cols-2 gap-6">
                <!-- System Config Form -->
                <div class="bg-white border border-gray-100 rounded-xl p-6 shadow-sm space-y-4">
                    <h3 class="text-xs font-bold text-gray-400 uppercase tracking-wider border-b border-gray-50 pb-2">System Config</h3>
                    <form method="POST" action="<?php echo e(route('super-admin.settings.update')); ?>" enctype="multipart/form-data" class="space-y-4">
                        <?php echo csrf_field(); ?>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">App Name</label>
                            <input type="text" name="app_name" value="<?php echo e(\App\Models\Setting::get('app_name', 'FBR Invoicing', null)); ?>" required class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                        </div>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Portal Favicon</label>
                            <input type="file" name="favicon" accept="image/*" class="w-full text-xs text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-xl file:border-0 file:text-xs file:font-semibold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100">
                            <?php if(\App\Models\Setting::get('favicon_url', null, null)): ?>
                                <img src="<?php echo e(\App\Models\Setting::get('favicon_url', null, null)); ?>" class="w-8 h-8 rounded-lg mt-3 border object-contain" alt="Favicon">
                            <?php endif; ?>
                        </div>
                        <button type="submit" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-semibold transition">Save Settings</button>
                    </form>
                </div>

                <!-- Database operations -->
                <div class="bg-white border border-gray-100 rounded-xl p-6 shadow-sm space-y-5">
                    <div>
                        <h3 class="text-xs font-bold text-gray-400 uppercase tracking-wider border-b border-gray-50 pb-2">Database Maintenance</h3>
                        <p class="text-[11px] text-gray-400 mt-1">Manage database storage dumps and clear operations safely.</p>
                    </div>

                    <div class="space-y-4">
                        <div class="flex items-center justify-between p-3.5 bg-gray-50 rounded-xl">
                            <div>
                                <h4 class="text-xs font-bold text-gray-700">Backup SQL Database</h4>
                                <p class="text-[10px] text-gray-400 mt-0.5">Download a clone of the active SQLite system database file.</p>
                            </div>
                            <a href="<?php echo e(route('super-admin.backup')); ?>" class="px-3.5 py-2 bg-white border border-gray-200 hover:bg-gray-50 rounded-xl text-xs font-semibold text-gray-700 shadow-sm transition">Backup DB</a>
                        </div>

                        <div class="flex items-center justify-between p-3.5 bg-red-50/50 border border-red-100/50 rounded-xl">
                            <div>
                                <h4 class="text-xs font-bold text-red-700">Clear Operational Data</h4>
                                <p class="text-[10px] text-red-500/80 mt-0.5">Truncate invoices, logs, line items, customers, and notifications.</p>
                            </div>
                            <form method="POST" action="<?php echo e(route('super-admin.clear')); ?>" onsubmit="return confirm('WARNING: This will wipe out all invoices, customers, items and sync logs permanently. Users and businesses will NOT be deleted. Are you sure you want to proceed?');">
                                <?php echo csrf_field(); ?>
                                <button type="submit" class="px-3.5 py-2 bg-red-600 hover:bg-red-700 rounded-xl text-xs font-semibold text-white shadow-sm transition">Clear Database</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Modal: Edit Business Subscription -->
        <div x-show="editBusinessModal" x-cloak class="fixed inset-0 z-50 overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true">
            <div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
                <div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" @click="editBusinessModal = false"></div>
                <span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span>
                <div class="inline-block align-middle bg-white rounded-2xl text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full p-6 space-y-4">
                    <div class="flex justify-between items-center border-b border-gray-100 pb-3">
                        <h3 class="text-md font-bold text-gray-800">Edit Business Subscription</h3>
                        <button type="button" @click="editBusinessModal = false" class="text-gray-400 hover:text-gray-600">
                            <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
                        </button>
                    </div>
                    <form method="POST" :action="`/super-admin/businesses/${selectedBusiness.id}`" class="space-y-4">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('PUT'); ?>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Business Name</label>
                            <input type="text" :value="selectedBusiness.name" disabled class="w-full bg-gray-50 rounded-xl border-gray-200 text-xs text-gray-400">
                        </div>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Subscription Plan</label>
                            <select name="subscription_plan_id" x-model="selectedBusiness.subscription_plan_id" class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                                <option value="">No Active Plan</option>
                                <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($plan->id); ?>"><?php echo e($plan->name); ?> (Rs. <?php echo e(number_format($plan->price)); ?>)</option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Plan Expiry Date</label>
                            <input type="date" name="subscription_expires_at" x-model="selectedBusiness.subscription_expires_at" class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                        </div>
                        <div>
                            <label class="block text-xs font-medium text-gray-500 mb-1">Portal Access Status</label>
                            <select name="is_active" x-model="selectedBusiness.is_active" class="w-full rounded-xl border-gray-200 text-xs focus:border-indigo-400 focus:ring-indigo-400">
                                <option value="1">Active / Allowed</option>
                                <option value="0">Deactivated / Suspended</option>
                            </select>
                        </div>
                        <div class="flex justify-end gap-2 border-t border-gray-100 pt-3">
                            <button type="button" @click="editBusinessModal = false" class="px-4 py-2 border border-gray-200 rounded-xl text-xs font-semibold text-gray-600 hover:bg-gray-50 transition">Cancel</button>
                            <button type="submit" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl text-xs font-semibold transition">Save Changes</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH /www/wwwroot/fbrdiv2.shiningerp.com/resources/views/super-admin/dashboard.blade.php ENDPATH**/ ?>