import { AdminHeader } from '@/components/admin-header'
import { AdminNav } from '@/components/admin-nav'

// Auth is enforced solely by middleware (auth.config.ts → authorized callback).
// All cross-group navigation (admin ↔ main) uses <a> tags (full page reload)
// to avoid React Error #310 caused by Next.js 16.x route-group transition bug.
export default function AdminLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <div className="bg-background flex flex-col min-h-screen">
      <AdminHeader />
      
      {/* Horizontal Tab Navigation */}
      <div className="flex items-center gap-1 px-8 bg-background border-b border-border shrink-0">
        <AdminNav />
      </div>

      {/* Page Content */}
      <div className="flex-1 overflow-y-auto">
        <div className="max-w-5xl mx-auto px-8 py-8 space-y-8">
          {children}
        </div>
      </div>
    </div>
  )
}
