<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>" class="dark">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo $__env->yieldContent('title', 'Admin Dashboard | Secure Vision'); ?></title>

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=inter:300,400,500,600,700|outfit:400,500,600,700,800&display=swap" rel="stylesheet" />

    <style>
        body { font-family: 'Inter', sans-serif; }
        h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; }
        [x-cloak] { display: none !important; }
    </style>

    <?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css', 'resources/js/app.js']); ?>
</head>
<body class="antialiased bg-slate-950 text-slate-300 selection:bg-blue-500 selection:text-white flex h-screen overflow-hidden" x-data="{ sidebarOpen: false }">

    <!-- Mobile Sidebar Backdrop -->
    <div x-cloak x-show="sidebarOpen" @click="sidebarOpen = false" class="fixed inset-0 z-40 bg-slate-900/80 backdrop-blur-sm lg:hidden"></div>

    <!-- Sidebar -->
    <aside :class="sidebarOpen ? 'translate-x-0' : '-translate-x-full'" class="fixed inset-y-0 left-0 z-50 w-72 bg-slate-900 border-r border-white/5 transition-transform duration-300 lg:translate-x-0 lg:static lg:w-72 flex flex-col">
        <!-- Sidebar Header -->
        <div class="h-20 flex items-center px-8 border-b border-white/5 shrink-0">
            <a href="<?php echo e(route('home')); ?>" class="flex items-center gap-3 group shrink-0">
                <div class="w-10 h-10 rounded-lg bg-linear-to-br from-blue-500 to-indigo-600 flex items-center justify-center text-white font-bold shadow-lg shadow-blue-500/20">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
                    </svg>
                </div>
                <span class="text-xl font-bold font-heading text-white tracking-tight">Secure<span class="text-blue-500">Vision</span></span>
            </a>
        </div>

        <!-- Sidebar Links -->
        <nav class="flex-1 overflow-y-auto py-6 px-4 space-y-1 custom-scrollbar">
            <p class="px-4 text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2">Principal</p>
            
            <a href="<?php echo e(route('admin.dashboard')); ?>" class="flex items-center gap-3 px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.dashboard') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" />
                </svg>
                <span class="font-medium text-sm">Dashboard</span>
            </a>

            <div class="pt-6 pb-2">
                <p class="px-4 text-xs font-semibold text-slate-500 uppercase tracking-wider">Gestão</p>
            </div>

            <a href="<?php echo e(route('admin.clients.index')); ?>" class="flex items-center gap-3 px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.clients.*') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <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>
                <span class="font-medium text-sm">Clientes</span>
            </a>

            <a href="<?php echo e(route('admin.installations.index')); ?>" class="flex items-center gap-3 px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.installations.*') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <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>
                <span class="font-medium text-sm">Instalações</span>
            </a>

            <a href="<?php echo e(route('admin.equipment.index')); ?>" class="flex items-center gap-3 px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.equipment.*') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" />
                </svg>
                <span class="font-medium text-sm">Eqp. & Câmeras</span>
            </a>

            <a href="<?php echo e(route('admin.contracts.index')); ?>" class="flex items-center gap-3 px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.contracts.*') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
                </svg>
                <span class="font-medium text-sm">Contratos</span>
            </a>

            <div class="pt-6 pb-2">
                <p class="px-4 text-xs font-semibold text-slate-500 uppercase tracking-wider">Operacional</p>
            </div>

            <a href="<?php echo e(route('admin.tickets.index')); ?>" class="flex items-center justify-between px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.tickets.*') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <div class="flex items-center gap-3">
                    <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" />
                    </svg>
                    <span class="font-medium text-sm">Suporte (Tickets)</span>
                </div>
                <span class="bg-blue-500 text-white text-xs font-bold px-2 py-0.5 rounded-full"><?php echo e(\App\Models\Ticket::whereIn('status', ['open', 'in_progress'])->count()); ?></span>
            </a>
            
            <a href="<?php echo e(route('admin.invoices.index')); ?>" class="flex items-center gap-3 px-4 py-3 rounded-xl <?php echo e(request()->routeIs('admin.invoices.*') ? 'bg-blue-600/10 text-blue-400' : 'text-slate-400 hover:bg-white/5 hover:text-white'); ?> transition-colors">
                <svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
                </svg>
                <span class="font-medium text-sm">Faturação</span>
            </a>
        </nav>

        <!-- User bottom section -->
        <div class="p-4 border-t border-white/5">
            <div class="flex items-center gap-3 px-4 py-3 rounded-xl bg-slate-950 border border-white/5">
                <div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white font-bold text-sm shrink-0">
                    <?php echo e(substr(Auth::user()->name ?? 'A', 0, 1)); ?>

                </div>
                <div class="min-w-0 flex-1">
                    <p class="text-sm font-medium text-white truncate"><?php echo e(Auth::user()->name ?? 'Admin User'); ?></p>
                    <p class="text-xs text-slate-400 truncate"><?php echo e(Auth::user()->role ?? 'Admin'); ?></p>
                </div>
                <form method="POST" action="<?php echo e(route('logout')); ?>" class="shrink-0">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded-lg transition-colors">
                        <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <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>

    <!-- Main Content Wrapper -->
    <div class="flex-1 flex flex-col min-w-0 bg-slate-950 relative">
        <!-- Floating Header -->
        <header class="h-20 px-6 lg:px-10 flex items-center justify-between z-30 relative shrink-0">
            <div class="flex items-center gap-4">
                <button @click="sidebarOpen = true" class="p-2 -ml-2 text-slate-400 hover:text-white lg:hidden">
                    <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
                    </svg>
                </button>
                <div>
                    <h2 class="text-2xl font-bold font-heading text-white"><?php echo $__env->yieldContent('header_title', 'Dashboard'); ?></h2>
                    <p class="text-sm text-slate-400 hidden sm:block"><?php echo $__env->yieldContent('header_subtitle', 'Visão geral do sistema e indicadores principais.'); ?></p>
                </div>
            </div>

            <div class="flex items-center gap-4">
                <!-- Notifications Bell -->
                <button class="relative p-2 text-slate-400 hover:text-white transition-colors">
                    <span class="absolute top-1.5 right-1.5 w-2.5 h-2.5 bg-blue-500 border-2 border-slate-950 rounded-full"></span>
                    <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <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>
                </button>
            </div>
        </header>

        <!-- Page Content -->
        <main class="flex-1 overflow-y-auto px-6 lg:px-10 pb-12 custom-scrollbar">
            <?php echo $__env->yieldContent('content'); ?>
        </main>
    </div>

    <!-- Extra global scripts/styles -->
    <style>
        .custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
        .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #475569; }
    </style>
</body>
</html>
<?php /**PATH C:\laragon\www\secure-vision-app\resources\views\layouts\admin.blade.php ENDPATH**/ ?>