<div class="max-w-4xl mx-auto">
  <div class="flex items-center gap-2 mb-6">
    <a href="/admin/pages" class="text-gray-500 hover:text-indigo-600"><i class="fas fa-arrow-left"></i></a>
    <h1 class="text-2xl font-bold text-gray-800"><%= page ? 'Edit Page' : 'Create Page' %></h1>
  </div>
  <div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
    <form action="<%= page ? '/admin/pages/' + page.id + '/edit' : '/admin/pages/create' %>" method="POST">
      <div class="space-y-4">
        <div><label class="block text-sm font-medium text-gray-700 mb-1">Title *</label><input type="text" name="title" value="<%= page ? page.title : '' %>" required class="w-full px-4 py-2 border border-gray-300 rounded-lg"></div>
        <div><label class="block text-sm font-medium text-gray-700 mb-1">Content</label><textarea name="content" rows="15" class="w-full px-4 py-2 border border-gray-300 rounded-lg font-mono text-sm"><%= page ? page.content || '' : '' %></textarea></div>
        <div><label class="block text-sm font-medium text-gray-700 mb-1">Meta Title</label><input type="text" name="metaTitle" value="<%= page ? page.metaTitle || '' : '' %>" class="w-full px-4 py-2 border border-gray-300 rounded-lg"></div>
        <div><label class="block text-sm font-medium text-gray-700 mb-1">Meta Description</label><textarea name="metaDescription" rows="2" class="w-full px-4 py-2 border border-gray-300 rounded-lg"><%= page ? page.metaDescription || '' : '' %></textarea></div>
        <div class="flex items-center gap-6">
          <label class="flex items-center gap-2"><input type="checkbox" name="isPublished" <%= page && page.isPublished ? 'checked' : '' %> class="rounded"><span class="text-sm text-gray-700">Published</span></label>
          <div><label class="block text-sm font-medium text-gray-700 mb-1">Sort Order</label><input type="number" name="sortOrder" value="<%= page ? page.sortOrder || 0 : 0 %>" class="w-24 px-3 py-2 border border-gray-300 rounded-lg"></div>
        </div>
      </div>
      <button type="submit" class="mt-6 bg-indigo-600 text-white px-8 py-2.5 rounded-lg font-medium hover:bg-indigo-700"><%= page ? 'Update Page' : 'Create Page' %></button>
    </form>
  </div>
</div>
