<!doctype html>
<html lang="ar" dir="rtl">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="noindex,nofollow">
  <title><%= title %> - SMM WhatsApp Bot</title>
  <link rel="stylesheet" href="/style.css">
</head>
<body>
<header class="topbar">
  <div>
    <strong>SMM WhatsApp Bot</strong>
    <small>Admin API V2</small>
  </div>
  <% if (session?.authenticated) { %>
    <form action="/logout" method="post">
      <input type="hidden" name="_csrf" value="<%= csrf %>">
      <button class="link-button" type="submit">تسجيل الخروج</button>
    </form>
  <% } %>
</header>
<% if (session?.authenticated) { %>
<nav class="nav">
  <a href="/">الرئيسية</a>
  <a href="/connection">واتساب و QR</a>
  <a href="/settings">الإعدادات</a>
  <a href="/admins">أرقام الإدارة</a>
  <a href="/groups">الجروبات</a>
  <a href="/templates">القوالب</a>
  <a href="/partial">Partial</a>
  <a href="/cancel">متابعة الإلغاء</a>
  <a href="/tickets">التذاكر</a>
  <a href="/logs">السجلات</a>
</nav>
<% } %>
<main class="container">
  <h1><%= title %></h1>
  <% if (typeof flash !== 'undefined' && flash) { %>
    <div class="alert <%= flash.type === 'error' ? 'alert-error' : 'alert-success' %>"><%= flash.message %></div>
  <% } %>
