<?php
if(!isset($_SESSION)) session_start();

if(!isset($_SESSION['admin_logged'])){
    header("Location: login.php");
    exit;
}
?>

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GoMAPS Admin</title>

<style>
body{
    margin:0;
    font-family:Arial, sans-serif;
    background:#f4f6f9;
    display:flex;
    min-height:100vh;
}

/* MAIN AREA */
.main-area{
    flex:1;
    display:flex;
    flex-direction:column;
}

/* TOPBAR */
.topbar{
    background:#ffffff;
    padding:15px 20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

.topbar-right a{
    color:#dc3545;
    text-decoration:none;
    font-weight:bold;
}

/* CONTENT */
.content{
    padding:30px;
}

/* CARD */
.card{
    background:#ffffff;
    padding:25px;
    border-radius:12px;
    box-shadow:0 4px 15px rgba(0,0,0,0.08);
    margin-bottom:25px;
}

/* FILTER */
.filter-bar{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:20px;
    align-items:center;
}

.input-field{
    padding:8px 12px;
    border:1px solid #ddd;
    border-radius:8px;
    min-width:200px;
}

/* BUTTONS */
.btn{
    padding:8px 14px;
    border-radius:8px;
    text-decoration:none;
    font-size:14px;
    border:none;
    cursor:pointer;
}

.btn-primary{ background:#0f6c75; color:#fff; }
.btn-success{ background:#28a745; color:#fff; }
.btn-danger{ background:#dc3545; color:#fff; }

/* TABLE */
.table-responsive{ overflow-x:auto; }

.dashboard-table{
    width:100%;
    border-collapse:collapse;
}

.dashboard-table th{
    background:#f1f3f5;
    padding:12px;
    text-align:left;
    font-weight:600;
}

.dashboard-table td{
    padding:12px;
    border-bottom:1px solid #eee;
}

.page-title{
    margin-bottom:20px;
    font-weight:600;
}

@media(max-width:768px){
    body{flex-direction:column;}
}
</style>
</head>
<body>

<!-- TOPBAR -->
<div class="topbar">
    <div><strong>Super Admin Panel</strong></div>
    <div class="topbar-right">
        <?= $_SESSION['admin_name']; ?> |
        <a href="logout.php">Logout</a>
    </div>
</div>