<?php
require_once __DIR__ . '/../../includes/functions.php';
requireLogin();
$storeName   = getSetting('store_name', 'Rewards');
$currentPage = basename($_SERVER['PHP_SELF'], '.php');
$role        = $_SESSION['role'] ?? 'cashier';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#0f172a">
<title><?= e($mobileTitle ?? 'Home') ?> — <?= e($storeName) ?></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link href="<?= BASE_URL ?>/mobile/assets/mobile.css" rel="stylesheet">
</head>
<body class="m-body">

<!-- Top Bar -->
<div class="m-topbar">
  <div class="m-topbar-inner">
    <div class="m-store-name">
      <i class="bi bi-star-fill text-warning me-1"></i>
      <span><?= e($storeName) ?></span>
    </div>
    <div class="d-flex align-items-center gap-2">
      <span class="badge <?= $role==='admin'?'bg-danger':'bg-primary' ?> text-uppercase" style="font-size:.65rem">
        <?= e($role) ?>
      </span>
      <a href="<?= BASE_URL ?>/logout.php" class="m-logout-btn">
        <i class="bi bi-box-arrow-right"></i>
      </a>
    </div>
  </div>
</div>

<!-- Page Content -->
<div class="m-content" id="mContent">
