<?php $__env->startSection('title', 'Edit '.$plan->name.' Plan'); ?>

<?php $__env->startSection('content'); ?>
<div class="mx-auto max-w-4xl space-y-6">
    <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between"><div><p class="text-xs font-bold uppercase tracking-[0.18em] text-orange-600">SaaS commercial controls</p><h1 class="mt-1 text-2xl font-bold text-slate-950 dark:text-white">Edit <?php echo e($plan->name); ?></h1><p class="text-sm text-slate-500">Update pricing, tenant limits, included features and availability.</p></div><a href="<?php echo e(route('platform.plans')); ?>" class="rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-xs font-bold text-slate-700">Back to Plans</a></div>

    <form method="POST" action="<?php echo e(route('platform.plans.update', $plan)); ?>" class="space-y-6">
        <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
        <section class="rounded-3xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-700 dark:bg-slate-800">
            <h2 class="text-sm font-bold text-slate-950 dark:text-white">Plan identity and pricing</h2>
            <div class="mt-4 grid gap-4 sm:grid-cols-2">
                <label class="text-xs font-semibold text-slate-700 sm:col-span-2">Plan name *<input name="name" value="<?php echo e(old('name', $plan->name)); ?>" required class="erp-input mt-1"></label>
                <label class="text-xs font-semibold text-slate-700 sm:col-span-2">Description<textarea name="description" rows="3" class="erp-input mt-1"><?php echo e(old('description', $plan->description)); ?></textarea></label>
                <label class="text-xs font-semibold text-slate-700">Monthly price (AED) *<input type="number" step="0.01" min="0" name="price_monthly" value="<?php echo e(old('price_monthly', $plan->price_monthly)); ?>" required class="erp-input mt-1"></label>
                <label class="text-xs font-semibold text-slate-700">Yearly price (AED) *<input type="number" step="0.01" min="0" name="price_yearly" value="<?php echo e(old('price_yearly', $plan->price_yearly)); ?>" required class="erp-input mt-1"></label>
            </div>
        </section>

        <section class="rounded-3xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-700 dark:bg-slate-800">
            <h2 class="text-sm font-bold text-slate-950 dark:text-white">Resource limits</h2>
            <div class="mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
                <label class="text-xs font-semibold text-slate-700">Maximum users *<input type="number" min="1" name="max_users" value="<?php echo e(old('max_users', $plan->max_users)); ?>" required class="erp-input mt-1"></label>
                <label class="text-xs font-semibold text-slate-700">Maximum branches *<input type="number" min="1" name="max_branches" value="<?php echo e(old('max_branches', $plan->max_branches)); ?>" required class="erp-input mt-1"></label>
                <label class="text-xs font-semibold text-slate-700">Storage (GB)<input type="number" min="1" name="max_storage_gb" value="<?php echo e(old('max_storage_gb', $plan->max_storage_gb)); ?>" class="erp-input mt-1"></label>
                <label class="text-xs font-semibold text-slate-700">Monthly AI credits<input type="number" min="0" name="monthly_ai_credits" value="<?php echo e(old('monthly_ai_credits', $plan->monthly_ai_credits)); ?>" class="erp-input mt-1"></label>
                <label class="text-xs font-semibold text-slate-700">WhatsApp message pack<input type="number" min="0" name="monthly_whatsapp_messages" value="<?php echo e(old('monthly_whatsapp_messages', $plan->monthly_whatsapp_messages)); ?>" class="erp-input mt-1"></label>
                <label class="flex items-center gap-2 self-end rounded-xl border border-slate-200 px-4 py-3 text-xs font-semibold text-slate-700"><input type="checkbox" name="is_active" value="1" <?php if($plan->is_active): echo 'checked'; endif; ?>> Plan available for subscriptions</label>
            </div>
        </section>

        <section class="rounded-3xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-700 dark:bg-slate-800">
            <h2 class="text-sm font-bold text-slate-950 dark:text-white">Included product features</h2>
            <div class="mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3"><?php $__currentLoopData = $features; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feature): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><label class="flex items-start gap-3 rounded-2xl border border-slate-200 p-4 text-xs"><input type="checkbox" name="features[]" value="<?php echo e($feature->id); ?>" class="mt-0.5 h-4 w-4 rounded text-orange-600" <?php if($plan->features->contains($feature->id)): echo 'checked'; endif; ?>><span><strong class="block text-slate-900"><?php echo e($feature->name); ?></strong><span class="mt-1 block text-slate-500"><?php echo e($feature->description); ?></span></span></label><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div>
        </section>

        <div class="flex justify-end"><button class="rounded-xl bg-[#0b1f38] px-6 py-3 text-xs font-bold text-white shadow-lg">Save plan changes</button></div>
    </form>
</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\platform\plans\edit.blade.php ENDPATH**/ ?>