<?php
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: 0');
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <title>Painel - <?= e(APP_NAME) ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Raleway:wght@600;700&family=Rawline:wght@400;600;700&display=swap">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
    <link rel="stylesheet" href="<?= asset_url('/assets/css/style.css') ?>?v=1910">
    <link rel="stylesheet" href="<?= asset_url('/assets/css/admin.css') ?>?v=1910">
</head>
<body>
    <header class="topbar admin govbar">
        <div class="container topbar-inner">
            <div class="brand-wrap">
                <div class="brand-mark">PR</div>
                <div>
                    <div class="eyebrow">Painel Administrativo</div>
                    <h1>Prefeitura Resolve</h1>
                </div>
            </div>
            <nav class="main-nav">
                <?php if (Auth::canViewOccurrences()): ?>
                <a href="<?= base_url('/admin') ?>">Dashboard</a>
                <a href="<?= base_url('/admin/mapa') ?>">Mapa Geral</a>
                <a href="<?= base_url('/admin/ocorrencias') ?>">Ocorrências</a>
                <a href="<?= base_url('/admin/servicos') ?>">Serviços</a>
                <?php endif; ?>
                <?php if (Auth::isAdmin()): ?>
                <a href="<?= base_url('/admin/usuarios') ?>">Usuários</a>
                <?php endif; ?>
                <a href="<?= base_url('/logout') ?>">Sair</a>
            </nav>
        </div>
    </header>

    <main class="container page-content">
        <?php require $viewFile; ?>
    </main>

    <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
    <script src="<?= asset_url('/assets/js/mapa.js') ?>?v=1910"></script>
</body>
</html>
