<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
session_start();
define('BASE_URL', '');

include __DIR__ . '/config/db.php';
include __DIR__ . '/config/auth.php';
require_page_access();

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submissions — Admin</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
body { font-family:'Roboto',sans-serif; margin:0; height:100vh; overflow:hidden; }
body.dark { background-color:#1a202c; color:#e2e8f0; }
.sidebar { width:250px; background:#2d3748; color:white; transition:all .3s; height:100%; position:fixed; top:0; left:0; z-index:10; overflow-y:auto; }
.sidebar.collapsed { width:70px; }
.sidebar.collapsed .sidebar-title { display:none; }
.content { margin-left:250px; transition:margin-left .3s; height:100vh; overflow-y:auto; }
.content.collapsed-sidebar { margin-left:70px; }
.nav-item { padding:10px 12px; cursor:pointer; transition:background .2s; display:flex; align-items:center; }
.nav-item:hover { background:#4a5568; }
.nav-item.active { background:#4a5568; border-left:4px solid #4299e1; }
body.dark .bg-white { background-color:#2d3748; }
body.dark .text-gray-700 { color:#d1d5db; }
body.dark table { color:#e2e8f0; }
body.dark .border-gray-200 { border-color:#4a5568; }
body.dark .bg-gray-50 { background-color:#374151; }
body.dark .border-gray-100 { border-color:#4a5568; }
body.dark input, body.dark select { background-color:#374151; color:#e5e7eb; border-color:#4b5563; }
body.dark .text-gray-800 { color:#F3F4F6; }
body.dark .text-gray-600 { color:#9CA3AF; }
body.dark .text-gray-500 { color:#6B7280; }
@media(max-width:768px){ .sidebar{transform:translateX(-250px)} .sidebar.mobile-open{transform:translateX(0)} .content{margin-left:0} }

/* Status badges */
.sbadge { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:9999px; font-size:11px; font-weight:600; }
.sbadge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.sb-draft { background:rgba(156,163,175,.15); color:#6b7280; } .sb-draft::before { background:#6b7280; }
.sb-submitted { background:rgba(59,130,246,.12); color:#2563eb; } .sb-submitted::before { background:#2563eb; }
.sb-under_review { background:rgba(245,158,11,.12); color:#d97706; } .sb-under_review::before { background:#d97706; }
.sb-accepted { background:rgba(16,185,129,.12); color:#059669; } .sb-accepted::before { background:#059669; }
.sb-rejected { background:rgba(239,68,68,.12); color:#dc2626; } .sb-rejected::before { background:#dc2626; }

/* Section dots */
.comp-dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex-shrink:0; }
.comp-yes { background:#10b981; } .comp-no { background:#e2e8f0; }

/* Filter tag */
.filter-tag { display:inline-flex; align-items:center; gap:5px; background:#EFF6FF; color:#2563EB; border:1px solid #BFDBFE; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:500; }

/* Status dropdown */
.action-dd { display:none; position:absolute; right:0; top:36px; background:white; border-radius:8px; box-shadow:0 8px 30px rgba(0,0,0,.15); border:1px solid #E5E7EB; z-index:50; width:165px; padding:4px 0; }
.action-dd.open { display:block; }
body.dark .action-dd { background:#374151; border-color:#4B5563; }

/* ── Review Modal ─────────────────────────────────────────── */
.modal-backdrop { background:rgba(0,0,0,.55); backdrop-filter:blur(3px); }
.reviewer-card { border:1px solid #E5E7EB; border-radius:10px; padding:14px; background:#FAFAFA; transition:border-color .15s,box-shadow .15s; cursor:pointer; }
.reviewer-card:hover { border-color:#3B82F6; box-shadow:0 0 0 3px rgba(59,130,246,.1); }
.reviewer-card.selected { border-color:#2563EB; background:#EFF6FF; box-shadow:0 0 0 3px rgba(37,99,235,.15); }
body.dark .reviewer-card { background:#374151; border-color:#4B5563; }
body.dark .reviewer-card.selected { background:#1E3A5F; border-color:#3B82F6; }
.rev-tab { padding:8px 16px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; border:none; background:transparent; color:#64748b; transition:all .15s; white-space:nowrap; }
.rev-tab.active { background:#EFF6FF; color:#1d4ed8; font-weight:600; }
.rev-panel { display:none; }
.rev-panel.active { display:block; }
.assign-input { width:100%; border:1px solid #D1D5DB; border-radius:8px; padding:8px 12px; font-size:13px; color:#374151; transition:border-color .15s; outline:none; }
.assign-input:focus { border-color:#3B82F6; box-shadow:0 0 0 2px rgba(59,130,246,.1); }
.star-display i { font-size:11px; }
.assignment-row { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid #E5E7EB; border-radius:8px; background:#F9FAFB; margin-bottom:8px; }
.as-badge { padding:2px 8px; border-radius:9999px; font-size:10px; font-weight:700; }
.as-request_sent { background:#DBEAFE; color:#1E40AF; }
.as-accepted { background:#D1FAE5; color:#065F46; }
.as-declined { background:#FEE2E2; color:#991B1B; }
.as-review_submitted { background:#F0FDF4; color:#14532D; }
.as-cancelled { background:#F3F4F6; color:#374151; }
.toast { position:fixed; bottom:24px; right:24px; z-index:9999; padding:12px 20px; border-radius:10px; font-size:13px; font-weight:600; display:flex; align-items:center; gap:8px; box-shadow:0 8px 24px rgba(0,0,0,.15); transform:translateY(80px); opacity:0; transition:all .3s ease; }
.toast.show { transform:translateY(0); opacity:1; }
.toast-success { background:#ECFDF5; color:#065F46; border:1px solid #A7F3D0; }
.toast-error { background:#FEF2F2; color:#991B1B; border:1px solid #FECACA; }
</style>
</head>
<body class="bg-gray-100">

<button onclick="toggleMobileSidebar()" class="fixed top-3 left-3 z-20 bg-gray-800 text-white px-3 py-2 rounded-md md:hidden">☰</button>

<?php include __DIR__ . '/include/sidebar.php'; ?>

<div class="content" id="content">

    <!-- Topbar -->
    <div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between sticky top-0 z-10 shadow-sm">
        <div class="flex items-center gap-3">
            <button onclick="toggleSidebar()" class="text-gray-500 hover:text-gray-700 hidden md:block">
                <i class="fas fa-bars text-lg"></i>
            </button>
            <div class="flex items-center gap-2 text-sm text-gray-500">
                <a href="index.php" class="hover:text-blue-600"><i class="fas fa-home"></i></a>
                <i class="fas fa-chevron-right text-xs text-gray-300"></i>
                <h1 class="text-gray-800 font-bold flex items-center gap-2">
                    <i class="fas fa-file-signature text-blue-600"></i> Submissions
                </h1>
            </div>
        </div>
        <div class="flex items-center gap-3">
            <button id="darkModeToggle" class="text-gray-500 hover:text-gray-700 w-9 h-9 rounded-lg border border-gray-200 flex items-center justify-center">
                <i class="fas fa-moon"></i>
            </button>
        </div>
    </div>

    <main class="p-6">
        
        hello dashboard

    </main>
</div>


</body>
</html>