<!doctype html>
<html lang="en">
<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 $__env->yieldContent('title', 'CRM'); ?></title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo e(asset('css/portal-theme.css')); ?>" rel="stylesheet">
    <?php echo $__env->yieldPushContent('styles'); ?>
</head>
<body class="portal-body <?php if(auth()->guard()->check()): ?> portal-body-app <?php endif; ?>">
<?php if(auth()->guard()->guest()): ?>
    <main class="container portal-main portal-main-guest">
        <?php if(session('success')): ?>
            <div class="alert alert-success portal-alert-success mt-3"><?php echo e(session('success')); ?></div>
        <?php endif; ?>
        <?php if($errors->any()): ?>
            <div class="alert alert-danger portal-alert-danger mt-3">
                <strong>Please fix the following:</strong>
                <ul class="mb-0 mt-2">
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>
        <?php echo $__env->yieldContent('content'); ?>
    </main>
<?php endif; ?>

<?php if(auth()->guard()->check()): ?>
<div class="portal-app">
    <div class="portal-sidebar-backdrop" id="portalSidebarBackdrop" aria-hidden="true"></div>

    <?php echo $__env->make('layouts.partials.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <div class="portal-main-wrap">
        <?php echo $__env->make('layouts.partials.topbar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        <main class="portal-content">
            <?php if(session('success')): ?>
                <div class="alert alert-success portal-alert-success"><?php echo e(session('success')); ?></div>
            <?php endif; ?>

            <?php if(session('warning')): ?>
                <div class="alert alert-warning border-0 rounded-3"><?php echo e(session('warning')); ?></div>
            <?php endif; ?>

            <?php if($errors->any()): ?>
                <div class="alert alert-danger portal-alert-danger">
                    <strong>Please fix the following:</strong>
                    <ul class="mb-0 mt-2">
                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li><?php echo e($error); ?></li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                </div>
            <?php endif; ?>

            <?php echo $__env->yieldContent('content'); ?>
        </main>
    </div>
</div>
<?php endif; ?>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<?php if(auth()->guard()->check()): ?>
<script>
(function () {
    var sidebar = document.getElementById('portalSidebar');
    var backdrop = document.getElementById('portalSidebarBackdrop');
    var openBtn = document.getElementById('portalSidebarOpen');
    var closeBtn = document.getElementById('portalSidebarClose');

    function openSidebar() {
        document.body.classList.add('portal-sidebar-open');
    }
    function closeSidebar() {
        document.body.classList.remove('portal-sidebar-open');
    }

    if (openBtn) openBtn.addEventListener('click', openSidebar);
    if (closeBtn) closeBtn.addEventListener('click', closeSidebar);
    if (backdrop) backdrop.addEventListener('click', closeSidebar);

    if (sidebar) {
        sidebar.querySelectorAll('.portal-sidebar-link, .portal-sidebar-sublink').forEach(function (link) {
            link.addEventListener('click', function () {
                if (window.innerWidth < 992) closeSidebar();
            });
        });
    }
})();
</script>
<?php endif; ?>
<?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH D:\laragon\www\lt\resources\views/layouts/app.blade.php ENDPATH**/ ?>