<?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 flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
            <div>
                <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
                    <?php echo e($client->name); ?>

                </h2>
                <?php if($client->registration_code): ?>
                    <p class="mt-1 text-sm font-mono font-semibold text-teal-700 dark:text-teal-300"><?php echo e($client->registration_code); ?></p>
                <?php endif; ?>
                <p class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo e(__('Representante / titular')); ?></p>
            </div>
            <div class="flex flex-wrap gap-2">
                <a href="<?php echo e(route('clients.index')); ?>" class="text-sm text-gray-600 dark:text-gray-400 hover:underline"><?php echo e(__('Volver al listado')); ?></a>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('clients.manage')): ?>
                    <a href="<?php echo e(route('clients.edit', $client)); ?>"
                       class="inline-flex items-center rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-medium text-gray-800 dark:text-gray-200 ring-1 ring-gray-300 dark:ring-gray-600">
                        <?php echo e(__('Editar')); ?>

                    </a>
                    <a href="<?php echo e(route('clients.patients.create', $client)); ?>"
                       class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-500">
                        <?php echo e(__('Nuevo paciente')); ?>

                    </a>
                <?php endif; ?>
            </div>
        </div>
     <?php $__env->endSlot(); ?>

    <div class="py-8">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
            <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6 md:flex md:gap-8">
                    <div class="shrink-0 mb-4 md:mb-0">
                        <?php if($client->photo_path): ?>
                            <img src="<?php echo e(\Illuminate\Support\Facades\Storage::url($client->photo_path)); ?>" alt="" class="h-32 w-32 rounded-xl object-cover border border-gray-200 dark:border-gray-600" />
                        <?php else: ?>
                            <div class="h-32 w-32 rounded-xl bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-4xl text-gray-400">
                                <?php echo e(mb_strtoupper(mb_substr($client->name, 0, 1))); ?>

                            </div>
                        <?php endif; ?>
                    </div>
                    <div class="flex-1 space-y-2 text-sm text-gray-700 dark:text-gray-300">
                        <?php if($client->document_number): ?>
                            <p><span class="font-medium text-gray-900 dark:text-gray-100"><?php echo e(__('Cédula')); ?>:</span>
                                <?php echo e(trim(($client->document_type ? $client->document_type.'-' : '').$client->document_number)); ?></p>
                        <?php endif; ?>
                        <?php if($client->phone): ?>
                            <p><span class="font-medium text-gray-900 dark:text-gray-100"><?php echo e(__('Teléfono')); ?>:</span> <?php echo e($client->phone); ?></p>
                        <?php endif; ?>
                        <?php if($client->email): ?>
                            <p><span class="font-medium text-gray-900 dark:text-gray-100"><?php echo e(__('Correo')); ?>:</span> <?php echo e($client->email); ?></p>
                        <?php endif; ?>
                        <?php if($client->address): ?>
                            <p><span class="font-medium text-gray-900 dark:text-gray-100"><?php echo e(__('Dirección')); ?>:</span> <?php echo e($client->address); ?></p>
                        <?php endif; ?>
                        <?php if($client->notes): ?>
                            <p class="pt-2 border-t border-gray-200 dark:border-gray-700">
                                <span class="font-medium text-gray-900 dark:text-gray-100"><?php echo e(__('Notas')); ?>:</span><br>
                                <?php echo e($client->notes); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
                <div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between">
                    <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100"><?php echo e(__('Pacientes (mascotas)')); ?></h3>
                </div>
                <ul class="divide-y divide-gray-200 dark:divide-gray-700">
                    <?php $__empty_1 = true; $__currentLoopData = $client->activePatients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $patient): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <li class="px-6 py-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2">
                            <div>
                                <a href="<?php echo e(route('clients.patients.show', [$client, $patient])); ?>" class="font-medium text-indigo-600 dark:text-indigo-400 hover:underline">
                                    <?php echo e($patient->name); ?>

                                </a>
                                <p class="text-sm text-gray-500 dark:text-gray-400">
                                    <?php echo e(collect([$patient->species, $patient->breed])->filter()->join(' · ') ?: __('Sin especie registrada')); ?>

                                    <?php if($patient->clinical_code): ?>
                                        <span class="ms-2 font-mono text-teal-600 dark:text-teal-400"><?php echo e($patient->clinical_code); ?></span>
                                    <?php endif; ?>
                                </p>
                            </div>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('clients.manage')): ?>
                                <a href="<?php echo e(route('clients.patients.edit', [$client, $patient])); ?>" class="text-sm text-indigo-600 dark:text-indigo-400 hover:underline shrink-0"><?php echo e(__('Editar')); ?></a>
                            <?php endif; ?>
                        </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <li class="px-6 py-8 text-center text-gray-500 dark:text-gray-400">
                            <?php echo e(__('No hay pacientes registrados para este cliente.')); ?>

                        </li>
                    <?php endif; ?>
                </ul>
            </div>

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('clients.manage')): ?>
                <form method="post" action="<?php echo e(route('clients.destroy', $client)); ?>" class="text-right"
                      onsubmit="return confirm(<?php echo \Illuminate\Support\Js::from(__('¿Eliminar este cliente y todos sus pacientes?'))->toHtml() ?>);">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('delete'); ?>
                    <button type="submit" class="text-sm text-red-600 dark:text-red-400 hover:underline">
                        <?php echo e(__('Eliminar cliente')); ?>

                    </button>
                </form>
            <?php endif; ?>
        </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 C:\wamp64\www\vet\resources\views/clients/show.blade.php ENDPATH**/ ?>