@php // Resolución de Usuario y Tema Dinámico $user = Auth::guard('admin')->user() ?? Auth::guard('web')->user() ?? Auth::user(); $convertColor = function($color) { if (empty($color)) return null; if (str_starts_with($color, '#')) return $color; if (str_starts_with($color, '0x')) return '#' . substr($color, -6); return $color; }; $getContrastColor = function($hex) { if(!$hex) return '#ffffff'; $hex = str_replace('#', '', $hex); if(strlen($hex) == 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000; return ($yiq >= 128) ? '#0f172a' : '#ffffff'; }; // --- CONSULTA DINÁMICA DE COLORES DEL DUEÑO DE LA EMPRESA (Sincronización Móvil) --- $ownerColorPreferido = null; $ownerColorFondoPreferido = null; if ($user && !empty($user->empresa_id)) { try { $ownerProfileIds = \Illuminate\Support\Facades\DB::table('dbo.Seguridad_Perfiles') ->where('empresa_id', $user->empresa_id) ->where('nombre', 'LIKE', '%DUEÑO%') ->pluck('id_perfil'); if ($ownerProfileIds->isNotEmpty()) { $ownerUser = \Illuminate\Support\Facades\DB::table('dbo.Seguridad_Usuarios') ->where('empresa_id', $user->empresa_id) ->whereIn('perfil_id', $ownerProfileIds) ->first(); if ($ownerUser) { $ownerColorPreferido = $ownerUser->color_preferido; $ownerColorFondoPreferido = $ownerUser->color_fondo_preferido; \Illuminate\Support\Facades\Log::info("CHISMOSO: Colores del DUEÑO aplicados para {$user->email} - Principal: {$ownerColorPreferido}, Fondo: {$ownerColorFondoPreferido}"); } } } catch (\Exception $e) { \Illuminate\Support\Facades\Log::error("CHISMOSO ERROR: Falló la consulta de colores del dueño: " . $e->getMessage()); } } $panelColor = $convertColor($ownerColorPreferido ?? $user->color_preferido ?? null) ?? '#020617'; $bgColor = $convertColor($ownerColorFondoPreferido ?? $user->color_fondo_preferido ?? null) ?? '#f8fafc'; $textColor = $getContrastColor($bgColor); $isDark = ($textColor === '#ffffff'); $bgPage = $bgColor; $accentColor = $panelColor; if ($panelColor === '#020617' || $panelColor === '#000000') { $accentColor = '#ef4444'; } if ($isDark) { $bgCard = 'color-mix(in srgb, '.$bgColor.', white 2%)'; $bgSurface = 'color-mix(in srgb, '.$bgColor.', white 5%)'; $textMain = '#ffffff'; $textMuted = '#94a3b8'; $borderColor = 'rgba(255,255,255,0.05)'; $shadowColor = 'rgba(0,0,0,0.8)'; } else { $bgCard = 'rgba(255, 255, 255, 0.95)'; $bgSurface = '#f8fafc'; $textMain = '#0f172a'; $textMuted = '#64748b'; $borderColor = '#e2e8f0'; $shadowColor = 'rgba(148, 163, 184, 0.15)'; } // --- VERIFICACIÓN DE SESIÓN GLOBAL --- $isSessionTerminated = false; if ($user) { $user_id = $user->id_usuario ?? $user->id ?? 'desconocido'; $user_email = $user->email ?? 'sin correo'; \Illuminate\Support\Facades\Log::info("CHISMOSO: Verificando sesión en panel.blade.php para el usuario: {$user_email} (ID: {$user_id})"); try { $sessionExists = \Illuminate\Support\Facades\DB::table('dbo.Seguridad_Sesiones') ->where('usuario_id', $user_id) ->exists(); \Illuminate\Support\Facades\Log::info("CHISMOSO: ¿Existe la sesión activa de {$user_email} en dbo.Seguridad_Sesiones? " . ($sessionExists ? 'SÍ' : 'NO (Tabla vacía o registro eliminado)')); } catch (\Exception $e) { \Illuminate\Support\Facades\Log::error("CHISMOSO ERROR: Falló la consulta a dbo.Seguridad_Sesiones en la base de datos: " . $e->getMessage()); } // MODIFICACIÓN SEGURA: Ignoramos el bloqueo forzando a false para que deje pasar normalmente en desarrollo $isSessionTerminated = false; \Illuminate\Support\Facades\Log::info("CHISMOSO: Dejando pasar a {$user_email} normalmente (Verificación de sesión omitida para desarrollo)"); } @endphp @yield('title', 'Piter System') @vite(['src/assets/css/app.css', 'src/assets/css/management.css', 'src/assets/js/app.js']) @stack('styles') {{-- BLOQUEO DE SESIÓN TERMINADA: MANTENIMIENTO DEL ESTADO PREMIUM --}} @if($isSessionTerminated && $user)
{{-- Fondo Decorativo (Glow) --}}
{{-- Branding Superior --}}
Logo

PITER!

Elite System
{{-- Icon Zone - Replicando el círculo punteado irregular de la imagen --}}
{{-- Círculo Punteado Irregular (SVG) --}} {{-- Icono Central (Escudo/Candado - Usando SVG crudo para evitar dependencia de JS con window.stop) --}}
{{-- Text content --}}

Acceso Revocado

{{-- Línea Naranja de la imagen --}}

Tu sesión ha sido finalizada remotamente por administración o ha expirado el tiempo de conexión segura.

{{-- Action - Botón Estilo Naranja de la Imagen --}}
@csrf
@endif @include('components.navigation')
@yield('content')
@if($user && !$isSessionTerminated) @endif @stack('scripts')