import { AdminSidebar } from '@/components/admin-sidebar'

// Auth is enforced solely by middleware (auth.config.ts → authorized callback).
// Navigation admin ↔ app en <a> (rechargement complet) pour éviter React Error #310
// sur les transitions entre route groups (Next.js 16 / React #33580).
export default function AdminLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <div className="flex h-screen overflow-hidden bg-[#E5E2D9] dark:bg-background">
      <AdminSidebar />
      <main className="memento-paper-texture flex min-h-0 flex-1 flex-col overflow-y-auto scroll-smooth">
        <div className="mx-auto w-full max-w-6xl space-y-8 px-4 py-6 sm:px-6 sm:py-8 lg:px-10">
          {children}
        </div>
      </main>
    </div>
  )
}
