<?php
session_start();
if (!isset($_SESSION['usuario']) || $_SESSION['rol'] != 2) {
    header('Location: ../../index.php');
    exit;
}

$usuarioId = $_SESSION['usuario'];
$rol = $_SESSION['rol'];
?>

<!DOCTYPE html>
<html lang="es">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashboard Administrador</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
</head>

<body class="bg-gray-100 flex h-screen">

    <aside class="w-64 bg-blue-900 text-white p-5 flex flex-col">
        <div class="text-center mb-6">
            <img src="../../public/images/logo.png" alt="Logo de la Institución" class="w-24 mx-auto">
            <h2 class="text-lg font-semibold mt-3">Administrador</h2>
        </div>
        <nav>
            <ul class="space-y-3">
                <li><a href="../admin/gestion_estudiantes.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-users mr-2"></i>Gestionar Estudiantes</a></li>
                <li><a href="../admin/gestion_docentes.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-chalkboard-teacher mr-2"></i>Gestionar Docentes</a></li>
                <li><a href="../carrera/gestionar_carreras.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-graduation-cap mr-2"></i>Gestionar Carreras</a></li>
                <li><a href="../cursos/gestionar_cursos.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-book-open mr-2"></i>Gestionar Cursos</a></li>
                <li><a href="../materias/gestionar_materias.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-calendar-alt mr-2"></i>Gestionar Materias</a></li>
                <li><a href="../caja/dashboard_caja.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-cash-register mr-2"></i>Caja</a></li>
                <li><a href="../asignar_materias/gestionar_asignaciones.php" class="block p-2 rounded hover:bg-blue-700"><i class="fas fa-cash-register mr-2"></i>Asignar Materias</a></li>
            </ul>
        </nav>
        <div class="mt-auto">
            <a href="../../logout.php" class="block text-center bg-red-600 p-2 rounded hover:bg-red-700"><i class="fas fa-sign-out-alt mr-2"></i>Cerrar Sesión</a>
        </div>
    </aside>


    <main class="flex-1 p-8 overflow-y-auto">
        <h1 class="text-2xl font-bold text-gray-800">Bienvenido Administrador!</h1>
        <div class="mt-6 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 gap-6">
            <div class="bg-white p-5 rounded-lg shadow-lg hover:shadow-xl transition-shadow duration-300">
                <h3 class="text-lg font-semibold"><i class="fas fa-users mr-2"></i>Estudiantes</h3>
                <p class="text-gray-500">Gestión de estudiantes registrados.</p>
            </div>
            <div class="bg-white p-5 rounded-lg shadow-lg hover:shadow-xl transition-shadow duration-300">
                <h3 class="text-lg font-semibold"><i class="fas fa-chalkboard-teacher mr-2"></i>Docentes</h3>
                <p class="text-gray-500">Administración del personal docente.</p>
            </div>
            <div class="bg-white p-5 rounded-lg shadow-lg hover:shadow-xl transition-shadow duration-300">
                <h3 class="text-lg font-semibold"><i class="fas fa-graduation-cap mr-2"></i>Carreras</h3>
                <p class="text-gray-500">Control y asignación de carreras.</p>
            </div>
            <div class="bg-white p-5 rounded-lg shadow-lg hover:shadow-xl transition-shadow duration-300">
                <h3 class="text-lg font-semibold"><i class="fas fa-book-open mr-2"></i>Cursos</h3>
                <p class="text-gray-500">Manejo de cursos académicos.</p>
            </div>
            <div class="bg-white p-5 rounded-lg shadow-lg hover:shadow-xl transition-shadow duration-300">
                <h3 class="text-lg font-semibold"><i class="fas fa-calendar-alt mr-2"></i>Horarios</h3>
                <p class="text-gray-500">Programación de horarios.</p>
            </div>
            <div class="bg-white p-5 rounded-lg shadow-lg hover:shadow-xl transition-shadow duration-300">
                <h3 class="text-lg font-semibold"><i class="fas fa-cash-register mr-2"></i>Caja</h3>
                <p class="text-gray-500">Gestión financiera y pagos.</p>
            </div>
        </div>
    </main>
</body>

</html>