<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo e(config('app.name', 'YBER')); ?></title>
    <?php $faviconDb = \App\Models\ConfiguracionPlataforma::first()?->favicon_path; ?>
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($faviconDb && file_exists(public_path($faviconDb))): ?>
        <link rel="icon" href="<?php echo e(asset($faviconDb)); ?>">
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    <?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css', 'resources/js/app.js']); ?>
    <link rel="stylesheet" href="<?php echo e(asset('css/yber-enterprise.css')); ?>">

    <style>
        /* Override visibilidad de secciones del sidebar */
        .yber-sidebar-section {
            font-size: 11px !important;
            text-transform: uppercase;
            color: #cbd5e1 !important;
            font-weight: 700 !important;
            letter-spacing: 0.1em !important;
            padding: 16px 16px 6px !important;
        }
    </style>
</head>
<body>
    <div x-data="{ sidebarOpen: false }">

        
        <aside class="yber-sidebar" style="overflow-y: auto; max-height: 100vh;" :class="{ 'open': sidebarOpen }" @click.away="sidebarOpen = false">
            
            <div class="yber-sidebar-logo">
                <?php
                    $configDb = \App\Models\ConfiguracionPlataforma::first();
                    $sidebarLogo = null;
                    if ($configDb && $configDb->logo_path && file_exists(public_path($configDb->logo_path))) {
                        $sidebarLogo = asset($configDb->logo_path);
                    }
                    if (!$sidebarLogo) {
                        foreach (["images/branding/logo.png", "images/branding/logo.svg", "images/login/logo.png"] as $p) {
                            if (file_exists(public_path($p))) { $sidebarLogo = asset($p); break; }
                        }
                    }
                ?>
                <a href="<?php echo e(route('dashboard')); ?>" wire:navigate class="flex items-center gap-3">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($sidebarLogo): ?>
                        <img src="<?php echo e($sidebarLogo); ?>" alt="<?php echo e(config('app.name')); ?>" style="height: 38px; width: auto; max-width: 180px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9;">
                    <?php else: ?>
                        <div style="width: 38px; height: 38px; background: linear-gradient(135deg, #4f46e5, #6366f1); border-radius: 8px; display: flex;align-items: center; justify-content: center;">
                            <svg style="width: 18px; height: 18px; color: white;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"/>
                            </svg>
                        </div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                </a>
            </div>

            
            <div class="yber-sidebar-section">Principal</div>

            <a href="<?php echo e(route('dashboard')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"/></svg>
                Dashboard
            </a>

                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('clientes.index')): ?>
            <a href="<?php echo e(route('clientes.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('clientes.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg>
                Entidades
            </a>
            <?php endif; ?>

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('deudores.index')): ?>
            <a href="<?php echo e(route('deudores.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('deudores.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
                Deudores
            </a>
            <?php endif; ?>

            
            <div class="yber-sidebar-section">Gestión</div>

            
            <div x-data="{
                gestionOpen: <?php echo e((request()->routeIs('casos-prejuridicos.*') || request()->routeIs('procesos.*')) ? 'true' : 'false'); ?>

            }">
                <button type="button" @click="gestionOpen = !gestionOpen"
                    class="yber-nav-item w-full flex items-center justify-between"
                    :class="{ 'active': gestionOpen }">
                    <span class="flex items-center">
                        <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/></svg>
                        Gestión
                    </span>
                    <svg class="h-4 w-4 transition-transform" :class="gestionOpen ? 'rotate-180' : ''" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
                    </svg>
                </button>

                <div x-show="gestionOpen" x-cloak class="ml-3 mt-1 border-l border-gray-700 pl-2">
                    <a href="<?php echo e(route('casos-prejuridicos.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('casos-prejuridicos.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
                Gestión Prejurídica
            </a>

                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('procesos.index')): ?>
                    <a href="<?php echo e(route('procesos.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('procesos.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"/></svg>
                Proceso Jurídico
            </a>
                    <?php endif; ?>
                </div>
            </div>
            

            <a href="<?php echo e(route('alertas.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('alertas.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/></svg>
                Alertas
            </a>

            <a href="<?php echo e(route('calendario.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('calendario.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
                Calendario
            </a>

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('importar.index')): ?>
            <a href="<?php echo e(route('importar.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('importar.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"/></svg>
                Importar
            </a>
            <?php endif; ?>

            
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if (\Illuminate\Support\Facades\Blade::check('role', 'admin')): ?>
            <div class="yber-sidebar-section">Administración</div>

            <a href="<?php echo e(route('usuarios.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('usuarios.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/></svg>
                Usuarios
            </a>

            <a href="<?php echo e(route('auditoria.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('auditoria.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/></svg>
                Auditoría
            </a>

            <a href="<?php echo e(route('configuracion.index')); ?>" wire:navigate
                class="yber-nav-item <?php echo e(request()->routeIs('configuracion.*') ? 'active' : ''); ?>">
                <svg class="nav-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.072 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
                Configuración
            </a>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

            
            <div class="yber-sidebar-user">
                <div class="yber-avatar">
                    <?php echo e(strtoupper(substr(auth()->user()->name, 0, 1))); ?>

                </div>
                <div style="flex: 1; min-width: 0;">
                    <div class="user-name" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><?php echo e(auth()->user()->name); ?></div>
                    <div class="user-role"><?php echo e(auth()->user()->roles->first()?->name ?? 'Usuario'); ?></div>
                </div>
                <div style="display: flex; flex-direction: column; gap: 4px;">
                    <a href="<?php echo e(route('profile')); ?>" wire:navigate style="color: #64748b; transition: color 0.2s;" onmouseover="this.style.color='#e2e8f0'" onmouseout="this.style.color='#64748b'">
                        <svg style="width: 16px; height: 16px;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
                    </a>
                    <form method="POST" action="/logout" style="display: inline;">
                        <?php echo csrf_field(); ?>
                        <button type="submit" style="background: none; border: none; color: #64748b; cursor: pointer; padding: 0; transition: color 0.2s;" onmouseover="this.style.color='#ef4444'" onmouseout="this.style.color='#64748b'">
                            <svg style="width: 16px; height: 16px;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/></svg>
                        </button>
                    </form>
                </div>
            </div>
        </aside>

        
        <div class="yber-main">
            
            <header class="yber-topbar">
                <div style="display: flex; align-items: center; gap: 12px;">
                    
                    <button @click="sidebarOpen = !sidebarOpen" class="sm:hidden" style="background: none; border: none; color: #64748b; cursor: pointer;">
                        <svg style="width: 24px; height: 24px;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
                    </button>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(isset($header)): ?>
                        <?php echo e($header); ?>

                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div class="yber-topbar-right">
                    <?php
$__split = function ($name, $params = []) {
    return [$name, $params];
};
[$__name, $__params] = $__split('notifications.notification-bell', []);

$key = null;

$key ??= \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::generateKey('lw-2076773633-0', null);

$__html = app('livewire')->mount($__name, $__params, $key);

echo $__html;

unset($__html);
unset($__name);
unset($__params);
unset($__split);
if (isset($__slots)) unset($__slots);
?>
                    <span style="font-size: 12px; color: #94a3b8;"><?php echo e(now()->translatedFormat('D, d M Y')); ?></span>
                </div>
            </header>

            
            <main class="yber-content">
                <?php echo e($slot); ?>

            </main>
        </div>

        
        <div x-show="sidebarOpen" @click="sidebarOpen = false"
            style="position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 35;"
            x-transition:enter="transition ease-out duration-200"
            x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100"
            x-transition:leave="transition ease-in duration-150"
            x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"
            class="sm:hidden">
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.2/dist/chart.umd.min.js"></script>
    <?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH /home/evolucionamos/public_html/yber-dev/resources/views/layouts/app.blade.php ENDPATH**/ ?>