<?php require_once __DIR__.'/../config.inc.php'; require_login(); $pageTitle=$pageTitle??'Dashboard'; ?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title><?=e($pageTitle)?> - Phone Display Manager</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
<style>
:root{--navy:#17233b;--purple:#5146e5;--bg:#f5f7fb}
body{margin:0;background:var(--bg);font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:#162033}
.sidebar{position:fixed;inset:0 auto 0 0;width:245px;background:linear-gradient(180deg,#17233b,#101827);color:#fff;z-index:1000}
.logo{height:74px;padding:18px 22px;font-weight:800;font-size:18px;border-bottom:1px solid rgba(255,255,255,.08)}
.logo i{font-size:25px;margin-right:8px;color:#8b7cff}
.nav-title{font-size:11px;color:#8d9bb2;font-weight:700;margin:25px 20px 8px;text-transform:uppercase;letter-spacing:.08em}
.nav-link{color:#c5cede;border-radius:9px;margin:4px 10px;padding:11px 13px}
.nav-link:hover,.nav-link.active{background:linear-gradient(90deg,#594ee9,#4d46bb);color:#fff}
.main{margin-left:245px;min-height:100vh}
.topbar{height:74px;background:#fff;border-bottom:1px solid #e7ebf1;padding:0 28px}
.content{padding:24px 28px}
.card{border:0;border-radius:15px;box-shadow:0 6px 25px rgba(28,39,65,.06)}
.form-control,.form-select{border-radius:9px;padding:11px 13px;border-color:#dce2ea}
.form-control:focus,.form-select:focus{border-color:#7067ef;box-shadow:0 0 0 .2rem rgba(81,70,229,.1)}
.btn-primary{background:var(--purple);border-color:var(--purple)}
.section-title{font-size:13px;color:var(--purple);font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.compat-row{background:#fafbff;border:1px solid #e3e7f0;border-radius:10px;padding:12px;margin-bottom:10px}
@media(max-width:800px){.sidebar{width:70px}.logo span,.nav-link span,.nav-title{display:none}.nav-link{text-align:center}.main{margin-left:70px}.content{padding:18px}.topbar{padding:0 18px}}
</style>
</head><body>
<aside class="sidebar">
 <div class="logo"><i class="bi bi-phone"></i><span>Phone Display<br>Manager</span></div>
 <div class="nav-title">Manage</div>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='index.php'?'active':''?>" href="index.php"><i class="bi bi-grid-1x2 me-2"></i><span>Dashboard</span></a>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='brands.php'?'active':''?>" href="brands.php"><i class="bi bi-tags me-2"></i><span>Brands</span></a>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='products.php'?'active':''?>" href="products.php"><i class="bi bi-phone me-2"></i><span>Displays</span></a>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='compatible.php'?'active':''?>" href="compatible.php"><i class="bi bi-diagram-3 me-2"></i><span>Compatible Models</span></a>
 
 <div class="nav-title">Admin</div>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='users.php'?'active':''?>" href="users.php"><i class="bi bi-people me-2"></i><span>Users</span></a>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='orders.php'?'active':''?>" href="orders.php"><i class="bi bi-cart-check me-2"></i><span>Orders</span></a>
 <a class="nav-link <?=basename($_SERVER['PHP_SELF'])==='change_password.php'?'active':''?>" href="change_password.php"><i class="bi bi-shield-lock me-2"></i><span>Change Password</span></a>
 <a class="nav-link" href="logout.php"><i class="bi bi-box-arrow-right me-2"></i><span>Logout</span></a>
</aside>
<div class="main">
<header class="topbar d-flex justify-content-between align-items-center">
 <strong><?=e($pageTitle)?></strong>
 <div class="text-secondary"><i class="bi bi-person-circle me-1"></i><?=e($_SESSION['admin_name']??'Administrator')?></div>
</header>
<main class="content"><?php show_flash(); ?>