<script lang="ts">
	import { Building2, FileText, Package, ShoppingCart } from 'lucide-svelte';
	import { resolve } from '$app/paths';
	import ProtectedRoute from '$lib/components/ProtectedRoute.svelte';
</script>

<ProtectedRoute>
	<main class="container mx-auto px-4 py-4">
		<div class="breadcrumbs mb-4 text-sm">
			<ul>
				<li><a href={resolve('/')} class="text-primary hover:underline">Dashboard</a></li>
				<li>Compras</li>
			</ul>
		</div>

		<div class="mb-6">
			<div class="mb-2 flex items-center gap-4">
				<div class="rounded-xl bg-cyan-500/20 p-3">
					<ShoppingCart class="h-8 w-8 text-cyan-600" strokeWidth={2} />
				</div>
				<div>
					<h1 class="text-primary text-3xl font-bold">Compras</h1>
					<p class="text-base-content/70">Gestão de compras e aquisições</p>
				</div>
			</div>
		</div>

		<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
			<a
				href={resolve('/compras/objetos')}
				class="card bg-base-100 border-base-200 hover:border-primary border shadow-md transition-shadow hover:shadow-lg"
			>
				<div class="card-body">
					<div class="mb-2 flex items-center gap-3">
						<div class="bg-primary/10 rounded-lg p-2">
							<Package class="text-primary h-6 w-6" strokeWidth={2} />
						</div>
						<h4 class="font-semibold">Objetos</h4>
					</div>
					<p class="text-base-content/70 text-sm">
						Cadastro, listagem e edição de objetos e serviços disponíveis para compra.
					</p>
				</div>
			</a>

			<a
				href={resolve('/compras/atas')}
				class="card bg-base-100 border-base-200 hover:border-accent border shadow-md transition-shadow hover:shadow-lg"
			>
				<div class="card-body">
					<div class="mb-2 flex items-center gap-3">
						<div class="bg-accent/10 rounded-lg p-2">
							<FileText class="text-accent h-6 w-6" strokeWidth={2} />
						</div>
						<h4 class="font-semibold">Atas de Registro</h4>
					</div>
					<p class="text-base-content/70 text-sm">
						Gerencie Atas de Registro de Preços e seus vínculos com objetos.
					</p>
				</div>
			</a>

			<a
				href={resolve('/licitacoes/empresas')}
				class="card bg-base-100 border-base-200 hover:border-info border shadow-md transition-shadow hover:shadow-lg"
			>
				<div class="card-body">
					<div class="mb-2 flex items-center gap-3">
						<div class="bg-info/10 rounded-lg p-2">
							<Building2 class="text-info h-6 w-6" strokeWidth={2} />
						</div>
						<h4 class="font-semibold">Empresas</h4>
					</div>
					<p class="text-base-content/70 text-sm">
						Cadastro e gestão de empresas fornecedoras e seus contatos.
					</p>
				</div>
			</a>

			<a
				href={resolve('/pedidos')}
				class="card bg-base-100 border-base-200 hover:border-secondary border shadow-md transition-shadow hover:shadow-lg"
			>
				<div class="card-body">
					<div class="mb-2 flex items-center gap-3">
						<div class="bg-secondary/10 rounded-lg p-2">
							<FileText class="text-secondary h-6 w-6" strokeWidth={2} />
						</div>
						<h4 class="font-semibold">Pedidos</h4>
					</div>
					<p class="text-base-content/70 text-sm">
						Gerencie pedidos de compra, acompanhe status e histórico de aquisições.
					</p>
				</div>
			</a>
		</div>
	</main>
</ProtectedRoute>
