
<div class="w-full" style="font-size:14px; display:flex; flex-direction:column; gap:16px;">

    <div>
        <a href="<?php echo e(route('clients.index')); ?>" wire:navigate
           class="inline-flex items-center gap-1.5 text-[13px] font-semibold"
           style="color:var(--text-link);">
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
            Clientes
        </a>
    </div>

    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session('success')): ?>
        <div class="rounded-lg px-4 py-2.5 text-[13px]"
             style="background:var(--success-50); color:var(--success-500);">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if (! ($client->actived)): ?>
        <div class="flex flex-wrap items-center gap-3.5 rounded-xl border px-5 py-3.5"
             style="background:var(--danger-50); border-color:var(--danger-500);">
            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="var(--danger-500)" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="flex-none"><circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/></svg>
            <div class="min-w-[240px] flex-1">
                <div class="text-[13.5px] font-bold" style="color:var(--danger-500);">
                    Cliente de baja
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->deactivated_at): ?>
                        desde el <?php echo e($client->deactivated_at->format('d/m/Y')); ?>

                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div class="mt-0.5 text-[12.5px]" style="color:var(--text-body);">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->deactivation_reason): ?>
                        «<?php echo e($client->deactivation_reason); ?>»
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->deactivatedBy): ?>
                        — <?php echo e($client->deactivatedBy->name); ?>.
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    Sus licencias están desactivadas y sus entornos reciben «Cliente inactivo».
                </div>
            </div>
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.clients.edit')): ?>
                <button type="button" wire:click="abrirCambioDeEstado"
                        class="flex-none rounded-lg border px-3.5 py-2 text-[13px] font-semibold"
                        style="border-color:var(--danger-500); background:var(--surface-page); color:var(--danger-500);"
                        title="Reactiva <?php echo e($impacto['licencias']); ?> licencia(s) y <?php echo e($impacto['entornos']); ?> entorno(s)">
                    Dar de alta…
                </button>
            <?php endif; ?>
        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    
    <section class="rounded-xl border px-6 py-5"
             style="background:var(--surface-card); border-color:var(--border-subtle);">

        <div class="flex flex-wrap items-start justify-between gap-6">
            <div class="min-w-0">
                <div class="flex flex-wrap items-center gap-2.5">
                    <h1 style="font-family:'Plus Jakarta Sans',sans-serif; font-size:22px; font-weight:700; letter-spacing:-0.02em; color:var(--text-strong); margin:0;">
                        <?php echo e($client->name); ?>

                    </h1>
                    <span class="rounded px-2 py-0.5 font-mono text-[11.5px]"
                          style="color:var(--text-muted); background:var(--surface-sunken);">
                        <?php echo e($client->shortname); ?>

                    </span>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->actived): ?>
                        <span class="rounded-full px-2.5 py-0.5 text-[11.5px] font-semibold"
                              style="color:var(--success-500); background:var(--success-50);">
                            De alta
                        </span>
                    <?php else: ?>
                        <span class="rounded-full px-2.5 py-0.5 text-[11.5px] font-semibold"
                              style="color:var(--danger-500); background:var(--danger-50);">
                            De baja
                        </span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>

                
                <div class="mt-2 flex items-center">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $productos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indice => $producto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <div class="relative" style="z-index:<?php echo e(count($productos) - $indice); ?>; margin-left:<?php echo e($indice > 0 ? '-8px' : '0'); ?>;"
                             title="<?php echo e($producto->name); ?>">
                            <img src="<?php echo e($producto->image_url ?? asset('images/placeholder.png')); ?>"
                                 alt="<?php echo e($producto->name); ?>"
                                 class="h-8 w-8 rounded-full border-2 bg-white object-contain"
                                 style="border-color:var(--border-subtle);">
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <span class="text-[12px]" style="color:var(--text-subtle);">
                            Sin productos contratados
                        </span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
            </div>

            <div class="flex flex-none flex-wrap gap-2">
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.clients.edit')): ?>
                    <a href="<?php echo e(route('clients.edit', $client)); ?>" wire:navigate
                       class="rounded-lg border px-3.5 py-2 text-[13px] font-semibold"
                       style="border-color:var(--border-default); background:var(--surface-page); color:var(--text-body);">
                        Editar
                    </a>
                <?php endif; ?>

                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.environments.create')): ?>
                    <a href="<?php echo e(route('environments.create-from-client', $client)); ?>" wire:navigate
                       class="rounded-lg border px-3.5 py-2 text-[13px] font-semibold"
                       style="border-color:var(--border-default); background:var(--surface-page); color:var(--text-body);">
                        Nuevo entorno
                    </a>
                <?php endif; ?>

                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->actived): ?>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.clients.edit')): ?>
                        
                        <button type="button" wire:click="abrirCambioDeEstado"
                                class="rounded-lg border px-3.5 py-2 text-[13px] font-semibold"
                                style="border-color:var(--danger-500); background:var(--surface-page); color:var(--danger-500);"
                                title="Desactiva <?php echo e($impacto['licencias']); ?> licencia(s) y corta <?php echo e($impacto['entornos']); ?> entorno(s)">
                            Dar de baja…
                        </button>
                    <?php endif; ?>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        </div>

        
        <div class="mt-4 grid grid-cols-2 gap-5 border-t pt-4 md:grid-cols-3 lg:grid-cols-5"
             style="border-color:var(--divider);">
            <?php
                $campos = [
                    ['Razón social', $client->razon_social, 'Falta razón social', true],
                    ['CIF', $client->cif, 'Falta CIF', true],
                    ['Cliente desde', $client->fecha_inicio_relacion?->format('m/Y'), '—', false],
                    ['CRM', $client->crm_id, '—', false],
                ];
            ?>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $campos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$etiqueta, $valor, $vacio, $importante]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div>
                    <div class="text-[11px] font-semibold uppercase tracking-[0.06em]" style="color:var(--text-muted);">
                        <?php echo e($etiqueta); ?>

                    </div>
                    <div class="mt-[3px] text-[13px]"
                         style="color:<?php echo e($valor ? 'var(--text-body)' : ($importante ? 'var(--warning-500)' : 'var(--text-subtle)')); ?>;">
                        <?php echo e($valor ?: $vacio); ?>

                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

            <div>
                <div class="text-[11px] font-semibold uppercase tracking-[0.06em]" style="color:var(--text-muted);">
                    Jira
                </div>
                <div class="mt-[3px] text-[13px]">
                    
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->jira && preg_match('#^https?://#i', $client->jira)): ?>
                        <a href="<?php echo e($client->jira); ?>" target="_blank" rel="noopener"
                           class="font-semibold" style="color:var(--text-link);">
                            <?php echo e(\Illuminate\Support\Str::limit(preg_replace('#^https?://#', '', $client->jira), 24)); ?>

                        </a>
                    <?php else: ?>
                        <span style="color:var(--text-subtle);">—</span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
            </div>
        </div>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($client->observation): ?>
            <div class="mt-3 rounded-lg px-3.5 py-2.5 text-[12.5px]"
                 style="background:var(--surface-alt); color:var(--text-muted);">
                <strong class="font-semibold" style="color:var(--text-body);">Observaciones:</strong>
                <?php echo e($client->observation); ?>

            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </section>

    
    <div class="grid grid-cols-1 items-start gap-4 lg:grid-cols-[3fr_2fr]">

        
        <section class="overflow-hidden rounded-xl border"
                 style="background:var(--surface-card); border-color:var(--border-subtle);">
            <div class="flex items-baseline justify-between gap-4 px-5 pb-2.5 pt-3.5">
                <h2 style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong); margin:0;">
                    Licencias
                </h2>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.license-tokens.create')): ?>
                    <a href="<?php echo e(route('license_tokens.create')); ?>" wire:navigate
                       class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                        Nueva licencia
                    </a>
                <?php endif; ?>
            </div>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $client->tokens->sortByDesc('end_at'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $token): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <?php
                    $estadoToken = $token->estado();
                    $coloresToken = [
                        'activa' => ['var(--success-500)', 'var(--success-50)', 'Activa'],
                        'pronto' => ['var(--warning-500)', 'var(--warning-50)', 'Vence pronto'],
                        'vencida' => ['var(--danger-500)', 'var(--danger-50)', 'Vencida'],
                        'desactivada' => ['var(--neutral-600)', 'var(--surface-sunken)', 'Desactivada'],
                    ];
                    [$color, $fondo, $texto] = $coloresToken[$estadoToken];
                ?>

                <a href="<?php echo e(route('license_tokens.show', $token)); ?>" wire:navigate
                   class="cli-lic-grid items-center border-t px-5 py-2.5 text-[12.5px] transition-colors hover:bg-[var(--surface-alt)]"
                   style="border-color:var(--divider);">
                    
                    <span class="justify-self-start truncate rounded px-2 py-0.5 font-mono text-[11.5px]"
                          style="color:var(--text-body); background:var(--surface-sunken);">
                        <?php echo e($token->token_corto); ?>

                    </span>

                    <span>
                        <span class="rounded-full px-2.5 py-0.5 text-[11px] font-semibold"
                              style="color:<?php echo e($color); ?>; background:<?php echo e($fondo); ?>;">
                            <?php echo e($texto); ?>

                        </span>
                    </span>

                    <span class="truncate" style="color:var(--text-muted);">
                        <?php echo e($token->products->pluck('name')->implode(' · ') ?: 'Sin productos'); ?>

                    </span>

                    <span style="color:<?php echo e(in_array($estadoToken, ['pronto', 'vencida'], true) ? $color : 'var(--text-muted)'); ?>;
                                 font-weight:<?php echo e(in_array($estadoToken, ['pronto', 'vencida'], true) ? '600' : '400'); ?>;">
                        <?php echo e($token->end_at?->format('m/Y') ?? 'Sin fin'); ?>

                    </span>
                </a>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="mx-5 mb-4 rounded-lg border border-dashed p-4 text-center text-[12.5px]"
                     style="border-color:var(--border-default); color:var(--text-muted);">
                    Nunca ha tenido licencias.
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.license-tokens.create')): ?>
                        <a href="<?php echo e(route('license_tokens.create')); ?>" wire:navigate
                           class="font-semibold" style="color:var(--text-link);">Crear la primera</a>
                    <?php endif; ?>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </section>

        
        <section class="overflow-hidden rounded-xl border"
                 style="background:var(--surface-card); border-color:var(--border-subtle);">
            <div class="flex items-baseline justify-between gap-4 px-5 pb-2.5 pt-3.5">
                <h2 style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong); margin:0;">
                    Contactos
                </h2>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.clients.edit')): ?>
                    <a href="<?php echo e(route('clients.edit', $client)); ?>" wire:navigate
                       class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                        Añadir
                    </a>
                <?php endif; ?>
            </div>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $contactos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contacto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="flex items-center gap-3 border-t px-5 py-2.5" style="border-color:var(--divider);">
                    <div class="flex h-8 w-8 flex-none items-center justify-center rounded-full text-[11.5px] font-semibold"
                         style="background:var(--teal-100); color:var(--teal-700);">
                        <?php echo e($contacto['iniciales']); ?>

                    </div>
                    <div class="min-w-0 flex-1">
                        <div class="text-[13px] font-semibold" style="color:var(--text-strong);">
                            <?php echo e($contacto['nombre']); ?>

                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($contacto['cargo']): ?>
                                <span class="text-[12px] font-normal" style="color:var(--text-muted);">
                                    · <?php echo e($contacto['cargo']); ?>

                                </span>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </div>
                        <div class="mt-px truncate text-[12px]">
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($contacto['email']): ?>
                                <a href="mailto:<?php echo e($contacto['email']); ?>" style="color:var(--text-link);">
                                    <?php echo e($contacto['email']); ?>

                                </a>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($contacto['telefono']): ?>
                                <span style="color:var(--text-muted);">
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($contacto['email']): ?> · <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    <?php echo e($contacto['telefono']); ?>

                                </span>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(! $contacto['email'] && ! $contacto['telefono']): ?>
                                <span style="color:var(--text-subtle);">Sin correo ni teléfono</span>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="mx-5 mb-4 rounded-lg border border-dashed p-4 text-center text-[12.5px]"
                     style="border-color:var(--border-default); color:var(--text-muted);">
                    Sin contactos guardados.
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.clients.edit')): ?>
                        <a href="<?php echo e(route('clients.edit', $client)); ?>" wire:navigate
                           class="font-semibold" style="color:var(--text-link);">Añadir el primero</a>
                    <?php endif; ?>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </section>
    </div>

    
    <section class="overflow-hidden rounded-xl border"
             style="background:var(--surface-card); border-color:var(--border-subtle);">
        <div class="flex flex-wrap items-baseline justify-between gap-4 px-5 pb-2.5 pt-3.5">
            <div class="flex items-baseline gap-2.5">
                <h2 style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong); margin:0;">
                    Entornos
                </h2>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($resumenDeEntornos['total'] > 0): ?>
                    <span class="text-[12px]" style="color:var(--text-muted);">
                        <?php echo e($resumenDeEntornos['total']); ?>

                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($resumenDeEntornos['sinSenal'] > 0): ?>
                            · <span class="font-semibold" style="color:var(--danger-500);"><?php echo e($resumenDeEntornos['sinSenal']); ?> sin señal</span>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($resumenDeEntornos['sinSincronizar'] > 0): ?>
                            · <span class="font-semibold" style="color:var(--warning-500);"><?php echo e($resumenDeEntornos['sinSincronizar']); ?> sin sincronizar</span>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($resumenDeEntornos['sinSenal'] === 0 && $resumenDeEntornos['sinSincronizar'] === 0): ?>
                            · todos con señal
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </span>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
            <div class="flex gap-3.5">
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.environments.create')): ?>
                    <a href="<?php echo e(route('environments.create-from-client', $client)); ?>" wire:navigate
                       class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                        Crear entorno
                    </a>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.environments.index')): ?>
                    <a href="<?php echo e(route('environments.index')); ?>" wire:navigate
                       class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                        Ver en Entornos
                    </a>
                <?php endif; ?>
            </div>
        </div>

        <?php
            // La paleta la da el catálogo de usos: era la misma lista copiada en seis vistas.
            $coloresEnv = \App\Models\Environments\Env::colores();
        ?>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $entornos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $entorno): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <?php [$colorEnv, $fondoEnv] = $coloresEnv[$entorno['env']] ?? $coloresEnv['local']; ?>

            <a href="<?php echo e(route('environments.edit', $entorno['id'])); ?>" wire:navigate
               class="cli-env-grid items-center border-t px-5 py-2.5 text-[12.5px] transition-colors hover:bg-[var(--surface-alt)]"
               style="border-color:var(--divider);">
                <span class="truncate font-semibold" style="color:var(--text-strong);">
                    <?php echo e($entorno['dominio'] ?: $entorno['nombre']); ?>

                </span>

                <span class="justify-self-start rounded px-[7px] py-px text-[10.5px] font-semibold"
                      style="color:<?php echo e($colorEnv); ?>; background:<?php echo e($fondoEnv); ?>;">
                    <?php echo e($entorno['env']); ?>

                </span>

                <span class="truncate" style="color:var(--text-body);">
                    <?php echo e($entorno['tipo'] ? $entorno['tipo'] . ' ' : ''); ?><?php echo e($entorno['version'] ?? '—'); ?>

                </span>

                
                <span class="truncate">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($entorno['nunca']): ?>
                        <span class="font-semibold" style="color:var(--warning-500);">Nunca sincronizado</span>
                    <?php elseif($entorno['sinSenal']): ?>
                        <span class="font-semibold" style="color:var(--danger-500);">
                            Sin señal · hace <?php echo e($entorno['dias']); ?> día(s)
                        </span>
                    <?php else: ?>
                        <span style="color:var(--text-muted);">Sincronizado <?php echo e($entorno['fecha']); ?></span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </span>

                <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--text-subtle)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="hidden md:block"><path d="m9 18 6-6-6-6"/></svg>
            </a>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="mx-5 mb-4 rounded-lg border border-dashed p-4 text-center text-[12.5px]"
                 style="border-color:var(--border-default); color:var(--text-muted);">
                Sin entornos.
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.environments.create')): ?>
                    <a href="<?php echo e(route('environments.create-from-client', $client)); ?>" wire:navigate
                       class="font-semibold" style="color:var(--text-link);">Crear el primero para este cliente</a>
                <?php endif; ?>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </section>
</div><?php /**PATH /var/www/html/resources/views/livewire/clients/show.blade.php ENDPATH**/ ?>