<?php
session_start();

// 🔐 Proteksi halaman (FIX)
if(!isset($_SESSION['admin'])){
    header("location:login.php");
    exit;
}
?>

<!DOCTYPE html>
<html>
<head>
<title>Dashboard Admin</title>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">

<style>
body {
  font-family:'Poppins',sans-serif;
  background:#f4f6f9;
}

/* HEADER */
.header {
  background: linear-gradient(135deg,#4f46e5,#6366f1);
  color:white;
  padding:30px;
  text-align:center;
}

/* CARD MENU */
.card-menu {
  border-radius:15px;
  padding:30px;
  text-align:center;
  transition:0.3s;
  box-shadow:0 10px 30px rgba(0,0,0,0.1);
}
.card-menu:hover {
  transform:translateY(-8px);
}

/* LINK FIX (biar tidak biru & rapi) */
a {
  text-decoration: none !important;
}
</style>
</head>

<body>

<div class="header">
<h2>⚙️ Dashboard Admin</h2>
<p>Selamat datang, <b><?= $_SESSION['admin'] ?></b></p>
</div>

<div class="container mt-4">

<div class="row">

<div class="col-md-4 mb-3">
<a href="dashboard_adm_pengaduan.php">
<div class="card-menu bg-primary text-white">
<h4>📋 Pengaduan</h4>
<p>Kelola data pengaduan siswa</p>
</div>
</a>
</div>

<div class="col-md-4 mb-3">
<a href="dashboard_adm_infokarirdanbeasiswa.php">
<div class="card-menu bg-success text-white">
<h4>🎓 Karir & Beasiswa</h4>
<p>Data tracer & SNBP</p>
</div>
</a>
</div>

<div class="col-md-4 mb-3">
<a href="dashboard_adm_pengembangandiri.php">
<div class="card-menu bg-warning text-white">
<h4>📚 Materi</h4>
<p>Kelola materi pengembangan diri</p>
</div>
</a>
</div>

</div>

<div class="text-center mt-4">
<a href="logout.php" class="btn btn-danger">Logout</a>
</div>

</div>

</body>
</html>