<?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 justify-between items-center">
            <h2 class="font-bold text-2xl text-slate-800 leading-tight flex items-center gap-2">
                <i class="ph-duotone ph-sliders-horizontal text-indigo-600"></i>
                <?php echo e(__('System Configuration')); ?>

            </h2>
            <p class="text-sm text-slate-500">Manage firm details, payments, and integrations.</p>
        </div>
     <?php $__env->endSlot(); ?>

    <div class="py-10 bg-slate-50 min-h-screen">
        <div class="max-w-5xl mx-auto sm:px-6 lg:px-8">

            <form action="<?php echo e(route('admin.settings.update')); ?>" method="POST">
                <?php echo csrf_field(); ?>

                <div class="space-y-8">

                    <div class="bg-white shadow-sm ring-1 ring-slate-900/5 sm:rounded-xl overflow-hidden">
                        <div class="px-8 py-6 border-b border-slate-100 bg-slate-50/50 flex items-center justify-between">
                            <h3 class="text-lg font-bold text-slate-800 flex items-center gap-2">
                                <i class="ph-duotone ph-buildings text-indigo-500 text-xl"></i> Firm Identity
                            </h3>
                            <span class="text-xs font-semibold uppercase tracking-wider text-slate-400">General Info</span>
                        </div>
                        <div class="p-8 grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6">
                            <div class="md:col-span-2">
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Legal Firm Name</label>
                                <input type="text" name="company_name" value="<?php echo e($settings['company_name'] ?? 'Law Firm Ltd'); ?>"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500 bg-slate-50 focus:bg-white transition-colors">
                            </div>
                            <div>
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Official Email</label>
                                <input type="email" name="company_email" value="<?php echo e($settings['company_email'] ?? ''); ?>"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500 bg-slate-50 focus:bg-white transition-colors">
                            </div>
                            <div>
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Phone Number</label>
                                <input type="text" name="company_phone" value="<?php echo e($settings['company_phone'] ?? ''); ?>"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500 bg-slate-50 focus:bg-white transition-colors">
                            </div>
                            <div class="md:col-span-2">
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Physical Address</label>
                                <textarea name="company_address" rows="3"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500 bg-slate-50 focus:bg-white transition-colors"><?php echo e($settings['company_address'] ?? ''); ?></textarea>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white shadow-sm ring-1 ring-slate-900/5 sm:rounded-xl overflow-hidden">
                        <div class="px-8 py-6 border-b border-slate-100 bg-slate-50/50 flex items-center justify-between">
                            <h3 class="text-lg font-bold text-slate-800 flex items-center gap-2">
                                <i class="ph-duotone ph-wallet text-emerald-600 text-xl"></i> M-Pesa Integration (Daraja)
                            </h3>
                            <span class="inline-flex items-center rounded-full bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20">Automatic Billing</span>
                        </div>

                        <div class="p-8">
                             <div class="mb-6 bg-emerald-50/50 border border-emerald-100 rounded-lg p-4 flex items-start gap-3">
                                <i class="ph-fill ph-info text-emerald-500 mt-0.5"></i>
                                <div class="text-sm text-emerald-900">
                                    <p class="font-semibold">STK Push Credentials</p>
                                    <p class="text-emerald-700/80 text-xs mt-1">These settings allow the system to automatically trigger payment prompts on client phones. Get these from the Safaricom Developer Portal.</p>
                                </div>
                            </div>

                            <div class="grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6">
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Environment</label>
                                    <select name="mpesa_env" class="w-full rounded-lg border-slate-200 text-sm focus:border-emerald-500 focus:ring-emerald-500 bg-slate-50">
                                        <option value="sandbox" <?php echo e(($settings['mpesa_env'] ?? '') == 'sandbox' ? 'selected' : ''); ?>>Sandbox (Testing)</option>
                                        <option value="production" <?php echo e(($settings['mpesa_env'] ?? '') == 'production' ? 'selected' : ''); ?>>Live (Production)</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Business Shortcode (Paybill/Till)</label>
                                    <input type="text" name="mpesa_shortcode" value="<?php echo e($settings['mpesa_shortcode'] ?? ''); ?>" placeholder="e.g. 174379"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-emerald-500 focus:ring-emerald-500 bg-slate-50 focus:bg-white">
                                </div>

                                <div class="md:col-span-2">
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Consumer Key</label>
                                    <input type="password" name="mpesa_consumer_key" value="<?php echo e($settings['mpesa_consumer_key'] ?? ''); ?>"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-emerald-500 focus:ring-emerald-500 bg-slate-50 focus:bg-white font-mono">
                                </div>

                                <div class="md:col-span-2">
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Consumer Secret</label>
                                    <input type="password" name="mpesa_consumer_secret" value="<?php echo e($settings['mpesa_consumer_secret'] ?? ''); ?>"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-emerald-500 focus:ring-emerald-500 bg-slate-50 focus:bg-white font-mono">
                                </div>

                                <div class="md:col-span-2">
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Lipa Na M-Pesa Passkey</label>
                                    <input type="password" name="mpesa_passkey" value="<?php echo e($settings['mpesa_passkey'] ?? ''); ?>"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-emerald-500 focus:ring-emerald-500 bg-slate-50 focus:bg-white font-mono">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white shadow-sm ring-1 ring-slate-900/5 sm:rounded-xl overflow-hidden">
                        <div class="px-8 py-6 border-b border-slate-100 bg-slate-50/50 flex items-center justify-between">
                            <h3 class="text-lg font-bold text-slate-800 flex items-center gap-2">
                                <i class="ph-duotone ph-chat-teardrop-text text-blue-600 text-xl"></i> Messaging
                            </h3>
                            <span class="text-xs font-semibold uppercase tracking-wider text-slate-400">SMS & WhatsApp</span>
                        </div>

                        <div class="p-8 grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6">
                            <div class="md:col-span-2">
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">SMS Provider</label>
                                <select name="sms_provider" class="w-full rounded-lg border-slate-200 text-sm focus:border-blue-500 focus:ring-blue-500 bg-slate-50">
                                    <option value="africastalking" <?php echo e(($settings['sms_provider'] ?? '') == 'africastalking' ? 'selected' : ''); ?>>Africa's Talking (Kenya Default)</option>
                                    <option value="twilio" <?php echo e(($settings['sms_provider'] ?? '') == 'twilio' ? 'selected' : ''); ?>>Twilio</option>
                                    <option value="infobip" <?php echo e(($settings['sms_provider'] ?? '') == 'infobip' ? 'selected' : ''); ?>>Infobip</option>
                                </select>
                            </div>

                            <div>
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">API Username / SID</label>
                                <input type="text" name="sms_username" value="<?php echo e($settings['sms_username'] ?? ''); ?>"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-blue-500 focus:ring-blue-500 bg-slate-50 focus:bg-white">
                            </div>

                            <div>
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">API Key / Token</label>
                                <input type="password" name="sms_api_key" value="<?php echo e($settings['sms_api_key'] ?? ''); ?>"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-blue-500 focus:ring-blue-500 bg-slate-50 focus:bg-white font-mono">
                            </div>

                            <div>
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Sender ID (Shortcode)</label>
                                <input type="text" name="sms_sender_id" value="<?php echo e($settings['sms_sender_id'] ?? ''); ?>" placeholder="Optional"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-blue-500 focus:ring-blue-500 bg-slate-50 focus:bg-white">
                            </div>

                            <div>
                                <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">WhatsApp Biz ID</label>
                                <input type="text" name="whatsapp_id" value="<?php echo e($settings['whatsapp_id'] ?? ''); ?>" placeholder="Optional"
                                    class="w-full rounded-lg border-slate-200 text-sm focus:border-blue-500 focus:ring-blue-500 bg-slate-50 focus:bg-white">
                            </div>

                            <div class="md:col-span-2 pt-4 border-t border-slate-100 flex gap-6">
                                <label class="flex items-center space-x-2.5 cursor-pointer group">
                                    <input type="checkbox" name="enable_sms_notifications" value="1"
                                        class="rounded text-blue-600 focus:ring-blue-500 h-4 w-4 border-slate-300 group-hover:border-blue-400 transition"
                                        <?php echo e(!empty($settings['enable_sms_notifications']) ? 'checked' : ''); ?>>
                                    <span class="text-sm font-semibold text-slate-700 group-hover:text-slate-900">Enable SMS Alerts</span>
                                </label>
                                <label class="flex items-center space-x-2.5 cursor-pointer group">
                                    <input type="checkbox" name="enable_whatsapp_notifications" value="1"
                                        class="rounded text-green-600 focus:ring-green-500 h-4 w-4 border-slate-300 group-hover:border-green-400 transition"
                                        <?php echo e(!empty($settings['enable_whatsapp_notifications']) ? 'checked' : ''); ?>>
                                    <span class="text-sm font-semibold text-slate-700 group-hover:text-slate-900">Enable WhatsApp Alerts</span>
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white shadow-sm ring-1 ring-slate-900/5 sm:rounded-xl overflow-hidden">
                        <div class="px-8 py-6 border-b border-slate-100 bg-slate-50/50 flex items-center justify-between">
                            <h3 class="text-lg font-bold text-slate-800 flex items-center gap-2">
                                <i class="ph-duotone ph-envelope-simple text-amber-500 text-xl"></i> Email Server (SMTP)
                            </h3>
                            <span class="text-xs font-semibold uppercase tracking-wider text-slate-400">Invoices & Notices</span>
                        </div>

                        <div class="p-8">
                             <div class="mb-6 bg-amber-50/50 border border-amber-100 rounded-lg p-4 flex items-start gap-3">
                                <i class="ph-fill ph-warning-circle text-amber-500 mt-0.5"></i>
                                <div class="text-sm text-amber-900">
                                    <p class="font-semibold">Security Note</p>
                                    <p class="text-amber-700/80 text-xs mt-1">If using Gmail, enable 2FA and create an <strong class="underline">App Password</strong>. Do not use your regular login password.</p>
                                </div>
                            </div>

                            <div class="grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6">
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Mail Host</label>
                                    <input type="text" name="mail_host" value="<?php echo e($settings['mail_host'] ?? 'smtp.gmail.com'); ?>" placeholder="smtp.gmail.com"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-amber-500 focus:ring-amber-500 bg-slate-50 focus:bg-white">
                                </div>
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Mail Port</label>
                                    <input type="text" name="mail_port" value="<?php echo e($settings['mail_port'] ?? '587'); ?>" placeholder="587"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-amber-500 focus:ring-amber-500 bg-slate-50 focus:bg-white">
                                </div>
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Username</label>
                                    <input type="text" name="mail_username" value="<?php echo e($settings['mail_username'] ?? ''); ?>"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-amber-500 focus:ring-amber-500 bg-slate-50 focus:bg-white">
                                </div>
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Password</label>
                                    <input type="password" name="mail_password" value="<?php echo e($settings['mail_password'] ?? ''); ?>"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-amber-500 focus:ring-amber-500 bg-slate-50 focus:bg-white">
                                </div>
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">Encryption</label>
                                    <select name="mail_encryption" class="w-full rounded-lg border-slate-200 text-sm focus:border-amber-500 focus:ring-amber-500 bg-slate-50">
                                        <option value="tls" <?php echo e(($settings['mail_encryption'] ?? '') == 'tls' ? 'selected' : ''); ?>>TLS (Standard)</option>
                                        <option value="ssl" <?php echo e(($settings['mail_encryption'] ?? '') == 'ssl' ? 'selected' : ''); ?>>SSL</option>
                                        <option value="null" <?php echo e(($settings['mail_encryption'] ?? '') == 'null' ? 'selected' : ''); ?>>None</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5">From Address</label>
                                    <input type="text" name="mail_from_address" value="<?php echo e($settings['mail_from_address'] ?? ''); ?>"
                                        class="w-full rounded-lg border-slate-200 text-sm focus:border-amber-500 focus:ring-amber-500 bg-slate-50 focus:bg-white">
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

                <div class="fixed bottom-6 right-6 z-40">
                    <button type="submit" class="shadow-xl bg-slate-900 text-white px-6 py-3 rounded-full font-bold hover:bg-indigo-600 transition-all flex items-center gap-2 transform hover:scale-105">
                        <i class="ph-bold ph-floppy-disk"></i>
                        Save Configurations
                    </button>
                </div>

            </form>
        </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 /Users/yousaf/Documents/GitHub/law-firm-project/resources/views/super-admin/settings/index.blade.php ENDPATH**/ ?>