import { Routes } from '@angular/router';
import { authGuard, guestGuard, permissionGuard } from './core/guards/auth.guard';

export const routes: Routes = [
  {
    path: 'login',
    canActivate: [guestGuard],
    loadComponent: () =>
      import('./features/auth/login/login.component').then((m) => m.LoginComponent),
  },
  {
    path: 'register',
    canActivate: [guestGuard],
    loadComponent: () =>
      import('./features/auth/register/register.component').then((m) => m.RegisterComponent),
  },
  {
    path: '',
    canActivate: [authGuard],
    loadComponent: () =>
      import('./layout/main-layout/main-layout.component').then((m) => m.MainLayoutComponent),
    children: [
      {
        path: '',
        redirectTo: 'dashboard',
        pathMatch: 'full',
      },
      {
        path: 'dashboard',
        loadComponent: () =>
          import('./features/dashboard/dashboard.component').then((m) => m.DashboardComponent),
      },
      {
        path: 'setup',
        loadComponent: () =>
          import('./features/setup/setup-wizard.component').then((m) => m.SetupWizardComponent),
      },
      // Core module routes
      {
        path: 'core',
        children: [
          { path: '', loadComponent: () => import('./features/core-intro/core-intro.component').then(m => m.CoreIntroComponent) },
          { path: 'guide', loadComponent: () => import('./features/core-guide/core-guide').then(m => m.CoreGuide) },
          { path: 'company', canActivate: [permissionGuard], data: { permissions: ['core.company'] }, loadComponent: () => import('./features/company/company.component').then(m => m.CompanyComponent) },
          { path: 'branches', canActivate: [permissionGuard], data: { permissions: ['core.branches'] }, loadComponent: () => import('./features/branches/branches.component').then(m => m.BranchesComponent) },
          { path: 'users', canActivate: [permissionGuard], data: { permissions: ['core.users'] }, loadComponent: () => import('./features/users/users.component').then(m => m.UsersComponent) },
          { path: 'roles', canActivate: [permissionGuard], data: { permissions: ['core.roles'] }, loadComponent: () => import('./features/roles/roles.component').then(m => m.RolesComponent) },
          { path: 'settings', canActivate: [permissionGuard], data: { permissions: ['core.settings'] }, loadComponent: () => import('./features/settings/settings.component').then(m => m.SettingsComponent) },
          { path: 'sequences', canActivate: [permissionGuard], data: { permissions: ['core.sequences'] }, loadComponent: () => import('./features/sequences/sequences.component').then(m => m.SequencesComponent) },
          { path: 'products', canActivate: [permissionGuard], data: { permissions: ['core.products', 'inventory.products'] }, loadComponent: () => import('./features/products/products.component').then(m => m.ProductsComponent) },
          { path: 'products/:id', canActivate: [permissionGuard], data: { permissions: ['core.products', 'inventory.products'] }, loadComponent: () => import('./features/product-detail/product-detail.component').then(m => m.ProductDetailComponent) },
          { path: 'product-categories', canActivate: [permissionGuard], data: { permissions: ['core.product-categories', 'inventory.products'] }, loadComponent: () => import('./features/product-categories/product-categories.component').then(m => m.ProductCategoriesComponent) },
          { path: 'unit-groups', canActivate: [permissionGuard], data: { permissions: ['core.unit-groups'] }, loadComponent: () => import('./features/unit-groups/unit-groups.component').then(m => m.UnitGroupsComponent) },
          { path: 'units', canActivate: [permissionGuard], data: { permissions: ['core.units'] }, loadComponent: () => import('./features/units/units.component').then(m => m.UnitsComponent) },
          { path: 'warehouses', canActivate: [permissionGuard], data: { permissions: ['inventory.warehouses'] }, loadComponent: () => import('./features/warehouses/warehouses.component').then(m => m.WarehousesComponent) },
          { path: 'stock-receipts', canActivate: [permissionGuard], data: { permissions: ['inventory.receipts'] }, loadComponent: () => import('./features/stock-receipts/stock-receipts.component').then(m => m.StockReceiptsComponent) },
          { path: 'stock-issues', canActivate: [permissionGuard], data: { permissions: ['inventory.issues'] }, loadComponent: () => import('./features/stock-issues/stock-issues.component').then(m => m.StockIssuesComponent) },
          { path: 'warehouse-transfers', canActivate: [permissionGuard], data: { permissions: ['inventory.transfers'] }, loadComponent: () => import('./features/warehouse-transfers/warehouse-transfers.component').then(m => m.WarehouseTransfersComponent) },
          { path: 'stock-balances', canActivate: [permissionGuard], data: { permissions: ['inventory.stock'] }, loadComponent: () => import('./features/stock-balances/stock-balances.component').then(m => m.StockBalancesComponent) },
          { path: 'stock-card/:productId', canActivate: [permissionGuard], data: { permissions: ['inventory.stock-card'] }, loadComponent: () => import('./features/stock-card/stock-card.component').then(m => m.StockCardComponent) },
          { path: 'inventory-counts', canActivate: [permissionGuard], data: { permissions: ['inventory.counts'] }, loadComponent: () => import('./features/inventory-counts/inventory-counts.component').then(m => m.InventoryCountsComponent) },
          { path: 'stock-adjustments', canActivate: [permissionGuard], data: { permissions: ['inventory.adjustments'] }, loadComponent: () => import('./features/stock-adjustments/stock-adjustments.component').then(m => m.StockAdjustmentsComponent) },
          { path: 'reorder-alerts', canActivate: [permissionGuard], data: { permissions: ['inventory.reorder'] }, loadComponent: () => import('./features/reorder-alerts/reorder-alerts.component').then(m => m.ReorderAlertsComponent) },
          { path: 'opening-balance-inventory', canActivate: [permissionGuard], data: { permissions: ['inventory.opening'] }, loadComponent: () => import('./features/opening-balance-inventory/opening-balance-inventory.component').then(m => m.OpeningBalanceInventoryComponent) },
          { path: 'inventory-reports', canActivate: [permissionGuard], data: { permissions: ['inventory.reports'] }, loadComponent: () => import('./features/inventory-reports/inventory-reports.component').then(m => m.InventoryReportsComponent) },
          { path: 'partners', canActivate: [permissionGuard], data: { permissions: ['core.partners', 'sales.', 'purchasing.'] }, loadComponent: () => import('./features/partners/partners.component').then(m => m.PartnersComponent) },
          { path: 'partner-categories', canActivate: [permissionGuard], data: { permissions: ['core.partner-categories', 'sales.', 'purchasing.'] }, loadComponent: () => import('./features/partner-categories/partner-categories.component').then(m => m.PartnerCategoriesComponent) },
          { path: 'attachments', canActivate: [permissionGuard], data: { permissions: ['core.attachments'] }, loadComponent: () => import('./features/attachments/attachments.component').then(m => m.AttachmentsComponent) },
          { path: 'print-settings', canActivate: [permissionGuard], data: { permissions: ['core.settings'] }, loadComponent: () => import('./shared/print/print-settings/print-settings.component').then(m => m.PrintSettingsComponent) },
          { path: 'theme', loadComponent: () => import('./features/theme/theme.component').then(m => m.ThemeComponent) },
          { path: 'database', canActivate: [permissionGuard], data: { permissions: ['core.backups'] }, loadComponent: () => import('./features/database-management/database-management.component').then(m => m.DatabaseManagementComponent) },
          { path: 'ai-settings', canActivate: [permissionGuard], data: { permissions: ['core.ai'] }, loadComponent: () => import('./features/ai-settings/ai-settings.component').then(m => m.AiSettingsComponent) },
        ],
      },
      // Accounting module routes
      {
        path: 'accounting',
        children: [
          { path: '', loadComponent: () => import('./features/accounting-intro/accounting-intro.component').then(m => m.AccountingIntroComponent) },
          { path: 'guide', loadComponent: () => import('./features/accounting-guide/accounting-guide').then(m => m.AccountingGuide) },
          { path: 'accounts', canActivate: [permissionGuard], data: { permissions: ['accounting.accounts'] }, loadComponent: () => import('./features/accounts/accounts.component').then(m => m.AccountsComponent) },
          { path: 'journal-entries', canActivate: [permissionGuard], data: { permissions: ['accounting.journal-entries'] }, loadComponent: () => import('./features/journal-entries/journal-entries.component').then(m => m.JournalEntriesComponent) },
          { path: 'fiscal-years', canActivate: [permissionGuard], data: { permissions: ['accounting.fiscal-years'] }, loadComponent: () => import('./features/fiscal-years/fiscal-years.component').then(m => m.FiscalYearsComponent) },
          { path: 'ledger', canActivate: [permissionGuard], data: { permissions: ['accounting.ledger'] }, loadComponent: () => import('./features/ledger/ledger.component').then(m => m.LedgerComponent) },
          { path: 'cost-centers', canActivate: [permissionGuard], data: { permissions: ['accounting.cost-centers'] }, loadComponent: () => import('./features/cost-centers/cost-centers.component').then(m => m.CostCentersComponent) },
          { path: 'budgets', canActivate: [permissionGuard], data: { permissions: ['accounting.budgets'] }, loadComponent: () => import('./features/budgets/budgets.component').then(m => m.BudgetsComponent) },
          { path: 'currencies', canActivate: [permissionGuard], data: { permissions: ['accounting.currencies'] }, loadComponent: () => import('./features/currencies/currencies.component').then(m => m.CurrenciesComponent) },
          { path: 'tax-rates', canActivate: [permissionGuard], data: { permissions: ['accounting.tax-rates'] }, loadComponent: () => import('./features/tax-rates/tax-rates.component').then(m => m.TaxRatesComponent) },
          { path: 'exchange-rates', canActivate: [permissionGuard], data: { permissions: ['accounting.exchange-rates'] }, loadComponent: () => import('./features/exchange-rates/exchange-rates.component').then(m => m.ExchangeRatesComponent) },
          { path: 'bank-accounts', canActivate: [permissionGuard], data: { permissions: ['accounting.bank-accounts'] }, loadComponent: () => import('./features/bank-accounts/bank-accounts.component').then(m => m.BankAccountsComponent) },
          { path: 'checks-received', canActivate: [permissionGuard], data: { permissions: ['accounting.checks-received'] }, loadComponent: () => import('./features/checks-received/checks-received.component').then(m => m.ChecksReceivedComponent) },
          { path: 'checks-issued', canActivate: [permissionGuard], data: { permissions: ['accounting.checks-issued'] }, loadComponent: () => import('./features/checks-issued/checks-issued.component').then(m => m.ChecksIssuedComponent) },
          { path: 'petty-cash', canActivate: [permissionGuard], data: { permissions: ['accounting.petty-cash'] }, loadComponent: () => import('./features/petty-cash/petty-cash.component').then(m => m.PettyCashComponent) },
          { path: 'transfers', canActivate: [permissionGuard], data: { permissions: ['accounting.transfers'] }, loadComponent: () => import('./features/transfers/transfers.component').then(m => m.TransfersComponent) },
          { path: 'opening-balances', canActivate: [permissionGuard], data: { permissions: ['accounting.opening-balances'] }, loadComponent: () => import('./features/opening-balances/opening-balances.component').then(m => m.OpeningBalancesComponent) },
          { path: 'year-end-closing', canActivate: [permissionGuard], data: { permissions: ['accounting.year-end-closing'] }, loadComponent: () => import('./features/year-end-closing/year-end-closing.component').then(m => m.YearEndClosingComponent) },
          { path: 'entry-templates', canActivate: [permissionGuard], data: { permissions: ['accounting.entry-templates'] }, loadComponent: () => import('./features/entry-templates/entry-templates.component').then(m => m.EntryTemplatesComponent) },
          { path: 'recurring-entries', canActivate: [permissionGuard], data: { permissions: ['accounting.recurring-entries'] }, loadComponent: () => import('./features/recurring-entries/recurring-entries.component').then(m => m.RecurringEntriesComponent) },
          { path: 'asset-categories', canActivate: [permissionGuard], data: { permissions: ['accounting.asset-categories'] }, loadComponent: () => import('./features/asset-categories/asset-categories.component').then(m => m.AssetCategoriesComponent) },
          { path: 'fixed-assets', canActivate: [permissionGuard], data: { permissions: ['accounting.fixed-assets'] }, loadComponent: () => import('./features/fixed-assets/fixed-assets.component').then(m => m.FixedAssetsComponent) },
          { path: 'allocation-rules', canActivate: [permissionGuard], data: { permissions: ['accounting.allocation-rules'] }, loadComponent: () => import('./features/allocation-rules/allocation-rules.component').then(m => m.AllocationRulesComponent) },
          { path: 'reconciliation-rules', canActivate: [permissionGuard], data: { permissions: ['accounting.reconciliation-rules'] }, loadComponent: () => import('./features/reconciliation-rules/reconciliation-rules.component').then(m => m.ReconciliationRulesComponent) },
          { path: 'bank-reconciliations', canActivate: [permissionGuard], data: { permissions: ['accounting.bank-reconciliations'] }, loadComponent: () => import('./features/bank-reconciliations/bank-reconciliations.component').then(m => m.BankReconciliationsComponent) },
          { path: 'ar-ap', canActivate: [permissionGuard], data: { permissions: ['accounting.ar-ap'] }, loadComponent: () => import('./features/ar-ap/ar-ap.component').then(m => m.ArApComponent) },
          { path: 'reports', canActivate: [permissionGuard], data: { permissions: ['reports', 'accounting.reports'] }, loadComponent: () => import('./features/reports/reports.component').then(m => m.ReportsComponent) },
          { path: 'receipt-vouchers', canActivate: [permissionGuard], data: { permissions: ['accounting.receipt-vouchers'] }, loadComponent: () => import('./features/receipt-vouchers/receipt-vouchers.component').then(m => m.ReceiptVouchersComponent) },
          { path: 'payment-vouchers', canActivate: [permissionGuard], data: { permissions: ['accounting.payment-vouchers'] }, loadComponent: () => import('./features/payment-vouchers/payment-vouchers.component').then(m => m.PaymentVouchersComponent) },
          { path: 'expense-categories', canActivate: [permissionGuard], data: { permissions: ['accounting.expense-categories'] }, loadComponent: () => import('./features/expense-categories/expense-categories.component').then(m => m.ExpenseCategoriesComponent) },
          { path: 'revenue-categories', canActivate: [permissionGuard], data: { permissions: ['accounting.revenue-categories'] }, loadComponent: () => import('./features/revenue-categories/revenue-categories.component').then(m => m.RevenueCategoriesComponent) },
          { path: 'expenses', canActivate: [permissionGuard], data: { permissions: ['accounting.expenses'] }, loadComponent: () => import('./features/expenses/expenses.component').then(m => m.ExpensesComponent) },
          { path: 'revenues', canActivate: [permissionGuard], data: { permissions: ['accounting.revenues'] }, loadComponent: () => import('./features/revenues/revenues.component').then(m => m.RevenuesComponent) },
          { path: 'cash-movement', canActivate: [permissionGuard], data: { permissions: ['accounting.reports'] }, loadComponent: () => import('./features/cash-movement/cash-movement.component').then(m => m.CashMovementComponent) },
        ],
      },
      // Sales module routes
      {
        path: 'sales',
        children: [
          { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
          { path: 'dashboard', loadComponent: () => import('./features/sales/dashboard/sales-dashboard.component').then(m => m.SalesDashboardComponent) },
          { path: 'guide', loadComponent: () => import('./features/sales/guide/sales-guide.component').then(m => m.SalesGuideComponent) },
          { path: 'quotations', canActivate: [permissionGuard], data: { permissions: ['sales.quotations'] }, loadComponent: () => import('./features/sales/quotations/quotations.component').then(m => m.QuotationsComponent) },
          { path: 'orders', canActivate: [permissionGuard], data: { permissions: ['sales.orders'] }, loadComponent: () => import('./features/sales/orders/orders.component').then(m => m.OrdersComponent) },
          { path: 'invoices', canActivate: [permissionGuard], data: { permissions: ['sales.invoices'] }, loadComponent: () => import('./features/sales/invoices/invoices.component').then(m => m.InvoicesComponent) },
          { path: 'returns', canActivate: [permissionGuard], data: { permissions: ['sales.returns'] }, loadComponent: () => import('./features/sales/returns/returns.component').then(m => m.ReturnsComponent) },
          { path: 'delivery-notes', canActivate: [permissionGuard], data: { permissions: ['sales.delivery_notes'] }, loadComponent: () => import('./features/sales/delivery-notes/delivery-notes.component').then(m => m.DeliveryNotesComponent) },
          { path: 'payments', canActivate: [permissionGuard], data: { permissions: ['sales.payments'] }, loadComponent: () => import('./features/sales/payments/payments.component').then(m => m.PaymentsComponent) },
          { path: 'commissions', canActivate: [permissionGuard], data: { permissions: ['sales.commissions'] }, loadComponent: () => import('./features/sales/commissions/commissions.component').then(m => m.CommissionsComponent) },
          { path: 'approval-workflows', canActivate: [permissionGuard], data: { permissions: ['sales.approval-workflows'] }, loadComponent: () => import('./features/sales/approval-workflows/approval-workflows.component').then(m => m.ApprovalWorkflowsComponent) },
          { path: 'print-templates', redirectTo: '/core/print-settings', pathMatch: 'full' },
          { path: 'settings', redirectTo: '/core/settings', pathMatch: 'full' },
          { path: 'reports', canActivate: [permissionGuard], data: { permissions: ['sales.reports'] }, loadComponent: () => import('./features/sales/reports/sales-reports.component').then(m => m.SalesReportsComponent) },
          { path: 'customer-statements', canActivate: [permissionGuard], data: { permissions: ['sales.reports', 'accounting.reports'] }, loadComponent: () => import('./features/sales/customer-statements/customer-statements.component').then(m => m.CustomerStatementsComponent) },
        ],
      },
      // Purchases module routes
      {
        path: 'purchases',
        children: [
          { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
          { path: 'dashboard', loadComponent: () => import('./features/purchases/dashboard/purchases-dashboard.component').then(m => m.PurchasesDashboardComponent) },
          { path: 'guide', loadComponent: () => import('./features/purchases/guide/purchases-guide.component').then(m => m.PurchasesGuideComponent) },
          { path: 'requests', canActivate: [permissionGuard], data: { permissions: ['purchases.requests'] }, loadComponent: () => import('./features/purchases/requests/requests.component').then(m => m.PurchaseRequestsComponent) },
          { path: 'orders', canActivate: [permissionGuard], data: { permissions: ['purchases.orders'] }, loadComponent: () => import('./features/purchases/orders/orders.component').then(m => m.PurchaseOrdersComponent) },
          { path: 'grns', canActivate: [permissionGuard], data: { permissions: ['purchases.grns'] }, loadComponent: () => import('./features/purchases/grns/grns.component').then(m => m.PurchaseGrnsComponent) },
          { path: 'bills', canActivate: [permissionGuard], data: { permissions: ['purchases.bills'] }, loadComponent: () => import('./features/purchases/bills/bills.component').then(m => m.PurchaseBillsComponent) },
          { path: 'returns', canActivate: [permissionGuard], data: { permissions: ['purchases.returns'] }, loadComponent: () => import('./features/purchases/returns/returns.component').then(m => m.PurchaseReturnsComponent) },
          { path: 'payments', canActivate: [permissionGuard], data: { permissions: ['purchases.payments'] }, loadComponent: () => import('./features/purchases/payments/payments.component').then(m => m.PurchasePaymentsComponent) },
          { path: 'supplier-prices', canActivate: [permissionGuard], data: { permissions: ['purchases.supplier-prices'] }, loadComponent: () => import('./features/purchases/supplier-prices/supplier-prices.component').then(m => m.SupplierPricesComponent) },
          { path: 'settings', redirectTo: '/core/settings', pathMatch: 'full' },
          { path: 'reports', canActivate: [permissionGuard], data: { permissions: ['purchases.reports'] }, loadComponent: () => import('./features/purchases/reports/purchase-reports.component').then(m => m.PurchaseReportsComponent) },
          { path: 'supplier-statements', canActivate: [permissionGuard], data: { permissions: ['purchases.reports', 'accounting.reports'] }, loadComponent: () => import('./features/purchases/supplier-statements/supplier-statements.component').then(m => m.SupplierStatementsComponent) },
        ],
      },
      // HR module routes
      {
        path: 'hr',
        children: [
          { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
          { path: 'dashboard', loadComponent: () => import('./features/hr/dashboard/hr-dashboard.component').then(m => m.HrDashboardComponent) },
          { path: 'departments', canActivate: [permissionGuard], data: { permissions: ['hr.departments'] }, loadComponent: () => import('./features/hr/departments/hr-departments.component').then(m => m.HrDepartmentsComponent) },
          { path: 'positions', canActivate: [permissionGuard], data: { permissions: ['hr.positions'] }, loadComponent: () => import('./features/hr/positions/hr-positions.component').then(m => m.HrPositionsComponent) },
          { path: 'employees', canActivate: [permissionGuard], data: { permissions: ['hr.employees'] }, loadComponent: () => import('./features/hr/employees/hr-employees.component').then(m => m.HrEmployeesComponent) },
          { path: 'shifts', canActivate: [permissionGuard], data: { permissions: ['hr.shifts'] }, loadComponent: () => import('./features/hr/shifts/hr-shifts.component').then(m => m.HrShiftsComponent) },
          { path: 'attendance', canActivate: [permissionGuard], data: { permissions: ['hr.attendance'] }, loadComponent: () => import('./features/hr/attendance/hr-attendance.component').then(m => m.HrAttendanceComponent) },
          { path: 'leave-types', canActivate: [permissionGuard], data: { permissions: ['hr.leave-types'] }, loadComponent: () => import('./features/hr/leave-types/hr-leave-types.component').then(m => m.HrLeaveTypesComponent) },
          { path: 'leave-requests', canActivate: [permissionGuard], data: { permissions: ['hr.leave-requests'] }, loadComponent: () => import('./features/hr/leave-requests/hr-leave-requests.component').then(m => m.HrLeaveRequestsComponent) },
          { path: 'salary-components', canActivate: [permissionGuard], data: { permissions: ['hr.salary-components'] }, loadComponent: () => import('./features/hr/salary-components/hr-salary-components.component').then(m => m.HrSalaryComponentsComponent) },
          { path: 'payroll', canActivate: [permissionGuard], data: { permissions: ['hr.payroll'] }, loadComponent: () => import('./features/hr/payroll/hr-payroll.component').then(m => m.HrPayrollComponent) },
          { path: 'loans', canActivate: [permissionGuard], data: { permissions: ['hr.loans'] }, loadComponent: () => import('./features/hr/loans/hr-loans.component').then(m => m.HrLoansComponent) },
          { path: 'eos', canActivate: [permissionGuard], data: { permissions: ['hr.eos'] }, loadComponent: () => import('./features/hr/eos/hr-eos.component').then(m => m.HrEosComponent) },
          { path: 'job-openings', canActivate: [permissionGuard], data: { permissions: ['hr.job-openings'] }, loadComponent: () => import('./features/hr/job-openings/hr-job-openings.component').then(m => m.HrJobOpeningsComponent) },
          { path: 'candidates', canActivate: [permissionGuard], data: { permissions: ['hr.candidates'] }, loadComponent: () => import('./features/hr/candidates/hr-candidates.component').then(m => m.HrCandidatesComponent) },
          { path: 'kpis', canActivate: [permissionGuard], data: { permissions: ['hr.kpis'] }, loadComponent: () => import('./features/hr/kpis/hr-kpis.component').then(m => m.HrKpisComponent) },
          { path: 'performance-reviews', canActivate: [permissionGuard], data: { permissions: ['hr.performance-reviews'] }, loadComponent: () => import('./features/hr/performance-reviews/hr-performance-reviews.component').then(m => m.HrPerformanceReviewsComponent) },
          { path: 'training', canActivate: [permissionGuard], data: { permissions: ['hr.training'] }, loadComponent: () => import('./features/hr/training/hr-training.component').then(m => m.HrTrainingComponent) },
          { path: 'reports', canActivate: [permissionGuard], data: { permissions: ['hr.reports'] }, loadComponent: () => import('./features/hr/reports/hr-reports.component').then(m => m.HrReportsComponent) },
          { path: 'settings', canActivate: [permissionGuard], data: { permissions: ['hr.settings'] }, loadComponent: () => import('./features/hr/settings/hr-settings.component').then(m => m.HrSettingsComponent) },
        ],
      },
      // POS settings (inside main-layout)
      {
        path: 'pos-settings',
        loadComponent: () => import('./features/pos/pos-settings/pos-settings.component').then(m => m.PosSettingsComponent),
      },
      // Profile
      {
        path: 'profile',
        loadComponent: () => import('./features/profile/profile.component').then(m => m.ProfileComponent),
      },
    ],
  },
  // POS — standalone fullscreen layout (outside main-layout)
  {
    path: 'pos',
    canActivate: [authGuard],
    loadChildren: () => import('./features/pos/pos.routes').then((m) => m.posRoutes),
  },
  {
    path: '**',
    redirectTo: '',
  },
];
