<?php $__env->startSection('title', 'Configurações'); ?>
<?php $__env->startSection('page-title', 'Configurações'); ?>

<?php $__env->startSection('content'); ?>
    <?php if (isset($component)) { $__componentOriginalffc289bcdb3e7d748912814ce53d6bc0 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalffc289bcdb3e7d748912814ce53d6bc0 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.settings.shell','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('settings.shell'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
        <div class="space-y-6">
            <div class="rounded-xl border border-slate-200 bg-white p-6 shadow-sm">
                <div class="flex flex-wrap items-start justify-between gap-4">
                    <div>
                        <h2 class="text-lg font-semibold text-slate-900"><?php echo e($tenant->name); ?></h2>
                        <p class="mt-1 text-sm text-slate-600">
                            <?php echo e($settings->trade_name ?: 'Nome comercial pendente'); ?>

                            · <?php echo e($tenant->type?->label() ?? 'Organização'); ?>

                        </p>
                    </div>
                    <div class="text-right">
                        <p class="text-xs font-medium uppercase tracking-wide text-slate-500">Cadastro</p>
                        <p class="mt-1 text-2xl font-semibold text-slate-900"><?php echo e($profile_completeness); ?>%</p>
                    </div>
                </div>

                <dl class="mt-6 grid gap-4 sm:grid-cols-3">
                    <div>
                        <dt class="text-xs font-medium uppercase tracking-wide text-slate-500">Plano</dt>
                        <dd class="mt-1 text-sm font-medium text-slate-900">
                            <?php echo e($subscription?->plan?->name ?? 'Sem plano'); ?>

                            <span class="text-slate-500">(<?php echo e($subscription?->status?->label() ?? '—'); ?>)</span>
                        </dd>
                    </div>
                    <div>
                        <dt class="text-xs font-medium uppercase tracking-wide text-slate-500">Eventos de pagamento</dt>
                        <dd class="mt-1 text-sm font-medium text-slate-900"><?php echo e($payments_count); ?></dd>
                    </div>
                    <div>
                        <dt class="text-xs font-medium uppercase tracking-wide text-slate-500">Documento</dt>
                        <dd class="mt-1 text-sm font-medium text-slate-900"><?php echo e($settings->document ?: 'Não informado'); ?></dd>
                    </div>
                </dl>
            </div>

            <div class="grid gap-4 sm:grid-cols-2">
                <a href="<?php echo e(route('settings.account')); ?>" class="rounded-xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-emerald-300">
                    <h3 class="font-semibold text-slate-900">Minha conta</h3>
                    <p class="mt-1 text-sm text-slate-600">Nome, e-mail, telefone, CRECI e senha.</p>
                </a>

                <?php if(auth()->user()->hasAnyRole(['Admin', 'Gestor'])): ?>
                    <a href="<?php echo e(route('settings.organization')); ?>" class="rounded-xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-emerald-300">
                        <h3 class="font-semibold text-slate-900">Organização</h3>
                        <p class="mt-1 text-sm text-slate-600">Dados da imobiliária, endereço e contato.</p>
                    </a>
                    <a href="<?php echo e(route('organizations.members')); ?>" class="rounded-xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-emerald-300">
                        <h3 class="font-semibold text-slate-900">Equipe</h3>
                        <p class="mt-1 text-sm text-slate-600">Convites, papéis e membros.</p>
                    </a>
                    <a href="<?php echo e(route('settings.payments')); ?>" class="rounded-xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-emerald-300">
                        <h3 class="font-semibold text-slate-900">Pagamentos</h3>
                        <p class="mt-1 text-sm text-slate-600">Histórico de cobranças e status da assinatura.</p>
                    </a>
                <?php endif; ?>

                <a href="<?php echo e(route('settings.plan')); ?>" class="rounded-xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-emerald-300">
                    <h3 class="font-semibold text-slate-900">Plano</h3>
                    <p class="mt-1 text-sm text-slate-600">Limites, capacidade e upgrade.</p>
                </a>
                <a href="<?php echo e(route('whatsapp.settings')); ?>" class="rounded-xl border border-slate-200 bg-white p-5 shadow-sm transition hover:border-emerald-300">
                    <h3 class="font-semibold text-slate-900">WhatsApp</h3>
                    <p class="mt-1 text-sm text-slate-600">Conexão e ligar/desligar o atendimento automático.</p>
                </a>
            </div>
        </div>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalffc289bcdb3e7d748912814ce53d6bc0)): ?>
<?php $attributes = $__attributesOriginalffc289bcdb3e7d748912814ce53d6bc0; ?>
<?php unset($__attributesOriginalffc289bcdb3e7d748912814ce53d6bc0); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalffc289bcdb3e7d748912814ce53d6bc0)): ?>
<?php $component = $__componentOriginalffc289bcdb3e7d748912814ce53d6bc0; ?>
<?php unset($__componentOriginalffc289bcdb3e7d748912814ce53d6bc0); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/backend/resources/views/settings/index.blade.php ENDPATH**/ ?>