<?php $__env->startPush('styles'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('css/tresipunt-dashboard.css')); ?>">
<?php $__env->stopPush(); ?>

<div class="dash">

    
    <div style="display:flex; align-items:flex-end; justify-content:space-between; gap:24px; flex-wrap:wrap;">
        <div>
            <div class="dash__eyebrow"><?php echo e(ucfirst(now()->translatedFormat('l, j \d\e F'))); ?></div>
            <h1 class="dash__title"><?php echo e($bienvenida['saludo']); ?></h1>
            <div class="dash__lead"><?php echo e($bienvenida['resumen']); ?></div>
        </div>
    </div>

    
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if (! ($puede['environments'] && $puede['apiLogs'])): ?>
        <div class="dash-note">
            <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="flex:none;"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>
            Estás viendo la parte que te corresponde según tu rol. El estado del parque y la actividad de la API requieren permisos de administración.
        </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($kpis): ?>
        <div class="dash-kpis" style="--dash-kpi-cols:<?php echo e(count($kpis)); ?>;">
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $kpis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kpi): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <a href="<?php echo e($kpi['url']); ?>" wire:navigate class="dash-kpi">
                    <span class="dash-kpi__label"><?php echo e($kpi['label']); ?></span>
                    <span class="dash-kpi__line">
                        <strong class="dash-kpi__value"><?php echo e(number_format($kpi['valor'], 0, ',', '.')); ?></strong>
                        <span class="dash-kpi__detail">
                            <?php echo e($kpi['detalle']); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($kpi['alerta']): ?> · <span class="dash-kpi__alert"><?php echo e($kpi['alerta']); ?></span><?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </span>
                    </span>
                </a>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    
    <section class="dash-card" x-data="{ abierto: false }">

        <div class="dash-card__head" style="cursor:pointer; align-items:center;"
             @click="abierto = !abierto" role="button" tabindex="0"
             @keydown.enter="abierto = !abierto" @keydown.space.prevent="abierto = !abierto"
             :aria-expanded="abierto ? 'true' : 'false'">

            <div style="display:flex; align-items:center; gap:12px; flex-wrap:wrap; min-width:0;">
                <h2 class="dash-card__title">Requiere tu atención</h2>

                
                
                <div x-show="!abierto" class="dash-att__sums">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($hayAtencion): ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($atencionPorNivel['crit'] > 0): ?>
                            <span class="dash-att__sum" style="color:var(--danger-500);">
                                <svg viewBox="0 0 14 14" width="11" height="11"><path d="M7 1.5 13 12H1Z" fill="var(--danger-500)"/></svg>
                                <?php echo e($atencionPorNivel['crit']); ?> <?php echo e($atencionPorNivel['crit'] === 1 ? 'crítico' : 'críticos'); ?>

                            </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($atencionPorNivel['warn'] > 0): ?>
                            <span class="dash-att__sum" style="color:var(--warning-500);">
                                <svg viewBox="0 0 14 14" width="11" height="11"><rect x="3" y="3" width="8" height="8" rx="1.5" transform="rotate(45 7 7)" fill="var(--warning-500)"/></svg>
                                <?php echo e($atencionPorNivel['warn']); ?> <?php echo e($atencionPorNivel['warn'] === 1 ? 'aviso' : 'avisos'); ?>

                            </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($atencionPorNivel['info'] > 0): ?>
                            <span class="dash-att__sum" style="color:var(--info-500);">
                                <svg viewBox="0 0 14 14" width="11" height="11"><circle cx="7" cy="7" r="5" fill="none" stroke="var(--info-500)" stroke-width="2"/></svg>
                                <?php echo e($atencionPorNivel['info']); ?> <?php echo e($atencionPorNivel['info'] === 1 ? 'informativo' : 'informativos'); ?>

                            </span>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <?php else: ?>
                        <span class="dash-att__sum" style="color:var(--success-500);">
                            <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--success-500)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>
                            Todo en orden
                        </span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
            </div>

            <span style="display:flex; align-items:center; gap:8px; flex:none;">
                <span x-show="!abierto" style="font-size:12px; color:var(--text-muted);">
                    <?php echo e($hayAtencion ? 'Ver detalle' : 'Ver'); ?>

                </span>
                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--text-subtle)"
                     stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                     :style="abierto ? 'transform:rotate(180deg); transition:transform .15s' : 'transition:transform .15s'">
                    <path d="m6 9 6 6 6-6"/>
                </svg>
            </span>
        </div>

        <div x-show="abierto" x-cloak>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($hayAtencion): ?>
                
                <div style="display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px;">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = ['all' => 'Todos', 'crit' => 'Críticos', 'warn' => 'Avisos', 'info' => 'Informativos']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $clave => $etiqueta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php $activa = $attentionFilter === $clave; ?>
                        <button type="button" wire:click="setAttentionFilter('<?php echo e($clave); ?>')"
                                class="dash-pill <?php echo e($activa ? '' : 'dash-pill--muted'); ?>"
                                style="display:inline-flex; align-items:center; gap:6px; border:none; cursor:pointer;
                                       font-size:11.5px; padding:3px 4px 3px 10px; white-space:nowrap;
                                       <?php echo e($activa ? 'background:var(--neutral-800); color:#fff;' : ''); ?>">
                            <?php echo e($etiqueta); ?>

                            <span style="display:inline-flex; min-width:18px; justify-content:center;
                                         border-radius:999px; padding:0 5px; font-size:10.5px; font-weight:700;
                                         <?php echo e($activa
                                            ? 'background:rgb(255 255 255 / 22%); color:#fff;'
                                            : 'background:var(--surface-card); color:var(--text-muted);'); ?>">
                                <?php echo e($atencionPorNivel[$clave]); ?>

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

        
        <div class="dash-att__list">

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $atencion; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div class="dash-att">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item['level'] === 'crit'): ?>
                    <svg class="dash-att__mark" viewBox="0 0 14 14"><path d="M7 1.5 13 12H1Z" fill="var(--danger-500)"/></svg>
                <?php elseif($item['level'] === 'warn'): ?>
                    <svg class="dash-att__mark" viewBox="0 0 14 14"><rect x="3" y="3" width="8" height="8" rx="1.5" transform="rotate(45 7 7)" fill="var(--warning-500)"/></svg>
                <?php else: ?>
                    <svg class="dash-att__mark" viewBox="0 0 14 14"><circle cx="7" cy="7" r="5" fill="none" stroke="var(--info-500)" stroke-width="2"/></svg>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                <div class="dash-att__text">
                    <div><strong><?php echo e($item['subject']); ?></strong> <?php echo e($item['rest']); ?></div>
                    <div class="dash-att__meta"><?php echo e($item['meta']); ?></div>
                </div>

                <a href="<?php echo e($item['url']); ?>" wire:navigate class="dash-att__cta">
                    <?php echo e($item['cta']); ?>

                    <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="m9 18 6-6-6-6"/></svg>
                </a>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($hayAtencion): ?>
                
                <div class="dash-empty" style="margin-top:0;">
                    Ninguna incidencia de esta categoría.
                </div>
            <?php else: ?>
                <div class="dash-ok">
                    <div class="dash-ok__icon">
                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="var(--success-500)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m22 4-10 10.01-3-3"/></svg>
                    </div>
                    <div>
                        <div style="font-size:14px; font-weight:600; color:var(--text-strong);">Todo en orden</div>
                        <div style="font-size:12.5px; color:var(--text-muted); margin-top:2px;">
                            Sin incidencias activas. Comprobado hace menos de un minuto.
                        </div>
                    </div>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        </div>

        </div>
    </section>

    
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($puede['environments']): ?>
        <section class="dash-card" style="padding:14px 20px 16px;">
            <div style="display:flex; align-items:center; gap:16px; flex-wrap:wrap;">
                <h2 class="dash-card__title" style="flex:none;">Comprobar un dominio</h2>
                <div class="dash-search">
                    <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="var(--text-subtle)" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" style="flex:none;"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
                    <input type="text" wire:model.live.debounce.400ms="domainQuery"
                           placeholder="Pega la URL de un cliente o su nombre — p. ej. moodle51">
                </div>
            </div>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($dominio && $dominio['encontrado']): ?>
                <div class="dash-facts">
                    <div>
                        <div class="dash-label">Entorno</div>
                        <div style="font-size:13.5px; margin-top:2px;">
                            <strong style="font-weight:600; color:var(--text-strong);"><?php echo e($dominio['dominio']); ?></strong>
                            · <?php echo e($dominio['cliente']); ?>

                        </div>
                    </div>
                    <div>
                        <div class="dash-label">Licencia</div>
                        <div style="margin-top:3px;">
                            <span class="dash-pill <?php echo e($dominio['licenciaOk'] ? 'dash-pill--ok' : 'dash-pill--bad'); ?>">
                                <?php echo e($dominio['licencia']); ?>

                            </span>
                        </div>
                    </div>
                    <div>
                        <div class="dash-label">Versión</div>
                        <div style="font-size:13px; margin-top:2px;"><?php echo e($dominio['version']); ?></div>
                    </div>
                    <div>
                        <div class="dash-label">Última señal</div>
                        <div style="font-size:13px; margin-top:2px;"><?php echo e($dominio['sync']); ?></div>
                    </div>
                    <div style="flex:1; display:flex; gap:16px; justify-content:flex-end;">
                        <a href="<?php echo e($dominio['url']); ?>" wire:navigate style="font-size:13px; font-weight:600;">Ver entorno</a>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($puede['apiLogs']): ?>
                            <a href="<?php echo e($dominio['urlLogs']); ?>" wire:navigate style="font-size:13px; font-weight:600;">Logs</a>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>
                </div>
            <?php elseif($dominio): ?>
                <div style="margin-top:10px; font-size:13px; color:var(--text-muted);">
                    Ningún entorno coincide. Comprueba el dominio o
                    <a href="<?php echo e(route('environments.index')); ?>" wire:navigate style="font-weight:600;">busca en Entornos</a>.
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </section>
    <?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($parque || $actividad): ?>
        <div class="dash-grid-2">

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($parque): ?>
                <section class="dash-card" style="padding:14px 20px 16px;">
                    <div style="display:flex; align-items:baseline; justify-content:space-between; margin-bottom:16px;">
                        <h2 class="dash-card__title">Estado del parque</h2>
                        <a href="<?php echo e(route('environments.index')); ?>" wire:navigate style="font-size:12.5px; font-weight:600;">Ver entornos</a>
                    </div>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($parque['versiones']): ?>
                        <div style="display:flex; flex-direction:column; gap:10px;">
                            <div class="dash-label">Entornos por versión de Moodle</div>

                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $parque['versiones']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $version): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                
                                <div class="dash-bar-row">
                                    <span style="font-size:13px; <?php echo e(($version['conocida'] ?? true) ? '' : 'color:var(--text-muted); font-style:italic;'); ?>"
                                          <?php if (! ($version['conocida'] ?? true)): ?> title="Entornos cuyo Moodle no ha sincronizado con el Manager actual: no sabemos su release, solo el versiondb que dejó el Manager antiguo" <?php endif; ?>><?php echo e($version['nombre']); ?></span>
                                    <div class="dash-bar">
                                        <div class="dash-bar__fill" style="width:<?php echo e($version['pct']); ?>%"></div>
                                    </div>
                                    <span class="dash-bar-row__n"><?php echo e($version['n']); ?></span>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                            <div style="display:flex; gap:24px; flex-wrap:wrap; margin-top:10px; padding-top:14px; border-top:1px solid var(--divider); font-size:13px;">
                                <div>
                                    <strong style="font-weight:700; color:var(--text-strong);"><?php echo e($parque['conSoporte']); ?> de <?php echo e($parque['total']); ?></strong>
                                    con soporte en vigor
                                    
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($parque['flagSinContrato'] > 0): ?>
                                        <span style="color:var(--text-muted);">
                                            · <?php echo e($parque['flagSinContrato']); ?> marcado<?php echo e($parque['flagSinContrato'] === 1 ? '' : 's'); ?> sin contrato
                                            <a href="<?php echo e(route('environments.index')); ?>" wire:navigate style="font-weight:600;">revisar</a>
                                        </span>
                                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                </div>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($parque['sinLicencia'] > 0): ?>
                                    <div>
                                        <strong style="font-weight:700; color:var(--danger-500);"><?php echo e($parque['sinLicencia']); ?></strong>
                                        sin licencia asignada ·
                                        <a href="<?php echo e(route('environments.index')); ?>" wire:navigate style="font-weight:600;">revisar</a>
                                    </div>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </div>
                        </div>
                    <?php else: ?>
                        <div class="dash-empty" style="margin:0;">
                            Sin datos todavía. Crea tu primer entorno para ver aquí el estado del parque.
                        </div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </section>
            <?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($actividad): ?>
                <section class="dash-card" style="padding:14px 20px 16px;">
                    <div style="display:flex; align-items:baseline; justify-content:space-between; margin-bottom:16px;">
                        <h2 class="dash-card__title">Actividad</h2>
                        <span style="font-size:11.5px; color:var(--text-subtle);">últimos 7 días</span>
                    </div>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($actividad['disponible']): ?>
                        <div style="display:flex; flex-direction:column; gap:18px;">
                            <div class="dash-metric">
                                <div>
                                    <div style="font-size:12px; color:var(--text-muted);">Peticiones hoy</div>
                                    <div style="display:flex; align-items:baseline; gap:8px;">
                                        <span class="dash-metric__value"><?php echo e(number_format($actividad['hoy'], 0, ',', '.')); ?></span>
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($actividad['variacion'] !== null): ?>
                                            <span class="dash-metric__delta <?php echo e($actividad['variacion'] >= 0 ? 'dash-metric__delta--up' : 'dash-metric__delta--flat'); ?>">
                                                <?php echo e($actividad['variacion'] >= 0 ? '+' : ''); ?><?php echo e($actividad['variacion']); ?>% vs ayer
                                            </span>
                                        <?php else: ?>
                                            <span class="dash-metric__delta dash-metric__delta--flat">sin referencia de ayer</span>
                                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    </div>
                                </div>

                                
                                <?php
                                    $puntosDe = function (array $valores): string {
                                        $tope = max(0.0001, max($valores));

                                        return collect($valores)
                                            ->map(fn ($v, $i) => (2 + $i * 17.6) . ',' . (30 - ($v / $tope) * 24))
                                            ->implode(' ');
                                    };
                                    $puntos = $puntosDe($actividad['serie']);
                                ?>
                                <svg width="110" height="34" viewBox="0 0 110 34" style="flex:none;">
                                    <polyline points="<?php echo e($puntos); ?>" fill="none" stroke="var(--teal-500)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                                </svg>
                            </div>

                            <div class="dash-metric" style="padding-top:16px; border-top:1px solid var(--divider);">
                                <div>
                                    <div style="font-size:12px; color:var(--text-muted);">Errores hoy</div>
                                    <div style="display:flex; align-items:baseline; gap:8px;">
                                        <span class="dash-metric__value"><?php echo e(number_format($actividad['errorPctHoy'], 1, ',', '.')); ?>%</span>
                                        <span class="dash-metric__delta <?php echo e($actividad['errorPctHoy'] > $actividad['errorPctAyer'] ? 'dash-metric__delta--warn' : 'dash-metric__delta--flat'); ?>">
                                            ayer <?php echo e(number_format($actividad['errorPctAyer'], 1, ',', '.')); ?>%
                                        </span>
                                    </div>
                                </div>

                                
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(max($actividad['serieError']) > 0): ?>
                                    <svg width="110" height="34" viewBox="0 0 110 34" style="flex:none;"
                                         role="img" aria-label="Porcentaje de error de los últimos 7 días">
                                        <polyline points="<?php echo e($puntosDe($actividad['serieError'])); ?>" fill="none"
                                                  stroke="var(--warning-500)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                                    </svg>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </div>
                        </div>
                    <?php else: ?>
                        
                        <div style="font-size:14px; font-weight:600; color:var(--text-muted);">No disponible</div>
                        <div style="font-size:11.5px; color:var(--text-subtle); margin-top:2px;">
                            Sin peticiones registradas ni hoy ni ayer: no hay nada que comparar.
                        </div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </section>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        </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($contenido): ?>
        <section class="dash-card">
            <div class="dash-card__head">
                <h2 class="dash-card__title">Contenido publicado</h2>
                <a href="<?php echo e(route('products.index')); ?>" wire:navigate style="font-size:12.5px; font-weight:600;">Ver productos</a>
            </div>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(count($contenido) > 0): ?>
                <div class="dash-table-head">
                    <span>Producto</span>
                    <span>Última versión</span>
                    <span>Publicada</span>
                    <span>Alcance real</span>
                </div>

                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $contenido; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $producto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="dash-table-row">
                        <a href="<?php echo e($producto['url']); ?>" wire:navigate style="color:var(--text-strong); font-weight:600;"><?php echo e($producto['nombre']); ?></a>
                        <span><?php echo e($producto['version']); ?></span>
                        <span style="color:var(--text-muted); font-size:12.5px;"><?php echo e($producto['fecha']); ?></span>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($producto['publicado']): ?>
                            
                            <span style="font-size:12.5px; color:var(--text-subtle);">Pendiente de calcular</span>
                        <?php else: ?>
                            <span class="dash-pill dash-pill--muted" style="justify-self:start;">Sin versiones</span>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <?php else: ?>
                <div class="dash-empty">Ningún producto todavía.</div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </section>
    <?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($masGrandes): ?>
        <section>
            <h2 style="font-family:'Plus Jakarta Sans',sans-serif; font-size:14px; font-weight:700; color:var(--text-strong); margin:0 0 12px;">
                Los sitios más grandes
            </h2>

            
            <div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px;">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $masGrandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lista): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div style="background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:12px; overflow:hidden;">
                        <div style="display:flex; align-items:center; gap:9px; padding:12px 18px 9px;">
                            
                            <span style="color:var(--orange-500); display:flex;">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                     stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $lista['icono']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trazo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <path d="<?php echo e($trazo); ?>" />
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                </svg>
                            </span>
                            <span style="font-size:11px; font-weight:600; letter-spacing:0.07em; text-transform:uppercase; color:var(--text-muted);">
                                <?php echo e($lista['titulo']); ?>

                            </span>
                        </div>

                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $lista['filas']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $fila): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div style="display:flex; align-items:center; gap:10px; padding:6px 18px; border-top:1px solid var(--divider); font-size:12.5px;">
                                <span style="flex:none; width:16px; font-size:11px; color:var(--text-subtle);"><?php echo e($i + 1); ?></span>

                                <a href="<?php echo e($fila['url']); ?>" wire:navigate
                                   title="<?php echo e($fila['nombre']); ?><?php echo e($fila['cliente'] ? ' · ' . $fila['cliente'] : ''); ?>"
                                   style="flex:1; min-width:0; font-weight:400; color:var(--text-body); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
                                    <?php echo e($fila['dominio']); ?>

                                </a>

                                <span style="flex:none; font-family:monospace; font-size:12px; font-weight:700; color:var(--text-strong);">
                                    <?php echo e(number_format($fila['cuantos'], 0, ',', '.')); ?>

                                </span>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            
                            <div style="padding:10px 18px 14px; border-top:1px solid var(--divider); font-size:12.5px; color:var(--text-muted);">
                                Ningún sitio ha enviado <?php echo e($lista['unidad']); ?> todavía.
                            </div>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        </section>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    
    <section>
        <h2 style="font-size:14px; font-weight:700; margin:0 0 12px;">Accesos rápidos</h2>
        <div class="dash-grid-3">
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.environments.create')): ?>
                <a href="<?php echo e(route('environments.create')); ?>" wire:navigate class="dash-quick">
                    <span class="dash-quick__icon"><?php if (isset($component)) { $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-icon','data' => ['name' => 'server-04','size' => 20,'tint' => 'orange']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-icon'); ?>
<?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(['name' => 'server-04','size' => 20,'tint' => 'orange']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $attributes = $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $component = $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?></span>
                    Nuevo entorno
                </a>
            <?php endif; ?>

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.clients.create')): ?>
                <a href="<?php echo e(route('clients.create')); ?>" wire:navigate class="dash-quick">
                    <span class="dash-quick__icon"><?php if (isset($component)) { $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-icon','data' => ['name' => 'building-07','size' => 20,'tint' => 'orange']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-icon'); ?>
<?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(['name' => 'building-07','size' => 20,'tint' => 'orange']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $attributes = $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $component = $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?></span>
                    Nuevo cliente
                </a>
            <?php endif; ?>

            <?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="dash-quick">
                    <span class="dash-quick__icon"><?php if (isset($component)) { $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-icon','data' => ['name' => 'check-done-02','size' => 20,'tint' => 'orange']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-icon'); ?>
<?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(['name' => 'check-done-02','size' => 20,'tint' => 'orange']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $attributes = $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $component = $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?></span>
                    Nuevo token
                </a>
            <?php endif; ?>
        </div>
    </section>

</div><?php /**PATH /var/www/html/resources/views/livewire/dashboard/index.blade.php ENDPATH**/ ?>