<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>SIM SKRIPSI FH UNCEN | <?php echo $__env->yieldContent('title'); ?></title>

    <!-- Google Fonts: Inter -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <!-- Font Awesome 6 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap5.min.css">
    <!-- Select2 -->
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <link href="https://cdn.jsdelivr.net/npm/@ttskch/select2-bootstrap4-theme@x.x.x/dist/select2-bootstrap4.min.css" rel="stylesheet" />
    
    <link rel="icon" type="image/png" href="<?php echo e(asset('logo_uncen.png')); ?>">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-hover: #4338ca;
            --secondary: #64748b;
            --sidebar-bg: #0f172a;
            --sidebar-text: #94a3b8;
            --sidebar-hover: rgba(255,255,255,0.05);
            --content-bg: #f8fafc;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --card-bg: #ffffff;
            --card-border: #f1f5f9;
            --table-header: #f8fafc;
            --table-border: #e2e8f0;
            --navbar-bg: rgba(255,255,255,0.8);
            --navbar-border: #e2e8f0;
            --card-radius: 16px;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
        }

        .dark-mode {
            --sidebar-bg: #020617;
            --content-bg: #0f172a;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --card-bg: #1e293b;
            --card-border: #334155;
            --table-header: #334155;
            --table-border: #475569;
            --navbar-bg: rgba(30,41,59,0.8);
            --navbar-border: #334155;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--content-bg);
            color: var(--text-main);
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        .wrapper { background-color: var(--content-bg); }

        /* Sidebar Styling */
        .main-sidebar {
            background-color: var(--sidebar-bg) !important;
            box-shadow: var(--shadow-lg) !important;
            transition: background-color 0.3s ease;
        }

        .brand-link {
            border-bottom: 1px solid rgba(255,255,255,0.05) !important;
            padding: 1.25rem 1rem !important;
            color: #fff !important;
        }

        .brand-text {
            font-weight: 700 !important;
            letter-spacing: -0.5px;
            font-size: 1.1rem;
        }

        .sidebar { padding: 1rem 0.5rem !important; }

        .nav-sidebar .nav-item { margin-bottom: 4px; }

        .nav-sidebar .nav-link {
            border-radius: 12px !important;
            padding: 10px 16px !important;
            color: var(--sidebar-text) !important;
            transition: all 0.2s ease;
        }

        .nav-sidebar .nav-link:hover {
            background-color: var(--sidebar-hover) !important;
            color: #fff !important;
        }

        .nav-sidebar .nav-link.active {
            background-color: var(--primary) !important;
            color: #fff !important;
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
        }

        .nav-sidebar .nav-icon {
            margin-right: 12px !important;
            font-size: 1.1rem !important;
        }

        .nav-header {
            color: #475569 !important;
            font-size: 0.75rem !important;
            font-weight: 700 !important;
            text-transform: uppercase;
            letter-spacing: 1px;
            padding: 1.5rem 1.5rem 0.5rem !important;
        }

        /* Navbar Styling */
        .main-header {
            border-bottom: 1px solid var(--navbar-border) !important;
            background-color: var(--navbar-bg) !important;
            backdrop-filter: blur(8px);
            padding: 0.5rem 1rem !important;
            transition: background-color 0.3s ease, border-color 0.3s ease;
        }

        /* Content Area */
        .content-wrapper { background-color: var(--content-bg) !important; transition: background-color 0.3s ease; }

        .content-header h1 {
            font-weight: 800;
            color: var(--text-main);
            letter-spacing: -1px;
            font-size: 1.875rem;
        }

        /* Mobile Adjustments */
        @media (max-width: 768px) {
            .content-header h1 { font-size: 1.5rem !important; }
            .card-header { 
                padding: 1rem !important;
                flex-direction: column;
                align-items: flex-start !important;
            }
            .card-title { margin-bottom: 0.5rem; }
            .card-tools { margin-left: 0 !important; width: 100%; display: flex; justify-content: flex-end; }
            .card-body { padding: 1rem !important; }
            .main-header .navbar-nav.ml-auto { margin-right: 0.25rem !important; }
            .theme-toggle { width: 36px; height: 36px; margin-right: 0.5rem; }
            .user-name { display: none !important; }
            .logout-text { display: none !important; }
            .main-footer { text-align: center; }
            .main-footer .float-right { float: none !important; display: block !important; margin-bottom: 0.5rem; }
            
            /* DataTables Mobile Fixes */
            .dataTables_wrapper .dataTables_filter { text-align: left !important; float: none !important; margin-bottom: 0.5rem; }
            .dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
            .dataTables_wrapper .dataTables_length { text-align: left !important; float: none !important; }
            .dataTables_wrapper .dataTables_info { text-align: center !important; margin-bottom: 0.5rem; margin-top: 10px; }
            .dataTables_wrapper .dataTables_paginate { text-align: center !important; float: none !important; }
            
            /* Action Buttons in Index Pages */
            .actions-wrapper {
                display: flex;
                flex-wrap: wrap;
                gap: 8px;
                justify-content: center;
                margin-bottom: 1rem;
            }
            .actions-wrapper .btn { flex: 1; min-width: 100px; }
            
            /* Form Buttons */
            .d-flex.align-items-center.mt-4.pt-3 {
                flex-direction: column;
                gap: 10px;
            }
            .d-flex.align-items-center.mt-4.pt-3 .btn {
                width: 100%;
                margin: 0 !important;
            }
        }

        @media (max-width: 480px) {
            .nav-link p { font-size: 0.875rem; }
            .content-header h1 { font-size: 1.25rem !important; }
            .main-sidebar .brand-text { font-size: 1rem !important; }
            .brand-image { width: 30px !important; }
            .table-responsive { border: none !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
            .container-fluid { padding-left: 10px !important; padding-right: 10px !important; }
            .content { padding: 0 !important; }
            .card { border-radius: 12px !important; margin-bottom: 1rem !important; }
            .btn-sm { padding: 0.25rem 0.6rem !important; font-size: 0.75rem !important; }
            .stat-card { border-radius: 12px !important; }
            .pagination { font-size: 0.8rem; flex-wrap: wrap; justify-content: center; gap: 5px; }
            
            /* Table Badges */
            .table td .badge { display: inline-block; margin-bottom: 3px; }
        }

        /* Card Modernization */
        .card {
            border: none !important;
            background-color: var(--card-bg) !important;
            border-radius: var(--card-radius) !important;
            box-shadow: var(--shadow-sm) !important;
            transition: box-shadow 0.3s ease, background-color 0.3s ease;
            margin-bottom: 1.5rem;
        }

        .card:hover { box-shadow: var(--shadow-md) !important; }

        .card-header {
            background-color: transparent !important;
            border-bottom: 1px solid var(--card-border) !important;
            padding: 1.25rem 1.5rem !important;
        }

        .card-title {
            font-weight: 700 !important;
            color: var(--text-main) !important;
            font-size: 1.1rem !important;
        }

        .card-body { padding: 1.5rem !important; }

        /* Tables */
        .table { color: var(--text-main) !important; }
        .table thead th {
            background-color: var(--table-header) !important;
            border-bottom: 2px solid var(--table-border) !important;
            color: var(--text-muted) !important;
            font-size: 0.875rem !important;
            font-weight: 600 !important;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .table td { border-top: 1px solid var(--table-border) !important; }

        /* Buttons */
        .btn {
            border-radius: 10px !important;
            font-weight: 600 !important;
            padding: 0.5rem 1rem !important;
            transition: all 0.2s ease;
        }

        .btn-primary {
            background-color: var(--primary) !important;
            border-color: var(--primary) !important;
            box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2) !important;
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
        }

        /* Footer */
        .main-footer {
            border-top: 1px solid var(--navbar-border) !important;
            background-color: var(--card-bg) !important;
            color: var(--text-muted) !important;
            font-size: 0.875rem !important;
            padding: 1.25rem 1.5rem !important;
            transition: background-color 0.3s ease, border-color 0.3s ease;
        }

        /* Theme Toggle Styling */
        .theme-toggle {
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            background: var(--table-header);
            border: 1px solid var(--table-border);
            color: var(--primary);
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            margin-right: 1rem;
        }

        .theme-toggle:hover {
            background: var(--table-border);
            transform: rotate(15deg);
        }
        
        .dark-mode .fa-sun { display: block; }
        .dark-mode .fa-moon { display: none; }
        .fa-sun { display: none; }
        .fa-moon { display: block; }
    </style>
    
    <?php echo $__env->yieldPushContent('css'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <!-- Navbar -->
    <nav class="main-header navbar navbar-expand navbar-white navbar-light">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
            </li>
        </ul>
        <ul class="navbar-nav ml-auto align-items-center">
            <li class="nav-item">
                <button id="themeToggle" class="theme-toggle">
                    <i class="fa-solid fa-moon"></i>
                    <i class="fa-solid fa-sun"></i>
                </button>
            </li>
            <li class="nav-item text-secondary d-flex align-items-center mr-3 user-name">
                <span class="small font-weight-bold"><?php echo e(Auth::user()->name); ?></span>
            </li>
            <li class="nav-item">
                <form method="POST" action="<?php echo e(route('logout')); ?>">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="btn btn-outline-danger btn-sm">
                        <i class="fas fa-sign-out-alt"></i> <span class="logout-text">Logout</span>
                    </button>
                </form>
            </li>
        </ul>
    </nav>


    <!-- Main Sidebar Container -->
    <aside class="main-sidebar sidebar-dark-primary elevation-4">
        <a href="<?php echo e(route('dashboard')); ?>" class="brand-link">
            <img src="<?php echo e(asset('logo_uncen.png')); ?>" alt="UNCEN Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
            <span class="brand-text">FH UNCEN</span>
        </a>

        <div class="sidebar">
            <nav class="mt-2">
                <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                    <li class="nav-item">
                        <a href="<?php echo e(route('dashboard')); ?>" class="nav-link <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-gauge-high"></i>
                            <p>Dashboard</p>
                        </a>
                    </li>
                    <?php if(auth()->user()->hasPermission('Mahasiswa', 'list') || auth()->user()->hasPermission('Dosen', 'list') || auth()->user()->hasPermission('Kriteria', 'list')): ?>
                    <li class="nav-item <?php echo e(request()->is('master*') ? 'menu-open' : ''); ?>">
                        <a href="#" class="nav-link <?php echo e(request()->is('master*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-database"></i>
                            <p>Master Data <i class="right fas fa-angle-left"></i></p>
                        </a>
                        <ul class="nav nav-treeview">
                            <?php if(auth()->user()->hasPermission('Mahasiswa', 'list')): ?>
                            <li class="nav-item">
                                <a href="<?php echo e(route('mahasiswa.index')); ?>" class="nav-link <?php echo e(request()->routeIs('mahasiswa.*') ? 'active' : ''); ?>">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>Mahasiswa</p>
                                </a>
                            </li>
                            <?php endif; ?>
                            <?php if(auth()->user()->hasPermission('Dosen', 'list')): ?>
                            <li class="nav-item">
                                <a href="<?php echo e(route('dosen.index')); ?>" class="nav-link <?php echo e(request()->routeIs('dosen.*') ? 'active' : ''); ?>">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>Dosen</p>
                                </a>
                            </li>
                            <?php endif; ?>
                            <?php if(auth()->user()->hasPermission('Kriteria', 'list')): ?>
                            <li class="nav-item">
                                <a href="<?php echo e(route('kriteria.index')); ?>" class="nav-link <?php echo e(request()->routeIs('kriteria.*') ? 'active' : ''); ?>">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>Kriteria Penilaian</p>
                                </a>
                            </li>
                            <?php endif; ?>
                        </ul>
                    </li>
                    <?php endif; ?>
                    
                    <li class="nav-header">PENGAJUAN & SURAT</li>
                    <?php if(auth()->user()->hasPermission('Surat P1', 'list')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('p1.persetujuan.index')); ?>" class="nav-link <?php echo e(request()->routeIs('p1.persetujuan.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-file-alt"></i>
                            <p>Surat P1</p>
                        </a>
                    </li>
                    <?php endif; ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('izin_p1.index')); ?>" class="nav-link <?php echo e(request()->routeIs('izin_p1.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-check-square"></i>
                            <p>Izin P1</p>
                        </a>
                    </li>
                    <?php if(auth()->user()->hasPermission('Surat P2', 'list')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('p2.sk_pembimbing.index')); ?>" class="nav-link <?php echo e(request()->routeIs('p2.sk_pembimbing.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-user-gear"></i>
                            <p>Surat P2</p>
                        </a>
                    </li>
                    <?php endif; ?>
                    <?php if(auth()->user()->hasPermission('Surat P3', 'list')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('p3.surat_penelitian.index')); ?>" class="nav-link <?php echo e(request()->routeIs('p3.surat_penelitian.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-location-dot"></i>
                            <p>Surat P3</p>
                        </a>
                    </li>
                    <?php endif; ?>
                    <?php if(auth()->user()->hasPermission('Surat P4', 'list')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('p4.tim_penguji.index')); ?>" class="nav-link <?php echo e(request()->routeIs('p4.tim_penguji.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-user-group"></i>
                            <p>Surat P4</p>
                        </a>
                    </li>
                    <?php endif; ?>
                    <?php if(auth()->user()->hasPermission('Surat P5', 'list')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('p5.undangan_ujian.index')); ?>" class="nav-link <?php echo e(request()->routeIs('p5.undangan_ujian.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-calendar-check"></i>
                            <p>Surat P5</p>
                        </a>
                    </li>
                    <?php endif; ?>
                    
                    <li class="nav-header">KEGIATAN & NILAI</li>
                    <?php if(auth()->user()->hasPermission('Penilaian', 'list')): ?>
                    <li class="nav-item">
                        <a href="<?php echo e(route('penilaian.index')); ?>" class="nav-link <?php echo e(request()->routeIs('penilaian.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-medal"></i>
                            <p>Penilaian Skripsi</p>
                        </a>
                    </li>
                    <?php endif; ?>

                    <?php if(auth()->user()->role === 'admin'): ?>
                    <li class="nav-header">LAPORAN</li>
                    <li class="nav-item <?php echo e(request()->is('laporan*') ? 'menu-open' : ''); ?>">
                        <a href="#" class="nav-link <?php echo e(request()->is('laporan*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-chart-pie"></i>
                            <p>Laporan P1-P5 <i class="right fas fa-angle-left"></i></p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item"><a href="<?php echo e(route('laporan.p1')); ?>" class="nav-link <?php echo e(request()->routeIs('laporan.p1') ? 'active' : ''); ?>"><i class="far fa-circle nav-icon"></i><p>P1</p></a></li>
                            <li class="nav-item"><a href="<?php echo e(route('laporan.p2')); ?>" class="nav-link <?php echo e(request()->routeIs('laporan.p2') ? 'active' : ''); ?>"><i class="far fa-circle nav-icon"></i><p>P2</p></a></li>
                            <li class="nav-item"><a href="<?php echo e(route('laporan.p3')); ?>" class="nav-link <?php echo e(request()->routeIs('laporan.p3') ? 'active' : ''); ?>"><i class="far fa-circle nav-icon"></i><p>P3</p></a></li>
                            <li class="nav-item"><a href="<?php echo e(route('laporan.p4')); ?>" class="nav-link <?php echo e(request()->routeIs('laporan.p4') ? 'active' : ''); ?>"><i class="far fa-circle nav-icon"></i><p>P4</p></a></li>
                            <li class="nav-item"><a href="<?php echo e(route('laporan.p5')); ?>" class="nav-link <?php echo e(request()->routeIs('laporan.p5') ? 'active' : ''); ?>"><i class="far fa-circle nav-icon"></i><p>P5</p></a></li>
                        </ul>
                    </li>
                    <?php endif; ?>
                    <?php if(auth()->user()->role === 'admin'): ?>
                    <li class="nav-header">PENGATURAN</li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('pengguna.index')); ?>" class="nav-link <?php echo e(request()->routeIs('pengguna.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-user-shield"></i>
                            <p>Manajemen User</p>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('permissions.index')); ?>" class="nav-link <?php echo e(request()->routeIs('permissions.*') ? 'active' : ''); ?>">
                            <i class="nav-icon fas fa-shield-halved"></i>
                            <p>Hak Akses</p>
                        </a>
                    </li>
                    <?php endif; ?>
                </ul>
            </nav>
        </div>
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1><?php echo $__env->yieldContent('title'); ?></h1>
                    </div>
                </div>
            </div>
        </section>

        <section class="content">
            <div class="container-fluid">
                <?php if(session('success')): ?>
                    <div class="alert alert-success alert-dismissible fade show" role="alert" style="border-radius: 12px;">
                        <i class="fas fa-check-circle mr-2"></i> <?php echo e(session('success')); ?>

                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                <?php endif; ?>
                <?php if(session('error')): ?>
                    <div class="alert alert-danger alert-dismissible fade show" role="alert" style="border-radius: 12px;">
                        <i class="fas fa-exclamation-circle mr-2"></i> <?php echo e(session('error')); ?>

                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                <?php endif; ?>
                <?php echo $__env->yieldContent('content'); ?>
            </div>
        </section>
    </div>

    <footer class="main-footer">
        <div class="float-right d-none d-sm-inline">
            Version 2.0
        </div>
        <strong>&copy; 2026 FH UNCEN.</strong> All rights reserved.
    </footer>
</div>

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Bootstrap 4 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/js/adminlte.min.js"></script>
<!-- DataTables -->
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap5.min.js"></script>
<!-- Select2 -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<?php echo $__env->yieldPushContent('js'); ?>
<script>
    $(document).ready(function() {
        // Theme Management
        const body = $('body');
        const themeToggle = $('#themeToggle');
        const currentTheme = localStorage.getItem('theme');

        if (currentTheme === 'dark') {
            body.addClass('dark-mode');
        }

        themeToggle.on('click', function() {
            body.toggleClass('dark-mode');
            const theme = body.hasClass('dark-mode') ? 'dark' : 'light';
            localStorage.setItem('theme', theme);
            
            // Trigger chart update if exists
            if (typeof updateChartTheme === 'function') {
                updateChartTheme(theme);
            }
        });

        // DataTable Initialization
        $('.datatables').DataTable({
            "language": {
                "url": "//cdn.datatables.net/plug-ins/1.10.24/i18n/Indonesian.json"
            },
            "pageLength": 10,
            "responsive": true
        });
    });
</script>
</body>
</html>

<?php /**PATH /opt/lampp/htdocs/skripsifh/resources/views/layouts/app.blade.php ENDPATH**/ ?>