// pages/_app.js
import "@/styles/globals.css";
import { useRouter } from "next/router";
import Sidebar from "@/components/layout/Sidebar";

export default function App({ Component, pageProps }) {
  const router = useRouter();

  // exclude login route (and anything under /login if you add nested routes later)
  const isLoginPage =
    router.pathname === "/Login" || router.pathname.startsWith("/Login");

  if (isLoginPage) {
    return <Component {...pageProps} />;
  }

  return (
    <div className="min-h-screen bg-[#fafafa] lg:flex">
      <Sidebar />
      <main className="flex-1 p-4 sm:p-6 lg:p-8">
        <Component {...pageProps} />
      </main>
    </div>
  );
}